Remove View::isWindow(), use isRootView() instead.
QWidget::isWindow() is misnamed in Qt, it's an artifact from Qt4 times.
This commit is contained in:
@@ -589,7 +589,7 @@ void LayoutSaver::Private::deserializeWindowGeometry(const T &saved, View *topLe
|
||||
|
||||
Controllers::FloatingWindow::ensureRectIsOnScreen(geometry);
|
||||
|
||||
if (topLevel->isWindow()) {
|
||||
if (topLevel->isRootView()) {
|
||||
topLevel->setGeometry(geometry);
|
||||
} else {
|
||||
// TODOv2: Have a WindowView abstraction, that will represent QWindow for Qt.
|
||||
|
||||
@@ -139,10 +139,6 @@ public:
|
||||
virtual void raise() = 0;
|
||||
virtual void activateWindow() = 0;
|
||||
virtual bool isRootView() const = 0;
|
||||
bool isWindow() const
|
||||
{
|
||||
return isRootView();
|
||||
};
|
||||
virtual QPoint mapToGlobal(QPoint) const = 0;
|
||||
virtual QPoint mapFromGlobal(QPoint) const = 0;
|
||||
virtual QPoint mapTo(View *, QPoint) const = 0;
|
||||
|
||||
@@ -102,7 +102,7 @@ void DockWidget::addDockWidgetAsTab(DockWidget *other, InitialOption option)
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (view()->isWindow()) {
|
||||
if (view()->isRootView()) {
|
||||
// Doesn't have a frame yet
|
||||
d->morphIntoFloatingWindow();
|
||||
frame = d->frame();
|
||||
@@ -139,7 +139,7 @@ void DockWidget::addDockWidgetToContainingWindow(DockWidget *other,
|
||||
return;
|
||||
}
|
||||
|
||||
if (view()->isWindow())
|
||||
if (view()->isRootView())
|
||||
d->morphIntoFloatingWindow();
|
||||
|
||||
if (auto fw = floatingWindow()) {
|
||||
@@ -529,7 +529,7 @@ Controllers::FloatingWindow *DockWidget::Private::morphIntoFloatingWindow()
|
||||
if (auto fw = floatingWindow())
|
||||
return fw; // Nothing to do
|
||||
|
||||
if (q->view()->isWindow()) {
|
||||
if (q->view()->isRootView()) {
|
||||
QRect geo = m_lastPosition->lastFloatingGeometry();
|
||||
if (geo.isNull()) {
|
||||
geo = q->geometry();
|
||||
@@ -557,7 +557,7 @@ Controllers::FloatingWindow *DockWidget::Private::morphIntoFloatingWindow()
|
||||
|
||||
void DockWidget::Private::maybeMorphIntoFloatingWindow()
|
||||
{
|
||||
if (q->view()->isWindow() && q->isVisible())
|
||||
if (q->view()->isRootView() && q->isVisible())
|
||||
morphIntoFloatingWindow();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
MainWindow *mainWindow() const
|
||||
{
|
||||
if (q->view()->isWindow())
|
||||
if (q->view()->isRootView())
|
||||
return nullptr;
|
||||
|
||||
// Note: Don't simply use window(), as the MainWindow might be embedded into something else
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
if (auto mw = p->asMainWindowController())
|
||||
return mw;
|
||||
|
||||
if (p->isWindow())
|
||||
if (p->isRootView())
|
||||
return nullptr;
|
||||
|
||||
p = p->parentView();
|
||||
|
||||
@@ -280,7 +280,7 @@ inline QRect globalGeometry(QQuickItem *item)
|
||||
inline QRect globalGeometry(View *w)
|
||||
{
|
||||
QRect geo = w->geometry();
|
||||
if (!w->isWindow())
|
||||
if (!w->isRootView())
|
||||
geo.moveTopLeft(w->mapToGlobal(QPoint(0, 0)));
|
||||
return geo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user