File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -512,9 +512,15 @@ void PythonQtTestApi::testVariables()
512512 QVariant v2 = PythonQt::self ()->getVariable (PythonQt::self ()->getMainModule (), " someObject2" );
513513 QVERIFY (v2==QVariant ());
514514
515- PythonQt::self ()->addVariable (PythonQt::self ()->getMainModule (), " someValue" , QStringList () << " test1" << " test2" );
515+ QVariant someValue = QStringList () << " test1" << " test2" ;
516+ PythonQt::self ()->addVariable (PythonQt::self ()->getMainModule (), " someValue" , someValue);
516517 QVariant v3 = PythonQt::self ()->getVariable (PythonQt::self ()->getMainModule (), " someValue" );
517- QVERIFY (v3 == QVariant (QStringList () << " test1" << " test2" ));
518+ #if QT_VERSION >= 0x060000
519+ // In Qt6 the behavior of the == operator changed, and it will not try to convert the other
520+ // value first, so we replicate this first (otherwise the comparison QVariantList <-> QStringList fails)
521+ QVERIFY (someValue.convert (v3.metaType ()));
522+ #endif
523+ QVERIFY (v3 == someValue);
518524
519525 QStringList l = PythonQt::self ()->introspection (PythonQt::self ()->getMainModule (), QString::null, PythonQt::Variable);
520526 QSet<QString> s;
You can’t perform that action at this time.
0 commit comments