You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to use the qt_all extension of python and can't figure out how to use it.
I cmaked pythonqt with
cmake -DPythonQt_Wrap_QtAll=ON .
and compiled, but it seems that the header extensions/PythonQt_QtAll/PythonQt_QtAll.h is not installed.
I added it to the cmake headers variable but when i compile my main.cc with the init method
PythonQt_QtAll::init();
the linker throws an
Undefined symbols for architecture x86_64:
"__ZN14PythonQt_QtAll4initEv", referenced from:
_main in main.cc.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
I won't make it compliant with Qt5 in a near future but the changes I made are independent of Qt so you can apply the same changes to a Qt5 compatible version of PythonQt.
From the error message, I would say you lack one (at least) of the following:
a file similar to extensions/CMakeLists.txt of my fork in your PythonQt source directory,
a TARGET_LINK_LIBRARY(yourcpp PythonQt_QtAll) in the project that depends on PythonQt.
Since they are no more shipped starting with 5.6 (or at least I don't have with the homebrew installation on mac). I'm not that confident in cmake to create a switch over something like if(${found_qt_version} VERSION_LESS [....], but It would be nice to have that fixed.
Now coming to my problem I think I have found a solution:
To use all the wrapped qt (which in the qmake version on sourceforge come in a separate library libPythonQt_QtAll.dylib)
I #include "PythonQt_QtBindings.h" and call PythonQt_init_QtBindings();
Is this correct?
With the qmake version, I used to link libPythonQt_QtAll.dylib
the included #include <PythonQt_QtAll.h> and call PythonQt_QtAll::init();
Thanks again!
p.s.
As side note I added this line (which seems missing):
Activity
jmirabel commentedon Jun 13, 2016
If you use a similar method as the one I present in #40 , you have to link to two libraries:
PythonQtandPythonQt_QtAll.iltommi commentedon Jun 13, 2016
Hi,
thanks for the suggestion, but unfortunately your fork doesn't work with qt5.
Any plans to support it?
jmirabel commentedon Jun 13, 2016
I won't make it compliant with Qt5 in a near future but the changes I made are independent of Qt so you can apply the same changes to a Qt5 compatible version of PythonQt.
From the error message, I would say you lack one (at least) of the following:
extensions/CMakeLists.txtof my fork in your PythonQt source directory,TARGET_LINK_LIBRARY(yourcpp PythonQt_QtAll)in the project that depends on PythonQt.jcfr commentedon Jun 13, 2016
Support for Qt5 has been integrated in commontk/PythonQt. Using the fork shouldn't be needed
Would make sense to integrate.
@iltommi or @jmirabel Would you mind rebasing the PR against the current
patched-6branch ?Thanks
Jc
iltommi commentedon Jun 14, 2016
Hello @jcfr, and thanks for the help.
I switched to #patched-6 branch and it compiles after removing
WebKitWidgetsandwebkitfromand comment this line:
Since they are no more shipped starting with 5.6 (or at least I don't have with the homebrew installation on mac). I'm not that confident in cmake to create a switch over something like
if(${found_qt_version} VERSION_LESS [....], but It would be nice to have that fixed.Now coming to my problem I think I have found a solution:
To use all the wrapped qt (which in the qmake version on sourceforge come in a separate library
libPythonQt_QtAll.dylib)I
#include "PythonQt_QtBindings.h"and callPythonQt_init_QtBindings();Is this correct?
With the qmake version, I used to link
libPythonQt_QtAll.dylibthe included
#include <PythonQt_QtAll.h>and callPythonQt_QtAll::init();Thanks again!
p.s.
As side note I added this line (which seems missing):
Would it be possible to include it in the next commit?
jcfr commentedon Aug 8, 2017
Closing. Support for Qt5 is now up-to-date and available in
patched-8branch