Last edited by Wojtek1990; 22nd July 2010 at 22:58.
With passing this as parent, you ensure that the allocated memory will be freed. To really "close" you window use window attribute Qt::WA_DeleteOnClose.
Wojtek1990 (23rd July 2010)
I think "tasker window was closed but main window of app still lags" means that the tasker window no longer responds to input. This line:
calls tasker() in a loop that never returns to the Qt event loop. The checkbox cannot change and emit clicked() and the window is generally unresponsive unless the event loop is entered.Qt Code:
while (checkBox()==1) tasker();To copy to clipboard, switch view to plain text mode
You could look at using QTimer to run tasker() regularly and then use the checkbox to start/stop the timer.
Wojtek1990 (23rd July 2010)
Okey, but when I've changed it to ...
... app laggs too, but just just once (tasker is called 1 time)- I would like to definitely destroy this lag. And thanks for advice how to change this loop - I'll read about QTimer - but as I said problem of lag seems not be here.Qt Code:
if (checkBox()==1) tasker();To copy to clipboard, switch view to plain text mode
Last edited by Wojtek1990; 23rd July 2010 at 12:30.
Okey, problem solved by using QThread class.
Thanks for every reply. I've learned a lot from you.
Bookmarks