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. [SOLVED] QtQuick not full-screen application, platform xcb
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QtQuick not full-screen application, platform xcb

Scheduled Pinned Locked Moved QtonPi
10 Posts 3 Posters 7.0k Views 1 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.
  • J Offline
    J Offline
    jerzu
    wrote on last edited by
    #1

    Hi,

    I have some simple QtQuick-based application for my Raspberry: QML GUI that displays data collected from I2C device. It works fine, but only in full-screen mode, and only on monitor connected to HDMI. When I'm using VNC and try to run my app, it actually runs, but I can't see GUI.
    So I want to display my app in a window, because I want to close app just by clicking 'x' on the window, and also launch (and see!) the app by VNC client on my PC. And I have read that I can do this by executing the app with an option:

    bq. ./app -platform xcb

    But it turns out that it doesn't work because of this:

    bq. Cant find EGLConfig, returning null config
    Unable to find an X11 visual which matches EGL config 0
    Could not initialize EGL
    Aborted

    And then I've found this comment:

    bq. Keep in mind that with xcb you won’t have any OpenGL support on the Pi. So it’s fine for running QWidget apps but it won’t run any Qt Quick 2 stuff.
    If you are not interested in Qt Quick or OpenGL, then go for xcb. It will function better than eglfs when using the traditional widgets.

    So, if it is true, is there any other way to:

    open QtQuick applications in windows, not in full-screen mode

    run applications via VNC client from PC in such a way that i could actually see the GUI

    Anyone help? :)

    PS. I'm using Qt 5.0.2 compiled for Raspberry and TightVNC.

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

      No, these (1 and 2) are not possible on a Pi. Certainly not with such ancient Qt version, but probalby also not doable today.

      (Z(:^

      S 1 Reply Last reply
      0
      • J Offline
        J Offline
        jerzu
        wrote on last edited by
        #3

        Ok, thanks a lot Sierdzio!

        The same quote once again:

        bq. Keep in mind that with xcb you won’t have any OpenGL support on the Pi. So it’s fine for running QWidget apps but it won’t run any Qt Quick 2 stuff.
        If you are not interested in Qt Quick or OpenGL, then go for xcb. It will function better than eglfs when using the traditional widgets.

        Is it true that my both objectives (please look at the top post), especially 1, are not possible because of QtQuick 2 is based on OpenGL? What if I would use QtQuick 1 and some more "ancient" Qt version (e.g. 4.8)? Maybe this could be a solution?

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

          Indeed, QtQuick 2 is based on OpenGL.

          You do have several options:

          • Use software painter from Qt Enterprise: "link":http://blog.qt.io/blog/2015/01/22/introducing-the-qt-quick-2d-renderer/ or an open source alternative (sorry, I don't have a link at this moment, but you can search the web)
          • use llvm-pipe OpenGL implementation
          • use QtQuick1 from Qt5 (no need to downgrade to Qt4!)
          • use QtQuick1 from Qt4 (there called QtDeclarative)

          (Z(:^

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jerzu
            wrote on last edited by
            #5

            Very helpful, thanks again!

            Ad. 3
            I thought that QtQuick1 was replaced by 2 in Qt5, hence my suggestion of downgrading. I read this "Porting QML Applications to Qt5":http://doc.qt.io/qt-5/qtquick-porting-qt5.html and I thought that I must use explicitly QtQuick2... But this way looks very promising because of I don't have to make lot of changes in existing code.

            I even tried to use QtQuick1 in my app just by replacing import statements in .qml file like this:

            bq. (old): import QtQuick 2.0
            (replaced): import QtQuick 1.0

            but when I launch my app, it throws the error, that (more or less)

            bq. QtQuick 1.0 is not installed

            So, how can I use QtQuick1 in Qt5 version? Please, don't tell me, that I must reconfigure and recompile Qt libraries with some additional option...

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

              You need to do some changes in C++ code: replace QQuick* and QQml* calls with QDeclarative*.

              In your .pro file, you need to remove QT+= qml quick and add QT += declarative (or qtquick1, I am not sure).

              (Z(:^

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jerzu
                wrote on last edited by
                #7

                Ok, when I'm done with this I will post here what exactly I had to change - maybe it will be helpful for someone.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jerzu
                  wrote on last edited by SGaist
                  #8

                  Everything is working now :) Thanks for advice, Sierdzio!!!

                  My problem was that it turned out that I did not build "qtquick1" module - hence the mentioned error "QtQuick 1.0 is not installed". So of course I had to build and install this particular module. Then, I had to change my program from "QtQuick2" or "QQml" style to "old style", using

                  • QDeclarativeContext
                  • qtquick1applicationviewer.h

                  headers. It was necessary to change the way I display QML file and the way I set some properties to QML GUI, but it was only a few lines in C++ code. In .pro file, in section "QT +=", I had to remove

                  bq. quick qml

                  and add

                  bq. declarative

                  I think this is all about code.

                  Next, when I was launching VNC server, it was necessary to start it as root, just like this:

                  bq. sudo vncserver :1 -geometry 1024x600 -depth 16 -pixelformat rgb565

                  I don't know why, but when I am a normal user my app crashes.

                  It still puts out this message:

                  bq. Cant find EGLConfig, returning null config
                  Unable to find an X11 visual which matches EGL config 0

                  but I don't mind, all is working fine ;)
                  Problem solved.

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

                    Good to know! Thanks for the info and happy coding :-)

                    (Z(:^

                    1 Reply Last reply
                    0
                    • sierdzioS sierdzio

                      No, these (1 and 2) are not possible on a Pi. Certainly not with such ancient Qt version, but probalby also not doable today.

                      S Offline
                      S Offline
                      Stefano86
                      wrote on last edited by
                      #10

                      @sierdzio
                      Hi, I think to have a similar problem. Specifically:
                      I developed a QtQuick 2.0 application for my target system (x86 system) and I decided to show it in full screen mode. In order to do this I used the method showFullScreen of the class QQuickView.
                      On target, app runs in fullScreen mode without problem, but when I try to do remote desktop via vnc (on my target is installed x11vnc), I don't see app on my local PC (I see only the desktop target).

                      On taget, I've installed amd graphic driver and openGL 4.4

                      Could you help me?
                      Thanks a lot...

                      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