mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdeui: do not change the spin boxes suffix to empty one on value change from KIntNumInput and KDoubleNumInput
because suffix may be set via the KDoubleNumInput::setSuffix() overload that takes QString argument Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
07fecca8d0
commit
1689a9288d
1 changed files with 4 additions and 6 deletions
|
@ -51,9 +51,7 @@ public:
|
|||
|
||||
void _k_valueChanged(int value)
|
||||
{
|
||||
if (suffix.isEmpty()) {
|
||||
spinbox->setSuffix(QString());
|
||||
} else {
|
||||
if (!suffix.isEmpty()) {
|
||||
spinbox->setSuffix(suffix.subs(value).toString());
|
||||
}
|
||||
slider->setValue(value);
|
||||
|
@ -206,6 +204,7 @@ void KIntNumInput::setValue(int value)
|
|||
void KIntNumInput::setSuffix(const KLocalizedString &suffix)
|
||||
{
|
||||
d->suffix = suffix;
|
||||
d->spinbox->setSuffix(QString());
|
||||
d->_k_valueChanged(d->spinbox->value());
|
||||
}
|
||||
|
||||
|
@ -245,9 +244,7 @@ public:
|
|||
|
||||
void _k_valueChanged(double value)
|
||||
{
|
||||
if (suffix.isEmpty()) {
|
||||
spinbox->setSuffix(QString());
|
||||
} else {
|
||||
if (!suffix.isEmpty()) {
|
||||
spinbox->setSuffix(suffix.subs(value).toString());
|
||||
}
|
||||
slider->setValue(qRound(value));
|
||||
|
@ -417,6 +414,7 @@ void KDoubleNumInput::setValue(double value)
|
|||
void KDoubleNumInput::setSuffix(const KLocalizedString &suffix)
|
||||
{
|
||||
d->suffix = suffix;
|
||||
d->spinbox->setSuffix(QString());
|
||||
d->_k_valueChanged(d->spinbox->value());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue