Qt5.11: reconfigure framebuffer
-
Hello!
I port application from Qt-4.7.3 to Qt-5.11.0, application work on board with ARM CPU and support several resolutions of user interface, e.g. 1920x1080 and 720x576.
For correct output user interface I must configure framebuffer, with Qt-4.7.3 I useQScreen::setMode(width, height, bpp)
, unfortunately I can't found same function in Qt-5.11.0.
Qt5 have API for reconfigure framebuffer or I should use ioctl or fbset?
How should I inform Qt about framebuffer config after I change it via ioctl?
Thank you and excuse my bad English. -
Are you using EGLFS or any server graphic as X11 or Wayland?
Is your project being ported to QtQuick or Widgets?
Look at this link has several information about resolutions Qt For Embedded Linux
Cleiton Bueno
-
Hello @Cleiton-Bueno and thank you for your answer!
At this moment we use linuxfb because this application work on several SoC which haven't GPU.
I read this page and linked pages but not found answer. -
Hello @Cleiton-Bueno and thank you for your answer!
At this moment we use linuxfb because this application work on several SoC which haven't GPU.
I read this page and linked pages but not found answer.@debian Ok, I understand. Passing via cmdline does not work?
./your_app -platform linuxfb:fb=/dev/fb0:size=720x576
-
@debian Ok, I understand. Passing via cmdline does not work?
./your_app -platform linuxfb:fb=/dev/fb0:size=720x576
@Cleiton-Bueno I can use
fbset
for configure framebuffer but this is not very good choice because:- need parse config before runnong app
- have additional util in rootfs, rootfs size is very important for embedded
- can't change UI resolution without restart app
-
@Cleiton-Bueno I can use
fbset
for configure framebuffer but this is not very good choice because:- need parse config before runnong app
- have additional util in rootfs, rootfs size is very important for embedded
- can't change UI resolution without restart app
@debian But the line I passed you is not using fbset, it's own QPA linuxFB statement.
Have you entered the link I passed in the LinuxFB part?
https://doc.qt.io/qt-5/embedded-linux.html#linuxfbIf you are using the same hardware as Qt4.8 to use Qt5.11, optimize it a lot and remove the unnecessary, because if you include a fbset it is worrying about the space that this upgrade is worrisome.
Cleiton Bueno
-
To try to help, Qt4 to Qt5
QScreen()
has undergone some changes and some attributes ofQScreen()
you access throughQGuiApplication()
.
https://www.ics.com/blog/whats-new-qt-5-qscreen-classAccessing some
QScreen()
properties throughQGUiApplication()
.QGuiApplication app(argc, argv); foreach(QScreen *screen, app.screens()) { qDebug().noquote() << "Name : " << screen->name(); qDebug().noquote() << "DevicePixelRatio : " << screen->devicePixelRatio(); qDebug().noquote() << "Width : " << screen->geometry().width(); qDebug().noquote() << "Height : " << screen->geometry().height(); qDebug().noquote() << "Size : " << screen->geometry().size(); }
Maybe altering geometry will help you with what you want?
screen->geometry().setWidth(800); screen->geometry().setHeight(600);
See the new
QScreen()
methods and which one can help you, such asgrabWindow()
.Now I want fb underneath I see no other way without being fbset and restarting application.
Good luck.