Skip to content

Use Qt_all extension #47

Closed
Closed

Description

@iltommi

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?

Activity

  1. jmirabel commented on Jun 13, 2016

    @jmirabel

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

  2. iltommi commented on Jun 13, 2016

    @iltommi
    Author

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

  3. jmirabel commented on Jun 13, 2016

    @jmirabel

    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.
  4. jcfr commented on Jun 13, 2016

    @jcfr
    Member

    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

  5. iltommi commented on Jun 14, 2016

    @iltommi
    Author

    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?

  6. jcfr commented on Aug 8, 2017

    @jcfr
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions