Skip to content

Commit

Permalink
Fix conversions with PySide6
Browse files Browse the repository at this point in the history
  • Loading branch information
YakoYakoYokuYoku authored and looooo committed Sep 24, 2024
1 parent e56f0e7 commit 16d64bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions interfaces/soqt.i
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ template <typename T> const char* get_typename(T& object)
#endif
/////////////////////////////////////////////////////

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define SHIBOKEN "shiboken6"
#else
#define SHIBOKEN "shiboken2"
#endif

static const char * PYSIDE_QT = "pivy.gui.qt";

static PyObject* getShiboken()
Expand All @@ -128,9 +134,9 @@ static PyObject* getShiboken()
// pip installs it in a wrong place
// if you have installed shiboken with pip please symlink to correct directory
PyObject * shiboken = NULL;
if (!(shiboken = PyDict_GetItemString(PyModule_GetDict(PyImport_AddModule("__main__")), "shiboken2"))) {
if (!(shiboken = PyDict_GetItemString(PyModule_GetDict(PyImport_AddModule("__main__")), SHIBOKEN))) {
// simple import shiboken from python.
shiboken = PyImport_ImportModule("shiboken2");
shiboken = PyImport_ImportModule(SHIBOKEN);
}
return shiboken;
}
Expand Down

0 comments on commit 16d64bd

Please sign in to comment.