You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

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.