Qt Design Studio to Qt Creator.. and my Python code
-
Hi, could someone perhaps give me an outline of what I need to look into.
All my apps were done in Qt designer in the Pyside6 pip install with Vscode using Python for functions, Ai model stuff, Audio processing etc.
I needed my UIs to be much prettier and Qt Design Studio is doing a tremendous job quickly, also using Blender models which is amazing. I heard someone say 'why would you even use it?' and not many seem to?
Anyway, I have a Qt Design Studio project, opened it in Qt Creator, now not a clue what to do. I added a Python file. So I link to the xxx.ui.qml file of Qt Design Studio somehow? I need to bolt all my Python code onto the buttons and sliders that Qt Design Studio made.
-
Good morning,
this is a very general question. In all honesty: It reads a bit like an attempt to fast-track and bypass reading the extensive documentation available for Qt Design Studio. Even if that wasn't the intention: It's a high expectation towards this community, that someone writes a straight forward recipe, based on general information like.
A good start would probably be to walk through a tutorial, get an example working, inspect the code, just to get familiar. Then you can start migrating your own code. Start reading here.
Cheers
Axel -
Sir, I respectfully disagree. I am not the original poster, but I, too, found very little online resources for a workflow that uses QT Design Studio and QT for Python. No tutorials, lots of unanswered forum questions, etc.
While toy examples of using Pyside6 to load a small hand-crafted QML do work, as soon as I attempted to do so with a real design on QT Design Studio, a lot of infrastructure-type issues popped up. modules that cannot be found, unexplained inability to load the .ui.qml file in the python code, inability to use QT Creator to manage anything, etc. I tried to get it to work for days now.
If the approach of programming in Python for designs done in QT Design Studio is a misguided approach and not a supported workflow, I'd like to know that, and would ask for suggestions for alternatives.
If this combination is reasonable, then I'd love to hear about any online resources for that - tutorials and so on. Please note that tutorials for each part alone are readily available - either just for Python with QML or for QT Design Studio by itself. However tutorials that show how to use what you designed in the Studio with python are unavailable (or none that I found, anyway), and instead I found many posts of frustrated would-be-users like myself that ran into tons of problems. This is in contrast with a workflow that uses QT Design Studio designs with C++ coding, where the process is well documented, support for this seems to be well built into the Design Studio with pre-made CMakelists.txt and other files and whatnot. Any support for Python with Design Studio seems like an afterthought at best.
thanks,
Guy. -
@JUDE34823 you can check out this answer: https://forum.qt.io/topic/157892/qt-design-studio-python-code/2
In a nutshell you just need a python file to load the Quick-based project you created with QtDS
and then if you want to add functionality to the graphical elements, you need to check the tutorials/examples on how to register aQmlElement
python object in QML, so you can access that functionality. For example https://doc.qt.io/qtforpython-6/tutorials/qmlintegration/qmlintegration.html