Skip to content

Commit cebd1e3

Browse files
committed
fix: Address warnings with QSet::fromList in Qt 5.15
Starting with Qt 5.15, the conversion functions between QList and QSet (e.g., `QSet::fromList`) have been deprecated in favor of range constructors. This change updates the code to use the new range constructors to avoid deprecation warnings starting from Qt 5.14 (instead of Qt 6) Related upstream Qt commits: * qt/qtbase@92f984273 ("Deprecate conversion functions between QList and QSet", 2019-05-07) * qt/qtbase@e59e5643b ("Use QT_DEPRECATED_X instead of Q_DECL_DEPRECATED_X", 2020-02-25) (cherry picked from commit commontk/PythonQt@630e376)
1 parent 86eb0eb commit cebd1e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PythonQtClassInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ QStringList PythonQtClassInfo::memberList()
562562
}
563563
}
564564

565-
#if QT_VERSION >= 0x060000
565+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
566566
QSet<QString> set(l.begin(), l.end());
567567
return set.values();
568568
#else

src/PythonQtClassWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
477477

478478
auto members = wrapper->classInfo()->memberList();
479479
auto properties = wrapper->classInfo()->propertyList();
480-
#if QT_VERSION >= 0x060000
480+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
481481
QSet<QString> completeSet(members.begin(), members.end());
482482
completeSet.unite(QSet<QString>(properties.begin(), properties.end()));
483483
#else

0 commit comments

Comments
 (0)