qtquick: Add a test to see that main window position is restored
Will improve it with QtQuick corner cases
This commit is contained in:
@@ -3356,6 +3356,24 @@ void TestDocks::tst_restoreNonClosable()
|
||||
}
|
||||
}
|
||||
|
||||
void TestDocks::tst_restoreRestoresMainWindowPosition()
|
||||
{
|
||||
// Tests that MainWindow position is restored by LayoutSaver
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
auto m = createMainWindow(QSize(800, 500), MainWindowOption_None);
|
||||
const QPoint originalPos = m->pos();
|
||||
|
||||
LayoutSaver saver;
|
||||
const QByteArray saved = saver.serializeLayout();
|
||||
|
||||
m->move(originalPos + QPoint(100, 100));
|
||||
|
||||
saver.restoreLayout(saved);
|
||||
QCOMPARE(originalPos, m->pos());
|
||||
}
|
||||
}
|
||||
|
||||
void TestDocks::tst_resizeViaAnchorsAfterPlaceholderCreation()
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
|
||||
@@ -113,6 +113,7 @@ private Q_SLOTS:
|
||||
void tst_restoreSimple();
|
||||
void tst_restoreSimplest();
|
||||
void tst_restoreNonClosable();
|
||||
void tst_restoreRestoresMainWindowPosition();
|
||||
void tst_invalidLayoutAfterRestore();
|
||||
void tst_dontCloseDockWidgetBeforeRestore();
|
||||
void tst_dontCloseDockWidgetBeforeRestore2();
|
||||
|
||||
Reference in New Issue
Block a user