Details
-
Bug
-
Resolution: Cannot Reproduce
-
P4: Low
-
4.4.3
-
None
Description
QMaindWindow::restoreGeometry() does not work correct if QMainWindow is maximized on secondary monitor.
This can be reproduced with following example on window vista.
#include <QtGui>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
QLabel *label = new QLabel("Please move the window position on second screen and maximiz and then close,Then restart the app", this);
label->setAlignment(Qt::AlignCenter);
setCentralWidget(label);
QSettings settings("MyCompany", "MyApp");
restoreGeometry(settings.value("Geometry/MainWindow").toByteArray());
}
void MainWindow::closeEvent(QCloseEvent *e)
{
QSettings settings("MyCompany", "MyApp");
settings.setValue("Geometry/MainWindow", saveGeometry());
QMainWindow::closeEvent(e);
}