Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Is QT Quick the right tool for Raspberry Pi

[Solved] Is QT Quick the right tool for Raspberry Pi

Scheduled Pinned Locked Moved QML and Qt Quick
14 Posts 6 Posters 7.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matinzk
    wrote on last edited by
    #4

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      swegmann
      wrote on last edited by
      #5

      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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        matinzk
        wrote on last edited by
        #6

        Aha cool.

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

        1 Reply Last reply
        0
        • S Offline
          S Offline
          swegmann
          wrote on last edited by
          #7

          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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            matinzk
            wrote on last edited by
            #8

            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.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DBoosalis
              wrote on last edited by
              #9

              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]

              1 Reply Last reply
              0
              • M Offline
                M Offline
                matinzk
                wrote on last edited by
                #10

                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?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  matinzk
                  wrote on last edited by
                  #11

                  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?

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    onek24
                    wrote on last edited by
                    #12

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

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      matinzk
                      wrote on last edited by
                      #13

                      Ran on Ubuntu 64 bit and it's fine.

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

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #14

                        Hi,

                        What exact error are you getting ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved