Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev

bb10
Thiago Macieira 2018-03-17 16:02:26 +00:00 committed by The Qt Project
commit 833a9fa9da
7 changed files with 24 additions and 15 deletions

View File

@ -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 == '.') {

View File

@ -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<QGtk3MenuItem *>(const_cast<QPlatformMenuItem *>(item)));
if (index != -1)
gtk_menu_set_active(GTK_MENU(m_menu), index);
const QGtk3MenuItem *menuItem = static_cast<const QGtk3MenuItem *>(item);
if (menuItem)
gtk_menu_shell_select_item(GTK_MENU_SHELL(m_menu), menuItem->handle());
m_targetPos = QPoint(targetRect.x(), targetRect.y() + targetRect.height());

View File

@ -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<qreal>(penWidth, 0.13 * rect.height());
penWidth = qMin<qreal>(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<int>(menuItem->rect.height() * 0.79,
qMax<int>(menuItem->maxIconWidth, dpiScaled(21))); // icon checkbox's highlight column width
if (
#if QT_CONFIG(combobox)
qobject_cast<const QComboBox*>(widget) ||

View File

@ -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);

View File

@ -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()
*/

View File

@ -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

View File

@ -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