summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-28 19:30:32 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-01-28 19:30:32 +0000
commite3621dd6bd32a64e602ae87711c24d6aae2989b5 (patch)
treec4539c9aa6b1a4b9a4e88ef5caef4bd3e29c7b41 /src/gui/kernel
parent71cd5a6f3643a5369b883d0e36478693de6db024 (diff)
parent980567b3a32b2e2f00c86f2d627cd82b5230dd0f (diff)
Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp9
-rw-r--r--src/gui/kernel/qplatformwindow.h2
-rw-r--r--src/gui/kernel/qtestsupport_gui.cpp10
-rw-r--r--src/gui/kernel/qwindow.cpp3
4 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index a455aa639d..22e46e0851 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -313,9 +313,12 @@ void QHighDpiScaling::updateHighDpiScaling()
}
m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
- QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle();
- qreal sf = screenSubfactor(primaryScreen);
- QDpi primaryDpi = primaryScreen->logicalDpi();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ if (!primaryScreen)
+ return;
+ QPlatformScreen *platformScreen = primaryScreen->handle();
+ qreal sf = screenSubfactor(platformScreen);
+ QDpi primaryDpi = platformScreen->logicalDpi();
m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);
}
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 995ccad70e..4d48cc2f13 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -110,7 +110,7 @@ public:
virtual bool isActive() const;
virtual bool isAncestorOf(const QPlatformWindow *child) const;
virtual bool isEmbedded() const;
- virtual bool isForeignWindow() const { return window()->type() == Qt::ForeignWindow; };
+ virtual bool isForeignWindow() const { return false; };
virtual QPoint mapToGlobal(const QPoint &pos) const;
virtual QPoint mapFromGlobal(const QPoint &pos) const;
diff --git a/src/gui/kernel/qtestsupport_gui.cpp b/src/gui/kernel/qtestsupport_gui.cpp
index 56e0eb52b3..8a6f662274 100644
--- a/src/gui/kernel/qtestsupport_gui.cpp
+++ b/src/gui/kernel/qtestsupport_gui.cpp
@@ -44,23 +44,21 @@
QT_BEGIN_NAMESPACE
-/*! \fn bool qWaitForWindowActive(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is active.
Returns \c true if \c window is active within \a timeout milliseconds, otherwise returns \c false.
- \sa QTest::qWaitForWindowExposed(), QWindow::isActive()
+ \sa qWaitForWindowExposed(), QWindow::isActive()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
{
return QTest::qWaitFor([&]() { return window->isActive(); }, timeout);
}
-/*! \fn bool qWaitForWindowExposed(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is exposed.
@@ -73,7 +71,7 @@ Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
area is completely covered by other windows, or if the window is otherwise not visible. This function
will then time out when waiting for such a window.
- \sa QTest::qWaitForWindowActive(), QWindow::isExposed()
+ \sa qWaitForWindowActive(), QWindow::isExposed()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowExposed(QWindow *window, int timeout)
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index c85f6a118d..0b833cfbc7 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -919,8 +919,7 @@ void QWindow::setFlag(Qt::WindowType flag, bool on)
*/
Qt::WindowType QWindow::type() const
{
- Q_D(const QWindow);
- return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
+ return static_cast<Qt::WindowType>(int(flags() & Qt::WindowType_Mask));
}
/*!