Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, April 2008
widget size known on polish event?


Message 1 in thread

is it possible to access the widget size when handling the Polish event on a
PushButton (for example)?? Is the size already known at that moment or
should i wait the show event?

bool MyPushButton::event(QEvent *event)
{
   int returnValue = QWidget::event(event);

   if (event->type() == QEvent::Polish)
   {
     QSize widgetSize = this->size();         // store widget size
     return true;
   }

   return returnValue;
}