Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Calling a QT Button (C++) From the External Python Script
Forum Updated to NodeBB v4.3 + New Features

Calling a QT Button (C++) From the External Python Script

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 148 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.
  • K Offline
    K Offline
    kirualuka
    wrote on last edited by
    #1

    I am working on a project that is mainly written on Python, but the part where the camera captures are being processed is in a QT project (C++).

    For ex:
    There is a start button in the QT which activates several functions that are written in C++:

    in main.qml:

    Button {
        id: startbutton
        x: 910
        y: 822
        text: qsTr("Start")
    
        onPressed: {
            VideoStreamer.startcapturing()
        }
    }
    

    For now, I am clicking on this button manually, but I need to write a function that activates this button whenever it is needed in the Python algorithm.

    --> So the Python script should call the start button somehow.

    I've read about pipes but I couldn't implement anything, actually I don't even know whether I should focus on the communication between QT and Python or C++ and Python.

    Please explain it through some example codes using the above code piece, not just ideas. Because I've already read tons of things but I am too noob to apply them.

    Notes:
    OS: Ubuntu 18.04.6 LTS

    All the projects are in the same PC.

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

      Hi and welcome to devnet,

      Qt is a C++ framework. From what you wrote your QtQuick GUI calls a C++ backend so the question is: do you really need the GUI to run when using your Python script ?

      You also have the option of implementing your code with PySide2/6 or PyQt5/6 if your main logic lies in Python.

      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

      • Login

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