debug_console: Support KWin::Window* property type

Display the window caption and class name (safe for the icon) like is done
with the windows themselves.

Eases debugging properties, such as "transientFor".
This commit is contained in:
Kai Uwe Broulik 2023-08-31 21:16:26 +02:00
parent 64cc884029
commit dadd7bb545

View file

@ -780,6 +780,13 @@ QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &
return QStringLiteral("nullptr");
}
}
if (value.userType() == qMetaTypeId<KWin::Window *>()) {
if (auto w = value.value<KWin::Window *>()) {
return w->caption() + QLatin1Char(' ') + QString::fromUtf8(w->metaObject()->className());
} else {
return QStringLiteral("nullptr");
}
}
if (value.userType() == qMetaTypeId<Qt::MouseButtons>()) {
const auto buttons = value.value<Qt::MouseButtons>();
if (buttons == Qt::NoButton) {