From d0736e9d17d0b3ec2f7aa3f323a1edf70aa83e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 7 Nov 2017 15:03:32 +0100 Subject: [PATCH 1/3] Cocoa: Make High DPI drag cursor work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ide4bc50ab7173529a00fe60a04204bad0b3f275e Task-id: QTBUG-60769 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec9d25fff9..2e64204fb7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -2068,6 +2068,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin } else { NSImage *nsimage = qt_mac_create_nsimage(pixmapCursor); + nsimage.size = NSSizeFromCGSize((pixmapCursor.size() / pixmapCursor.devicePixelRatioF()).toCGSize()); nativeCursor = [[NSCursor alloc] initWithImage:nsimage hotSpot:NSZeroPoint]; [nsimage release]; } From 25b18fb241315ed314b6b67f4b97028e2a1e484a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 2 Nov 2017 17:46:35 +0100 Subject: [PATCH 2/3] Document interaction of style name and other style properties Setting style name to "Regular" and then setting bold to true, results in platform depending behavior, and should be avoided. Also removes comment about style name not working on Windows, it has been working since 5.8.0. Task-number: QTBUG-63792 Change-Id: Ie5be7215a673f5751dbeb6512df8ec7bfaef4d0a Reviewed-by: Leena Miettinen Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7f3ed3adaa..806ede88e2 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -727,11 +727,9 @@ void QFont::setFamily(const QString &family) /*! \since 4.8 - Returns the requested font style name, it will be used to match the + Returns the requested font style name. This can be used to match the font with irregular styles (that can't be normalized in other style - properties). It depends on system font support, thus only works for - \macos and X11 so far. On Windows irregular styles will be added - as separate font families so there is no need for this. + properties). \sa setFamily(), setStyle() */ @@ -744,7 +742,12 @@ QString QFont::styleName() const \since 4.8 Sets the style name of the font to \a styleName. When set, other style properties - like \l style() and \l weight() will be ignored for font matching. + like \l style() and \l weight() will be ignored for font matching, though they may be + simulated afterwards if supported by the platform's font engine. + + Due to the lower quality of artificially simulated styles, and the lack of full cross + platform support, it is not recommended to use matching by style name together with + matching by style properties \sa styleName() */ @@ -985,6 +988,10 @@ int QFont::pixelSize() const Sets the style() of the font to QFont::StyleItalic if \a enable is true; otherwise the style is set to QFont::StyleNormal. + \note If styleName() is set, this value may be ignored, or if supported + on the platform, the font may be rendered tilted instead of picking a + designed italic font-variant. + \sa italic(), QFontInfo */ @@ -1050,6 +1057,8 @@ int QFont::weight() const Sets the weight of the font to \a weight, using the scale defined by \l QFont::Weight enumeration. + \note If styleName() is set, this value may be ignored for font selection. + \sa weight(), QFontInfo */ void QFont::setWeight(int weight) @@ -1083,6 +1092,9 @@ void QFont::setWeight(int weight) For finer boldness control use setWeight(). + \note If styleName() is set, this value may be ignored, or if supported + on the platform, the font artificially embolded. + \sa bold(), setWeight() */ From 66bace390ba4c0d20f006f02dbcba45e30d08590 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 8 Nov 2017 16:18:31 +0100 Subject: [PATCH 3/3] tst_qnetworkreply::getFromUnreachableIp - fix win64 also MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looking at the failures in grafana it appears this test is also failing on Windows 64. The same fix applies then, and we use Q_OS_WIN now. Change-Id: Iafcfd6d1e747f3c816878cad072fbfae3aee19ca Reviewed-by: Mårten Nordheim Reviewed-by: Edward Welbourne --- .../auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index b86750a900..3a752c0748 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -6766,9 +6766,9 @@ void tst_QNetworkReply::getFromUnreachableIp() { QNetworkAccessManager manager; -#ifdef Q_OS_WIN32 +#ifdef Q_OS_WIN // This test assumes that attempt to connect to 255.255.255.255 fails more - // or less fast/immediately. This is not what we observe on Windows x86: + // or less fast/immediately. This is not what we observe on Windows: // WSAConnect on non-blocking socket returns SOCKET_ERROR, WSAGetLastError // returns WSAEWOULDBLOCK (expected) and getsockopt most of the time returns // NOERROR; so socket engine starts a timer (30 s.) and waits for a timeout/ @@ -6806,7 +6806,7 @@ void tst_QNetworkReply::getFromUnreachableIp() #else // bearermanagement QSKIP("This test is non-deterministic on Windows x86"); #endif // !bearermanagement -#endif // Q_OS_WIN32 +#endif // Q_OS_WIN QNetworkRequest request(QUrl("http://255.255.255.255/42/23/narf/narf/narf")); QNetworkReplyPtr reply(manager.get(request));