From 48e3cc30ed828e2d18bae2d95f30c71e166ed65c Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Thu, 25 Apr 2013 17:36:17 +0200 Subject: 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 Reviewed-by: Lars Knoll Reviewed-by: Giuseppe D'Angelo --- examples/widgets/widgets/spinboxes/window.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'examples') 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] -- cgit v1.2.3