From f7630bcc510861811cc7f2cb6656b4683c3c26c4 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 14 Mar 2018 09:37:47 +0100 Subject: [PATCH 1/7] Revert "Blacklist tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109 on windows ci" This reverts commit a0db55040d21d17b1bba2ab406cb51c0f3a671aa. After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10 (msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The failure is gone. Task-number: QTBUG-66756 Change-Id: I4a8e8c62b4a021d144d570c38c4f4c10e8b1317c Reviewed-by: Friedemann Kleint --- tests/auto/gui/kernel/qwindow/BLACKLIST | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index 734e928f7d..ac021eaf4b 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -13,7 +13,6 @@ opensuse [modalWindowEnterEventOnHide_QTBUG35109] ubuntu-16.04 osx ci -windows ci [modalDialogClosingOneOfTwoModal] osx [modalWindowModallity] From 8edc08ef78202f42f373efc6f0814744b01eac9a Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 14 Mar 2018 09:40:13 +0100 Subject: [PATCH 2/7] Revert "Blacklist tst_QWindow::testInputEvents on Windows" This reverts commit fdddb3a4814f588e3ee87a6c1a0a6791f6ef0298. After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10 (msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The failure is gone. Task-number: QTBUG-66798 Task-number: QTBUG-66216 Change-Id: Iba353b18b0be1346007fde674a9f768c4b9bf384 Reviewed-by: Friedemann Kleint --- tests/auto/gui/kernel/qwindow/BLACKLIST | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index ac021eaf4b..e55bf77403 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -23,5 +23,3 @@ osx-10.12 ci [testInputEvents] rhel-7.4 -# QTBUG-66798 -windows From 53f82185e9320e0561d5a424d7145aadc18cca30 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Wed, 14 Mar 2018 02:57:42 +0300 Subject: [PATCH 3/7] QFusionStyle: Fix compilation when qreal is float Change-Id: I575d348915a7239a40b589012b4e9707bd15d1dd Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/styles/qfusionstyle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 6873ca876e..0c6825cb36 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -778,8 +778,8 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, } else if (checkbox->state & State_On) { qreal penWidth = QStyleHelper::dpiScaled(1.5); - penWidth = qMax(penWidth , 0.13 * rect.height()); - penWidth = qMin(penWidth , 0.20 * rect.height()); + penWidth = qMax(penWidth, 0.13 * rect.height()); + penWidth = qMin(penWidth, 0.20 * rect.height()); QPen checkPen = QPen(checkMarkColor, penWidth); checkMarkColor.setAlpha(210); painter->translate(dpiScaled(-0.8), dpiScaled(0.5)); @@ -1562,8 +1562,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio bool ignoreCheckMark = false; const int checkColHOffset = windowsItemHMargin + windowsItemFrame - 1; - int checkcol = qMax(menuItem->rect.height() * 0.79, - qMax(menuItem->maxIconWidth * 1.0, dpiScaled(21))); // icon checkbox's highlihgt column width + int checkcol = qMax(menuItem->rect.height() * 0.79, + qMax(menuItem->maxIconWidth, dpiScaled(21))); // icon checkbox's highlight column width if ( #if QT_CONFIG(combobox) qobject_cast(widget) || From 2fb706f9a842474e534e7c6e2915d9096f5a10d1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 14 Mar 2018 12:13:55 -0700 Subject: [PATCH 4/7] QIpAddress: reject IPv6 addresses with more than 4 hex digits Matches glibc commit 9a0cc8c1bd7645bf3c988890ffb59639c07a5812. [ChangeLog][QtCore][QUrl] Fixed a bug in parsing IPv6 addresses with more than 4 hex digits in a component. [ChangeLog][QtNetwork][QHostAddress] Fixed a bug in parsing IPv6 addresses with more than 4 hex digits in a component. [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9a0cc8c1bd7645bf3c988890ffb59639c07a5812 Change-Id: I2701038131d91eb108aebb3bec16278e4efe3de2 Reviewed-by: Timur Pocheptsov --- src/corelib/io/qipaddress.cpp | 5 ++++- tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp index 02b12f635a..039e291b43 100644 --- a/src/corelib/io/qipaddress.cpp +++ b/src/corelib/io/qipaddress.cpp @@ -216,7 +216,10 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end quint64 ll = qstrtoull(ptr, &endptr, 16, &ok); quint16 x = ll; - if (!ok || ll != x) + // Reject malformed fields: + // - failed to parse + // - too many hex digits + if (!ok || endptr > ptr + 4) return begin + (ptr - buffer.data()); if (*endptr == '.') { diff --git a/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp b/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp index ba5e9eaaa1..d41efa18f5 100644 --- a/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp +++ b/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp @@ -288,9 +288,6 @@ void tst_QIpAddress::parseIp6_data() << "ffee:ddcc:bbaa:9988:7766:5544:3322:1100" << Ip6(0xffee, 0xddcc, 0xbbaa, 0x9988, 0x7766, 0x5544, 0x3322, 0x1100); - // too many zeroes - QTest::newRow("0:0:0:0:0:0:0:00103") << "0:0:0:0:0:0:0:00103" << Ip6(0,0,0,0,0,0,0,0x103); - // double-colon QTest::newRow("::1:2:3:4:5:6:7") << "::1:2:3:4:5:6:7" << Ip6(0,1,2,3,4,5,6,7); QTest::newRow("1:2:3:4:5:6:7::") << "1:2:3:4:5:6:7::" << Ip6(1,2,3,4,5,6,7,0); @@ -382,6 +379,9 @@ void tst_QIpAddress::invalidParseIp6_data() // too big number QTest::newRow("0:0:0:0:0:0:0:10103") << "0:0:0:0:0:0:0:10103"; + // too many zeroes + QTest::newRow("0:0:0:0:0:0:0:00103") << "0:0:0:0:0:0:0:00103"; + // too short QTest::newRow("0:0:0:0:0:0:0:") << "0:0:0:0:0:0:0:"; QTest::newRow("0:0:0:0:0:0:0") << "0:0:0:0:0:0:0"; @@ -438,6 +438,8 @@ void tst_QIpAddress::invalidParseIp6() #if defined(__GLIBC__) && defined(AF_INET6) Ip6 inet_result; bool inet_ok = inet_pton(AF_INET6, address.toLatin1(), &inet_result.u8); + if (__GLIBC_MINOR__ < 26) + QEXPECT_FAIL("0:0:0:0:0:0:0:00103", "Bug fixed in glibc 2.26", Continue); QVERIFY(!inet_ok); #endif From 0c059db57d47cb20bf069fce3e444f9eb8e9f33c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 13 Mar 2018 19:43:15 -0700 Subject: [PATCH 5/7] QMenu: Realign submenu first action with its parent menu action There was an offset equivalent to all the margins we add to the action rectangles. We need to subtract it in order for both menu items, parent and sub-menu, to be aligned. This amount is given by the sub-menu's first action position relative to its popup. Change-Id: I141bbe3cfb81825a25b12e4059b93e61c29df518 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qmenu.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 024f9a75a1..363647aee0 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -3641,6 +3641,13 @@ void QMenu::internalDelayedPopup() if (subMenuPos.x() > screen.right()) subMenuPos.setX(QCursor::pos().x()); + const auto &subMenuActions = d->activeMenu->actions(); + if (!subMenuActions.isEmpty()) { + // Offset by the submenu's 1st action position to align with the current action + const auto subMenuActionRect = d->activeMenu->actionGeometry(subMenuActions.first()); + subMenuPos.ry() -= subMenuActionRect.top(); + } + d->activeMenu->popup(subMenuPos); d->sloppyState.setSubMenuPopup(actionRect, d->currentAction, d->activeMenu); From f371b1cc8d0683e4e42194c8049f9523e58129f9 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Wed, 14 Mar 2018 21:56:14 +0100 Subject: [PATCH 6/7] QDomNode::replaceChild(): Fix documentation typo Change-Id: Ib530ebc926aa2c6779b0e02878f92664022b6bcf Reviewed-by: Giuseppe D'Angelo --- src/xml/dom/qdom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index df2d7c3ce8..17f87804e9 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -2544,7 +2544,7 @@ QDomNode QDomNode::insertAfter(const QDomNode& newChild, const QDomNode& refChil If \a newChild is a QDomDocumentFragment, then \a oldChild is replaced by all of the children of the fragment. - Returns a new reference to \a oldChild on success or a \l{isNull()}{null node} an failure. + Returns a new reference to \a oldChild on success or a \l{isNull()}{null node} on failure. \sa insertBefore(), insertAfter(), removeChild(), appendChild() */ From 23fd4f7171ce0d509f59f42a9881de53f85644e7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 2 Feb 2018 13:43:46 +0100 Subject: [PATCH 7/7] QGtk3Menu::showPopup(): fix target item selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a target item was passed, QGtk3Menu tried using gtk_menu_set_active() to select the target item. However, the function does not do what you'd imagine. Even the documentation states: This is used by the GtkComboBox and should not be used by anyone else. The correct function, gtk_menu_shell_select_item(), is in the GtkMenuShell "base class". Change-Id: Ia2c03f87bb97f618c041c03011af8c676108aea5 Reviewed-by: Dmitry Shachnev Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Mitch Curtis --- src/plugins/platformthemes/gtk3/qgtk3menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp index 1bbd463119..4f0bd9d9a0 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp @@ -426,9 +426,9 @@ QPoint QGtk3Menu::targetPos() const void QGtk3Menu::showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) { - int index = m_items.indexOf(static_cast(const_cast(item))); - if (index != -1) - gtk_menu_set_active(GTK_MENU(m_menu), index); + const QGtk3MenuItem *menuItem = static_cast(item); + if (menuItem) + gtk_menu_shell_select_item(GTK_MENU_SHELL(m_menu), menuItem->handle()); m_targetPos = QPoint(targetRect.x(), targetRect.y() + targetRect.height());