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

Thursday, December 23rd 2010, 6:25pm

Create a thread to the one UI to be connected with the QCloseEvent of the Main UI

Ok, it is a bit complicated. I want my application to be restarted from a QDialog executed from the main UI. The way I have created the other UIs executed from my main application is the following:
1) Right Click in Forms->Qt->Qt Designer form Class
2) Edit the UI and add its header file into the mainwindow.cpp in order to be able to execute the dialog through there.
3) Execute the dialog using (e.g. if it is named 'preferences')

Source code

1
2
preferences *gamatos= new preferences(this);
gamatos->exec()

Well, what I want to do is to call the mainwindow's QCloseEvent from the preferences.cpp.
Actually, in the preferences.cpp I do the following:

Source code

1
system("/usr/bin/myapp&"); qApp->exit(0);

Which executes my app and the closes the current. It's a kind of a restart!
I want, when this restart is given, the closing window to pass through the QCloseEvent of the mainwindow.cpp in order to save some user entries.
I don't know how to create this thread which will go through the 2 forms(mainwindow and preferences)!

Please be a bit specific with your answer because I'm quite newbie. Thx in advance

2

Saturday, December 25th 2010, 4:04pm

I also need this... anyone?