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/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()); 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) || 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); 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() */ 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 diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index 734e928f7d..e55bf77403 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] @@ -24,5 +23,3 @@ osx-10.12 ci [testInputEvents] rhel-7.4 -# QTBUG-66798 -windows