KUserFeedback

screeninfosource.cpp
1/*
2 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#include "screeninfosource.h"
8
9#include <QGuiApplication>
10#include <QScreen>
11#include <QVariant>
12
13using namespace KUserFeedback;
14
16 AbstractDataSource(QStringLiteral("screens"), Provider::DetailedSystemInformation)
17{
18}
19
21{
22 return tr("Size and resolution of all connected screens.");
23}
24
26{
27 QVariantList l;
28 foreach (auto screen, QGuiApplication::screens()) {
29 QVariantMap m;
30 m.insert(QStringLiteral("width"), screen->size().width());
31 m.insert(QStringLiteral("height"), screen->size().height());
32 m.insert(QStringLiteral("dpi"), qRound(screen->physicalDotsPerInch()));
33 m.insert(QStringLiteral("devicePixelRatio"), screen->devicePixelRatio());
34 l.push_back(m);
35 }
36 return l;
37}
38
40{
41 return tr("Screen parameters");
42}
Base class for data sources for telemetry data.
The central object managing data sources and transmitting feedback to the server.
Definition provider.h:32
QString description() const override
Returns a human-readable, translated description of what this source provides.
QString name() const override
Returns a short name of this data source.
ScreenInfoSource()
Create a new screen information source.
QVariant data() override
Returns the data gathered by this source.
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
QList< QScreen * > screens()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:56 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.