[Qt-interest] QLabel is invisible after setText()

Sean Harmer sean.harmer at maps-technology.com
Fri Jan 28 12:56:58 CET 2011


On Friday 28 January 2011 11:41:18 Bruno Colombet wrote:
> Le 28/01/2011 12:39, Sean Harmer a écrit :
> > On Friday 28 January 2011 11:37:43 Bruno Colombet wrote:
> >> the show() in constructor is supposed to repaint the widget, isn't it?
> > 
> > It *schedules* a repaint which requires the event loop to be running to
> > actually get processed.
> > 
> > Sean
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at qt.nokia.com
> > http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> 
> OK, thanks.
> so the solution is :
> 
> PleaseWaitWidget wait(QString("Wait for me"));
> wait.repaint();

No, that will only paint your GUI once. T keep your GUI alive during your long 
calculation you need to make sure the event loop is allowed to run 
periodically.

Please have a read of this article:

http://doc.qt.nokia.com/qq/qq27-responsive-guis.html

Sean



More information about the Qt-interest-old mailing list