Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Automating exposing large number of C++ QT classes to Python
Qt 6.12 LTS is out! See what's new in the release blog

Automating exposing large number of C++ QT classes to Python

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 3 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrewCQT
    wrote on last edited by
    #1

    I have gone through the examples of exposing QT C++ classes to Python via Shiboken2 and PySide2 ( KDAB has a great tutorial).

    However , I have an existing QT C++ application with 100+ classes with many methods ( it's a scientific application). Writing the Shiboken2 XML file will be bit of a tedious nightmare.
    In the past I used swig, you just ran swig on your headers and it would handle nearly everything. You cleaned up the exceptions as needed. Am I missing something with using Shiboken2/PySide2?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Warning: I haven't used it yet.

      Are you using the Shiboken Generator ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 2 Replies Last reply
      0
      • N Offline
        N Offline
        NYBL
        wrote on last edited by NYBL
        #3

        Hey @AndrewCQT ,, I have went threw this tutrial and many other resources but couldn't bind a single QObject ... can you share how you did it? I have a repo that I made for me and others to learn how to do that (currently isn't working), if you are willing to contribute your knowledge there it would be awesome!.

        As for your question, have you looked into Kdab's KDDockWidget and PySideQwt?

        A 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Warning: I haven't used it yet.

          Are you using the Shiboken Generator ?

          A Offline
          A Offline
          AndrewCQT
          wrote on last edited by
          #4

          @SGaist Hmm, I need to dive into using Shiboken a bit more. Maybe I am missing something here.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            Warning: I haven't used it yet.

            Are you using the Shiboken Generator ?

            A Offline
            A Offline
            AndrewCQT
            wrote on last edited by
            #5

            @SGaist I completely misunderstood how shiboken2 worked. By default it exposes all the methods in the classes, so it's a simple matter to just list the classes in the bindings.xml file. In the end it was quite simple to bind to all my classes.

            1 Reply Last reply
            1
            • N NYBL

              Hey @AndrewCQT ,, I have went threw this tutrial and many other resources but couldn't bind a single QObject ... can you share how you did it? I have a repo that I made for me and others to learn how to do that (currently isn't working), if you are willing to contribute your knowledge there it would be awesome!.

              As for your question, have you looked into Kdab's KDDockWidget and PySideQwt?

              A Offline
              A Offline
              AndrewCQT
              wrote on last edited by
              #6

              @NYBL I found that the examples in the pyside repo at https://github.com/pyside/pyside2-setup were very helpful
              In particular the widgetbinding example

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt
              • Unsolved