Hi
I have a problem with QStringList::contains() where it does not return the correct value. I honestly don't believe that there will be a bug in this function, thus I can't understand what is going wrong. I do the following:
// Check uniqueness of name:
Qt::CaseSensitivity case_sensitivity = Qt::CaseSensitive;
qDebug() << "string_list: " << string_list;
qDebug() << "Validate against: " << name << " using " << case_sensitivity;
if (string_list.contains(name,case_sensitivity)) {
result |= Duplicate;
qDebug() << "This is a duplicate";
}
// Check uniqueness of name:
Qt::CaseSensitivity case_sensitivity = Qt::CaseSensitive;
QStringList string_list = observer->subjectNames();
qDebug() << "string_list: " << string_list;
qDebug() << "Validate against: " << name << " using " << case_sensitivity;
if (string_list.contains(name,case_sensitivity)) {
result |= Duplicate;
qDebug() << "This is a duplicate";
}
To copy to clipboard, switch view to plain text mode
It prints out the following:
string_list: ("D:\Work\Firmware\FirmwareDesigns\DAC_1X_TOP\Supporting Items\Associated Folders\DOCS")
Validate against: "D:\Work\Firmware\FirmwareDesigns\DAC_1X_TOP\Supporting Items\Associated Folders\Docs" using 1
string_list: ("D:\Work\Firmware\FirmwareDesigns\DAC_1X_TOP\Supporting Items\Associated Folders\DOCS")
Validate against: "D:\Work\Firmware\FirmwareDesigns\DAC_1X_TOP\Supporting Items\Associated Folders\Docs" using 1
To copy to clipboard, switch view to plain text mode
contains() should return true, however it does not and I never get the "This is a duplicate" printed out.
Any ideas?
Thanks
Jaco
Bookmarks