查看完整版本: [-- qt5 多屏显示 --]

QTCN开发网 -> Qt嵌入式开发 -> qt5 多屏显示 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

yuxue 2016-06-03 22:54

qt5 多屏显示

qt5 取消 qws 之后 如何实现 双屏显示呢 qt4 配置
export QWS_DISPLAY="Multi: LinuxFB:fb=/dev/fb0 LinuxFb:fb=/dev/fb2"
就可以了
我移植好了qt5 EGLFS 显示 只能 fb0 显示 无法fb1 显示


有没有接触过的 优酷上有个 搞成功了不知道怎么弄的
http://v.youku.com/v_show/id_XMTMwMTk2NTM2NA==.html


在网站上也看到这个


i.MX6 support in Qt 5.2 and up

Make sure to configure with -device imx6 (which is the same as -device linux-imx6-g+). Without this the build may still succeed but eglfs will not be functional due to not having the Vivante-specific hooks compiled in from qtbase/mkspecs/devices/linux-imx6-g+.
Both linuxfb and eglfs should work. Note however that in 5.2.0 linuxfb is broken. This is corrected in 5.2.1.


Multiple screens

When having multiple displays connected (e.g. the touch LCD panel and HDMI), there are two framebuffer devices: /dev/fb0 and /dev/fb2. Note that fb1 and fb3 are overlays for fb0 and fb2 and are not useful for our purposes here.
Both eglfs and linuxfb uses /dev/fb0 by default. To change this, linuxfb can be configued with the 'fb' parameter: just launch the application with "-platform linuxfb:fb=/dev/fb2".
eglfs has no way to configure this before 5.3.0 so apps using eglfs will always show up on the display belonging to fb0. In 5.3.0 a new environment variable is introduced: QT_QPA_EGLFS_FB. Setting this to /dev/fb2 before launching the app will make the EGL/GLES content show up on the second display. Update: It might be possible to launch eglfs apps on the other display with 5.2 too, by setting FB_FRAMEBUFFER_0 to /dev/fb2.
There is currently no way to display content on multiple displays from the same application. The workaround is to launch two separate applications and use some sort of IPC mechanism to communicate between them.


Screen configuration

Both linuxfb and eglfs will try to query the display dimensions (both physical and pixels) from the framebuffer device. This may not always lead to good looking results. For eglfs the screen size can be set explicitly by setting QT_QPA_EGLFS_WIDTH and QT_QPA_EGLFS_HEIGHT to the desired width/height (in pixels) before launching the application. linuxfb has a size=…x… plugin parameter (for example -platform linuxfb:fb=/dev/fb2:size=1920x1080).


Multiple top-level widgets (QWidget)

linuxfb, which supports sw-rendered widget apps only, has full support for multiple top-level widgets. It is nonetheless advisable to have one widget that covers the entire screen (e.g. showFullScreen()) since the unpainted areas of the screen are not cleared.
Starting with Qt 5.2.0 eglfs also has a certain level of support for multiple top-level widgets. Opening new top-levels, e.g. a menu or a combobox dropdown, will not lead to creating a new native window and EGL surface. Instead, all widget windows are uploaded into textures and composited into a single fullscreen window that is backed by a native window and EGL surface. Before 5.2 having multiple top-levels displayed correctly was not possible at all.
eglfs forces the first top-level to become fullscreen. This is because something has to cover the entire surface, we cannot have "empty" areas. This window is also chosen to be the "root" widget window, into which all other top-level widgets are composited. This works well for applications that have a single main window that exists for the entire lifetime of the application, and all other widgets are either non-top-levels or are created later on. It presents a potential issue for other type of applications, though, and can lead to unexpected results.


yuyu414 2019-08-05 10:17
楼主有找到办法吗,我从qt4换到qt5也无法实现嵌入式多屏了

大漠之鹰 2020-05-14 17:21
yuyu414:楼主有找到办法吗,我从qt4换到qt5也无法实现嵌入式多屏了 (2019-08-05 10:17) 

有办法了吗?我现在也面临同样的问题,目前有一种思路有待验证,需要重写eglfs后端

笑颜 2020-05-14 17:36
可以重新实现一个qt的后端。操作多个fb的也是可行的,我之前实现过。

yuyu414 2020-05-14 18:00
笑颜:可以重新实现一个qt的后端。操作多个fb的也是可行的,我之前实现过。
 (2020-05-14 17:36) 

多进程?

yuyu414 2020-05-14 18:00
大漠之鹰:有办法了吗?我现在也面临同样的问题,目前有一种思路有待验证,需要重写eglfs后端 (2020-05-14 17:21) 

莫得办法,用qt4了

笑颜 2020-05-14 18:27
yuyu414:多进程? (2020-05-14 18:00)

当然是单进程了,一个进程打开多个fb,生成多个QScreen,你就可以显示到多个屏幕上了。改动应该不会太大,基于linuxfb直接改就行了

大漠之鹰 2020-05-15 09:22
笑颜:当然是单进程了,一个进程打开多个fb,生成多个QScreen,你就可以显示到多个屏幕上了。改动应该不会太大,基于linuxfb直接改就行了
 (2020-05-14 18:27) 

有没有参考示例,我要改eglfs

笑颜 2020-05-15 13:03
真要参考,你可以参考windows的后端,怎么生成多个屏幕的。最终肯定会调用QWindowSystemInterface::handleScreenAdded 来添加多个屏幕的搜关键字,应该能找到

大漠之鹰 2020-05-15 14:44
笑颜:真要参考,你可以参考windows的后端,怎么生成多个屏幕的。最终肯定会调用QWindowSystemInterface::handleScreenAdded 来添加多个屏幕的搜关键字,应该能找到 (2020-05-15 13:03) 

你现在还在战信吗?要不要来我们这边?

笑颜 2020-05-15 15:57
大漠之鹰:你现在还在战信吗?要不要来我们这边? (2020-05-15 14:44) 

啥战信?

笑颜 2020-05-15 15:59
大漠之鹰:你现在还在战信吗?要不要来我们这边? (2020-05-15 14:44) 

你们是做什么的啊?

大漠之鹰 2020-05-15 16:02
笑颜:啥战信? (2020-05-15 15:57) 

你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的

笑颜 2020-05-15 16:06
大漠之鹰:你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的 (2020-05-15 16:02) 

是的,基于Qt5写了个窗口管理器,支持多屏幕,所以知道点这些东西,但是不是VX而是SylixOS

笑颜 2020-05-15 16:07
大漠之鹰:你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的 (2020-05-15 16:02) 

或者,加我QQ了解下:624080979


查看完整版本: [-- qt5 多屏显示 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled