I have a problem with having an aboutToQuit() function.
// THIS IS INT MAIN()'s end.
int end = Qapp.exec();
QObject::connect(&Qapp,
SIGNAL(aboutToQuit
()), qwCoreWindow,
SLOT(almostQutting
()));
return end;
}
// declared thru CoreWindow as public slot
void CoreWindow::almostQuitting(){
switch (QMB2.exec()) {
break;
default:
break;
}
CP.SaveDefaultSettings(size(), pos());
}
// THIS IS INT MAIN()'s end.
int end = Qapp.exec();
QObject::connect(&Qapp, SIGNAL(aboutToQuit()), qwCoreWindow, SLOT(almostQutting()));
return end;
}
// declared thru CoreWindow as public slot
void CoreWindow::almostQuitting(){
QMessageBox QMB2(QMessageBox::NoIcon, "Help", "Saving to Registry "+
QString("size h: %1").arg(size().height())+QString("pos.x: %1").arg((long)pos().x()), QMessageBox::Ok);
switch (QMB2.exec()) {
case QMessageBox::Ok:
break;
default:
break;
}
CP.SaveDefaultSettings(size(), pos());
}
To copy to clipboard, switch view to plain text mode
I added the message box to see what changes. Because it wasn't saving the registry (SaveDefaultSettings).
I wanted to see if it remembered the QSize and QPoint (position) of the main window which is CoreWindow...
Any help is appreciated.
Bookmarks