I'm trying to make a Python QT GUI but my files are in c++
-
This post is deleted!
-
Hi
While you can call c++ from python and reverse I'm not sure what goal is here?
Do you want to convert app to python or you want the C++ GUi to call a function in python
as a backend ?You can convert the UI file into something useful with python but the .cpp would not be in effect then.
-
This post is deleted!
-
Hi
While you can call c++ from python and reverse I'm not sure what goal is here?
Do you want to convert app to python or you want the C++ GUi to call a function in python
as a backend ?You can convert the UI file into something useful with python but the .cpp would not be in effect then.
@mrjj Both are private entities at the moment, for example.
In my Python code I have a connect function, and then there is a connect button in the GUI. Once the connect button is hit on the GUI I want to call the connect function. And so on from there.
-
This post is deleted!
Hi
Ok.
option 1:
convert UI file to python
https://doc.qt.io/qtforpython/tutorials/basictutorial/uifiles.htmland use it directly with your python app and leave .cpp and .h in the dust.
Option 2:
Keep the app as GUI and call python as a script
https://forum.qt.io/topic/115475/calling-python-from-qt-cOption 3:
Embed python in the C++ app
https://docs.python.org/3/extending/embedding.htmlQustion:
Does the cpp file do anything ? -
@mrjj The cpp files are very small and mostly contain default constructors and other variable type information. I don't use them for any of the actual code
-
@mrjj The cpp files are very small and mostly contain default constructors and other variable type information. I don't use them for any of the actual code
Hi
Well Qt has very good python-support so I think i would use reuse the UI file and
make the app a pure python app to avoid too much fiddling with mixing c++ and python. -
Hi
Well Qt has very good python-support so I think i would use reuse the UI file and
make the app a pure python app to avoid too much fiddling with mixing c++ and python.@mrjj That would be similar to the first link you sent then correct?
-
@mrjj That would be similar to the first link you sent then correct?
Yes
The UI file is an XML file that contains positions and properties of the Form/widgets.The pyside6-uic converts this XML file to code and its just like normal python code.
you can also load UI files at runtime
https://doc.qt.io/qtforpython-5/PySide2/QtUiTools/QUiLoader.html
but then its a bit more clumsy to get to talk to them. -
Yes
The UI file is an XML file that contains positions and properties of the Form/widgets.The pyside6-uic converts this XML file to code and its just like normal python code.
you can also load UI files at runtime
https://doc.qt.io/qtforpython-5/PySide2/QtUiTools/QUiLoader.html
but then its a bit more clumsy to get to talk to them.@mrjj Okay I'll look at that. Thank you very much. I appreciate the help :]