Hooray! Whether it was some configuration issue or out of date binaries we don’t know yet for sure, but it does run. I switched to Raspbian to give that a shot…Īfter repeating the process on the latest Raspbian, the Qt Quick QML test application launches.
I don’t have a full grasp of what goes on in the world of repositories ran by various Debian-based distributions, but I could see URLs flying by on-screen and I remembered that Ubuntu Mate pulled from different repositories than Raspbian. I wish I was good enough to figure out what’s going on and contribute intelligently to the discussion! As of this writing, no solution had been posted. Searching on the web, I found somebody on stuck in the same place.
My QML’s import QtQuick 2.7 failed with error module "QtQuick" version 2.7 is not installed The obvious implication is that the version of QtQuick in qml-module-qtquick2 was too old, but I couldn’t figure out how to verify version number is indeed the problem or if it’s a configuration issue elsewhere in the system. After installing the required packages, I got stuck.
I pulled the project git repository to my Raspberry Pi running Ubuntu Mate and tried to run the project. That’s good enough for now, so I pushed these changes up to Github and switched platforms… Once that was done, the application launched successfully on my Ubuntu desktop machine, albeit with visual appearance very different from the C++ version. (If there are additional dependencies I forgot about, look for them in the output of apt list python3-pyqt5*)
This required sudo apt install python3-pyqt5.qtquick in addition to the python3-pyqt5 I already had.
Looking at the Qt Creator boilerplate main.cpp for reference, I translated the application launch code into main.py. The PyQt5 documentation claimed support for QML but the example on the introductory page doesn’t quite line up with the Qt Creator boilerplate code. The next goal is to get it up and running on Python via PyQt5. Once the boilerplate successfully launched, I switched languages… (From memory: qml-module-qtquick2, qml-module-qtquick-controls2, qml-module-qtquick-templates2, and qml-module-qtquick-layouts) Reading the error message, I looked at the output of apt list qml-module-qtquick* and installed the ones that sound right. Even without any changes to the startup boilerplate, it reported error messages complaining of missing modules. Once the Qt Creator IDE was up and running, I followed the Qt Quick tutorial to create a bare bones boilerplate Qt Quick application. Step 1: Qt Creator IDE Default Boilerplate. And this starts with a smoke test to make sure I could run Qt Quick in the environments I care about: Python and Raspberry Pi.
Now that I’ve had a bit of QWidget UI work under my belt I wanted to see what Qt Quick has to offer. Qt Quick is new for Qt5 and seem to share nothing in common with QWidget other than both a part of Qt5. Up to this point my experience with building graphics user interface in Qt was with the QWidget-based infrastructure, which has a long lineage in past editions of Qt. Built with modern ideas such as OpenGL graphics acceleration for animation effects and UI layout declared with a text-based markup language QML (probably stands for Qt Markup Language.)
As far as I can tell, this is an entirely different system for creating user interface of a Qt application. The prime motivation for me to go through Qt licensing documentation and installing Qt Creator IDE was to explore the new UI infrastructure introduced in Qt 5 under the umbrella of “ Qt Quick“.