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
src_gui_widgets_qspinbox.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5sb->setPrefix("$");
7
8
10sb->setSuffix(" km");
12
13
15setRange(minimum, maximum);
17
18
20setMinimum(minimum);
21setMaximum(maximum);
23
24
26spinbox->setPrefix("$");
28
29
31spinbox->setSuffix(" km");
33
34
36setRange(minimum, maximum);
38
39
41setMinimum(minimum);
42setMaximum(maximum);
44
46int IconSizeSpinBox::valueFromText(const QString &text) const
47{
48 static const QRegularExpression regExp(tr("(\\d+)(\\s*[xx]\\s*\\d+)?"));
49 Q_ASSERT(regExp.isValid());
50
51 const QRegularExpressionMatch match = regExp.match(text);
52 if (match.isValid())
53 return match.captured(1).toInt();
54 return 0;
55}
57
59QString IconSizeSpinBox::textFromValue(int value) const
60{
61 return tr("%1 x %1").arg(value);
62}
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define tr(X)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
setMaximum(maximum)
setMinimum(minimum)
[2]
setRange(minimum, maximum)
[1]