[Qt-interest] widget update problem
Malyushytsky, Alex
alex at wai.com
Fri Oct 2 00:27:18 CEST 2009
Sorry, don't think my explanation was clear.
Update does not cause an immediate repaint.
It schedules a paint event for processing when Qt returns to the main event loop.
Regards,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Malyushytsky, Alex
Sent: Thursday, October 01, 2009 3:15 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] widget update problem
Update does not update the widget.
QT itself is optimizing the events, so it may skip undesired updates.
What you may try, you may QApplication to process events before calling sleep.
Look at QCoreApplication::processEvents
Regards,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of "Alexander Carôt"
Sent: Thursday, October 01, 2009 2:39 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] widget update problem
Hi all,
I have a question related to a simple animation of a widget: After the click of a button I want to make another widget visible and moving it from left to right. I created a slot, which is triggered by the button click:
void JamDesk::jamButtonClicked(){
ui.LMixer->setVisible(true);
for (int i=1;i<5;i++){
ui.LMixer->setGeometry(i, ui.LMixer->y(),
ui.LMixer->width(),ui.LMixer->height() );
this->update();
sleep(1000);
}
}
So, it should be visible and then move from x-coordinate 1 to 4 and after each move it should stop moving for one second. This, however, doesn't work: What happens instead is that I don't see anything for 5 seconds and then it shows up at the final and correct spot. Update and repaint don't work althoug the widget has updates enabled.
Can anyone tell where my problem is ?
Thanks
-- A l e x
--
Dr.-Ing. Alexander Carôt
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list