I am trying to compare 2 QStrings with the == operator and I get some errors. My code looks like:
// line is a QString created earlier in the code.
if( confList.
at( 0 ) == QString( "LAST_OPEN_DIR" ) ) {
// Some code
}
// line is a QString created earlier in the code.
QStringList confList = QStringList::split( QString( "=" ), line );
if( confList.at( 0 ) == QString( "LAST_OPEN_DIR" ) )
{
// Some code
}
To copy to clipboard, switch view to plain text mode
My code errors out in the if-statement and here is the error I get.
error: no match for 'operator ==' in QValueList<T>::at( size_t) [with T = QString](0ul) == QString(((const char*)"LAST_OPEN_DIR"))'
Any idea how to fix this error. This is in Qt 3.3.3. Thanks!
Bookmarks