Remove last usage of QWidgetOrQuick type
This commit is contained in:
@@ -10,10 +10,3 @@
|
||||
*/
|
||||
|
||||
#include "../../KDDockWidgets.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace KDDockWidgets {
|
||||
// TODO remove
|
||||
using QWidgetOrQuick = QWidget;
|
||||
}
|
||||
|
||||
@@ -741,7 +741,7 @@ bool DragController::eventFilter(QObject *o, QEvent *e)
|
||||
if (!me)
|
||||
return MinimalStateMachine::eventFilter(o, e);
|
||||
|
||||
auto w = qobject_cast<QWidgetOrQuick *>(o);
|
||||
auto w = qobject_cast<QWidget *>(o);
|
||||
if (!w)
|
||||
return MinimalStateMachine::eventFilter(o, e);
|
||||
|
||||
@@ -788,7 +788,7 @@ StateBase *DragController::activeState() const
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
static QWidgetOrQuick *qtTopLevelForHWND(HWND hwnd)
|
||||
static QWidget *qtTopLevelForHWND(HWND hwnd)
|
||||
{
|
||||
const QList<QWindow *> windows = qApp->topLevelWindows();
|
||||
for (QWindow *window : windows) {
|
||||
@@ -822,7 +822,7 @@ static QWidgetOrQuick *qtTopLevelForHWND(HWND hwnd)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static QRect topLevelGeometry(const QWidgetOrQuick *topLevel)
|
||||
static QRect topLevelGeometry(const QWidget *topLevel)
|
||||
{
|
||||
if (auto mainWindow = qobject_cast<const MainWindowBase *>(topLevel))
|
||||
return mainWindow->windowGeometry();
|
||||
|
||||
@@ -45,6 +45,33 @@ using namespace KDDockWidgets::Controllers;
|
||||
using namespace KDDockWidgets::Tests;
|
||||
using namespace Layouting;
|
||||
|
||||
inline Controllers::DockWidget *createDockWidget(const QString &name, QWidget *w,
|
||||
Controllers::DockWidget::Options options = {},
|
||||
Controllers::DockWidget::LayoutSaverOptions layoutSaverOptions = {},
|
||||
bool show = true,
|
||||
const QString &affinityName = {})
|
||||
{
|
||||
w->setFocusPolicy(Qt::StrongFocus);
|
||||
auto dock = new Controllers::DockWidget(name, options, layoutSaverOptions);
|
||||
dock->setAffinityName(affinityName);
|
||||
dock->setGuestView(std::shared_ptr<ViewWrapper>(new Views::ViewWrapper_qtwidgets(w)));
|
||||
dock->setObjectName(name);
|
||||
dock->view()->setGeometry(QRect(0, 0, 400, 400));
|
||||
if (show) {
|
||||
dock->show();
|
||||
dock->dptr()->morphIntoFloatingWindow();
|
||||
dock->view()->activateWindow();
|
||||
Q_ASSERT(dock->window());
|
||||
if (Platform::instance()->tests_waitForWindowActive(dock->view()->window(), 1000)) {
|
||||
return dock;
|
||||
}
|
||||
qWarning() << Q_FUNC_INFO << "Couldn't activate window";
|
||||
return nullptr;
|
||||
} else {
|
||||
return dock;
|
||||
}
|
||||
};
|
||||
|
||||
inline EmbeddedWindow *createEmbeddedMainWindow(QSize sz)
|
||||
{
|
||||
static int count = 0;
|
||||
|
||||
@@ -60,33 +60,6 @@ KDDockWidgets::Tests::createMainWindow(QSize sz, KDDockWidgets::MainWindowOption
|
||||
return ptr;
|
||||
}
|
||||
|
||||
Controllers::DockWidget *KDDockWidgets::Tests::createDockWidget(const QString &name, QWidgetOrQuick *w,
|
||||
Controllers::DockWidget::Options options,
|
||||
Controllers::DockWidget::LayoutSaverOptions layoutSaverOptions,
|
||||
bool show,
|
||||
const QString &affinityName)
|
||||
{
|
||||
w->setFocusPolicy(Qt::StrongFocus);
|
||||
auto dock = new Controllers::DockWidget(name, options, layoutSaverOptions);
|
||||
dock->setAffinityName(affinityName);
|
||||
dock->setGuestView(std::shared_ptr<ViewWrapper>(new Views::ViewWrapper_qtwidgets(w)));
|
||||
dock->setObjectName(name);
|
||||
dock->view()->setGeometry(QRect(0, 0, 400, 400));
|
||||
if (show) {
|
||||
dock->show();
|
||||
dock->dptr()->morphIntoFloatingWindow();
|
||||
dock->view()->activateWindow();
|
||||
Q_ASSERT(dock->window());
|
||||
if (Platform::instance()->tests_waitForWindowActive(dock->view()->window(), 1000)) {
|
||||
return dock;
|
||||
}
|
||||
qWarning() << Q_FUNC_INFO << "Couldn't activate window";
|
||||
return nullptr;
|
||||
} else {
|
||||
return dock;
|
||||
}
|
||||
};
|
||||
|
||||
Controllers::DockWidget *KDDockWidgets::Tests::createDockWidget(const QString &name, View *guest,
|
||||
Controllers::DockWidget::Options options,
|
||||
Controllers::DockWidget::LayoutSaverOptions layoutSaverOptions,
|
||||
|
||||
@@ -137,11 +137,6 @@ std::unique_ptr<Controllers::MainWindow> createMainWindow(QSize sz = { 1000, 100
|
||||
|
||||
std::unique_ptr<Controllers::MainWindow> createMainWindow(QVector<DockDescriptor> &docks);
|
||||
|
||||
Controllers::DockWidget *createDockWidget(const QString &name, QWidgetOrQuick *w,
|
||||
Controllers::DockWidget::Options options = {},
|
||||
Controllers::DockWidget::LayoutSaverOptions layoutSaverOptions = {},
|
||||
bool show = true, const QString &affinityName = {});
|
||||
|
||||
Controllers::DockWidget *createDockWidget(const QString &name, View *guest,
|
||||
Controllers::DockWidget::Options options = {},
|
||||
Controllers::DockWidget::LayoutSaverOptions layoutSaverOptions = {},
|
||||
|
||||
Reference in New Issue
Block a user