Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3.1
-
None
Description
With 4a69cd7f7 (from QTBUG-84636), QVariants were changed to not compare between types anymore as documented in the commit. As a result of that, QAbstractItemModel::match and QComboBox::findData change behavior as well, with QComboBox::findData calling QAbstractItemModel::match. In this case however, the documentation for these functions does not seem to reflect the QVariant behavior change.
It is unclear if the behavior change in QAbstractItemModel::match and QComboBox::findData is undocumented, implied with the QVariant change, or unintended.
Simple reproducer:
QComboBox *combo = new QComboBox(this); combo->addItem("Text", 50); QByteArray byteArray = "50"; int idx = combo->findData(byteArray); if(idx == 0) std::cout << "Found. Qt 5" << std::endl; else if (idx == -1) std::cout << "Not found. Qt 6" << std::endl;
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-104990 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
450772,8 | QAbstractItemModel: add note about QVariant::operator==() changes | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |