Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.0 Beta
-
None
Description
See following code snippet:
#include <QApplication> #include <QDebug> enum class color { red, green, blue }; Q_DECLARE_METATYPE(color) int main(int argc, char** argv) { QApplication app(argc, argv); QVariant v1 = QVariant::fromValue(color::green); QVariant v2 = 1; qDebug() << (v1 == v2); qDebug() << (v2 == v1); return app.exec(); }
Output:
false true
I find this behavior strange. Is this on purpose? When yes, why?
Otherwise, please fix it.
Attachments
Issue Links
- is duplicated by
-
QTBUG-69805 == operator for QVariant not behaving as expected
- Closed