[Solved] Is QT Quick the right tool for Raspberry Pi
-
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 ?