Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Qt5.1 on Rasberry Pi (full install not cross-compile)
Forum Updated to NodeBB v4.3 + New Features

Qt5.1 on Rasberry Pi (full install not cross-compile)

Scheduled Pinned Locked Moved QtonPi
93 Posts 24 Posters 123.7k Views 2 Watching
  • 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.
  • P Offline
    P Offline
    postmako
    wrote on last edited by
    #45

    I also came across these for wayland support: "http://wayland.freedesktop.org/raspberrypi.html":http://wayland.freedesktop.org/raspberrypi.html

    Then build similar to these instructions: "http://qt-project.org/wiki/QtWayland":http://qt-project.org/wiki/QtWayland

    @WLD=$HOME/Apps/Wayland # change this to another location if you prefer
    LD_LIBRARY_PATH=$WLD/lib
    PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
    ACLOCAL="aclocal -I $WLD/share/aclocal"
    PATH=$WLD/bin:$PATH
    XDG_RUNTIME_DIR=/tmp

    export WLD LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL PATH XDG_RUNTIME_DIR

    git clone git://gitorious.org/qt/qtwayland.git
    cd qtwayland
    qmake
    make
    make install@

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RodriguesCunha
      wrote on last edited by
      #46

      Hi postmako
      Using your suggestion ./app_name -platform xcb now i get the window and it works over vnc.
      Thanks

      1 Reply Last reply
      0
      • G Offline
        G Offline
        geoffml
        wrote on last edited by
        #47

        Hi,
        At last I have found a link that actually works, thanks guys. I am running the cube example on my Pi. Now I want to run a working Qt5 Windows 32 bit app on my Pi. Has anybody done this yet with Qt5? As it is suggested, can I place all the associated files on my Pi and compile the .pro project and run qmake etc or is this too simplistic?
        Just a few points to make compilation a little quicker. It took me 30 hours to compile

        1. Reduce memory share to 16
        2. Do not enable SSH
        3. Overclocked at MEDIUM level only. Could be quicker if TURBO used.

        Note to run the cube example return the memory share to at least 128 otherwise nothing happens on the screen. CTRL+ALT+BACKSPACE to exit.
        Thanks

        1 Reply Last reply
        0
        • P Offline
          P Offline
          postmako
          wrote on last edited by
          #48

          Yeah that should work, just run qmake and make. Let us know.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            geoffml
            wrote on last edited by
            #49

            Hi,
            I have run into a few problems. I have a very basic Qt5.0.1 (32 bit) project using Qt Creator 2.6.2 on my PC, simply comprising of a mainwindow.h, main.cpp, mainwindow.cpp and mainwindow.ui. The form has a single text box. There is no code, I just wanted to see the form appear on my RPI. With the projec built and showing the form on my PC, I transferred the project .pro and all files mentioned above into the opt/qt5/examples/gui folder. I compiled it, ran qmake and make. This flagged up errors about closing braces. When looking at the above files in leaf pad, they contained ascii characters, and not code text. Since I cannot inspect the mainwindow.ui code I cannot determine if this is also corrupt.
            I have also attempted to transfer .png and .bmp images from my PC to my RPI which are not recognised by either Gimp 2.8 or the image viewer.
            Is this a Windows versus Linux problem? Can I use Qt4 to build my form and compile it under Qt5?
            Thanks

            1 Reply Last reply
            0
            • P Offline
              P Offline
              postmako
              wrote on last edited by
              #50

              Sounds like you transferred the files incorrectly from your PC to your Raspberry Pi. I would use WinSCP to transfer the files or use FileZilla but then use SFTP in binary mode.

              How did you transfer your files?

              1 Reply Last reply
              0
              • G Offline
                G Offline
                geoffml
                wrote on last edited by
                #51

                Hi postmako,
                I used a USB stick from PC to RPI. Just downloaded WinSCP and I'll give it ago using SFTP protocol.

                Thanks

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  postmako
                  wrote on last edited by
                  #52

                  Actually if you are using WinSCP you just use it as is. You only need to use SFTP with Filezilla. If you transferred it via USB stick then you shouldn't have any issues unless the encoding is incorrect. You may need to save them in UTF-8 format and make sure the Pi is set the same way, this shouldn't affect the binary files though so something else may be going on.

                  Do you have a website or some place where you could dump the files and some people here might be able to help you?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    geoffml
                    wrote on last edited by
                    #53

                    Hi postmako,
                    Ha it was an encryption issue from PC to USB to RPI. Now I have my Qt5 app, developed on PC, running on RPI thanks to you. I can really make some progress now and plan to make a handheld RPI with touch screen.
                    I too have a full screen app but I guess this is an OpenGL thing. Any ideas would be welcome. Tried the ./app_name -platform xcb but no joy.
                    I don't have a web page but I'd be happy to share my working Qt5onPi.img, but even zipped it's over 3GB. Any suggestions such a Dropbox

                    Cheers

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      postmako
                      wrote on last edited by
                      #54

                      Could you post your code and then we could all see why it is full-screen only? Are you running it in the main terminal or from x-windows?

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        geoffml
                        wrote on last edited by
                        #55

                        Hi,
                        I run the app from LXterminal. For the cube example I made a shortcut to the desktop and both are full screen. Ran cp command qmake and then make as per instructions. On the PC the window is correctly sized as expected and not full screen.
                        Qt Creator 2.6.2
                        Qt 5.0.1 (32 bit)
                        Windows 7
                        MinGw_32bit
                        For Qt5onPi.pro

                        @#-------------------------------------------------

                        Project created by QtCreator 2013-09-01T12:00:39

                        #-------------------------------------------------

                        QT += core gui

                        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                        TARGET = Qt5onPi
                        TEMPLATE = app

                        SOURCES += main.cpp
                        mainwindow.cpp
                        hled.cpp

                        HEADERS += mainwindow.h
                        hled.h

                        FORMS += mainwindow.ui
                        @
                        For main.cpp
                        @#include "mainwindow.h"
                        #include <QApplication>

                        int main(int argc, char *argv[])
                        {
                        QApplication a(argc, argv);
                        MainWindow w;
                        w.show();

                        return a.exec&#40;&#41;;
                        

                        }@
                        For mainwindow.cpp
                        @#include "mainwindow.h"
                        #include "ui_mainwindow.h"
                        #include "hled.h"

                        MainWindow::MainWindow(QWidget *parent) :
                        QMainWindow(parent),
                        ui(new Ui::MainWindow)
                        {
                        ui->setupUi(this);
                        //Connect signals and slots - Read QT documentation for fundamentals
                        connect(ui->pushButton_On_Off, SIGNAL(clicked()), SLOT(onpushButton_On_OffClicked()));
                        connect(ui->dial_Volume, SIGNAL(actionTriggered(int)), SLOT(on_dial_Volume_actionTriggered(int)));
                        connect(ui->lcdNumber, SIGNAL(overflow()), SLOT(on_lcdNumber_overflow));
                        ui->Power_Led_On_Off->turnOff(true);
                        setWindowTitle(tr("Qt5onPi v1.0"));
                        }

                        MainWindow::~MainWindow()
                        {
                        delete ui;
                        }

                        void MainWindow::on_pushButton_On_Off_clicked()
                        {
                        ui->Power_Led_On_Off->toggle();
                        }

                        void MainWindow::on_dial_Volume_valueChanged(int value)
                        {
                        this->ui->lcdNumber->display(value);
                        }

                        void MainWindow::on_lcdNumber_overflow()
                        {

                        }
                        @

                        Thanks

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          geoffml
                          wrote on last edited by
                          #56

                          Hi,
                          Here's the relevant mainwindow.ui code that defines the size set to max 430 x 430

                          @<?xml version="1.0" encoding="UTF-8"?>
                          <ui version="4.0">
                          <class>MainWindow</class>
                          <widget class="QMainWindow" name="MainWindow">
                          <property name="geometry">
                          <rect>
                          <x>0</x>
                          <y>0</y>
                          <width>430</width>
                          <height>430</height>
                          </rect>
                          </property>
                          <property name="maximumSize">
                          <size>
                          <width>430</width>
                          <height>430</height>
                          </size>
                          </property>
                          <property name="windowTitle">
                          <string>MainWindow</string>@

                          Thanks

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            postmako
                            wrote on last edited by
                            #57

                            Well hopefully someone else will be able to help you with this. My pi is busy at the moment and we will be moving soon. I'll be busy for the next couple of months. Let us know if you end up fixing it and how you did it.

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              RavenII
                              wrote on last edited by
                              #58

                              Anyone know why I might be running into an issue building qt5 all of a sudden? I compiled it a week or so ago with no issue...now I run into "this":http://pastebin.com/sCPfL5DB

                              1 Reply Last reply
                              0
                              • G Offline
                                G Offline
                                geoffml
                                wrote on last edited by
                                #59

                                Hi,
                                Just an update to let you guys know I now have Qt5.1.1 installed and running on my RPi, reading and writing to the ttyUSB0 port.

                                The screen issue has been resolved simply in Qt5 in the .ui Form, where the API is displayed in the center of a £13 3.5" LCD monitor. The RPi is powered from a 5Ahr USB rechargeable power pack, making it portale.

                                @ <layout class="QGridLayout" name="gridLayout">
                                <item row="0" column="0" alignment="Qt::AlignVCenter">
                                <widget class="QToolBox" name="toolBox">
                                <property name="minimumSize">
                                <size>
                                <width>575</width>
                                <height>375</height>@

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  polon
                                  wrote on last edited by
                                  #60

                                  Hi
                                  I am using Qt on Windows and I would like to communicate with RPi.

                                  I'm trying to compile Qt as explained in this thread and on wiki pages but I have problems.

                                  @
                                  pi@raspberrypi ~/opt $ git clone git://gitorious.org/qt/qt5.git
                                  Cloning into 'qt5'...
                                  fatal: unable to connect to gitorious.org:
                                  gitorious.org[0: 87.238.52.168]: errno=Connection timed out
                                  gitorious.org[1: 2a02:c0:1014::1]: errno=Address family not supported by protocol
                                  @

                                  Internet connection is working.
                                  I'm not an Linux expert.

                                  I would be grateful for any suggestions how to solve this problem.
                                  Thanks

                                  1 Reply Last reply
                                  0
                                  • sierdzioS Offline
                                    sierdzioS Offline
                                    sierdzio
                                    Moderators
                                    wrote on last edited by
                                    #61

                                    Try cloning through http instead of git.

                                    (Z(:^

                                    1 Reply Last reply
                                    0
                                    • P Offline
                                      P Offline
                                      polon
                                      wrote on last edited by
                                      #62

                                      Many thanks for the help!
                                      I have used
                                      @git clone http://gitorious.org/qt/qt5.git@
                                      and it is working.

                                      I'm slowly going forward.

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        polon
                                        wrote on last edited by
                                        #63

                                        Unfortunately git through http has not finished successfully.
                                        @Cloning into 'qtbase'...
                                        error: The requested URL returned error: 502 (curl_result = 22, http_code = 502, sha1 = 0bcb75ae5bb29dfc3d303bbada13341fa7969858)
                                        error: Unable to find 0bcb75ae5bb29dfc3d303bbada13341fa7969858 under http://gitorious.org/qt/qtbase.git
                                        Cannot obtain needed tree 0bcb75ae5bb29dfc3d303bbada13341fa7969858
                                        while processing commit e6cac2c19315c9127f5b4048088e66da6b9296fe.
                                        error: Fetch failed.
                                        @

                                        I have moved to another network with access to git and it was ok for long time. However after one day of compiling there was some problem with power and it was not finished.

                                        I am trying to run it once again but now I have problem with configure
                                        @bash: ./configure -v -opengl: No such file or directory@
                                        When I run configure without options it works.

                                        I would be grateful for any suggestions what I'm doing wrong.

                                        Or maybe somebody is able to build a torrent with image of rpi with qt? I promise to seed it.

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          misiek303
                                          wrote on last edited by
                                          #64

                                          Can someone share a plain raspberry/qt5 image with all.

                                          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