4

I am developing a GUI in Qt. The target platform is Linux / ARMv6-based Raspberry Pi Zero W and distribution is a custom Poky / Yocto distribution. I attached a display module (ILI9341-based 2.4" SPI TFT Display) to the Raspberry Pi and I would like my Qt application to run on the framebuffer /dev/fb1 provided by a display driver.

The current framebuffer driver allows me to display the desktop in the display module, i.e:

FRAMEBUFFER=/dev/fb1 startx

The previous command achieves what I would like to do indirectly. However, I do not want to show my desktop. I just want to specify a framebuffer as a displaying platform for a Qt application (instead of using DISPLAY environment variable)

Any guidance as to how this would be achieved by using either command line arguments to the executable, or via application code, or by using both approaches is highly appreciated.

mozcelikors
  • 2,582
  • 8
  • 43
  • 77
  • 1
    Having Qt use a framebuffer is very different from it using X. With X, there's a window manager. With the framebuffer, Qt manages its own window frames and window focus. – Kuba hasn't forgotten Monica May 08 '18 at 18:31
  • I knew that, But, I gave X server example because it supports running on a framebuffer. I want to be able to do the same for a Qt application, if possible. – mozcelikors May 08 '18 at 20:22
  • Maybe this can help you: https://doc.qt.io/qt-5/embedded-linux.html – Felix May 09 '18 at 08:32

1 Answers1

9

Running Qt directly on the framebuffer is described here.

In short, you would use the linuxfb driver for Qt that will interface you with the /dev/fbX available on your system.

Some more info is also available here.

emmrk
  • 276
  • 2
  • 6
  • As far as I understood, this is for creating a virtual framebuffer called `qvfb`. I would like to simply "specify a framebuffer" to run on, instead of "specifying a display" for the Qt application. Am I wrong? How would I specify that this application should run on framebuffer `/dev/fb1` ? – mozcelikors May 08 '18 at 20:20
  • 3
    You should use the following option to specify which framebuffer to use: `-platform linuxfb:fb=/dev/fb0`. It's all in the documentation :) – emmrk May 11 '18 at 08:21
  • Thanks. I already got it working thanks to the helpful comment from Felix. – mozcelikors May 11 '18 at 08:59