跑步:
./myapp -platform wayland
给出:
此应用程序无法启动,因为它无法在“”中找到或加载 Qt 平台插件“wayland”。
可用的平台插件有:eglfs、linuxfb、minimal、minimalegl、offscreen、vnc、xcb。
重新安装应用程序可能会解决此问题。中止(核心转储)
按照说明:如何构建 qtwayland?
运行 qmake 给出:
运行配置测试...完成运行配置测试。
配置总结:Qt Wayland Client ...................... 否
Qt Wayland 合成器 .................... 没有
注意:未检测到 wayland-egl 支持。禁用跨工具包兼容性。
qtwayland README 指出 2 个依赖项:
- xkbcommon 0.2.0 - http://xkbcommon.org/
- Wayland 1.6.0 - http://wayland.freedesktop.org/
在 fedora 28 上,默认安装 libxkbcommon。另外我还安装了 libxkbcommon-devel
dnf whatprovides *wayland*
尽管我的 gnome 会话在 wayland 下运行,但没有返回任何结果。
我知道我可以从https://wayland.freedesktop.org/releases.html下载 Wayland 。我下载并解压缩了 1.15,但不确定如何处理解压缩的源:我要构建它吗?我需要把它放在qtwayland可以找到的地方吗?
我看到fedora 28中默认存在以下文件:
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
但是将其复制到 ~/Qt/5.10.1/gcc_64/plugins/platforms 并不能解决我的应用程序启动错误。
问题:如何让我的 Qt 应用程序在 Wayland 下运行?
为回答以下 bobbaluba 问题而添加:
我正在尝试针对官方 Qt 二进制文件构建 QtWayland,因为它不包括在内。
按照建议安装了 wayland-devel,但根据上面的消息,qmake 仍然报告没有配置 Qt Wayland Client。
尝试使用dnf安装qt5-qtwayland,报:包qt5-qtwayland-5.10.1-2.fc28.x86_64已经安装,跳过。
以下可能是相关的:
? sudo dnf whatprovides libwayland-egl.so
上次元数据过期检查:0:18:44 前,2018 年 5 月 9 日星期三 09:15:20 PM +08。
qt5-qtwayland-5.10.1-2.fc28.i686 :Qt5 - Wayland 平台支持和 QtCompositor 模块
回购:fedora
匹配自:
提供:libwayland-egl.so
? 查找 / -name libwayland-egl.so* -print
/usr/lib64/libwayland-egl.so
/usr/lib64/qt5/plugins/wayland-graphics-integration-server/libwayland-egl.so
? sudo ldconfig -p | grep wayland-egl
libwayland-egl.so.1 (libc6,x86-64) => /lib64/libwayland-egl.so.1
libwayland-egl.so (libc6,x86-64) => /lib64/libwayland-egl.so
安装了 Qt 5.11.0rc 导致
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so
~/Qt/5.11.0/gcc_64/plugins/wayland-graphics-integration-server/libwayland-egl.so.debug
被添加到 ~/Qt/5.11.0/gcc_64/plugins/platforms。
当我安装 Qt5.11rc 时,cmake 的 CMakeFile.txt 突然停止工作 - gcc 无法找到像 QDate 这样的 Qt 头文件。
尝试使用 Qt5.11 编译示例项目“地址簿”并得到:
QSocketNotifier:只能用于以 QThread 启动的线程
使用 Wayland-EGL
使用“xdg-shell-v6”外壳集成
简而言之,使用 Qt5.11rc 似乎可以解决问题。