From a58359b5324bab9925e7a1e23d93f67b56082c43 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 1 Jul 2012 22:27:12 -0500 Subject: [PATCH] Fix spinbox text entry when base is not 10 (cherry picked from commit d1c71f692f5329dbfe817bbed41c5137be608efa) --- kdeui/knuminput.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kdeui/knuminput.cpp b/kdeui/knuminput.cpp index 27b86f98e..118af6c22 100644 --- a/kdeui/knuminput.cpp +++ b/kdeui/knuminput.cpp @@ -206,6 +206,7 @@ KIntSpinBox::KIntSpinBox(TQWidget *parent, const char *name) { editor()->setAlignment(AlignRight); val_base = 10; + setValidator(new KIntValidator(this, val_base)); setValue(0); } @@ -219,11 +220,16 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, { editor()->setAlignment(AlignRight); val_base = base; + setValidator(new KIntValidator(this, val_base)); setValue(value); } void KIntSpinBox::setBase(int base) { + const KIntValidator* kvalidator = dynamic_cast(validator()); + if (kvalidator) { + const_cast(kvalidator)->setBase(base); + } val_base = base; }