打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
i.MX 6 | Qt Wiki | Qt Project

i.MX6 Installation

Freescale i.MX6

Building QT for i.MX6 [community.freescale.com]

Toolchains

Linaro

linaro-toolchain-binaries [launchpad.net]

OpenGL ES 2.0

apt-get install libgles2-mesa-dev

Your text to link here… [qt-project.org]

Other

Freescale Taxonomy [freescale.com]

CPUa single, dual or quad core Cortex A9, ARMv7, including NEON
OpenGLOpenGL ES 2.0

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=1920×1080).

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.

OpenGL windows and Quick2 views

As of Qt 5.2.1 eglfs supports a single, fullscreen OpenGL-based QWIndow or QQuickWindow or QGLWidget. Mixing these with QWidget content is not supported and will typically terminate the application with the message “EGLFS: OpenGL windows cannot be mixed with others.”.

Input

linuxfb and eglfs follow different paths here: eglfs has the evdev input handling code built-in, while linuxfb relies on the traditional -plugin command-line parameters.

To enable keyboard, mouse, touch or (Wacom) tablet support with linuxfb, pass -plugin evdevkeyboard, -plugin evdevmouse, -plugin evdevtouch or -plugin evdevtablet on the command-line. Each of these can take a device node parameter, e.g. -plugin evdevmouse:/dev/event1, in case the automatic device discovery (based either on libudev or a walkthrough of /dev/input/event*) is not functional.

For eglfs, these parameters, like the device node name, can be set in the environment variables QT_QPA_EVDEV_MOUSE_PARAMETERS, QT_QPA_EVDEV_KEYBOARD_PARAMETERS and QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS. Additionally, starting from 5.3.0 the built-in input handlers can be disabled by setting QT_QPA_EGLFS_DISABLE_INPUT to 1. This allows for example to use the tslib input plugin, in case the evdev one is not suitable.

Touch

Unlike earlier versions, starting from 5.2.0 the evdev touch handler is able to recognize and use the touchscreen out of the box, hence there is usually no need to fall back to tslib. Just launching the application with -platform eglfs should be enough.

On some touch screens the coordinates will need to be rotated. This can be enabled by setting QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS to rotate=180.

Mouse cursor and hotplugging

The mouse cursor will show up whenever QT_QPA_(EGLFS|FB)_HIDECURSOR is not set and Qt’s libudev-based device discovery reports that at least one mouse is available. When the libudev support is not present, the mouse cursor will always show up unless explicitly disabled via the environment variable.

Hotplugging is supported, but only if Qt was configured with libudev support (it is picked up automatically during configure if the development headers are present). This allows connecting or disconnecting an input device while the application is running, however the mouse cursor does not yet support this so, for instance, disconnecting the mouse while the application is running will leave the mouse cursor visible. This is planned to be addressed in the near future.

Terminal input

Starting from Qt 5.3.0 the Embedded Linux platforms (eglfs, linuxfb, kms) are disabling the terminal keyboard on application startup. This prevents the fairly annoying behavior of letting keystrokes go to the terminal underneath the application. If the old behavior needs to be restored for some reason, set the environment variable QT_QPA_ENABLE_TERMINAL_KEYBOARD to 1.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Qt for Embedded Linux | Qt 5.4
Qt和嵌入式Linux
T507核心板常见问题解析
树莓派2和树莓派3交叉编译Qt 5.5/5.6,含我的操作注解
qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in ““ This application failed to sta
全志 Tina Linux 图形系统 框架介绍 最全介绍 MiniGUI、QT5、EFL、GTK+(WebkitGtk、Midori)、DirectFB、Wayland
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服