[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/widgets
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2010-09-30 3:19:16
Message-ID: 20100930031916.37C06AC88E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181110 by cfeck:

Fix sizeHint of KNumInput

If we don't re-read the column2width after doLayout(), then
we will keep the old size forever.

BUG: 221989


 M  +8 -6      knuminput.cpp  


--- trunk/KDE/kdelibs/kdeui/widgets/knuminput.cpp #1181109:1181110
@@ -178,7 +178,9 @@
         return;
     }
 
-    KNumInput* p = this;
+    w2 = d->column2Width;
+
+    KNumInput* p = d->previousNumInput;
     while (p) {
         p->doLayout();
         w1 = qMax(w1, p->d->column1Width);
@@ -550,7 +552,7 @@
         h = qMax(h, priv->labelSize.height() + 2);
     }
 
-    w = priv->slider ? priv->slider->sizeHint().width() + 8 : 0;
+    w = priv->slider ? priv->slider->sizeHint().width() + KDialog::spacingHint() : \
0;  w += priv->column1Width + priv->column2Width;
 
     if (priv->labelAlignment & (Qt::AlignTop | Qt::AlignBottom)) {
@@ -588,9 +590,9 @@
         priv->label->setGeometry(0, 0, w, d->intSpinBoxSize.height());
     }
 
-    if (qApp->layoutDirection()) {
+    if (qApp->layoutDirection() == Qt::RightToLeft) {
         d->intSpinBox->setGeometry(w, h, priv->slider ? priv->column2Width : \
                qMax(priv->column2Width, e->size().width() - w), \
                d->intSpinBoxSize.height());
-        w += priv->column2Width + 8;
+        w += priv->column2Width + KDialog::spacingHint();
 
         if (priv->slider) {
             priv->slider->setGeometry(w, h, e->size().width() - w, \
d->intSpinBoxSize.height() + KDialog::spacingHint()); @@ -810,7 +812,7 @@
         h = qMax(h, priv->labelSize.height() + 2);
     }
 
-    w = priv->slider ? priv->slider->sizeHint().width() + 8 : 0;
+    w = priv->slider ? priv->slider->sizeHint().width() + KDialog::spacingHint() : \
0;  w += priv->column1Width + priv->column2Width;
 
     if (priv->labelAlignment & (Qt::AlignTop | Qt::AlignBottom)) {
@@ -836,7 +838,7 @@
         priv->label->setGeometry(0, 0, w, d->editSize.height());
     }
 
-    if (qApp->layoutDirection()) {
+    if (qApp->layoutDirection() == Qt::RightToLeft) {
         d->spin->setGeometry(w, h, priv->slider ? priv->column2Width
                              : e->size().width() - w, d->editSize.height());
         w += priv->column2Width + KDialog::spacingHint();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic