[Solved] Is QT Quick the right tool for Raspberry Pi
-
Hi everyone. I am very new to the QT stuff.
I would like to install QT on Linux (Ubuntu) do a graphical design and run on Raspberry Pi.
My questions:
Is QT Quick the right tool to do this with? I'd like to program using QML.
Which version should I install on Ubuntu? Any particular links?
Thanks for all the Help.
M.
-
Hello, first of all ... QT stand for QuickTime (Apple) ... while Qt stand for Qt :-)
This error was enough to get that your are new to Qt :-DIf you like Qt Quick ... then definitely Qt Quick is the right tool for Raspberry Pi.
A friend of mine for an event, he programmed a simple videogame running on a Raspberry Pi. So, it's possibile to use and it also run well. -
We are using the Raspberry Pi as a prototyping platform for a customers project and are quite happy with it. However I noticed that loading and parsing QML files can be a bit slow on the Raspi. But once the pages are loaded it runs quite smoothly. Also I reverted to using my own implementations for the very rich and powerful QML controls.
For the cross toolchain I relied on building one of my own based on the following links. I'm not aware of any pre-built packages for Ubuntu.
http://qt-project.org/wiki/Qt-RaspberryPi
http://qt-project.org/wiki/RaspberryPi_Beginners_guideIf it helps, I also condensed the Qt-RaspberyPi instructions into a Gist:
-
Thanks for the replies guys.
If I program using Qt Quick and QML and run the application ono 64bit Ubuntu, can I then compile this for Raspberry Pi as Embedded Linux easily? Do I need to start any special type of project in Qt Creator? Or just choose Qt Quick Application?
Thanks.
-
If you're building everything under Linux and using qmake/QtCreator there should be no need to set up a special project. You can just add a new Raspberry Pi kit and compiler to Qt Creator (see links below) and include these Kits for your project. From there you can simply switch between building for Ubuntu and Raspberry Pi just as simply as you switch between Debug and Release.
http://qt-project.org/doc/qtcreator-3.2/creator-tool-chains.html
http://qt-project.org/doc/qtcreator-3.2/creator-targets.html -
In principle yes, as long as you're not using any special RPi features, like the camera, GPIOs etc. In that case you'd have to implement some abstraction for the application to also work on Ubuntu. Samuel Gaist had a presentation about that in this years Qt Developer days:
https://www.qtdeveloperdays.com/sites/default/files/presentation_pdf/SamuelGaist_Testdriven_0.pdf
-
Curious as to whether or not you are loading the QML files as resource files or not.
[quote author="swegmann" date="1416917154"]We are using the Raspberry Pi as a prototyping platform for a customers project and are quite happy with it. However I noticed that loading and parsing QML files can be a bit slow on the Raspi. But once the pages are loaded it runs quite smoothly. Also I reverted to using my own implementations for the very rich and powerful QML controls.
For the cross toolchain I relied on building one of my own based on the following links. I'm not aware of any pre-built packages for Ubuntu.
http://qt-project.org/wiki/Qt-RaspberryPi
http://qt-project.org/wiki/RaspberryPi_Beginners_guideIf it helps, I also condensed the Qt-RaspberyPi instructions into a Gist:
https://gist.github.com/Jokymon/7133dbc943e917f645fc[/quote]
-
So when I try and run the compiled files for RPi, we get alot of segment faults errors and of course the application never runs.
Here is my code:
main.cpp
@
#include <QApplication>
#include <QQmlApplicationEngine>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec();
}
@
main.qml
@
import QtQuick 2.3
import QtQuick.Controls 1.2ApplicationWindow {
visible: true
width: 800
height: 480
opacity: 1
title: qsTr("Dash Left")
flags: Qt.FramelessWindowHintRectangle {
id: rect
x: 380
y: 240
width: 100; height: 100
color: "yellow"
}}
@Any ideas?
-
So when I try and run the compiled files for RPi, we get alot of segment faults errors and of course the application never runs.
Here is my code:
main.cpp@#include <QApplication>
#include <QQmlApplicationEngine>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec();
}@
main.qml
@import QtQuick 2.3
import QtQuick.Controls 1.2ApplicationWindow {
visible: true
width: 800
height: 480
opacity: 1
title: qsTr("Hello Window")
flags: Qt.FramelessWindowHintRectangle {
id: rect
x: 380
y: 240
width: 100; height: 100
color: "yellow"
}}@
Any ideas?
-
Hi,
What exact error are you getting ?