diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:10:56 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:10:57 +0200 |
commit | fc5da399c3145621c5945d53dde7b37fa463c6e9 (patch) | |
tree | 8deec4c78b5add097ba7f2b1e371f27e3ae759c5 /src/plugins | |
parent | 225dcf355a95f272aaa7ac236c7274e254dca41c (diff) | |
parent | a14a943f9ac3d1e85514d7fb6688c84e624ac850 (diff) |
Merge 5.11 into 5.11.1
Change-Id: I28f48e980a9e23ddde5251608dd9d1d83df65392
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsnativeinterface.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 | ||||
-rw-r--r-- | src/plugins/sqldrivers/ibase/qsql_ibase.cpp | 8 | ||||
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 18 |
4 files changed, 26 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp index 324b00144e..ffa100f824 100644 --- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp +++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp @@ -278,6 +278,8 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun return QFunctionPointer(QWindowsWindow::setTouchWindowTouchTypeStatic); else if (function == QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()) return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic); + else if (function == QWindowsWindowFunctions::setWindowActivationBehaviorIdentifier()) + return QFunctionPointer(QWindowsNativeInterface::setWindowActivationBehavior); else if (function == QWindowsWindowFunctions::isTabletModeIdentifier()) return QFunctionPointer(QWindowsNativeInterface::isTabletMode); return nullptr; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a2883e2601..3909c64c53 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2201,6 +2201,15 @@ void QWindowsWindow::requestActivateWindow() foregroundThread = GetWindowThreadProcessId(foregroundWindow, NULL); if (foregroundThread && foregroundThread != currentThread) attached = AttachThreadInput(foregroundThread, currentThread, TRUE) == TRUE; + if (attached) { + if (!window()->flags().testFlag(Qt::WindowStaysOnBottomHint) + && !window()->flags().testFlag(Qt::WindowStaysOnTopHint) + && window()->type() != Qt::ToolTip) { + const UINT swpFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER; + SetWindowPos(m_data.hwnd, HWND_TOPMOST, 0, 0, 0, 0, swpFlags); + SetWindowPos(m_data.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, swpFlags); + } + } } } SetForegroundWindow(m_data.hwnd); diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp index 6fbdef2695..484dad6e1d 100644 --- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp +++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp @@ -1845,9 +1845,9 @@ bool QIBaseDriver::subscribeToNotification(const QString &name) eBuffer->bufferLength, eBuffer->eventBuffer, #if defined (FB_API_VER) && FB_API_VER >= 20 - (ISC_EVENT_CALLBACK)qEventCallback, + reinterpret_cast<ISC_EVENT_CALLBACK>(qEventCallback), #else - (isc_callback)qEventCallback, + reinterpret_cast<isc_callback>(qEventCallback), #endif eBuffer->resultBuffer); @@ -1925,9 +1925,9 @@ void QIBaseDriver::qHandleEventNotification(void *updatedResultBuffer) eBuffer->bufferLength, eBuffer->eventBuffer, #if defined (FB_API_VER) && FB_API_VER >= 20 - (ISC_EVENT_CALLBACK)qEventCallback, + reinterpret_cast<ISC_EVENT_CALLBACK>(qEventCallback), #else - (isc_callback)qEventCallback, + reinterpret_cast<isc_callback>(qEventCallback), #endif eBuffer->resultBuffer); if (Q_UNLIKELY(status[0] == 1 && status[1])) { diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 95809906c1..5999163c91 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -1675,13 +1675,13 @@ QRectF QMacStylePrivate::comboboxEditBounds(const QRectF &outerBounds, const Coc } else if (cw.type == Button_PopupButton) { switch (cw.size) { case QStyleHelper::SizeLarge: - ret.adjust(14, 1, -23, -4); + ret.adjust(10, 1, -23, -4); break; case QStyleHelper::SizeSmall: - ret.adjust(13, 4, -20, -3); + ret.adjust(10, 4, -20, -3); break; case QStyleHelper::SizeMini: - ret.adjust(12, 0, -19, 0); + ret.adjust(9, 0, -19, 0); ret.setHeight(13); break; default: @@ -2826,7 +2826,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai #if QT_CONFIG(toolbutton) if (const QToolButton *tb = qobject_cast<const QToolButton *>(w)) { // When stroking the arrow, make sure it fits in the tool button - if (tb->arrowType() != Qt::NoArrow) + if (tb->arrowType() != Qt::NoArrow + || tb->popupMode() == QToolButton::MenuButtonPopup) halfSize -= penWidth; } #endif @@ -5865,11 +5866,11 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op #endif case CC_ToolButton: ret = QCommonStyle::subControlRect(cc, opt, sc, widget); - if (sc == SC_ToolButtonMenu + if (sc == SC_ToolButtonMenu) { #ifndef QT_NO_ACCESSIBILITY - && !QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar) + if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) + ret.adjust(-toolButtonArrowMargin, 0, 0, 0); #endif - ) { ret.adjust(-1, 0, 0, 0); } break; @@ -6107,6 +6108,9 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, case CT_ToolButton: sz.rwidth() += 10; sz.rheight() += 10; + if (const auto *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) + if (tb->features & QStyleOptionToolButton::Menu) + sz.rwidth() += toolButtonArrowMargin; return sz; case CT_ComboBox: if (const auto *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { |