Coverage Report

Created: 2026-07-30 07:17

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qtbase/src/gui/kernel/qstylehints.h
Line
Count
Source
1
// Copyright (C) 2016 The Qt Company Ltd.
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
5
#ifndef QSTYLEHINTS_H
6
#define QSTYLEHINTS_H
7
8
#include <QtGui/qtguiglobal.h>
9
#include <QtCore/qobject.h>
10
11
#include <chrono>
12
13
QT_BEGIN_NAMESPACE
14
15
class QPlatformIntegration;
16
class QStyleHintsPrivate;
17
class QAccessibilityHints;
18
19
class Q_GUI_EXPORT QStyleHints : public QObject
20
{
21
0
    Q_OBJECT
22
0
    Q_DECLARE_PRIVATE(QStyleHints)
23
0
    Q_PROPERTY(int cursorFlashTime READ cursorFlashTime NOTIFY cursorFlashTimeChanged FINAL)
24
0
    Q_PROPERTY(qreal fontSmoothingGamma READ fontSmoothingGamma STORED false CONSTANT FINAL)
25
0
#if QT_DEPRECATED_SINCE(6, 5)
26
0
    Q_PROPERTY(int keyboardAutoRepeatRate READ keyboardAutoRepeatRate STORED false CONSTANT FINAL)
27
0
#endif
28
0
    Q_PROPERTY(qreal keyboardAutoRepeatRateF READ keyboardAutoRepeatRateF STORED false CONSTANT FINAL)
29
0
    Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval
30
0
               NOTIFY keyboardInputIntervalChanged FINAL)
31
0
    Q_PROPERTY(int mouseDoubleClickInterval READ mouseDoubleClickInterval
32
0
               NOTIFY mouseDoubleClickIntervalChanged FINAL)
33
0
    Q_PROPERTY(int mousePressAndHoldInterval READ mousePressAndHoldInterval
34
0
               NOTIFY mousePressAndHoldIntervalChanged FINAL)
35
0
    Q_PROPERTY(QChar passwordMaskCharacter READ passwordMaskCharacter STORED false CONSTANT FINAL)
36
0
    Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay STORED false CONSTANT FINAL)
37
0
    Q_PROPERTY(bool setFocusOnTouchRelease READ setFocusOnTouchRelease STORED false CONSTANT FINAL)
38
0
    Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen STORED false CONSTANT FINAL)
39
0
    Q_PROPERTY(bool showIsMaximized READ showIsMaximized STORED false CONSTANT FINAL)
40
0
    Q_PROPERTY(bool showShortcutsInContextMenus READ showShortcutsInContextMenus
41
0
               WRITE setShowShortcutsInContextMenus NOTIFY showShortcutsInContextMenusChanged FINAL)
42
0
    Q_PROPERTY(Qt::ContextMenuTrigger contextMenuTrigger READ contextMenuTrigger WRITE
43
0
                   setContextMenuTrigger NOTIFY contextMenuTriggerChanged FINAL)
44
0
    Q_PROPERTY(int startDragDistance READ startDragDistance NOTIFY startDragDistanceChanged FINAL)
45
0
    Q_PROPERTY(int startDragTime READ startDragTime NOTIFY startDragTimeChanged FINAL)
46
0
    Q_PROPERTY(int startDragVelocity READ startDragVelocity STORED false CONSTANT FINAL)
47
0
    Q_PROPERTY(bool useRtlExtensions READ useRtlExtensions STORED false CONSTANT FINAL)
48
0
    Q_PROPERTY(Qt::TabFocusBehavior tabFocusBehavior READ tabFocusBehavior
49
0
               NOTIFY tabFocusBehaviorChanged FINAL)
50
0
    Q_PROPERTY(bool singleClickActivation READ singleClickActivation STORED false CONSTANT FINAL)
51
0
    Q_PROPERTY(bool useHoverEffects READ useHoverEffects WRITE setUseHoverEffects
52
0
               NOTIFY useHoverEffectsChanged FINAL)
53
0
    Q_PROPERTY(int wheelScrollLines READ wheelScrollLines NOTIFY wheelScrollLinesChanged FINAL)
54
0
    Q_PROPERTY(int mouseQuickSelectionThreshold READ mouseQuickSelectionThreshold
55
0
               WRITE setMouseQuickSelectionThreshold NOTIFY mouseQuickSelectionThresholdChanged
56
0
               FINAL)
57
0
    Q_PROPERTY(int mouseDoubleClickDistance READ mouseDoubleClickDistance STORED false CONSTANT
58
0
               FINAL)
59
0
    Q_PROPERTY(int touchDoubleTapDistance READ touchDoubleTapDistance STORED false CONSTANT FINAL)
60
0
    Q_PROPERTY(Qt::ColorScheme colorScheme READ colorScheme WRITE setColorScheme
61
0
               RESET unsetColorScheme NOTIFY colorSchemeChanged FINAL)
62
0
    Q_PROPERTY(bool menuSelectionWraps READ menuSelectionWraps STORED false CONSTANT FINAL REVISION(6, 10))
63
0
    Q_PROPERTY(const QAccessibilityHints* accessibility READ accessibility CONSTANT FINAL REVISION(6, 10))
64
0
    Q_PROPERTY(std::chrono::milliseconds toolTipWakeUpDelay READ toolTipWakeUpDelay
65
0
               WRITE setToolTipWakeUpDelay NOTIFY toolTipWakeUpDelayChanged FINAL REVISION(6, 12))
66
0
67
0
public:
68
0
    void setMouseDoubleClickInterval(int mouseDoubleClickInterval);
69
0
    int mouseDoubleClickInterval() const;
70
0
    int mouseDoubleClickDistance() const;
71
0
    int touchDoubleTapDistance() const;
72
0
    void setMousePressAndHoldInterval(int mousePressAndHoldInterval);
73
0
    int mousePressAndHoldInterval() const;
74
0
    void setStartDragDistance(int startDragDistance);
75
0
    int startDragDistance() const;
76
0
    void setStartDragTime(int startDragTime);
77
0
    int startDragTime() const;
78
0
    int startDragVelocity() const;
79
0
    void setKeyboardInputInterval(int keyboardInputInterval);
80
0
    int keyboardInputInterval() const;
81
0
#if QT_DEPRECATED_SINCE(6, 5)
82
0
    QT_DEPRECATED_VERSION_X_6_5("Use keyboardAutoRepeatRateF() instead")
83
0
    int keyboardAutoRepeatRate() const;
84
0
#endif
85
0
    qreal keyboardAutoRepeatRateF() const;
86
0
    void setCursorFlashTime(int cursorFlashTime);
87
0
    int cursorFlashTime() const;
88
0
    bool showIsFullScreen() const;
89
0
    bool showIsMaximized() const;
90
0
    bool showShortcutsInContextMenus() const;
91
0
    void setShowShortcutsInContextMenus(bool showShortcutsInContextMenus);
92
0
    Qt::ContextMenuTrigger contextMenuTrigger() const;
93
0
    void setContextMenuTrigger(Qt::ContextMenuTrigger contextMenuTrigger);
94
0
    bool menuSelectionWraps() const;
95
0
    int passwordMaskDelay() const;
96
0
    QChar passwordMaskCharacter() const;
97
0
    qreal fontSmoothingGamma() const;
98
0
    bool useRtlExtensions() const;
99
0
    bool setFocusOnTouchRelease() const;
100
0
    Qt::TabFocusBehavior tabFocusBehavior() const;
101
0
    void setTabFocusBehavior(Qt::TabFocusBehavior tabFocusBehavior);
102
0
    bool singleClickActivation() const;
103
0
    bool useHoverEffects() const;
104
0
    void setUseHoverEffects(bool useHoverEffects);
105
0
    int wheelScrollLines() const;
106
0
    void setWheelScrollLines(int scrollLines);
107
0
    void setMouseQuickSelectionThreshold(int threshold);
108
0
    int mouseQuickSelectionThreshold() const;
109
0
    Qt::ColorScheme colorScheme() const;
110
0
    void setColorScheme(Qt::ColorScheme scheme);
111
0
    void unsetColorScheme() { setColorScheme(Qt::ColorScheme::Unknown); }
112
    const QAccessibilityHints* accessibility() const;
113
    std::chrono::milliseconds toolTipWakeUpDelay() const;
114
    void setToolTipWakeUpDelay(std::chrono::milliseconds toolTipWakeUpDelay);
115
116
Q_SIGNALS:
117
    void cursorFlashTimeChanged(int cursorFlashTime);
118
    void keyboardInputIntervalChanged(int keyboardInputInterval);
119
    void mouseDoubleClickIntervalChanged(int mouseDoubleClickInterval);
120
    void mousePressAndHoldIntervalChanged(int mousePressAndHoldInterval);
121
    void startDragDistanceChanged(int startDragDistance);
122
    void startDragTimeChanged(int startDragTime);
123
    void tabFocusBehaviorChanged(Qt::TabFocusBehavior tabFocusBehavior);
124
    void useHoverEffectsChanged(bool useHoverEffects);
125
    void showShortcutsInContextMenusChanged(bool);
126
    void contextMenuTriggerChanged(Qt::ContextMenuTrigger contextMenuTrigger);
127
    void wheelScrollLinesChanged(int scrollLines);
128
    void mouseQuickSelectionThresholdChanged(int threshold);
129
    void colorSchemeChanged(Qt::ColorScheme colorScheme);
130
    Q_REVISION(6, 12) void toolTipWakeUpDelayChanged(std::chrono::milliseconds toolTipWakeUpDelay);
131
132
private:
133
    friend class QGuiApplication;
134
    QStyleHints();
135
};
136
137
QT_END_NAMESPACE
138
139
#endif