-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
4.5.3
-
None
QMainWindow::restoreState() should return false and don't do anything if the structure of the QMainWindow does not match the state.
It is not the case, QMainWindow::restoreState() returns true, and the QMainWindow is in a partially restored state. This can leads to crashes when the QMainWindow is modified after QMainWindow::restoreState().
Here is a test case for this issue:
#include <QtTest/QtTest>
#include <QtGui>
class Test : public QObject{
Q_OBJECT
private slots:
void restoreStateFailIfNotMatch() {
const QRect geometry(30, 40, 50, 60);
QByteArray state;
}
};
QTEST_MAIN(Test)
#include "test.moc"