Need to know how to set up Qt Designer with PySide2/Qt5
-
Hi there. I was using the Qt Creator that gets installed with Qt (7.0.2) but found a bug. Originally it was working fine with PySide6/Qt6 but I had to switch to PySide2/Qt5 because I need QtLocation. When I switched, it does not render the QML page properly in the Designer "form editor" and instead opens the page twice in an external window.
I read that Qt Creator was buggy so I installed Qt Design Studio, but I cannot figure out how to open my python project. There doesn't seem to be any option to start a new project with existing files and I have no Studio project file. I was thinking I could start a blank Python project and then copy my main.py into it but I can see no way to start a Python project. Any new project starts with .cpp.
I also tried to install with the offline installer for Qt Creator 6.0.2 but that gave me an error of 'Line 0: The Design Mode requires a valid Qt kit' which is an import QtQuick. I'm getting very frustrated with this. Could someone just tell me how they get a working QT Creator or QT Design Studio for PySide2/Qt5?
Does anyone have any recommendations? I'm not even sure if I should be using Qt Studio as opposed to Qt Creator. Thanks.UPDATE: I just tried the following:
- Delete all Qt/Qt Designer with Add or Remove programs
- With QT unified installer, install Qt 5.15 with custom install. I selected all the MSVC, all the MinGW, all the UWP, and nothing below (The following are unselected: Sources, Qt Charts, Qt Quick 3D, Qt Data Visualization, Qt Lottie Animation, Qt Purchasing, Qt Virtual Keyboard, Qt WebEngine, Qt Network Authorization, Qt WebGL Streaming Plugin, Qt Script (Deprecated), Qt Debug Information Files, Qt Quick Timeline). Under QT Creator 7.0.2 I selected CDB Debugger support, Debugging tools for windows, QT Design Studio, CMake 3.23.2 and Ninja 1.10.2
- When I run creator and start a new project, it runs but form editor gives error 'Line 0: The Design Mode requires a valid Qt kit'. Line 0 is an import QtQuick 2.15.
- Then I opened my project I opened the directory in the command prompt, did pip -m venv env , activated it, and pip install PySide2
- When I open my PySide2 project in form editor I get message Line 0: The Design Mode requires a valid Qt kit. Line 0 refers to an import for QtQuick.
- When I try to execute the project, I get No module named 'PySide2'.
What am I doing wrong? I can't get this to work with Qt5/PySide2 at all. Please help.
If I uninstall Qt and instead of doing the custom install I install 'Design Tools' and 'Qt 6.3 for desktop development' it all works fine, but of course then I won't be able to use QtLocation.
I found this post: https://forum.qt.io/topic/84198/no-valid-kits-found
It indicates for Qt5 you need to select the MingGW version under Qt5 and the same version under tools. In my case it was MingGW 8.1.0 64-bit. Tried that but it still didn't work. I still get the Line 0 error in Form Editor.