Hi,
I have embedded a Python interpreter in my Qt5.12.0 App. The interpreter is python 3.6, running on Ubuntu 18.04. Everything works as expected.
But now I want to show a widget from a python script inside my application, with PySide2.
import sys
label
= QLabel("<font color=red size=40>Hello World!</font>")label.show()
app.exec_()
import sys
from PySide2.QtWidgets import QApplication, QLabel
app = QApplication(sys.argv)
label = QLabel("<font color=red size=40>Hello World!</font>")
label.show()
app.exec_()
To copy to clipboard, switch view to plain text mode
This works fine as a standalone PySide2 Qt application. But obviously I cant create another QApplication in my embedded interpreter, because my regular C++ application already does that.
However, just doing
label
= QLabel("<font color=red size=40>Hello World!</font>")label.show()
label = QLabel("<font color=red size=40>Hello World!</font>")
label.show()
To copy to clipboard, switch view to plain text mode
doesnt work, which doesnt really surprise me.
Question: How can I make this work?
(Final goal would be to create a docking widget from python, so I would have to make it a child of my QMainWindow, or expose a C++ baseclass to derive from. But that's the next step I guess...)
Bookmarks