October 02, 2024 by Cristián Maureira-Fredes | Comments
After the adoption of Qt Design Studio, many users started to wonder about the possibilities of running their projects with different types of backends, but until now only C++ was available.
C++ has been the default language to add functionality to Quick-based projects created with QtDS, but with the growing popularity of Python (and PySide), more people were requesting the possibility of easing the process to add a Python backend to the QtDS projects.
How to get it?
Following the approach with our Python packages, these new components are one command away from your project. Activate the virtual environment where you have your PySide6 installation and use:
pip install PySide6_DS
and that's all! The new components will be added to your PySide6 installation.
QtDS adds a few convenient Quick Components, so people can have more flexibility when importing designs from other applications, like Figma, or Photoshop. These components are not part of a default Qt installation, meaning that the PySide bindings did not include them, generating errors when trying to run projects that included them.
A workaround was to copy those ad-hoc Quick components into the PySide installation environment, but it was a solution that did not scale, due to the volatile nature of Python virtual environments.
With the release of Qt DS 4.6 you can now enable the Python export option, in order to enable your project to work with PySide.
For doing so, you can check on File > Export Project > Enable Python Generator, and you will now have a Python directory within your project files.
In the following case, we were using an E-bike example, and when exporting the project you can see the following content. Notice that the Python directory contains a couple of Python files, autogen.py
and main.py
.
~/QtDesignStudio/examples/EBikeDesign % ls -1 content/ Generated/ imports/ Python/ src/ CMakeLists.txt EBikeDesign.qmlproject EBikeDesign.qmlproject.qtds main.qml qmlmodules qtquickcontrols2.conf ~/QtDesignStudio/examples/EBikeDesign % tree Python Python ├── autogen │ └── settings.py └── main.py 2 directories, 2 files |
The goal of these files, are to provide a main file that contains all the necessary code to launch the application, and a more volatile one for the settings of the project. As you can imagine, while auto-saving your project while editing, only the settings file will be changing in order to provide the url to the main file and the import paths with all the Quick components are located.
Considering this is the first release, we are already observing a few things where this can be improved and we are working on a couple of features for the next QtDS release.
Do you have an idea? share it with us!
Download the latest release here: www.qt.io/download.
Qt 6.9 is now available, with new features and improvements for application developers and device creators.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Apr 3, 2025
2025 is the year of the snake! 🐍 and for that we are happy to tell you..
Feb 26, 2025
Qt Design Studio 4.7 is here! This version empowers you to deploy and..
Feb 21, 2025
Hey Everyone! I hope you have had a great start to the year! We are hard..
Commenting for this post has ended.
Same question here … I am waiting for QML Maps before I can port my mobile app from Qt5 to Qt6…
Thanks guys, especially for QML Treeview. However, QtCreator fails to recognize Qt 6.3 saying that the Qt version is not properly installed. I am also getting error related to missing /permissive- MVSC (2019) options. I failed to fix this issue even when adding /permissive- option in my CMakefiles.
Unfortunately, there was a packaging issue which is triggering this failure to detect Qt version in Qt Creator. Root cause is tracked here: https://bugreports.qt.io/browse/QTBUG-99656. The fix for this is already available and will be released in Qt 6.3 beta1 by latest.
What compiler error do you get, related to /permissive? Could you maybe file a bug with the complete error message at bugreports.qt.io?
Hi, will qml Map be included in 6.3 release?
Wow, QML TreeView is finally been added!
Include Qt Speech with 6.4 release please :). Then we can finally upgrade to Qt 6.
Qt 6.3 alpha windows release is broken, it shows "Invalid Qt version" in the configuration page.
Hi! Unfortunately some users are seeing this error with Qt 6.3.0 Alpha, see https://bugreports.qt.io/browse/QTCREATORBUG-26876. The issue should be fixed properly in Qt 6.3.0 Beta1 release which is targeted to be released still during January. Meanwhile you can try a dirty workaround: remove qt.conf file from installations /bin directory. After that Qt Creator seems to work OK with Qt 6.3.0 Alpha
Will qt enter the server field, I am looking forward to Qt Httpserver
We are currently looking into feasible options and timing for a finalized Qt Http Server.
Have no idea how to build 6.3 with wasm... There are just errors. Is there an algorithm?