Qt5 linuxfb platform plugin does not work with 8bit color depth
-
I have ported an embedded application from Qtopia 4 to Qt 5. The Qt 4 application was running on linux framebuffer. The embedded device the application should run on uses the vesafb framebuffer driver. As I understand Qt 5 uses plugins to support different graphic plaforms (like linuxfb and X11). So I'm trying to run the ported application with the linuxfb framebuffer plugin.
./myApp -platform linuxfb
My problem now is that the ported application runs fine on machines with at least 16bit color depth. But I have to support old hardware which only supports 8bit color depth. On these devices the application starts, but produces no graphical output at all. On colsole I get the following errors:
QPainter::begin: Paint device returned engine == 0, type: 2 QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 ...
fbset gives the following output on the machine where the graphics do not work:
mode "1024x768-60" # D: 63.500 MHz, H: 47.816 kHz, V: 59.920 Hz geometry 1024 768 1024 768 8 timings 15748 152 48 23 3 104 4 vsync high rgba 8/0,8/0,8/0,0/0 endmode
Can it be that the linuxfb framebuffer plugin does not support 8bit color depth?
-
Hi and welcome to devnet,
AFAIK, there should be no such limitation.
Which version of Qt are you using ?
Did you cross-compile it yourself ?
Do you have the same issue with a simple dummy application ? -
Thank you for your reply!
I'm using Qt 5.12.8 which is cross-complied via buildroot. I tested it again with this super simple program.
#include <QApplication> #include <QLabel> int main( int argc, char *argv[] ) { QApplication *app = new QApplication( argc, argv ); QLabel *label = new QLabel( "This is a test!" ); label->show(); return app->exec(); }
But the result is still the same. It does not work with 8bit famebuffer. I tested it on another machine which supports 8bit and 16bit color depth. If I switch the framebuffer to 16bit color it runs fine. If I switch the framebuffer to 8bit color depth, I get the same errors as before.
/tmp/test -platform linuxfb QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::pen: Painter not active QPainter::setPen: Painter not active QPainter::setPen: Painter not active QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QPainter::begin: Paint device returned engine == 0, type: 3 QPainter::setCompositionMode: Painter not active QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::pen: Painter not active QPainter::setPen: Painter not active QPainter::setPen: Painter not active QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 QPainter::pen: Painter not active QPainter::setPen: Painter not active QPainter::setPen: Painter not active QPainter::setCompositionMode: Painter not active QPainter::setCompositionMode: Painter not active
-
Looking at the code it seems that 8 bit does not have a QImage format associated to it hence the error you see.
You may have to modify the QPA plugin.
-
So Qt5 does not support 8bit color depth out of the box like Qtopia 4 anymore?
-
The code looks pretty similar between both code bases.
What was your configuration for Qtopia ? Where you using DirectFB ?
-
Before porting to Qt5 I was using Qtopia 4.7.5 with QWS.
-
That does not give the information I requested.
-
This was the QTopia 4.7.5 build configuration:
#!/bin/bash ./configure \ -embedded x86 \ -prefix /opt/qtopia-4.7.5_webkit \ -commercial \ -shared \ -no-largefile \ -exceptions \ -xmlpatterns \ -no-multimedia \ -no-audio-backend \ -no-phonon \ -no-phonon-backend \ -svg \ -webkit \ -javascript-jit \ -no-script \ -no-scripttools \ -no-declarative \ -no-mmx \ -no-3dnow \ -no-sse \ -no-sse2 \ -no-sse3 \ -no-ssse3 \ -no-sse4.1 \ -no-sse4.2 \ -no-avx \ -no-neon \ -qt-zlib \ -qt-gif \ -qt-libtiff \ -qt-libpng \ -qt-libmng \ -qt-libjpeg \ -qt-freetype \ -depths all \ -qt-decoration-windows \ -plugin-decoration-windows \ -no-opengl \ -qt-gfx-linuxfb \ -qt-gfx-qvfb \ -qt-kbd-tty \ -qt-kbd-qvfb \ -qt-mouse-pc \ -qt-mouse-qvfb \ -no-glib
Framebuffer was QWS LinuxFB.
-
Do you need windowing support ?
-
@SGaist said in Qt5 linuxfb platform plugin does not work with 8bit color depth:
Do you need windowing support ?
Would be nice, but I could work around this if I can get the application running with 8bit color depth.
-
Then you should check wayland and see if it runs on your target at the depth you are looking for.
By the way, I see the commercial option. If you are a commercial user, you should contact the Qt Company support.