For some reason I should use Qt6 for my project. I need serial port functionality but Qt Creator cannot find corresponding module. The following error is raised:
Project ERROR: Unknown module(s) in QT: serialport. My .pro file includes serialport - it seems to me that the problem is in the absence of this module. Also I don't corresponding examples projects.
I tried to install libqt5serialport5 and libqt5serialport5-dev using commands:
sudo apt-get install libqt5serialport5
sudo apt-get install libqt5serialport5-dev
but it didn't help. Please explain how to add serial port module to my Qt6 installation.
Below is information about my installation:
Qt Creator 8.0.2
Based on Qt 6.3.2 (GCC 10.3.1 20210422 (Red Hat 10.3.1-1), x86_64)
This problem has been solved very simple. Use Qt MaintenanceTool using which allows remove/update or install modules.
Related
I recently installed Qt Creator on my Ubuntu machine using the command:
$ sudo apt install qtcreator
$ sudo apt install qt5-default
I also know that it is correctly installed through this
$ qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/qt5/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"
However, the Qt Creator app still does not let me select a Kit because my Qt Versions is
still empty:
It seems there are others with the same issue but I cannot find a solution.
Ultimately, this all began because I was trying to make a project after installing Qt but I could not get passed this Kit Selection:
menu. I learned that the kit selection problem stems from not having the "Qt version" installed. However, I still cannot find a solution to how I can correctly install this Qt version.
you should install gcc and g++ compiler, look at Qt documentation
you should write this command
sudo apt-get install build-essential
Launch Qt Creator. Go to Tools > Options. Click Build & Run and select
tab Kit. Configure a compiler if it is not automatically detected.
this problem happens because of qt creator didn't understand and find the compiler, you should install it, after that it is usually automatically detected. if you have this issue again you should add it manually in the compiler section and in the kit section set compiler for your Desktop kit.
For adding manually compiler look at this QT Documentation
For adding manually kit look at this QT Documentation
For Adding Qt Versions manually
look at this QT Documentation
To add a Qt version:
Select Tools > Options > Kits > Qt Versions > Add.
Select the qmake executable for the Qt version that you want to add.
Select the Qt version to view and edit it.
In the Version name field, edit the name that Qt Creator suggests
for the Qt version.
In the qmake location field, you can change the qmake location.
If the Qt version is for QNX, enter the path to your installed QNX
SDK in the QNX SDK field.
I installed Qt Creator from XUbuntu 20.04 repository using these commands:
sudo apt install qt5-default qtcreator qtbase5-examples qtdeclarative5-examples
And I got Qt Creator where all Qt classes are highlighted as errors with message "Use of undeclared identifier". But projects are compiled correctly. АUtocompletion of Qt Classes is also not working.
I don't want to install version from Qt site, because repo versions run faster.
Screenshot:
I've got it fixed by going to Help > About Plugins > C++ > uncheck ClangCodeModel. Restart QtCreator.
Having an issue on migrating a Qt project from RPi4 to NVIDIA Jetson Nano. We wanted to migrate our project to Jetson Nano to improve image processing performance.
The qt dependency of our project is >= 5.11. But Jetson Nano uses Ubuntu 18.04.4 and it has qt5-default package pre-installed in it (in my understanding some system files use it). And this qt5-default packages version is 5.9.5.
I tried to downgrade my qt dependency, but every change made lead to harder to fix issue.
I tried to upgrade default qt5 version but couldn't find any similar guidance. The guides/questions already exists are about x86 etc. environment. Couldn't find any ARM based solution. The qt downloads doesn't give any buildable for ARM env (or I can't find them). The official documents only talks about cross-compiling.
What should I do to overcome this issue? Thanks in advance.
Okay I finally was able to successfully compile QT 5.12.9 on the Nano itself (no cross compilation).
The steps I did:
git clone https://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.12.9
Then
git submodule update --init --recursive
cd ~
mkdir qt5-build
cd qt5-build
Configure and build
../qt5/configure -nomake examples -nomake tests -skip qtwebengine
make
sudo make install
Make took like nearly a whole day to compile all sources. Also I had some compilation errors before. However after skipping webengine and not building the tests and examples in ./configure I was finally able to sucessfully make it.
I don't understand why there is a yellow warning sign next to my manually-added Qt version of qmake, i.e. Qt 5.9.1 (qt5), hovering over the warning sign gives no additional info:
In the above screen-shot, it is mentioned:
No qmlscene installed
Suggested by this answer, I installed this but it couldn't help:
$ sudo apt install qtdeclarative5-dev
Why is there a warning? How can I resolve it? Will it affect my builds/runs in a crucial way?
QmlScene is an external QML preview application for Qt Quick 2 views. Qt Quick 1 has a tool called QmlViewer for same purpose. It seems to be packed separately on debian based system. Following command should get the package.
sudo apt-get install qmlscene
For those that didn't install GCC, you can try uninstalling QT and then re-installing but with GCC. This was my resolution which worked for me on Linux Mint 19 with QT 5.7.
I am stuck with one error while building PyQt5 for rasberry pi. I was successfully able to run the application which uses QQmlApplicationEngine on Windows Desktop. Now I wanted to run the same application in Raspberry pi 3. I build the PyQt5 (5.4.1v) from the source and tried running the application but I get error:
ImportError: No Module Found "PyQt5.QtQml".
I realized that, when I build the PyQt5 from the source, I get:
Project Error: Unknown module(s) in QT: qml
and shows me a list of modules which will be built.
Just for a reference, I am using a raspbian, and have installed the following before building PyQt5.
sudo apt-get update
sudo apt-get install qtcreator
sudo apt-get install qt5-qmake
added "export QT_SELECT = qt5" to my "~/.profile" and "~/.bashrc"
sudo apt-get install qt5-default qt5-qmake qtbase5-dev-tools qttools5-dev-tools build-essential libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libgl1-mesa-dev
How am I supposed to install QtQml in PyQt5? Please help...
Thanks in Advance.
PyQt5 is (as you perhaps know) just a wrapper for the Qt C++ libraries. In order to use a specific module in PyQt5 the underlying C++ library needs to be installed.
The first error message shows that PyQt5.QtQml module is missing which respectively leads to the conclusion that the underlying Python wrapper is missing.
The second error message is probably generated on the C++ level and means that the required Qt C++ library for this module is missing.
Since you are building PyQt5 you not only need the runtime libraries but also the development packages for Qt. For QML you need the qtdeclerative5-dev package and the libqt5qml5 (I think that was the name for the runtime library). These of course depend on a bunch of other packages which will automatically be installed.
PS: Don't forget the SIP library which PyQt has as a dependency no matter which Qt modules you want to use.