Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add proper defines over PyQt5- and PyQt6-specific code

Dmitry Kazakove517afd789f8
diff --git a/plugins/extensions/pykrita/plugin/utilities.cpp b/plugins/extensions/pykrita/plugin/utilities.cpp
index 170d120b33..ccb9515353 100644
--- a/plugins/extensions/pykrita/plugin/utilities.cpp
+++ b/plugins/extensions/pykrita/plugin/utilities.cpp
@@ -390,15 +390,22 @@ bool Python::setPath(const QStringList& scriptPaths)
QString d = QFileInfo(PYKRITA_PYTHON_LIBRARY).absolutePath();
paths.append(d + "/" + p2 + "/site-packages");
- paths.append(d + "/" + p2 + "/site-packages/PyQt5");
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
paths.append(d + "/" + p2 + "/site-packages/PyQt6");
+#else
+ paths.append(d + "/" + p2 + "/site-packages/PyQt5");
+#endif
+
}
else {
#endif
paths.append(originalPath + "/lib-dynload");
paths.append(originalPath + "/site-packages");
- paths.append(originalPath + "/site-packages/PyQt5");
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
paths.append(originalPath + "/site-packages/PyQt6");
+#else
+ paths.append(originalPath + "/site-packages/PyQt5");
+#endif
#ifdef Q_OS_MAC
}
#endif