Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved] How to redirect the QT Application display to /dev/fb0
Forum Updated to NodeBB v4.3 + New Features

[Solved] How to redirect the QT Application display to /dev/fb0

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 2 Posters 6.9k 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.
  • L Offline
    L Offline
    lutzhell
    wrote on 3 Jun 2014, 09:34 last edited by
    #2

    Hi Sid,

    i assume you use Qt5? The QWS system does not exist anymore and is replaced by the QPA system which by now is not documented very well.

    http://www.kdab.com/porting-from-qt-4-to-qt-5/

    However you should be fine with the linuxfb plugin. What you need to change is:

    • change your application to be a QGuiApplication

    @#include <QGuiApplication>@

    ...

    @QGuiApplication theApp(argc, argv);@

    • remove @-qws -display “linuxfb:/dev/fb0”@

    command line parameters

    • copy or move the platforms directory created by qt install to the directory containing your application (maybe it is also ok to just install the platforms directory's contents to /lib or /usr/lib?)

    Cheers,
    Lutz

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lutzhell
      wrote on 3 Jun 2014, 09:41 last edited by
      #3

      Oh, and dont't forget to pass

      @-qpa linuxfb@

      as an argument to configure when you build Qt5 to assure that the linuxfb plugin is used as default.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sidii
        wrote on 3 Jun 2014, 10:02 last edited by
        #4

        Dear Lutzhell,

        Thanks for your quick reply.
        Actually while building QT from source i got following Config summary:

        QPA backends:
        DirectFB ............. no
        EGLFS ................ no
        KMS .................. no
        LinuxFB .............. yes
        XCB .................. no

        so i think there is no need of doing QT Configure with -qpa linuxfb.

        So i want to pass the command line argument. So to run the application what arguments i should use so that it is redirected to LinuxFb.

        Looking forward for your help.

        Thanks lot.
        Sid

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sidii
          wrote on 3 Jun 2014, 10:04 last edited by
          #5

          Forgot to mention that i am using QT 5.2.1.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lutzhell
            wrote on 3 Jun 2014, 10:09 last edited by
            #6

            Hi Sid,

            my application starts nicely without any additional parameters.

            This is possible because with the configure flag i say that i want to use "offscreen" (i.e. in my case: -qpa offscreen, you would use -qpa linuxfb) as default QPA platform plugin.

            from ./configure --help

            @-qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).@

            If you don't want to use linuxfb as default you can still pass the platform parameter to your programme:

            @-platform linuxfb@

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lutzhell
              wrote on 3 Jun 2014, 10:12 last edited by
              #7

              BTW i'm using Qt 5.1.1 but the instructions should do for your version as well

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sidii
                wrote on 3 Jun 2014, 10:36 last edited by
                #8

                Dear Lutzhell,

                Thanks for your quick reply.

                I will work on your inputs and will update you about the progress :)

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lutzhell
                  wrote on 3 Jun 2014, 10:42 last edited by
                  #9

                  Good luck :)

                  The doc for QGuiApplication gives some clues which arguments can be passed to a QGuiApplication:

                  http://qt-project.org/doc/qt-5/qguiapplication.html#QGuiApplication

                  very interesting is:

                  @-platform platformName[:options], specifies the Qt Platform Abstraction (QPA) plugin.

                  Overridden by the QT_QPA_PLATFORM environment variable.
                  @

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Sidii
                    wrote on 5 Jun 2014, 06:33 last edited by
                    #10

                    Hi lutzhell,

                    Thanks for the help. I regenerated all the libraries by passing

                    @-qpa LinuxFB @

                    during the configure.

                    Now i am able to see the output on LinuxFB by giving the following command:
                    @
                    ./gui_qt -platform linuxfb@

                    Cheers :)

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Sidii
                      wrote on 5 Jun 2014, 06:34 last edited by
                      #11

                      Marking it as solved.

                      1 Reply Last reply
                      0

                      11/11

                      5 Jun 2014, 06:34

                      • Login

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