Super Confused. Trying to develop a Qt Gui using Python3 and PySide6. Need some clarification.
-
So I'll start out by saying I'm completely new to Qt, I've made an app using PyQt5 and Qt Designer, but trying to move over to PySide6 and Qt Creator to use QML and all the new fancy stuff in the Creator. The amount of Qt names and abbreviations just get me confused to oblivion though.
I am developing using a win10 x64 PC with Qt Creator 4.14.2 Community edition, I have installed Python3 and also PySide6 via pip.
The end device is a Raspberry Pi 4 running archlinuxarm 64 bit with Python3 and pyside6 6.0.4-1 installed via pacman.I opened Qt Creator and imported the QtQuick.Extras 1.4, dragged on a couple of Gauges and tried to run using Build > Run.
I get an error saying import QtQuick.Extras 1.4 failed, as QtQuick.Extras is not installed. I'm struggling to understand what's going on here haha as the folder is clearly there within the Qt directory, the module is imported in the creator and I can see/drag on all the QML types?
From searching about, I've read "It doesn't matter about the folders in the Qt Creator directory, those are just for the creator, it matters on how your Qt setup is installed" but this just makes no sense to me haha? Surely the build>run would use the qt creator directory? The main.py uses 'import PySide6' but then the view.qml uses 'import QtQuick'? Is this meant to be or can I change the Qt Creator to make the .qmls use pyside?
Could someone try clarify this for me and just some sort of general overview haha.. I know there is a wiki and documentation, but there is just so much it's hard to take it all in at once.
-
If I can say a personal opinion, please don't use python and Qt. Please use c++ - qml - Qt. This scenario is very simple and portable without problems between windows and Linux on raspberry.
When you will have more experience you can try python and Qt and you will find the solution on every problem alone. -
If I can say a personal opinion, please don't use python and Qt. Please use c++ - qml - Qt. This scenario is very simple and portable without problems between windows and Linux on raspberry.
When you will have more experience you can try python and Qt and you will find the solution on every problem alone.@mrdebug Even that's just more confusing than Python version lol. The Qt Online installer doesn't seem to have any options for an Arm setup. And the open source Qt creator doesn't seem to have any compiler installed for C++ projects.
There doesn't seem to be any instructions for installing and using Qt on windows with the end device being Linux on ARM.
-
In contrast to other posted opinions I've gound that the pyqt bindings to Qt allow me to produce quick and effective proof-of-concept designs.
- design some screens using qt-designer
- pyqt5 < screen.ui > screen.py
- subclass screen using setupUi()
- create backend python code
-
In order to develop for raspberry pi (I have a lot of some Qt projects for it) it is not necessary to use a toolchain. You just have to write the application on Windows.
If you haven't got to manage external libraries (for gpio for example) when your software is done you just have to copy the sources in a raspberry pi ant compile them.
In raspberry pi you can use the Raspbian Qt framework or you can install it from sources.
Another way is to use yocto with a toolchain. This scenario is very cool but I use it only for a projects that can run only in the target machine. -
In order to develop for raspberry pi (I have a lot of some Qt projects for it) it is not necessary to use a toolchain. You just have to write the application on Windows.
If you haven't got to manage external libraries (for gpio for example) when your software is done you just have to copy the sources in a raspberry pi ant compile them.
In raspberry pi you can use the Raspbian Qt framework or you can install it from sources.
Another way is to use yocto with a toolchain. This scenario is very cool but I use it only for a projects that can run only in the target machine. -
In contrast to other posted opinions I've gound that the pyqt bindings to Qt allow me to produce quick and effective proof-of-concept designs.
- design some screens using qt-designer
- pyqt5 < screen.ui > screen.py
- subclass screen using setupUi()
- create backend python code
@Kent-Dorfman Yes i agree, i had no issues with pyqt/pyside. I just wasn't 100% on how to use QML with pyside/pyqt as i couldn't really find any tutorials on it. I wanted to use QT Creator instead of the older QT Designer for making the QML, and then python backend which i already had.
My previous workflow was to just design the .ui and use pycui, copy the .py generated code to the Pi and i had a second load script which assigned all the clicked events to buttons etc. It worked fine, but i never knew or could find a good guide on using qml, although i have actually got it to work before and display some example qml, but i didn't really know what was going on haha!