Better way restoring a window's geometry.
--HG-- branch : develop
This commit is contained in:
parent
1731637b7b
commit
00b0f4ec31
|
@ -1942,11 +1942,8 @@ QString MainWindow::strippedName(const QString &fullFileName)
|
|||
*/
|
||||
void MainWindow::ReadSettings()
|
||||
{
|
||||
QRect geomentry = VApplication::desktop()->availableGeometry(this);
|
||||
QPoint pos = qApp->getSettings()->value("pos", geomentry.topLeft()).toPoint();
|
||||
QSize size = qApp->getSettings()->value("size", geomentry.size()).toSize();
|
||||
resize(size);
|
||||
move(pos);
|
||||
restoreGeometry(qApp->getSettings()->value("geometry").toByteArray());
|
||||
restoreState(qApp->getSettings()->value("windowState").toByteArray());
|
||||
|
||||
// Scene antialiasing
|
||||
bool graphOutputValue = qApp->getSettings()->value("pattern/graphicalOutput", 1).toBool();
|
||||
|
@ -1969,8 +1966,8 @@ void MainWindow::ReadSettings()
|
|||
*/
|
||||
void MainWindow::WriteSettings()
|
||||
{
|
||||
qApp->getSettings()->setValue("pos", pos());
|
||||
qApp->getSettings()->setValue("size", size());
|
||||
qApp->getSettings()->setValue("geometry", saveGeometry());
|
||||
qApp->getSettings()->setValue("windowState", saveState());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user