• 9660阅读
  • 14回复

[提问]qt5 多屏显示 [复制链接]

上一主题 下一主题
离线yuxue
 

只看楼主 倒序阅读 楼主  发表于: 2016-06-03
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

只看该作者 1楼 发表于: 2019-08-05
楼主有找到办法吗,我从qt4换到qt5也无法实现嵌入式多屏了
离线大漠之鹰

只看该作者 2楼 发表于: 2020-05-14
回 yuyu414 的帖子
yuyu414:楼主有找到办法吗,我从qt4换到qt5也无法实现嵌入式多屏了 (2019-08-05 10:17) 

有办法了吗?我现在也面临同样的问题,目前有一种思路有待验证,需要重写eglfs后端
本是后山人,偶作前堂客,醉舞经阁半卷书,坐井说天阔。大志戏功名,海斗量福祸,论到囊中羞涩时,怒指乾坤错
QQ:874164244
离线笑颜

只看该作者 3楼 发表于: 2020-05-14
可以重新实现一个qt的后端。操作多个fb的也是可行的,我之前实现过。
离线yuyu414

只看该作者 4楼 发表于: 2020-05-14
回 笑颜 的帖子
笑颜:可以重新实现一个qt的后端。操作多个fb的也是可行的,我之前实现过。
 (2020-05-14 17:36) 

多进程?
离线yuyu414

只看该作者 5楼 发表于: 2020-05-14
回 大漠之鹰 的帖子
大漠之鹰:有办法了吗?我现在也面临同样的问题,目前有一种思路有待验证,需要重写eglfs后端 (2020-05-14 17:21) 

莫得办法,用qt4了
离线笑颜

只看该作者 6楼 发表于: 2020-05-14
回 yuyu414 的帖子
yuyu414:多进程? (2020-05-14 18:00)

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

只看该作者 7楼 发表于: 2020-05-15
回 笑颜 的帖子
笑颜:当然是单进程了,一个进程打开多个fb,生成多个QScreen,你就可以显示到多个屏幕上了。改动应该不会太大,基于linuxfb直接改就行了
 (2020-05-14 18:27) 

有没有参考示例,我要改eglfs
本是后山人,偶作前堂客,醉舞经阁半卷书,坐井说天阔。大志戏功名,海斗量福祸,论到囊中羞涩时,怒指乾坤错
QQ:874164244
离线笑颜

只看该作者 8楼 发表于: 2020-05-15
真要参考,你可以参考windows的后端,怎么生成多个屏幕的。最终肯定会调用QWindowSystemInterface::handleScreenAdded 来添加多个屏幕的搜关键字,应该能找到
离线大漠之鹰

只看该作者 9楼 发表于: 2020-05-15
回 笑颜 的帖子
笑颜:真要参考,你可以参考windows的后端,怎么生成多个屏幕的。最终肯定会调用QWindowSystemInterface::handleScreenAdded 来添加多个屏幕的搜关键字,应该能找到 (2020-05-15 13:03) 

你现在还在战信吗?要不要来我们这边?
本是后山人,偶作前堂客,醉舞经阁半卷书,坐井说天阔。大志戏功名,海斗量福祸,论到囊中羞涩时,怒指乾坤错
QQ:874164244
离线笑颜

只看该作者 10楼 发表于: 2020-05-15
回 大漠之鹰 的帖子
大漠之鹰:你现在还在战信吗?要不要来我们这边? (2020-05-15 14:44) 

啥战信?
离线笑颜

只看该作者 11楼 发表于: 2020-05-15
回 大漠之鹰 的帖子
大漠之鹰:你现在还在战信吗?要不要来我们这边? (2020-05-15 14:44) 

你们是做什么的啊?
离线大漠之鹰

只看该作者 12楼 发表于: 2020-05-15
回 笑颜 的帖子
笑颜:啥战信? (2020-05-15 15:57) 

你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的
本是后山人,偶作前堂客,醉舞经阁半卷书,坐井说天阔。大志戏功名,海斗量福祸,论到囊中羞涩时,怒指乾坤错
QQ:874164244
离线笑颜

只看该作者 13楼 发表于: 2020-05-15
回 大漠之鹰 的帖子
大漠之鹰:你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的 (2020-05-15 16:02) 

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

只看该作者 14楼 发表于: 2020-05-15
回 大漠之鹰 的帖子
大漠之鹰:你以前不是做vxworks qt移植的吗?难道我记错了吗?
我们是做国产化的 (2020-05-15 16:02) 

或者,加我QQ了解下:624080979
快速回复
限100 字节
 
上一个 下一个