diff options
author | Kevin Ottens <ervin@kde.org> | 2013-04-25 17:36:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 18:40:43 +0200 |
commit | 48e3cc30ed828e2d18bae2d95f30c71e166ed65c (patch) | |
tree | 0ae4c00e489e9d56449c055d86cedf70ac3a52d0 /examples/widgets/widgets | |
parent | 44c47af950c040603da7145e4f1437b5546915ba (diff) |
Set the base used to display the spin box value
Provide a new displayIntegerBase property which control the base used
by the spin box to display the value in its internal line edit.
Change-Id: Ibadc37107db8770d757b64350946bf19142e8f6c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'examples/widgets/widgets')
-rw-r--r-- | examples/widgets/widgets/spinboxes/window.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/widgets/widgets/spinboxes/window.cpp b/examples/widgets/widgets/spinboxes/window.cpp index 8c35f93c56..acce642ec6 100644 --- a/examples/widgets/widgets/spinboxes/window.cpp +++ b/examples/widgets/widgets/spinboxes/window.cpp @@ -94,6 +94,14 @@ void Window::createSpinBoxes() priceSpinBox->setValue(99); //! [4] //! [5] + QLabel *hexLabel = new QLabel(tr("Enter a value between " + "%1 and %2:").arg('-' + QString::number(31, 16)).arg(QString::number(31, 16))); + QSpinBox *hexSpinBox = new QSpinBox; + hexSpinBox->setRange(-31, 31); + hexSpinBox->setSingleStep(1); + hexSpinBox->setValue(0); + hexSpinBox->setDisplayIntegerBase(16); + QVBoxLayout *spinBoxLayout = new QVBoxLayout; spinBoxLayout->addWidget(integerLabel); spinBoxLayout->addWidget(integerSpinBox); @@ -101,6 +109,8 @@ void Window::createSpinBoxes() spinBoxLayout->addWidget(zoomSpinBox); spinBoxLayout->addWidget(priceLabel); spinBoxLayout->addWidget(priceSpinBox); + spinBoxLayout->addWidget(hexLabel); + spinBoxLayout->addWidget(hexSpinBox); spinBoxesGroup->setLayout(spinBoxLayout); } //! [5] |