Form show is not immediate
-
fun1(){
Code A
form1.show();
Code B
}My problem is that until code B is not finished form1 is not shown immediately. Please tell me the solution for this.
-
Hello amolypaishet..
include<QDialog>
fun1(){
qDebug() << "Code A";QDialog wid; wid.exec(); qDebug() << "Code B";
}
Try this. -
#include<QDialog>
fun1(){
qDebug() << “Code A”;
w.show(); // Should display wait screen dialog
/* My problem is that wait screen is not shown immediately but shown after code B is executed. */qDebug() << “Code B”; // Perform some calculations and read write to I/O device.
w.hide(); // Hide wait screen dialog
} -
This could be possible
fun1(){code A;
w.show(); //immediate show
sleep(2000); //sleeps for 2 seconds
code B;
w.hide();
} -
Tried the sleep(2000) but still the wait screen wont show up before code B gets executed.
-
sleep() will make the delay even longer.
In the future, please don't post the same question in different places. You already asked this at http://qt-project.org/forums/viewthread/38913/
-
Please give solution.
-
Solution at http://qt-project.org/forums/viewthread/38913/
-
Try threading if you want things in parallel.
or try timer .