Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Communicating between Qt c++ program and another Python Qt program

Communicating between Qt c++ program and another Python Qt program

Scheduled Pinned Locked Moved Unsolved Language Bindings
5 Posts 2 Posters 1.4k Views
  • 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.
  • AdantehA Offline
    AdantehA Offline
    Adanteh
    wrote on last edited by
    #1

    Hi there,

    maybe an oddly specific question, but is it possible to influence a running Qt program made in C++,
    by a python script using Qt python bindings (Either PyQt or Pyside). I did some googling and did find about PythonQt,
    but that seemed quite limited.

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

      Hi and welcome to devnet,

      What kind of influence do you have in mind ?

      Depending on that there might different techniques.

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

      1 Reply Last reply
      0
      • AdantehA Offline
        AdantehA Offline
        Adanteh
        wrote on last edited by
        #3

        Hi,

        At first it would mostly come down to using setting text, adjust styles (Add / remove colored background of widgets) and things like that. Additionally I'd like to create new widgets (QDockWidgets, plus whatever their contents may be, mostly general layouts, text, labels and perhaps some dials)

        Basically I'm used to PyQt5 (or Pyside2) but will now have to extend a C++ Qt4 application and prefer to do as much as possible in Python (and as pythontic as possible), because I'm much more experienced in that. I do have access the to the QMainWindow through a plugin for the application, and ideally basically all finding children of existing widgets, adjusting and so would be done as much in python as possible (From just passing in the QMainWindow).

        It's more a "general advice" of what maybe others have done to do something similar. Maybe PythonQt would actually work okay, another thing I found was lthis stackoverflow answer

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

          For PySide2 / C++, see the example in this blog post.

          Qt 4 ? Are you locked to that old version ? It has reached end of life a long time ago.

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

          AdantehA 1 Reply Last reply
          1
          • SGaistS SGaist

            For PySide2 / C++, see the example in this blog post.

            Qt 4 ? Are you locked to that old version ? It has reached end of life a long time ago.

            AdantehA Offline
            AdantehA Offline
            Adanteh
            wrote on last edited by
            #5

            @SGaist
            Unfortunately I am locked into Qt4 with the program itself. Heck, I was even hoping I could somehow influence this Qt4 app by some external python app running Pyside2. I have no idea how any of the underlying Qt infrastructure works, but that seems very far from possible (at least for me)

            My experience with PyQt5 and Pyside2 has been super pleasant and I feel really comfortable in Python, and not comfortable at all in C++, so that's why I'm looking around if there's an alternative.

            Ill probably give this a go for starters: https://ubuverse.com/embedding-the-python-interpreter-in-a-qt-application/

            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 Extensions
            • Unsolved