src/hbcore/gui/hbabstractbutton.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
--- a/src/hbcore/gui/hbabstractbutton.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbcore/gui/hbabstractbutton.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -1167,9 +1167,14 @@
     if (d->mRepolishRequested && isVisible()) {
         d->mRepolishRequested = false;
         // force the polish event in order to get the real size
-        QEvent polishEvent(QEvent::Polish);
-        QCoreApplication::sendEvent(const_cast<HbAbstractButton *>(this), &polishEvent);
-        d->mSizeHintPolish = true;
+        if (!d->polished) {
+            QEvent polishEvent(QEvent::Polish);
+            QCoreApplication::sendEvent(const_cast<HbAbstractButton *>(this), &polishEvent);
+            d->mSizeHintPolish = true;
+        } else if (d->repolishOutstanding) {
+            QCoreApplication::sendPostedEvents(const_cast<HbAbstractButton *>(this), QEvent::Polish);
+        }
+        QCoreApplication::sendPostedEvents(const_cast<HbAbstractButton *>(this), QEvent::LayoutRequest);
     }
     return HbWidget::sizeHint(which, constraint);
 }