qml: Remove QWidget'isms from DockWidgetBase

This commit is contained in:
Sergio Martins
2020-07-26 16:07:36 +01:00
parent fab0c5f8f8
commit e9131897e4
3 changed files with 14 additions and 2 deletions

View File

@@ -389,7 +389,7 @@ void DockWidgetBase::show()
// This reduces flickering on some platforms
morphIntoFloatingWindow();
} else {
QWidget::show();
QWidgetOrQuick::show();
}
}
@@ -624,7 +624,7 @@ void DockWidgetBase::Private::maybeRestoreToPreviousPosition()
Frame *frame = q->frame();
if (frame && frame->QWidget::parentWidget() == DockRegistry::self()->layoutForItem(layoutItem)) {
if (frame && frame->QWidgetAdapter::parentWidget() == DockRegistry::self()->layoutForItem(layoutItem)) {
// There's a frame already. Means the DockWidget was hidden instead of closed.
// Nothing to do, the dock widget will simply be shown
qCDebug(placeholder) << Q_FUNC_INFO << "Already had frame.";

View File

@@ -147,6 +147,16 @@ void QWidgetAdapter::setParent(QQuickItem *p)
QQuickItem::setParentItem(p);
}
void QWidgetAdapter::activateWindow()
{
qWarning() << Q_FUNC_INFO << "Implement me";
}
void QWidgetAdapter::setSizePolicy(QSizePolicy)
{
qWarning() << Q_FUNC_INFO << "Implement me";
}
void QWidgetAdapter::setFlag(Qt::WindowType f, bool on)
{
if (auto w = windowHandle()) {

View File

@@ -111,6 +111,8 @@ public:
void move(int x, int y);
void setParent(QQuickItem*);
void activateWindow();
void setSizePolicy(QSizePolicy);
protected:
void raiseAndActivate();