KUserFeedback

styleinfosource.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#include "styleinfosource.h"
8
9#include <QApplication>
10#include <QPalette>
11#include <QStyle>
12#include <QVariant>
13
14using namespace KUserFeedback;
15
16StyleInfoSource::StyleInfoSource()
17 : AbstractDataSource(QStringLiteral("style"))
18{
19}
20
22{
23 return tr("The widget style used by the application, and information about the used color scheme.");
24}
25
27{
28 QVariantMap m;
29 if (qApp && qApp->style())
30 m.insert(QStringLiteral("style"), qApp->style()->objectName()); // QStyleFactory sets the object name to the style name
31 m.insert(QStringLiteral("dark"), qApp->palette().color(QPalette::Window).lightness() < 128);
32 return m;
33}
34
36{
37 return tr("Application style");
38}
Base class for data sources for telemetry data.
QString name() const override
Returns a short name of this data source.
QVariant data() override
Returns the data gathered by this source.
QString description() const override
Returns a human-readable, translated description of what this source provides.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.