[Qt-interest] QThread: infinite loops
Malyushytsky, Alex
alex at wai.com
Fri Feb 25 03:54:21 CET 2011
I could not get to your code on the Windows, so just a few comments which might can help:
If you want to let window display itself, then start time consuming operation with QThread
I would suggest to use QTimer::singleShot( 0, ....) in QWidget constructor.
Put code creating QThread ( or at least call to QThread::start ) in that slot.
That slow will be called when all events are processed ( widgets displayed, etc).
If you have very busy hardworking thread you might need to make sure QCoreApplication::processEvents periodically
so your gui is updated even if your other thread using all computer resources.
Alex
-----Original Message-----
From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Nicholas Shatokhin
Sent: Thursday, February 24, 2011 6:27 PM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] QThread: infinite loops
I'm trying to use libfprint, but It was written on C and I'm creating a
layer
between qt4 and libfprint.
Because it need loop to scan finger and I don't want to freeze my program
I used QThread. But my program still frozing.
What's I doing wrong? My source are: http://ubuntuone.com/p/esE/
And I tryed to start thread in mainwindow constructor, but window didn't
showed, so I created button. How start scanning after showing window
without freezing of it?
--
За використання революційного клієнта електронної пошти Opera:
http://www.opera.com/mail/
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.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.”
More information about the Qt-interest-old
mailing list