I have written a function with qhash of qhash, which is shown below:
void scanOccurenceOnAllSequence(QString motif, QString chkMotif, qint32 offset, QString cell, QHash <QString, QHash <QString, QHash<qint32, qint32> > > *motifByCell2seq, QList<QString> *peakSequence){
qint32 peakSequenceNumber = peakSequence->size();
for(qint32 si=0; si < peakSequenceNumber; si++){
if( motifByCell2seq->value(motif).value(cell).contains(si) || motifByCell2seq->value(motif).value(cell).contains(si) ){
continue;
}
bool flag = checkMotifOccurence(motif,chkMotif,peakSequence->at(si),offset);
if(flag){
motifByCell2seq->value(motif).value(cell).insert(si,1);
}
}
}
However, there is an error on this line:
motifByCell2seq->value(motif).value(cell).insert(si,1);
The error is:
error: passing 'const QHash' as 'this' argument of 'QHash::iterator QHash::insert(const Key&, const T&) [with Key = int; T = int]' discards qualifiers [-fpermissive] motifByCell2seq->value(motif).value(cell).insert(si,1);
Even when I changed this line to the following, there is still an error
motifByCell2seq[motif][cell].insert(si,1);
Could you help me to find out the problem?