qt_quick: Enable tst_restoreCentralFrame too

Removes a warning from FrameQuick. It's benign.
For QtWidgets we also set a -1 tab index to clear
This commit is contained in:
Sergio Martins
2020-10-10 20:25:46 +01:00
parent a56e6d7fe8
commit 60a68817b6
3 changed files with 27 additions and 27 deletions

View File

@@ -80,6 +80,7 @@ private Q_SLOTS:
void tst_floatingWindowTitleBug();
void tst_resizeWindow_data();
void tst_resizeWindow();
void tst_restoreCentralFrame();
};
void TestCommon::tst_simple1()
@@ -442,6 +443,31 @@ void TestCommon::tst_resizeWindow()
delete fw2;
}
void TestCommon::tst_restoreCentralFrame()
{
EnsureTopLevelsDeleted e;
auto m = createMainWindow(QSize(800, 500));
auto layout = m->multiSplitter();
QCOMPARE(layout->count(), 1);
Item *item = m->dropArea()->centralFrame();
QVERIFY(item);
auto frame = static_cast<Frame *>(item->guestAsQObject());
QCOMPARE(frame->options(), FrameOption_IsCentralFrame | FrameOption_AlwaysShowsTabs);
QVERIFY(!frame->titleBar()->isVisible());
LayoutSaver saver;
QVERIFY(saver.saveToFile(QStringLiteral("layout_tst_restoreCentralFrame.json")));
QVERIFY(saver.restoreFromFile(QStringLiteral("layout_tst_restoreCentralFrame.json")));
QCOMPARE(layout->count(), 1);
item = m->dropArea()->centralFrame();
QVERIFY(item);
frame = static_cast<Frame *>(item->guestAsQObject());
QCOMPARE(frame->options(), FrameOption_IsCentralFrame | FrameOption_AlwaysShowsTabs);
QVERIFY(!frame->titleBar()->isVisible());
}
int main(int argc, char *argv[])
{
if (!qpaPassedAsArgument(argc, argv)) {