| Summary: | kguiaddons fails to build with qt6/kde6 | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kguiaddons | Reporter: | kdebug |
| Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | borgman.jeremy, mrp, randomland |
| Priority: | NOR | ||
| Version First Reported In: | 6.17.0 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
kdebug
2023-03-20 22:56:37 UTC
I am hitting the same error on Pop 22.04 with Qt compiled via kdesrc-build. How did you solve that? I could not resolve this issue. I did try to talk to a KDE contributor, however, their only recommendation was to use kde/qt 5 and ignore kde/qt 6. Hence, I'm not interested in pursuing kde contributions or this issue any further. I ran into this also with Qt 6.6 compiled with kdesrc-build on Debian unstable. To fix it I needed to add `-DQT_FEATURE_xcb=ON` to `cmake-options` and rebuild qt6-set (I'm not sure if rebuilding only qtbase would have been enough, so I built it all). I added it in `~/kde/src/kdesrc-build/qt6-build-include` but I think you could use `kdesrc-build qt6-set --cmake-options="-DQT_FEATURE_xcb=ON"` like it says on https://community.kde.org/Get_Involved/development/More#Build_Qt6_using_kdesrc-build, near the end of the section. I tried to find where QX11Application was defined, and I found https://invent.kde.org/qt/qt/qtbase/-/blob/6.6/src/gui/kernel/qguiapplication_platform.h?ref_type=heads#L41 in a `#if QT_CONFIG(xcb) || defined(Q_QDOC)` block. I'm not familiar with the Qt codebase and all the macros, but that's what made me try setting `-DQT_FEATURE_xcb=ON`, and kguiaddons compiled fine after rebuilding Qt. Flameshot uses KSystemClipboard provided by KGuiAddons. After porting to Qt6 our clipboard functionality stopped working on gnome + wayland. This error is reported:
```
kf.guiaddons: Could not init WaylandClipboard, falling back to QtClipboard.
```
I then wrote a very minimal working example to demonstrate this bug. If this code is executed on Gnome + Wayland the same error is printed to the terminal. Unfortunately falling back to QtClipboard does not work on gnome + wayland. Is this user error on my part with how we are using the clipboard or is there an underlying issues?
```
#include <QApplication>
#include <KSystemClipboard>
#include <QDebug>
#include <QGuiApplication>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
auto clipboard = KSystemClipboard::instance();
if (!clipboard) {
qDebug() << "Failed to get KSystemClipboard instance";
return 1;
}
qDebug() << "KSystemClipboard initialized successfully";
return 0;
}
```
I'm sorry I meant to post my comment as a new bug not a comment here and I cant figure out how to delete it. Apologies. |