I call qApp->process().....but how to call progress DURING? LongOperationTodo (); is a function that call other function; during want mean before??? so I think It'll the same...i'm confused...
I call qApp->process().....but how to call progress DURING? LongOperationTodo (); is a function that call other function; during want mean before??? so I think It'll the same...i'm confused...
Regards
hi, my problem is this: I call render pixmap and it take a long time; where do I have to call processEvents? Every examples I saw, insert it in a for; but I haven't it....thanks
Qt Code:
mainform::render() { qApp->processEvents(); widget->renderPixmap() }To copy to clipboard, switch view to plain text mode
Regards
Yes, that's the intended usage. There are sometimes lengthy tasks (like calculating of something and so on) which prevent the execution from returning to the application's event loop and so the application cannot process it's move/update/whatever events coming from the underlying system. This is what makes the application unresponsive during a lengthy task unless you call QApplication::processEvents() and let the application to process it's events every now and then.Originally Posted by mickey
It's a bit problematic when the lengthy task isn't written by you. You cannot get QApplication::processEvents() called (nor a progress dialog advanced) during for example like in your situation, just a single library call. One option is to move the code calling that library function to another thread. But unfortunately in your situation it might be impossible since you really shouldn't touch widgets in another than the main GUI thread.
I have come to a conclusion that you don't have many options here. Maybe you could just inform the user about what's going to happen: "Saving the image. Please be patient." :)
Btw, have you tried setting useContext as TRUE when calling QGLWidget::renderPixmap()? I'm not sure about it's risks, but it promises to be more efficient.. :)
J-P Nurmi
but the dialog must be called beofe or after renderPixmap(); this doesn't change the thing, I guess....that's incredibile....thanks
Regards
Bookmarks