summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qstylehints.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qstylehints.cpp')
-rw-r--r--src/gui/kernel/qstylehints.cpp55
1 files changed, 49 insertions, 6 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 7ccf1d86b0..85c0768e35 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -78,6 +78,7 @@ public:
, m_cursorFlashTime(-1)
, m_tabFocusBehavior(-1)
, m_uiEffects(-1)
+ , m_wheelScrollLines(-1)
{}
int m_mouseDoubleClickInterval;
@@ -88,6 +89,7 @@ public:
int m_cursorFlashTime;
int m_tabFocusBehavior;
int m_uiEffects;
+ int m_wheelScrollLines;
};
/*!
@@ -329,7 +331,9 @@ int QStyleHints::cursorFlashTime() const
/*!
\property QStyleHints::showIsFullScreen
- \brief \c true if the platform defaults to windows being fullscreen,
+ \brief whether the platform defaults to fullscreen windows.
+
+ This property is \c true if the platform defaults to windows being fullscreen,
otherwise \c false.
\note The platform may still choose to show certain windows non-fullscreen,
@@ -344,7 +348,9 @@ bool QStyleHints::showIsFullScreen() const
/*!
\property QStyleHints::showIsMaximized
- \brief \c true if the platform defaults to windows being maximized,
+ \brief whether the platform defaults to maximized windows.
+
+ This property is \c true if the platform defaults to windows being maximized,
otherwise \c false.
\note The platform may still choose to show certain windows non-maximized,
@@ -389,7 +395,9 @@ qreal QStyleHints::fontSmoothingGamma() const
/*!
\property QStyleHints::useRtlExtensions
- \brief \c true if right-to-left writing direction is enabled,
+ \brief the writing direction.
+
+ This property is \c true if right-to-left writing direction is enabled,
otherwise \c false.
*/
bool QStyleHints::useRtlExtensions() const
@@ -399,7 +407,9 @@ bool QStyleHints::useRtlExtensions() const
/*!
\property QStyleHints::setFocusOnTouchRelease
- \brief \c true if focus objects (line edits etc) should receive
+ \brief the event that should set input focus on focus objects.
+
+ This property is \c true if focus objects (line edits etc) should receive
input focus after a touch/mouse release. This is normal behavior on
touch platforms. On desktop platforms, the standard is to set
focus already on touch/mouse press.
@@ -443,7 +453,9 @@ void QStyleHints::setTabFocusBehavior(Qt::TabFocusBehavior tabFocusBehavior)
/*!
\property QStyleHints::singleClickActivation
- \brief \c true if items should be activated by single click, \b false
+ \brief whether items are activated by single or double click.
+
+ This property is \c true if items should be activated by single click, \c false
if they should be activated by double click instead.
\since 5.5
@@ -455,7 +467,9 @@ bool QStyleHints::singleClickActivation() const
/*!
\property QStyleHints::useHoverEffects
- \brief \c true if UI elements should use hover effects. This is the
+ \brief whether UI elements use hover effects.
+
+ This property is \c true if UI elements should use hover effects. This is the
standard behavior on desktop platforms with a mouse pointer, whereas
on touch platforms the overhead of hover event delivery can be avoided.
@@ -483,4 +497,33 @@ void QStyleHints::setUseHoverEffects(bool useHoverEffects)
emit useHoverEffectsChanged(useHoverEffects);
}
+/*!
+ \property QStyleHints::wheelScrollLines
+ \brief Number of lines to scroll by default for each wheel click.
+
+ \since 5.9
+*/
+int QStyleHints::wheelScrollLines() const
+{
+ Q_D(const QStyleHints);
+ if (d->m_wheelScrollLines > 0)
+ return d->m_wheelScrollLines;
+ return themeableHint(QPlatformTheme::WheelScrollLines, QPlatformIntegration::WheelScrollLines).toInt();
+}
+
+/*!
+ Sets the \a wheelScrollLines.
+ \internal
+ \sa wheelScrollLines()
+ \since 5.9
+*/
+void QStyleHints::setWheelScrollLines(int scrollLines)
+{
+ Q_D(QStyleHints);
+ if (d->m_wheelScrollLines == scrollLines)
+ return;
+ d->m_wheelScrollLines = scrollLines;
+ emit wheelScrollLinesChanged(scrollLines);
+}
+
QT_END_NAMESPACE