Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandfractionalscale.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 David Edmundson <davidedmundson@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
8
9namespace QtWaylandClient {
10
11QWaylandFractionalScale::QWaylandFractionalScale(struct ::wp_fractional_scale_v1 *object, QObject *parent)
12 : QObject(parent)
13 , QtWayland::wp_fractional_scale_v1(object)
14{}
15
16
21
23{
24 qreal preferredScale = scale / 120.0; // hardcoded denominator determined in the spec
25 if (preferredScale != mPreferredScale) {
26 mPreferredScale = preferredScale;
27 Q_EMIT preferredScaleChanged();
28 }
29}
30
31}
32
33QT_END_NAMESPACE
void wp_fractional_scale_v1_preferred_scale(uint scale) override
Combined button and popup list for selecting options.