[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 :-D

    If 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_guide

    If it helps, I also condensed the Qt-RaspberyPi instructions into a Gist:

    https://gist.github.com/Jokymon/7133dbc943e917f645fc



  • 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



  • Aha cool.

    So I can program and test on Linux and use the same application to build/release for RPi using the RPi Kit?



  • 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



  • 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.



  • 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_guide

    If 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&#40;&#41;;
    

    }
    @
    main.qml
    @
    import QtQuick 2.3
    import QtQuick.Controls 1.2

    ApplicationWindow {
    visible: true
    width: 800
    height: 480
    opacity: 1
    title: qsTr("Dash Left")
    flags: Qt.FramelessWindowHint

    Rectangle {
    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&#40;&#41;;
    

    }@

    main.qml

    @import QtQuick 2.3
    import QtQuick.Controls 1.2

    ApplicationWindow {
    visible: true
    width: 800
    height: 480
    opacity: 1
    title: qsTr("Hello Window")
    flags: Qt.FramelessWindowHint

    Rectangle {
    id: rect
    x: 380
    y: 240
    width: 100; height: 100
    color: "yellow"
    }

    }@

    Any ideas?



  • Have you tried running the compiled application on the RPI or on your x86/x64 linux device?



  • Ran on Ubuntu 64 bit and it's fine.

    Doesn't run on Raspberry Pi with embedded Linux though.


  • Lifetime Qt Champion

    Hi,

    What exact error are you getting ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.