Open GuShaocheng opened 6 months ago
wayland?
One other point: "goldendict-ng" refuses to run for the "root" user. To make this work, I need to do some tricks. It would be nice if the restriction could be removed.
gd-ng should has no restriction on root user.
I had the error that is discussed in this thread: Error: 'QX11Application' is not a member of 'QNativeInterface'
Hi and sorry for the OT, but I'm dealing with the same issue in another product: https://github.com/martinrotter/rssguard/discussions/1338 I tried installing the mentioned package, but I am unable to find it. Could you maybe help me out? Thank you!
tldr: it appears that Qt now days can be built without xcb/xlib support.
Ubuntu 22.04 cmake 3.29.1 qt6 6.5.4
No idea how is this version of Qt is installed, but it is not the one from ubuntu's repo.
I also have no idea about how Qt automatically detecting things.
However, adding -DQT_FEATURE_XCB=ON
when building Qt should resolve the problem.
@OldCoder's discovery is right, installing certain libraries will enable xcb feature automatically.
@Bro-Account is a similar but different issue. QWaylandApplication
comes from wayland
feature, -DQT_FEATURE_wayland=ON
is needed when building Qt.
Related code:
QX11Application
needs xcb feature enabled and QWaylandApplication
need wayland feature enabled. https://github.com/qt/qtbase/blob/02cb165ef8050230b477358e4136e9f0acd83eb6/src/gui/kernel/qguiapplication_platform.h#L56-L67
Qt's CMake code that enables those features.
We need a compile time flag to disable all things that depend on X/X11/xcb based on /usr/include/qt6/QtGui/qtgui-config.h -> QT_FEATURE_xcb
Describe the bug I can't complete
cmake build
. Errors were pointed toQNativeInterface::QX11Application * x11AppInfo = qApp->nativeInterface< QNativeInterface::QX11Application >();
For example,
/goldendict-ng-24.01.22-LoongYear.3dddb3be/goldendict-ng-24.01.22-LoongYear.3dddb3be/src/hotkeywrapper.cc: In member function ‘quint32 HotkeyWrapper::nativeKey(int)’: /goldendict-ng-24.01.22-LoongYear.3dddb3be/goldendict-ng-24.01.22-LoongYear.3dddb3be/src/hotkeywrapper.cc:815:21: error: ‘QX11Application’ is not a member of ‘QNativeInterface’; did you mean ‘QWaylandApplication’? 815 | QNativeInterface::QX11Application * x11AppInfo = qApp->nativeInterface< QNativeInterface::QX11Application >(); | ^~~~~~~~~~~~~~~ | QWaylandApplication /goldendict-ng-24.01.22-LoongYear.3dddb3be/goldendict-ng-24.01.22-LoongYear.3dddb3be/src/hotkeywrapper.cc:815:39: error: ‘x11AppInfo’ was not declared in this scope 815 | QNativeInterface::QX11Application * x11AppInfo = qApp->nativeInterface< QNativeInterface::QX11Application >(); | ^~~~~~~~~~ /goldendict-ng-24.01.22-LoongYear.3dddb3be/goldendict-ng-24.01.22-LoongYear.3dddb3be/src/hotkeywrapper.cc:815:93: error: ‘QX11Application’ is not a member of ‘QNativeInterface’; did you mean ‘QWaylandApplication’? 815 | ion * x11AppInfo = qApp->nativeInterface< QNativeInterface::QX11Application >(); | ^~~~~~~~~~~~~~~ | QWaylandApplication /goldendict-ng-24.01.22-LoongYear.3dddb3be/goldendict-ng-24.01.22-LoongYear.3dddb3be/src/hotkeywrapper.cc:815:110: error: no matching function for call to ‘QApplication::nativeInterface<<expression error> >()’ 815 | AppInfo = qApp->nativeInterface< QNativeInterface::QX11Application >(); | ^
To Reproduce Steps to reproduce the behavior:
QX11Application
as mentioned before.OS and software versions Ubuntu 22.04 cmake 3.29.1 qt6 6.5.4