From 94f249977c7a1249118cb26d74bd730caf710646 Mon Sep 17 00:00:00 2001 From: Sergiy Korobov Date: Wed, 30 May 2018 21:00:53 +0300 Subject: Fix QWindowsNativeInterface::platformFunction() QWindowsWindowFunctions::setWindowActivationBehavior() does not work because QWindowsNativeInterface::platformFunction() is broken. Task-number: QTBUG-37435 Task-number: QTBUG-14062 Change-Id: Id5688316654ea8ad47d5c68894c376cb83e3583a Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsnativeinterface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins') 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; -- cgit v1.2.3 From 0866fe20799cf1ad8295f7c156f8d55a3166e40b Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 29 May 2018 15:32:34 -0700 Subject: QMacStyle: Fix QComboBox left contents margin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I89a5e0c271bdaced8440e123c63c5435fa725856 Task-number: QTBUG-68518 Reviewed-by: Andy Shaw Reviewed-by: Morten Johan Sørvig --- src/plugins/styles/mac/qmacstyle_mac.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 95809906c1..21013dc76c 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: -- cgit v1.2.3 From 23ae05cf6801426daa01b2f3f278fce17b3b86ff Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 29 May 2018 18:47:30 -0700 Subject: QMacStyle: Fix clipped arrow in QToolButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A quick and reasonable fix is to make sure the arrow fits in SC_ToolButtonMenu returns. In the future, we should keep the arrow's actual size and offset the icon accordingly. Change-Id: I218fa7726efbe4576a72889c41685de87ac14ac1 Task-number: QTBUG-68517 Reviewed-by: Andy Shaw Reviewed-by: Morten Johan Sørvig --- src/plugins/styles/mac/qmacstyle_mac.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 21013dc76c..5999163c91 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -2826,7 +2826,8 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai #if QT_CONFIG(toolbutton) if (const QToolButton *tb = qobject_cast(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(opt)) + if (tb->features & QStyleOptionToolButton::Menu) + sz.rwidth() += toolButtonArrowMargin; return sz; case CT_ComboBox: if (const auto *cb = qstyleoption_cast(opt)) { -- cgit v1.2.3 From 7b797982751dad3a448037ae99c4c8967529dddc Mon Sep 17 00:00:00 2001 From: Sergiy Korobov Date: Tue, 5 Jun 2018 14:27:52 +0300 Subject: Fix QWindowsWindow::requestActivateWindow() QWindowsWindow::requestActivateWindow() does not work correct if QWindowsWindowFunctions::AlwaysActivateWindow is passed as a parameter to QWindowsWindowFunctions::setWindowActivationBehavior(). When the calling process is not the active process, only the taskbar entry is flashed. It is not correct. The window should be always activated, even when the calling process is not the active process. Task-number: QTBUG-37435 Task-number: QTBUG-14062 Change-Id: I7a321d7bac744a7776278210b1b5a2fd4288aa43 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins') 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); -- cgit v1.2.3 From 6108d8f515d7911427b764647f1d6ab487ad5203 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 18 May 2018 14:05:56 +0200 Subject: ibase: Silence warning about incompatible function types Task-number: QTBUG-68330 Change-Id: I1bb272ec647f9fb5f67f67f04600e51409ebd40a Reviewed-by: Simon Hausmann --- src/plugins/sqldrivers/ibase/qsql_ibase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins') 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(qEventCallback), #else - (isc_callback)qEventCallback, + reinterpret_cast(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(qEventCallback), #else - (isc_callback)qEventCallback, + reinterpret_cast(qEventCallback), #endif eBuffer->resultBuffer); if (Q_UNLIKELY(status[0] == 1 && status[1])) { -- cgit v1.2.3