[Solved] Is QT Quick the right tool for Raspberry Pi
-
wrote on 21 Nov 2014, 21:07 last edited by
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.
-
wrote on 21 Nov 2014, 21:54 last edited by
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. -
wrote on 25 Nov 2014, 12:05 last edited by
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:
-
wrote on 28 Nov 2014, 17:46 last edited by
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.
-
wrote on 28 Nov 2014, 18:40 last edited by
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 -
wrote on 28 Nov 2014, 18:48 last edited by
Aha cool.
So I can program and test on Linux and use the same application to build/release for RPi using the RPi Kit?
-
wrote on 28 Nov 2014, 20:19 last edited by
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
-
wrote on 28 Nov 2014, 20:22 last edited by
fantastic, I will have a read.
All we'd need to test on Ubuntu in that sense is the actual animation etc. Hardware stuff would be only serial data, which we will test with USB on Ubuntu then test on RPi either via USB or Rx/Tx pins.
-
wrote on 28 Nov 2014, 20:47 last edited by
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]
-
wrote on 1 Dec 2014, 21:51 last edited by
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?
-
wrote on 1 Dec 2014, 21:54 last edited by
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?
-
wrote on 3 Dec 2014, 16:31 last edited by
Have you tried running the compiled application on the RPI or on your x86/x64 linux device?
-
wrote on 3 Dec 2014, 17:20 last edited by
Ran on Ubuntu 64 bit and it's fine.
Doesn't run on Raspberry Pi with embedded Linux though.
-
Hi,
What exact error are you getting ?
2/14