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.5k 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.
  • R Offline
    R Offline
    RodriguesCunha
    wrote on last edited by
    #39

    Hi postmako.
    I still didn't managed to build Qtcreator.
    After build and install qtquick1 module the declarative error was resolved. But now i get the same you had: designercomponents designer.

    One other thing, is it possible when building an app, define it not to use opengl?

    My problem is that i want to show my app (running on RPi) on my laptop (not on monitor), using x11vnc and tightvncviewer. I get the same screen as pi, but i can't get the hdmi output because of opengl.
    Is there any way to do it, or should i build again Qt and in configure do not use -opengl es2?

    Thanks

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

      As far as I know adding the -opengl es2 to the configure is just telling Qt to configure opengl for ES2 not the desktop. It should not matter when it comes to building your apps. There is probably something wrong with your application.

      Did you try building the sample apps in /home/pi/opt/qt5/qtbase/examples/ ?

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

        Hi,
        I tried to build some examples, but i get the same.
        On my laptop i get everything but the app.
        When i plug the hdmi monitor, the app is showing.
        So i don't know if the problem is on RPi or on Qt side...
        I read that it's not possible to get same screen on monitor and laptop if it's using opengl.
        Like i said, on RPi i'm using x11vnc and on laptop tightvncviewer.

        If you want, i can send you my app code. But i think the problem it's not in my app. My app is working well in Ubuntu and on Windows 7.
        One thing different is that in RPi, when i start app it's always fullscreen, but in the other OS it's not and so i get the buttons to maximize, minimize and close.

        Thanks

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

          Are you running the app in x-windows or from the terminal?

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

            From terminal, inside x-windows.

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

              Maybe this is helpful: "http://qt-project.org/forums/viewthread/22903":http://qt-project.org/forums/viewthread/22903

              It basically says "it will be fullscreen if you are using the eglfs QPA plugin"

              Then I found this: "http://qt-project.org/forums/viewthread/10466":http://qt-project.org/forums/viewthread/10466

              I noticed this in the qmake.conf file:
              @QT_QPA_DEFAULT_PLATFORM = wayland@

              So you could change that to xcb and rebuild or you could build and install wayland and get that to work. But when I typed ./app_name -platform xcb it worked in a window.

              Interesting, I guess it is good to learn something new everyday...

              Let me know what you end up doing, I'm still learning too.

              1 Reply Last reply
              0
              • 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

                                          • Login

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