| 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 QGuiApplicationPrivate::platformIntegration()->styleHint(h); | - | ||||||||||||
| 7 | } | - | ||||||||||||
| 8 | - | |||||||||||||
| 9 | static inline QVariant themeableHint(QPlatformTheme::ThemeHint th, | - | ||||||||||||
| 10 | QPlatformIntegration::StyleHint ih) | - | ||||||||||||
| 11 | { | - | ||||||||||||
| 12 | if (!QCoreApplication::instance()
| 0 | ||||||||||||
| 13 | QMessageLogger(__FILE__, 5157, __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_mousePressAndHoldInterval(-1) | - | ||||||||||||
| 31 | , m_startDragDistance(-1) | - | ||||||||||||
| 32 | , m_startDragTime(-1) | - | ||||||||||||
| 33 | , m_keyboardInputInterval(-1) | - | ||||||||||||
| 34 | , m_cursorFlashTime(-1) | - | ||||||||||||
| 35 | , m_tabFocusBehavior(-1) | - | ||||||||||||
| 36 | {} never executed: end of block | 0 | ||||||||||||
| 37 | - | |||||||||||||
| 38 | int m_mouseDoubleClickInterval; | - | ||||||||||||
| 39 | int m_mousePressAndHoldInterval; | - | ||||||||||||
| 40 | int m_startDragDistance; | - | ||||||||||||
| 41 | int m_startDragTime; | - | ||||||||||||
| 42 | int m_keyboardInputInterval; | - | ||||||||||||
| 43 | int m_cursorFlashTime; | - | ||||||||||||
| 44 | int m_tabFocusBehavior; | - | ||||||||||||
| 45 | }; | - | ||||||||||||
| 46 | QStyleHints::QStyleHints() | - | ||||||||||||
| 47 | : QObject(*new QStyleHintsPrivate(), 0) | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | } | - | ||||||||||||
| 50 | - | |||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| 53 | - | |||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | - | |||||||||||||
| 57 | void QStyleHints::setMouseDoubleClickInterval(int mouseDoubleClickInterval) | - | ||||||||||||
| 58 | { | - | ||||||||||||
| 59 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 60 | if (d->m_mouseDoubleClickInterval == mouseDoubleClickInterval) | - | ||||||||||||
| 61 | return; | - | ||||||||||||
| 62 | d->m_mouseDoubleClickInterval = mouseDoubleClickInterval; | - | ||||||||||||
| 63 | mouseDoubleClickIntervalChanged(mouseDoubleClickInterval); | - | ||||||||||||
| 64 | } | - | ||||||||||||
| 65 | - | |||||||||||||
| 66 | - | |||||||||||||
| 67 | - | |||||||||||||
| 68 | - | |||||||||||||
| 69 | - | |||||||||||||
| 70 | - | |||||||||||||
| 71 | int QStyleHints::mouseDoubleClickInterval() const | - | ||||||||||||
| 72 | { | - | ||||||||||||
| 73 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 74 | return d->m_mouseDoubleClickInterval >= 0 ? | - | ||||||||||||
| 75 | d->m_mouseDoubleClickInterval : | - | ||||||||||||
| 76 | themeableHint(QPlatformTheme::MouseDoubleClickInterval, QPlatformIntegration::MouseDoubleClickInterval).toInt(); | - | ||||||||||||
| 77 | } | - | ||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | - | |||||||||||||
| 81 | - | |||||||||||||
| 82 | - | |||||||||||||
| 83 | - | |||||||||||||
| 84 | - | |||||||||||||
| 85 | void QStyleHints::setMousePressAndHoldInterval(int mousePressAndHoldInterval) | - | ||||||||||||
| 86 | { | - | ||||||||||||
| 87 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 88 | if (d->m_mousePressAndHoldInterval == mousePressAndHoldInterval
| 0 | ||||||||||||
| 89 | return; never executed: return; | 0 | ||||||||||||
| 90 | d->m_mousePressAndHoldInterval = mousePressAndHoldInterval; | - | ||||||||||||
| 91 | mousePressAndHoldIntervalChanged(mousePressAndHoldInterval); | - | ||||||||||||
| 92 | } never executed: end of block | 0 | ||||||||||||
| 93 | int QStyleHints::mousePressAndHoldInterval() const | - | ||||||||||||
| 94 | { | - | ||||||||||||
| 95 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 96 | return never executed: d->m_mousePressAndHoldInterval >= 0 ?return d->m_mousePressAndHoldInterval >= 0 ? d->m_mousePressAndHoldInterval : themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt();never executed: return d->m_mousePressAndHoldInterval >= 0 ? d->m_mousePressAndHoldInterval : themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); | 0 | ||||||||||||
| 97 | d->m_mousePressAndHoldInterval : never executed: return d->m_mousePressAndHoldInterval >= 0 ? d->m_mousePressAndHoldInterval : themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); | 0 | ||||||||||||
| 98 | themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); never executed: return d->m_mousePressAndHoldInterval >= 0 ? d->m_mousePressAndHoldInterval : themeableHint(QPlatformTheme::MousePressAndHoldInterval, QPlatformIntegration::MousePressAndHoldInterval).toInt(); | 0 | ||||||||||||
| 99 | } | - | ||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | - | |||||||||||||
| 103 | - | |||||||||||||
| 104 | - | |||||||||||||
| 105 | - | |||||||||||||
| 106 | - | |||||||||||||
| 107 | void QStyleHints::setStartDragDistance(int startDragDistance) | - | ||||||||||||
| 108 | { | - | ||||||||||||
| 109 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 110 | if (d->m_startDragDistance == startDragDistance) | - | ||||||||||||
| 111 | return; | - | ||||||||||||
| 112 | d->m_startDragDistance = startDragDistance; | - | ||||||||||||
| 113 | startDragDistanceChanged(startDragDistance); | - | ||||||||||||
| 114 | } | - | ||||||||||||
| 115 | int QStyleHints::startDragDistance() const | - | ||||||||||||
| 116 | { | - | ||||||||||||
| 117 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 118 | return d->m_startDragDistance >= 0 ? | - | ||||||||||||
| 119 | d->m_startDragDistance : | - | ||||||||||||
| 120 | themeableHint(QPlatformTheme::StartDragDistance, QPlatformIntegration::StartDragDistance).toInt(); | - | ||||||||||||
| 121 | } | - | ||||||||||||
| 122 | - | |||||||||||||
| 123 | - | |||||||||||||
| 124 | - | |||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | void QStyleHints::setStartDragTime(int startDragTime) | - | ||||||||||||
| 130 | { | - | ||||||||||||
| 131 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 132 | if (d->m_startDragTime == startDragTime) | - | ||||||||||||
| 133 | return; | - | ||||||||||||
| 134 | d->m_startDragTime = startDragTime; | - | ||||||||||||
| 135 | startDragTimeChanged(startDragTime); | - | ||||||||||||
| 136 | } | - | ||||||||||||
| 137 | int QStyleHints::startDragTime() const | - | ||||||||||||
| 138 | { | - | ||||||||||||
| 139 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 140 | return d->m_startDragTime >= 0 ? | - | ||||||||||||
| 141 | d->m_startDragTime : | - | ||||||||||||
| 142 | themeableHint(QPlatformTheme::StartDragTime, QPlatformIntegration::StartDragTime).toInt(); | - | ||||||||||||
| 143 | } | - | ||||||||||||
| 144 | int QStyleHints::startDragVelocity() const | - | ||||||||||||
| 145 | { | - | ||||||||||||
| 146 | return themeableHint(QPlatformTheme::StartDragVelocity, QPlatformIntegration::StartDragVelocity).toInt(); | - | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| 151 | - | |||||||||||||
| 152 | - | |||||||||||||
| 153 | - | |||||||||||||
| 154 | - | |||||||||||||
| 155 | void QStyleHints::setKeyboardInputInterval(int keyboardInputInterval) | - | ||||||||||||
| 156 | { | - | ||||||||||||
| 157 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 158 | if (d->m_keyboardInputInterval == keyboardInputInterval) | - | ||||||||||||
| 159 | return; | - | ||||||||||||
| 160 | d->m_keyboardInputInterval = keyboardInputInterval; | - | ||||||||||||
| 161 | keyboardInputIntervalChanged(keyboardInputInterval); | - | ||||||||||||
| 162 | } | - | ||||||||||||
| 163 | - | |||||||||||||
| 164 | - | |||||||||||||
| 165 | - | |||||||||||||
| 166 | - | |||||||||||||
| 167 | - | |||||||||||||
| 168 | - | |||||||||||||
| 169 | int QStyleHints::keyboardInputInterval() const | - | ||||||||||||
| 170 | { | - | ||||||||||||
| 171 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 172 | return d->m_keyboardInputInterval >= 0 ? | - | ||||||||||||
| 173 | d->m_keyboardInputInterval : | - | ||||||||||||
| 174 | themeableHint(QPlatformTheme::KeyboardInputInterval, QPlatformIntegration::KeyboardInputInterval).toInt(); | - | ||||||||||||
| 175 | } | - | ||||||||||||
| 176 | - | |||||||||||||
| 177 | - | |||||||||||||
| 178 | - | |||||||||||||
| 179 | - | |||||||||||||
| 180 | - | |||||||||||||
| 181 | - | |||||||||||||
| 182 | int QStyleHints::keyboardAutoRepeatRate() const | - | ||||||||||||
| 183 | { | - | ||||||||||||
| 184 | return themeableHint(QPlatformTheme::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardAutoRepeatRate).toInt(); | - | ||||||||||||
| 185 | } | - | ||||||||||||
| 186 | - | |||||||||||||
| 187 | - | |||||||||||||
| 188 | - | |||||||||||||
| 189 | - | |||||||||||||
| 190 | - | |||||||||||||
| 191 | - | |||||||||||||
| 192 | - | |||||||||||||
| 193 | void QStyleHints::setCursorFlashTime(int cursorFlashTime) | - | ||||||||||||
| 194 | { | - | ||||||||||||
| 195 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 196 | if (d->m_cursorFlashTime == cursorFlashTime) | - | ||||||||||||
| 197 | return; | - | ||||||||||||
| 198 | d->m_cursorFlashTime = cursorFlashTime; | - | ||||||||||||
| 199 | cursorFlashTimeChanged(cursorFlashTime); | - | ||||||||||||
| 200 | } | - | ||||||||||||
| 201 | int QStyleHints::cursorFlashTime() const | - | ||||||||||||
| 202 | { | - | ||||||||||||
| 203 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 204 | return d->m_cursorFlashTime >= 0 ? | - | ||||||||||||
| 205 | d->m_cursorFlashTime : | - | ||||||||||||
| 206 | themeableHint(QPlatformTheme::CursorFlashTime, QPlatformIntegration::CursorFlashTime).toInt(); | - | ||||||||||||
| 207 | } | - | ||||||||||||
| 208 | bool QStyleHints::showIsFullScreen() const | - | ||||||||||||
| 209 | { | - | ||||||||||||
| 210 | return hint(QPlatformIntegration::ShowIsFullScreen).toBool(); | - | ||||||||||||
| 211 | } | - | ||||||||||||
| 212 | bool QStyleHints::showIsMaximized() const | - | ||||||||||||
| 213 | { | - | ||||||||||||
| 214 | return hint(QPlatformIntegration::ShowIsMaximized).toBool(); | - | ||||||||||||
| 215 | } | - | ||||||||||||
| 216 | - | |||||||||||||
| 217 | - | |||||||||||||
| 218 | - | |||||||||||||
| 219 | - | |||||||||||||
| 220 | - | |||||||||||||
| 221 | - | |||||||||||||
| 222 | int QStyleHints::passwordMaskDelay() const | - | ||||||||||||
| 223 | { | - | ||||||||||||
| 224 | return themeableHint(QPlatformTheme::PasswordMaskDelay, QPlatformIntegration::PasswordMaskDelay).toInt(); | - | ||||||||||||
| 225 | } | - | ||||||||||||
| 226 | - | |||||||||||||
| 227 | - | |||||||||||||
| 228 | - | |||||||||||||
| 229 | - | |||||||||||||
| 230 | - | |||||||||||||
| 231 | - | |||||||||||||
| 232 | QChar QStyleHints::passwordMaskCharacter() const | - | ||||||||||||
| 233 | { | - | ||||||||||||
| 234 | return themeableHint(QPlatformTheme::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskCharacter).toChar(); | - | ||||||||||||
| 235 | } | - | ||||||||||||
| 236 | - | |||||||||||||
| 237 | - | |||||||||||||
| 238 | - | |||||||||||||
| 239 | - | |||||||||||||
| 240 | - | |||||||||||||
| 241 | qreal QStyleHints::fontSmoothingGamma() const | - | ||||||||||||
| 242 | { | - | ||||||||||||
| 243 | return hint(QPlatformIntegration::FontSmoothingGamma).toReal(); | - | ||||||||||||
| 244 | } | - | ||||||||||||
| 245 | - | |||||||||||||
| 246 | - | |||||||||||||
| 247 | - | |||||||||||||
| 248 | - | |||||||||||||
| 249 | - | |||||||||||||
| 250 | - | |||||||||||||
| 251 | bool QStyleHints::useRtlExtensions() const | - | ||||||||||||
| 252 | { | - | ||||||||||||
| 253 | return hint(QPlatformIntegration::UseRtlExtensions).toBool(); | - | ||||||||||||
| 254 | } | - | ||||||||||||
| 255 | bool QStyleHints::setFocusOnTouchRelease() const | - | ||||||||||||
| 256 | { | - | ||||||||||||
| 257 | return hint(QPlatformIntegration::SetFocusOnTouchRelease).toBool(); | - | ||||||||||||
| 258 | } | - | ||||||||||||
| 259 | Qt::TabFocusBehavior QStyleHints::tabFocusBehavior() const | - | ||||||||||||
| 260 | { | - | ||||||||||||
| 261 | const QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 262 | return never executed: Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ?return Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ? d->m_tabFocusBehavior : themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt());never executed: return Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ? d->m_tabFocusBehavior : themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); | 0 | ||||||||||||
| 263 | d->m_tabFocusBehavior : never executed: return Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ? d->m_tabFocusBehavior : themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); | 0 | ||||||||||||
| 264 | themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); never executed: return Qt::TabFocusBehavior(d->m_tabFocusBehavior >= 0 ? d->m_tabFocusBehavior : themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); | 0 | ||||||||||||
| 265 | } | - | ||||||||||||
| 266 | - | |||||||||||||
| 267 | - | |||||||||||||
| 268 | - | |||||||||||||
| 269 | - | |||||||||||||
| 270 | - | |||||||||||||
| 271 | - | |||||||||||||
| 272 | - | |||||||||||||
| 273 | void QStyleHints::setTabFocusBehavior(Qt::TabFocusBehavior tabFocusBehavior) | - | ||||||||||||
| 274 | { | - | ||||||||||||
| 275 | QStyleHintsPrivate * const d = d_func(); | - | ||||||||||||
| 276 | if (d->m_tabFocusBehavior == tabFocusBehavior
| 0 | ||||||||||||
| 277 | return; never executed: return; | 0 | ||||||||||||
| 278 | d->m_tabFocusBehavior = tabFocusBehavior; | - | ||||||||||||
| 279 | tabFocusBehaviorChanged(tabFocusBehavior); | - | ||||||||||||
| 280 | } never executed: end of block | 0 | ||||||||||||
| 281 | bool QStyleHints::singleClickActivation() const | - | ||||||||||||
| 282 | { | - | ||||||||||||
| 283 | return themeableHint(QPlatformTheme::ItemViewActivateItemOnSingleClick, QPlatformIntegration::ItemViewActivateItemOnSingleClick).toBool(); | - | ||||||||||||
| 284 | } | - | ||||||||||||
| 285 | - | |||||||||||||
| 286 | - | |||||||||||||
| Switch to Source code | Preprocessed file |