Hi,
i am writing a program which calculates the irradiation dose for cancer treatment. This can take some time, so my idea was, to show up a simple dialog with a progress-bar in it. I dont know really how to do it because when the dialog is started, the program stops as long it is opened.
I like to implement such an interface:
class ProgressDialog
: public QWidget {public:
signalProgress(); //the bar should move a bit to right
setTotalProgress(int); //maxValue of progress bar
}
class ProgressDialog : public QWidget {
public:
signalProgress(); //the bar should move a bit to right
setTotalProgress(int); //maxValue of progress bar
}
To copy to clipboard, switch view to plain text mode
My programm is a console program actually. I dont want to do all the calulation stuff in a window. So - how should i implement the main() function. My idea was like following, but this won't work:
void doComplicatedStuff(ProgressDialog& pd){
while(calculating){
someCalculation;
pd.signalProgress();
}
}
main(argc,argv){
ProgressDialog pd;
pd.show();
doComplicatedStuff(pd);//no dialog visible
return a.exec(); //here, the dialog pops up - swapping last lines is no solution
}
void doComplicatedStuff(ProgressDialog& pd){
while(calculating){
someCalculation;
pd.signalProgress();
}
}
main(argc,argv){
QApplication a(argc,argv);
ProgressDialog pd;
pd.show();
doComplicatedStuff(pd);//no dialog visible
return a.exec(); //here, the dialog pops up - swapping last lines is no solution
}
To copy to clipboard, switch view to plain text mode
So what can i do instead? I hope, you can help me.
Thanks! Thanks! Thanks!
Cheers
Bookmarks