tests: Fix createMainWindow having different behavior between frontends
This commit is contained in:
@@ -145,13 +145,17 @@ View *Platform_qtwidgets::tests_createNonClosableView(View *parent)
|
||||
}
|
||||
|
||||
Controllers::MainWindow *Platform_qtwidgets::createMainWindow(const QString &uniqueName,
|
||||
CreateViewOptions, MainWindowOptions options,
|
||||
CreateViewOptions opts, MainWindowOptions options,
|
||||
View *parent, Qt::WindowFlags flags) const
|
||||
{
|
||||
auto view = new Views::MainWindow_qtwidgets(uniqueName, options,
|
||||
parent ? static_cast<Views::View_qtwidgets<QMainWindow> *>(parent) : nullptr,
|
||||
flags);
|
||||
|
||||
if (opts.isVisible)
|
||||
view->show();
|
||||
view->resize(opts.size);
|
||||
|
||||
return view->mainWindow();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,13 +41,11 @@ KDDockWidgets::Tests::createMainWindow(QSize sz, KDDockWidgets::MainWindowOption
|
||||
const QString mainWindowName = name.isEmpty() ? QStringLiteral("MyMainWindow%1").arg(count)
|
||||
: name;
|
||||
Platform::CreateViewOptions viewOpts;
|
||||
viewOpts.isVisible = true;
|
||||
viewOpts.size = QSize(1000, 1000);
|
||||
viewOpts.isVisible = show;
|
||||
viewOpts.size = sz;
|
||||
auto ptr = std::unique_ptr<Controllers::MainWindow>(Platform::instance()->createMainWindow(mainWindowName,
|
||||
viewOpts, options));
|
||||
if (show)
|
||||
ptr->show();
|
||||
ptr->view()->resize(sz);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user