[Qt-interest] Qt-Cocoa UI Elements not getting Events
Michael Jackson
mike.jackson at bluequartz.net
Tue Mar 23 15:51:04 CET 2010
Qt 4.6.1 64/32 Bit Cocoa compiled on OS X 10.5.8 using GCC 4.2 (Apple
supplied). I have a QMainWindow derived class with some buttons in it. One
of the buttons is the typical "Play" button to start an animation. I use a
QTime::singleShot() with some booleans that tell if the animation should
continue or stop.
<fake code>
void MyMainWindow::UpdateAnimation()
If ( Animate == true )
{
loadAndDisplayData();
QTime::singleShot(33, this, UpdateAnimation();
}
This works great on Windows, OS X Carbon and Linux (X11). When I try this in
Qt_Cocoa the Play button does not respond to the user clicking on the button
once the animation begins, or it does if the user clicks and holds on the
button until the button appears to change to the depressed state, then stays
that way for a long time until finally sending its signal. I have tried this
a few different ways including creating a separate thread to run the QTimers
then using a signal to call back to the MainWindow::UpdateAnimation() method
to do the updates. Same issue exists.
Has anyone seen anything like this? Is this a bug perhaps? Am I somehow
flooding the Event Queue so the GUI becomes unresponsive?
It "feels" like I am somehow not really relinquishing control to the event
loop even though it is my understanding by using a QTime::SingleShot() that
is what should happen.
Any insight or ideas are much appreciated.
Mike Jackson
Principal Software Engineer
BlueQuartz Software (www.bluequartz.net)
More information about the Qt-interest-old
mailing list