You are not logged in.

1

Monday, March 2nd 2009, 1:47pm

QInputDialog closes Application

Hi everyone,

I try to set the interval of a timer to fire it's event via a QInputDialog so the user has some control over the number of notifications he/she gets.

Source code

1
2
3
4
5
6
bool ok;

	int interval = QInputDialog::getInteger(this, "Set Interval Of Messages", "Enter the number of notifications you would like to receive in a day", 1, 1, 10, 1, &ok);
	
	if(ok)
		timer->setInterval(timer->interval() + 1000);


after this code runs, the inputdialog closes and so does the application!

"this" is a QWidget containing a QSystemTrayIcon.

i hope anyone can help me!

thanks

2

Monday, March 2nd 2009, 2:33pm

Hello.
No buildable code.
If you close all your windows (QInputDialog. It could be guessed - application "goes" to tray. Or it is "tray" application) then QApplication will exit the event loop by default.
http://doc.trolltech.com/4.4/qapplicatio…ndowClosed-prop
Fighting fire with fire.
Three can keep a secret if two of them are dead.