tests: Make createMainWindow return MainWindowBase
Instead of QMainWindow, so it works with qml too
This commit is contained in:
@@ -547,7 +547,7 @@ DockWidgetBase *createAndNestDockWidget(DropArea *dropArea, Frame *relativeTo, K
|
||||
return dock;
|
||||
}
|
||||
|
||||
std::unique_ptr<MainWindow> createSimpleNestedMainWindow(DockWidgetBase * *centralDock, DockWidgetBase * *leftDock, DockWidgetBase * *rightDock)
|
||||
std::unique_ptr<MainWindowBase> createSimpleNestedMainWindow(DockWidgetBase * *centralDock, DockWidgetBase * *leftDock, DockWidgetBase * *rightDock)
|
||||
{
|
||||
auto window = createMainWindow({900, 500});
|
||||
*centralDock = createDockWidget("centralDock", Qt::green);
|
||||
@@ -773,7 +773,7 @@ void TestDocks::tst_close()
|
||||
// 2. Test that closing the single frame of a main window doesn't close the main window itself
|
||||
{
|
||||
auto m = createMainWindow(QSize(800, 500), MainWindowOption_None); // Remove central frame
|
||||
QPointer<MainWindow> mainWindowPtr = m.get();
|
||||
QPointer<MainWindowBase> mainWindowPtr = m.get();
|
||||
dock1 = createDockWidget("hello", Qt::green);
|
||||
m->addDockWidget(dock1, Location_OnLeft);
|
||||
|
||||
@@ -786,7 +786,7 @@ void TestDocks::tst_close()
|
||||
// 2.1 Test closing the frame instead
|
||||
{
|
||||
auto m = createMainWindow(QSize(800, 500), MainWindowOption_None); // Remove central frame
|
||||
QPointer<MainWindow> mainWindowPtr = m.get();
|
||||
QPointer<MainWindowBase> mainWindowPtr = m.get();
|
||||
dock1 = createDockWidget("hello", Qt::green);
|
||||
m->addDockWidget(dock1, Location_OnLeft);
|
||||
|
||||
@@ -800,7 +800,7 @@ void TestDocks::tst_close()
|
||||
// 2.2 Repeat, but with a central frame
|
||||
{
|
||||
auto m = createMainWindow(QSize(800, 500));
|
||||
QPointer<MainWindow> mainWindowPtr = m.get();
|
||||
QPointer<MainWindowBase> mainWindowPtr = m.get();
|
||||
dock1 = createDockWidget("hello", Qt::green);
|
||||
m->addDockWidget(dock1, Location_OnLeft);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void NonClosableWidget::closeEvent(QCloseEvent *ev)
|
||||
}
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
std::unique_ptr<KDDockWidgets::MainWindow> KDDockWidgets::Tests::createMainWindow(QSize sz, KDDockWidgets::MainWindowOptions options, const QString &name)
|
||||
std::unique_ptr<KDDockWidgets::MainWindowBase> KDDockWidgets::Tests::createMainWindow(QSize sz, KDDockWidgets::MainWindowOptions options, const QString &name)
|
||||
{
|
||||
static int count = 0;
|
||||
count++;
|
||||
@@ -91,7 +91,7 @@ DockWidgetBase *KDDockWidgets::Tests::createDockWidget(const QString &name, QCol
|
||||
};
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
std::unique_ptr<MainWindow> KDDockWidgets::Tests::createMainWindow(QVector<DockDescriptor> &docks)
|
||||
std::unique_ptr<MainWindowBase> KDDockWidgets::Tests::createMainWindow(QVector<DockDescriptor> &docks)
|
||||
{
|
||||
static int count = 0;
|
||||
count++;
|
||||
|
||||
@@ -89,12 +89,12 @@ struct EnsureTopLevelsDeleted
|
||||
bool shouldBlacklistWarning(const QString &msg, const QString &category = {});
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
std::unique_ptr<KDDockWidgets::MainWindow> createMainWindow(QSize sz = {600, 600},
|
||||
std::unique_ptr<MainWindowBase> createMainWindow(QSize sz = {600, 600},
|
||||
KDDockWidgets::MainWindowOptions options = MainWindowOption_HasCentralFrame, const QString &name = {});
|
||||
|
||||
|
||||
|
||||
std::unique_ptr<KDDockWidgets::MainWindow> createMainWindow(QVector<DockDescriptor> &docks);
|
||||
std::unique_ptr<KDDockWidgets::MainWindowBase> createMainWindow(QVector<DockDescriptor> &docks);
|
||||
#endif
|
||||
KDDockWidgets::DockWidgetBase *createDockWidget(const QString &name, QWidgetOrQuick *w,
|
||||
DockWidgetBase::Options options = {}, bool show = true,
|
||||
|
||||
Reference in New Issue
Block a user