Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use Qt_all extension #47

Closed
iltommi opened this issue Jun 13, 2016 · 6 comments
Closed

Use Qt_all extension #47

iltommi opened this issue Jun 13, 2016 · 6 comments

Comments

@iltommi
Copy link

iltommi commented Jun 13, 2016

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)

Any suggestion?

@jmirabel
Copy link

If you use a similar method as the one I present in #40 , you have to link to two libraries: PythonQt and PythonQt_QtAll.

@iltommi
Copy link
Author

iltommi commented Jun 13, 2016

Hi,
thanks for the suggestion, but unfortunately your fork doesn't work with qt5.
Any plans to support it?

@jmirabel
Copy link

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.

@jcfr
Copy link
Member

jcfr commented Jun 13, 2016

your fork doesn't work with qt5.

Support for Qt5 has been integrated in commontk/PythonQt. Using the fork shouldn't be needed

re: #40

Would make sense to integrate.

@iltommi or @jmirabel Would you mind rebasing the PR against the current patched-6 branch ?

Thanks
Jc

@iltommi
Copy link
Author

iltommi commented Jun 14, 2016

Hello @jcfr, and thanks for the help.
I switched to #patched-6 branch and it compiles after removing WebKitWidgets and webkit from

set(qt5libs Core Widgets Network OpenGL Sql Svg UiTools WebKitWidgets Xml XmlPatterns)
                                                        ^^^^^^^^^^^^^
set(qt4libs core gui network opengl sql svg uitools webkit xml xmlpatterns)
                                                    ^^^^^^

and comment this line:

# set(qtlib_to_wraplib_WebKitWidgets webkit)

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):

install(FILES src/gui/PythonQtScriptingConsole.h DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}/gui)

Would it be possible to include it in the next commit?

@jcfr
Copy link
Member

jcfr commented Aug 8, 2017

Closing. Support for Qt5 is now up-to-date and available in patched-8 branch

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

3 participants