diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qinputmethod.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 31 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 18 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.h | 2 |
5 files changed, 38 insertions, 26 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 6a473b3836..6fa974829f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -194,9 +194,6 @@ extern void qRegisterGuiVariant(); #ifndef QT_NO_ANIMATION extern void qRegisterGuiGetInterpolator(); #endif -extern void qInitBlendFunctions(); -extern void qInitDrawhelperAsm(); -extern void qInitImageConversions(); static bool qt_detectRTLLanguage() { @@ -1359,13 +1356,6 @@ void QGuiApplicationPrivate::init() if (platform_integration == 0) createPlatformIntegration(); - // Set up blend function tables. - qInitBlendFunctions(); - // Set up which span functions should be used in raster engine... - qInitDrawhelperAsm(); - // and QImage conversion functions - qInitImageConversions(); - initPalette(); QFont::initialize(); diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp index 8d51be853a..2684c43518 100644 --- a/src/gui/kernel/qinputmethod.cpp +++ b/src/gui/kernel/qinputmethod.cpp @@ -147,6 +147,9 @@ QRectF QInputMethod::cursorRectangle() const /*! \property QInputMethod::keyboardRectangle \brief Virtual keyboard's geometry in window coordinates. + + This might be an empty rectangle if it is not possible to know the geometry + of the keyboard. This is the case for a floating keyboard on android. */ QRectF QInputMethod::keyboardRectangle() const { diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 8757715c0d..aea029b7f5 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -581,6 +581,9 @@ void QPlatformWindow::invalidateSurface() QRect QPlatformWindow::initialGeometry(const QWindow *w, const QRect &initialGeometry, int defaultWidth, int defaultHeight) { + const QScreen *screen = effectiveScreen(w); + if (!screen) + return initialGeometry; QRect rect(QHighDpi::fromNativePixels(initialGeometry, w)); if (rect.width() == 0) { const int minWidth = w->minimumWidth(); @@ -591,25 +594,23 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, rect.setHeight(minHeight > 0 ? minHeight : defaultHeight); } if (w->isTopLevel() && qt_window_private(const_cast<QWindow*>(w))->positionAutomatic - && w->type() != Qt::Popup) { - if (const QScreen *screen = effectiveScreen(w)) { - const QRect availableGeometry = screen->availableGeometry(); - // Center unless the geometry ( + unknown window frame) is too large for the screen). - if (rect.height() < (availableGeometry.height() * 8) / 9 + && w->type() != Qt::Popup) { + const QRect availableGeometry = screen->availableGeometry(); + // Center unless the geometry ( + unknown window frame) is too large for the screen). + if (rect.height() < (availableGeometry.height() * 8) / 9 && rect.width() < (availableGeometry.width() * 8) / 9) { - const QWindow *tp = w->transientParent(); - if (tp) { - // A transient window should be centered w.r.t. its transient parent. - rect.moveCenter(tp->geometry().center()); - } else { - // Center the window on the screen. (Only applicable on platforms - // which do not provide a better way.) - rect.moveCenter(availableGeometry.center()); - } + const QWindow *tp = w->transientParent(); + if (tp) { + // A transient window should be centered w.r.t. its transient parent. + rect.moveCenter(tp->geometry().center()); + } else { + // Center the window on the screen. (Only applicable on platforms + // which do not provide a better way.) + rect.moveCenter(availableGeometry.center()); } } } - return QHighDpi::toNativePixels(rect, w); + return QHighDpi::toNativePixels(rect, screen); } /*! diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 0ecd2e12e8..eea26c05ed 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -325,7 +325,7 @@ int QStyleHints::cursorFlashTime() const \note The platform may still choose to show certain windows non-fullscreen, such as popups or dialogs. This property only reports the default behavior. - \sa QWindow::show() + \sa QWindow::show(), showIsMaximized() */ bool QStyleHints::showIsFullScreen() const { @@ -333,6 +333,22 @@ bool QStyleHints::showIsFullScreen() const } /*! + \property QStyleHints::showIsMaximized + \brief \c true if the platform defaults to windows being maximized, + otherwise \c false. + + \note The platform may still choose to show certain windows non-maximized, + such as popups or dialogs. This property only reports the default behavior. + + \sa QWindow::show(), showIsFullScreen() + \since 5.6 +*/ +bool QStyleHints::showIsMaximized() const +{ + return hint(QPlatformIntegration::ShowIsMaximized).toBool(); +} + +/*! \property QStyleHints::passwordMaskDelay \brief the time, in milliseconds, a typed letter is displayed unshrouded in a text input field in password mode. diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h index 5762482f35..7c46eaa746 100644 --- a/src/gui/kernel/qstylehints.h +++ b/src/gui/kernel/qstylehints.h @@ -56,6 +56,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject Q_PROPERTY(int passwordMaskDelay READ passwordMaskDelay STORED false CONSTANT FINAL) Q_PROPERTY(bool setFocusOnTouchRelease READ setFocusOnTouchRelease STORED false CONSTANT FINAL) Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen STORED false CONSTANT FINAL) + Q_PROPERTY(bool showIsMaximized READ showIsMaximized STORED false CONSTANT FINAL) Q_PROPERTY(int startDragDistance READ startDragDistance NOTIFY startDragDistanceChanged FINAL) Q_PROPERTY(int startDragTime READ startDragTime NOTIFY startDragTimeChanged FINAL) Q_PROPERTY(int startDragVelocity READ startDragVelocity STORED false CONSTANT FINAL) @@ -79,6 +80,7 @@ public: void setCursorFlashTime(int cursorFlashTime); int cursorFlashTime() const; bool showIsFullScreen() const; + bool showIsMaximized() const; int passwordMaskDelay() const; QChar passwordMaskCharacter() const; qreal fontSmoothingGamma() const; |