Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qstylehints.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | static inline QVariant hint(QPlatformIntegration::StyleHint h) | - | ||||||||||||
5 | { | - | ||||||||||||
6 | return never executed: QGuiApplicationPrivate::platformIntegration()->styleHint(h);return QGuiApplicationPrivate::platformIntegration()->styleHint(h); never executed: return QGuiApplicationPrivate::platformIntegration()->styleHint(h); | 0 | ||||||||||||
7 | } | - | ||||||||||||
8 | - | |||||||||||||
9 | static inline QVariant themeableHint(QPlatformTheme::ThemeHint th, | - | ||||||||||||
10 | QPlatformIntegration::StyleHint ih) | - | ||||||||||||
11 | { | - | ||||||||||||
12 | if (!QCoreApplication::instance()
| 0 | ||||||||||||
13 | QMessageLogger(__FILE__, 51, __PRETTY_FUNCTION__).warning() << "Must construct a QGuiApplication before accessing a platform theme hint."; | - | ||||||||||||
14 | return never executed: QVariant();return QVariant(); never executed: return QVariant(); | 0 | ||||||||||||
15 | } | - | ||||||||||||
16 | if (const
| 0 | ||||||||||||
17 | const QVariant themeHint = theme->themeHint(th); | - | ||||||||||||
18 | if (themeHint.isValid()
| 0 | ||||||||||||
19 | return never executed: themeHint;return themeHint; never executed: return themeHint; | 0 | ||||||||||||
20 | } never executed: end of block | 0 | ||||||||||||
21 | return never executed: QGuiApplicationPrivate::platformIntegration()->styleHint(ih);return QGuiApplicationPrivate::platformIntegration()->styleHint(ih); never executed: return QGuiApplicationPrivate::platformIntegration()->styleHint(ih); | 0 | ||||||||||||
22 | } | - | ||||||||||||
23 | - | |||||||||||||
24 | class QStyleHintsPrivate : public QObjectPrivate | - | ||||||||||||
25 | { | - | ||||||||||||
26 | inline QStyleHints* q_func() { return static_cast<QStyleHints *>(q_ptr); } inline const QStyleHints* q_func() const { return static_cast<const QStyleHints *>(q_ptr); } friend class QStyleHints; | - | ||||||||||||
27 | public: | - | ||||||||||||
28 | inline QStyleHintsPrivate() | - | ||||||||||||
29 | : m_mouseDoubleClickInterval(-1) | - | ||||||||||||
30 | , m_startDragDistance(-1) | - | ||||||||||||
31 | , m_startDragTime(-1) | - | ||||||||||||
32 | , m_keyboardInputInterval(-1) | - | ||||||||||||
33 | , m_cursorFlashTime(-1) | - | ||||||||||||
34 | {} never executed: end of block | 0 | ||||||||||||
35 | - | |||||||||||||
36 | int m_mouseDoubleClickInterval; | - | ||||||||||||
37 | int m_startDragDistance; | - | ||||||||||||
38 | int m_startDragTime; | - | ||||||||||||
39 | int m_keyboardInputInterval; | - | ||||||||||||
40 | int m_cursorFlashTime; | - | ||||||||||||
41 | }; | - | ||||||||||||
42 | QStyleHints::QStyleHints() | - | ||||||||||||
43 | : QObject(*new QStyleHintsPrivate(), 0) | - | ||||||||||||
44 | { | - | ||||||||||||
45 | } never executed: end of block | 0 | ||||||||||||
46 | - | |||||||||||||
47 | - | |||||||||||||
48 | - | |||||||||||||
49 | - | |||||||||||||
50 | - | |||||||||||||
51 | - | |||||||||||||
52 | - | |||||||||||||
53 | void QStyleHints::setMouseDoubleClickInterval(int mouseDoubleClickInterval) | - | ||||||||||||
54 | { | - | ||||||||||||
55 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
56 | if (d->m_mouseDoubleClickInterval == mouseDoubleClickInterval
| 0 | ||||||||||||
57 | return; never executed: return; | 0 | ||||||||||||
58 | d->m_mouseDoubleClickInterval = mouseDoubleClickInterval; | - | ||||||||||||
59 | mouseDoubleClickIntervalChanged(mouseDoubleClickInterval); | - | ||||||||||||
60 | } never executed: end of block | 0 | ||||||||||||
61 | - | |||||||||||||
62 | - | |||||||||||||
63 | - | |||||||||||||
64 | - | |||||||||||||
65 | - | |||||||||||||
66 | - | |||||||||||||
67 | int QStyleHints::mouseDoubleClickInterval() const | - | ||||||||||||
68 | { | - | ||||||||||||
69 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
70 | return never executed: d->m_mouseDoubleClickInterval >= 0return d->m_mouseDoubleClickInterval >= 0 ? d->m_mouseDoubleClickInterval : themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt();
never executed: return d->m_mouseDoubleClickInterval >= 0 ? d->m_mouseDoubleClickInterval : themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt(); | 0 | ||||||||||||
71 | d->m_mouseDoubleClickInterval : never executed: return d->m_mouseDoubleClickInterval >= 0 ? d->m_mouseDoubleClickInterval : themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt(); | 0 | ||||||||||||
72 | themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt(); never executed: return d->m_mouseDoubleClickInterval >= 0 ? d->m_mouseDoubleClickInterval : themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt(); | 0 | ||||||||||||
73 | } | - | ||||||||||||
74 | int QStyleHints::mousePressAndHoldInterval() const | - | ||||||||||||
75 | { | - | ||||||||||||
76 | return never executed: themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt();return themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); never executed: return themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); | 0 | ||||||||||||
77 | } | - | ||||||||||||
78 | - | |||||||||||||
79 | - | |||||||||||||
80 | - | |||||||||||||
81 | - | |||||||||||||
82 | - | |||||||||||||
83 | - | |||||||||||||
84 | - | |||||||||||||
85 | void QStyleHints::setStartDragDistance(int startDragDistance) | - | ||||||||||||
86 | { | - | ||||||||||||
87 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
88 | if (d->m_startDragDistance == startDragDistance
| 0 | ||||||||||||
89 | return; never executed: return; | 0 | ||||||||||||
90 | d->m_startDragDistance = startDragDistance; | - | ||||||||||||
91 | startDragDistanceChanged(startDragDistance); | - | ||||||||||||
92 | } never executed: end of block | 0 | ||||||||||||
93 | int QStyleHints::startDragDistance() const | - | ||||||||||||
94 | { | - | ||||||||||||
95 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
96 | return never executed: d->m_startDragDistance >= 0return d->m_startDragDistance >= 0 ? d->m_startDragDistance : themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt();
never executed: return d->m_startDragDistance >= 0 ? d->m_startDragDistance : themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt(); | 0 | ||||||||||||
97 | d->m_startDragDistance : never executed: return d->m_startDragDistance >= 0 ? d->m_startDragDistance : themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt(); | 0 | ||||||||||||
98 | themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt(); never executed: return d->m_startDragDistance >= 0 ? d->m_startDragDistance : themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt(); | 0 | ||||||||||||
99 | } | - | ||||||||||||
100 | - | |||||||||||||
101 | - | |||||||||||||
102 | - | |||||||||||||
103 | - | |||||||||||||
104 | - | |||||||||||||
105 | - | |||||||||||||
106 | - | |||||||||||||
107 | void QStyleHints::setStartDragTime(int startDragTime) | - | ||||||||||||
108 | { | - | ||||||||||||
109 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
110 | if (d->m_startDragTime == startDragTime
| 0 | ||||||||||||
111 | return; never executed: return; | 0 | ||||||||||||
112 | d->m_startDragTime = startDragTime; | - | ||||||||||||
113 | startDragTimeChanged(startDragTime); | - | ||||||||||||
114 | } never executed: end of block | 0 | ||||||||||||
115 | int QStyleHints::startDragTime() const | - | ||||||||||||
116 | { | - | ||||||||||||
117 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
118 | return never executed: d->m_startDragTime >= 0return d->m_startDragTime >= 0 ? d->m_startDragTime : themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt();
never executed: return d->m_startDragTime >= 0 ? d->m_startDragTime : themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt(); | 0 | ||||||||||||
119 | d->m_startDragTime : never executed: return d->m_startDragTime >= 0 ? d->m_startDragTime : themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt(); | 0 | ||||||||||||
120 | themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt(); never executed: return d->m_startDragTime >= 0 ? d->m_startDragTime : themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt(); | 0 | ||||||||||||
121 | } | - | ||||||||||||
122 | int QStyleHints::startDragVelocity() const | - | ||||||||||||
123 | { | - | ||||||||||||
124 | return never executed: themeableHint(QPlatformTheme::StartDragVelocity, QPlatformIntegration::StartDragVelocity).toInt();return themeableHint(QPlatformTheme::StartDragVelocity, QPlatformIntegration::StartDragVelocity).toInt(); never executed: return themeableHint(QPlatformTheme::StartDragVelocity, QPlatformIntegration::StartDragVelocity).toInt(); | 0 | ||||||||||||
125 | } | - | ||||||||||||
126 | - | |||||||||||||
127 | - | |||||||||||||
128 | - | |||||||||||||
129 | - | |||||||||||||
130 | - | |||||||||||||
131 | - | |||||||||||||
132 | - | |||||||||||||
133 | void QStyleHints::setKeyboardInputInterval(int keyboardInputInterval) | - | ||||||||||||
134 | { | - | ||||||||||||
135 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
136 | if (d->m_keyboardInputInterval == keyboardInputInterval
| 0 | ||||||||||||
137 | return; never executed: return; | 0 | ||||||||||||
138 | d->m_keyboardInputInterval = keyboardInputInterval; | - | ||||||||||||
139 | keyboardInputIntervalChanged(keyboardInputInterval); | - | ||||||||||||
140 | } never executed: end of block | 0 | ||||||||||||
141 | - | |||||||||||||
142 | - | |||||||||||||
143 | - | |||||||||||||
144 | - | |||||||||||||
145 | - | |||||||||||||
146 | - | |||||||||||||
147 | int QStyleHints::keyboardInputInterval() const | - | ||||||||||||
148 | { | - | ||||||||||||
149 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
150 | return never executed: d->m_keyboardInputInterval >= 0return d->m_keyboardInputInterval >= 0 ? d->m_keyboardInputInterval : themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt();
never executed: return d->m_keyboardInputInterval >= 0 ? d->m_keyboardInputInterval : themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt(); | 0 | ||||||||||||
151 | d->m_keyboardInputInterval : never executed: return d->m_keyboardInputInterval >= 0 ? d->m_keyboardInputInterval : themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt(); | 0 | ||||||||||||
152 | themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt(); never executed: return d->m_keyboardInputInterval >= 0 ? d->m_keyboardInputInterval : themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt(); | 0 | ||||||||||||
153 | } | - | ||||||||||||
154 | - | |||||||||||||
155 | - | |||||||||||||
156 | - | |||||||||||||
157 | - | |||||||||||||
158 | - | |||||||||||||
159 | - | |||||||||||||
160 | int QStyleHints::keyboardAutoRepeatRate() const | - | ||||||||||||
161 | { | - | ||||||||||||
162 | return never executed: themeableHint(QPlatformTheme::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardAutoRepeatRate).toInt();return themeableHint(QPlatformTheme::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardAutoRepeatRate).toInt(); never executed: return themeableHint(QPlatformTheme::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardAutoRepeatRate).toInt(); | 0 | ||||||||||||
163 | } | - | ||||||||||||
164 | - | |||||||||||||
165 | - | |||||||||||||
166 | - | |||||||||||||
167 | - | |||||||||||||
168 | - | |||||||||||||
169 | - | |||||||||||||
170 | - | |||||||||||||
171 | void QStyleHints::setCursorFlashTime(int cursorFlashTime) | - | ||||||||||||
172 | { | - | ||||||||||||
173 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
174 | if (d->m_cursorFlashTime == cursorFlashTime
| 0 | ||||||||||||
175 | return; never executed: return; | 0 | ||||||||||||
176 | d->m_cursorFlashTime = cursorFlashTime; | - | ||||||||||||
177 | cursorFlashTimeChanged(cursorFlashTime); | - | ||||||||||||
178 | } never executed: end of block | 0 | ||||||||||||
179 | int QStyleHints::cursorFlashTime() const | - | ||||||||||||
180 | { | - | ||||||||||||
181 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
182 | return never executed: d->m_cursorFlashTime >= 0return d->m_cursorFlashTime >= 0 ? d->m_cursorFlashTime : themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt();
never executed: return d->m_cursorFlashTime >= 0 ? d->m_cursorFlashTime : themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt(); | 0 | ||||||||||||
183 | d->m_cursorFlashTime : never executed: return d->m_cursorFlashTime >= 0 ? d->m_cursorFlashTime : themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt(); | 0 | ||||||||||||
184 | themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt(); never executed: return d->m_cursorFlashTime >= 0 ? d->m_cursorFlashTime : themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt(); | 0 | ||||||||||||
185 | } | - | ||||||||||||
186 | bool QStyleHints::showIsFullScreen() const | - | ||||||||||||
187 | { | - | ||||||||||||
188 | return never executed: hint(QPlatformIntegration::ShowIsFullScreen).toBool();return hint(QPlatformIntegration::ShowIsFullScreen).toBool(); never executed: return hint(QPlatformIntegration::ShowIsFullScreen).toBool(); | 0 | ||||||||||||
189 | } | - | ||||||||||||
190 | bool QStyleHints::showIsMaximized() const | - | ||||||||||||
191 | { | - | ||||||||||||
192 | return never executed: hint(QPlatformIntegration::ShowIsMaximized).toBool();return hint(QPlatformIntegration::ShowIsMaximized).toBool(); never executed: return hint(QPlatformIntegration::ShowIsMaximized).toBool(); | 0 | ||||||||||||
193 | } | - | ||||||||||||
194 | - | |||||||||||||
195 | - | |||||||||||||
196 | - | |||||||||||||
197 | - | |||||||||||||
198 | - | |||||||||||||
199 | - | |||||||||||||
200 | int QStyleHints::passwordMaskDelay() const | - | ||||||||||||
201 | { | - | ||||||||||||
202 | return never executed: themeableHint(QPlatformTheme::PasswordMaskDelay, QPlatformIntegration::PasswordMaskDelay).toInt();return themeableHint(QPlatformTheme::PasswordMaskDelay, QPlatformIntegration::PasswordMaskDelay).toInt(); never executed: return themeableHint(QPlatformTheme::PasswordMaskDelay, QPlatformIntegration::PasswordMaskDelay).toInt(); | 0 | ||||||||||||
203 | } | - | ||||||||||||
204 | - | |||||||||||||
205 | - | |||||||||||||
206 | - | |||||||||||||
207 | - | |||||||||||||
208 | - | |||||||||||||
209 | - | |||||||||||||
210 | QChar QStyleHints::passwordMaskCharacter() const | - | ||||||||||||
211 | { | - | ||||||||||||
212 | return never executed: themeableHint(QPlatformTheme::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskCharacter).toChar();return themeableHint(QPlatformTheme::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskCharacter).toChar(); never executed: return themeableHint(QPlatformTheme::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskCharacter).toChar(); | 0 | ||||||||||||
213 | } | - | ||||||||||||
214 | - | |||||||||||||
215 | - | |||||||||||||
216 | - | |||||||||||||
217 | - | |||||||||||||
218 | - | |||||||||||||
219 | qreal QStyleHints::fontSmoothingGamma() const | - | ||||||||||||
220 | { | - | ||||||||||||
221 | return never executed: hint(QPlatformIntegration::FontSmoothingGamma).toReal();return hint(QPlatformIntegration::FontSmoothingGamma).toReal(); never executed: return hint(QPlatformIntegration::FontSmoothingGamma).toReal(); | 0 | ||||||||||||
222 | } | - | ||||||||||||
223 | - | |||||||||||||
224 | - | |||||||||||||
225 | - | |||||||||||||
226 | - | |||||||||||||
227 | - | |||||||||||||
228 | - | |||||||||||||
229 | bool QStyleHints::useRtlExtensions() const | - | ||||||||||||
230 | { | - | ||||||||||||
231 | return never executed: hint(QPlatformIntegration::UseRtlExtensions).toBool();return hint(QPlatformIntegration::UseRtlExtensions).toBool(); never executed: return hint(QPlatformIntegration::UseRtlExtensions).toBool(); | 0 | ||||||||||||
232 | } | - | ||||||||||||
233 | bool QStyleHints::setFocusOnTouchRelease() const | - | ||||||||||||
234 | { | - | ||||||||||||
235 | return never executed: hint(QPlatformIntegration::SetFocusOnTouchRelease).toBool();return hint(QPlatformIntegration::SetFocusOnTouchRelease).toBool(); never executed: return hint(QPlatformIntegration::SetFocusOnTouchRelease).toBool(); | 0 | ||||||||||||
236 | } | - | ||||||||||||
237 | Qt::TabFocusBehavior QStyleHints::tabFocusBehavior() const | - | ||||||||||||
238 | { | - | ||||||||||||
239 | return never executed: Qt::TabFocusBehavior(themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt());return Qt::TabFocusBehavior(themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); never executed: return Qt::TabFocusBehavior(themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); | 0 | ||||||||||||
240 | } | - | ||||||||||||
241 | bool QStyleHints::singleClickActivation() const | - | ||||||||||||
242 | { | - | ||||||||||||
243 | return never executed: themeableHint(QPlatformTheme::ItemViewActivateItemOnSingleClick, QPlatformIntegration::ItemViewActivateItemOnSingleClick).toBool();return themeableHint(QPlatformTheme::ItemViewActivateItemOnSingleClick, QPlatformIntegration::ItemViewActivateItemOnSingleClick).toBool(); never executed: return themeableHint(QPlatformTheme::ItemViewActivateItemOnSingleClick, QPlatformIntegration::ItemViewActivateItemOnSingleClick).toBool(); | 0 | ||||||||||||
244 | } | - | ||||||||||||
245 | - | |||||||||||||
246 | - | |||||||||||||
Switch to Source code | Preprocessed file |