Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qabstractslider_p.h
Go to the documentation of this file.
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
4#ifndef QABSTRACTSLIDER_P_H
5#define QABSTRACTSLIDER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include "QtCore/qbasictimer.h"
20#include "QtCore/qelapsedtimer.h"
21#include "private/qwidget_p.h"
22#include "qstyle.h"
23
24QT_REQUIRE_CONFIG(abstractslider);
25
27
29{
30 Q_DECLARE_PUBLIC(QAbstractSlider)
31public:
34
35 void setSteps(int single, int page);
36
38
43 int singleStepFromItemView; // If we have itemViews we track the views preferred singleStep value.
45
53
57
58#ifdef QT_KEYPAD_NAVIGATION
59 int origValue;
60
63 bool isAutoRepeating;
64
69 qreal repeatMultiplier;
70
74 QElapsedTimer firstRepeat;
75
76#endif
77
78 inline int effectiveSingleStep() const
79 {
80 return singleStep
81#ifdef QT_KEYPAD_NAVIGATION
82 * repeatMultiplier
83#endif
84 ;
85 }
86 void itemviewChangeSingleStep(int step);
87
88 virtual int bound(int val) const { return qMax(minimum, qMin(maximum, val)); }
89 inline int overflowSafeAdd(int add) const
90 {
91 int newValue = value + add;
92 if (add > 0 && newValue < value)
93 newValue = maximum;
94 else if (add < 0 && newValue > value)
95 newValue = minimum;
96 return newValue;
97 }
99 {
100 Q_Q(QAbstractSlider);
101 if (q->style()->styleHint(QStyle::SH_Slider_StopMouseOverSlider, nullptr, q)) {
102 if ((position > pressValue - 2 * pageStep) && (position < pressValue + 2 * pageStep)) {
104 q->setSliderPosition(pressValue);
105 return;
106 }
107 }
108 q->triggerAction(repeatAction);
109 }
110 bool scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta);
111};
112
114
115#endif // QABSTRACTSLIDER_P_H
int overflowSafeAdd(int add) const
QAbstractSlider::SliderAction repeatAction
void itemviewChangeSingleStep(int step)
void setSteps(int single, int page)
virtual int bound(int val) const
Qt::Orientation orientation
bool scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta)
void setAdjustedSliderPosition(int position)
The QAbstractSlider class provides an integer value within a range.
SliderAction
\value SliderNoAction \value SliderSingleStepAdd \value SliderSingleStepSub \value SliderPageStepAdd ...
\inmodule QtCore
Definition qbasictimer.h:18
\inmodule QtCore
@ SH_Slider_StopMouseOverSlider
Definition qstyle.h:612
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:98
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLuint GLfloat * val
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
#define QT_REQUIRE_CONFIG(feature)
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QByteArray page
[45]