From 5b22d1719881b5f061be6b832a96a1e4305d981f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 19 Dec 2019 10:36:15 +0100 Subject: Fix some issues of a clang-cl developer build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - qeasingcurve.cpp: Add a cast, fixing: qeasingcurve.cpp(1515,25): error: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Werror,-Wmicrosoft-cast] - Disable copy and move of QMainWindowLayoutSeparatorHelper, fixing: qbasictimer.h(59,5): note: 'QBasicTimer' has been explicitly marked deprecated here QT_DEPRECATED_X("copy-construction is unsupported; use move-construction instead") Task-number: QTBUG-63512 Change-Id: I4d12a29cb1dcd68da9f9316c9e42992f218e6045 Reviewed-by: Oliver Wolff Reviewed-by: André de la Rocha Reviewed-by: Shawn Rutledge --- src/corelib/tools/qeasingcurve.cpp | 2 +- src/widgets/widgets/qmainwindowlayout_p.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 52c8d13fe3..bf2fd2e401 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1512,7 +1512,7 @@ QDebug operator<<(QDebug debug, const QEasingCurve &item) { QDebugStateSaver saver(debug); debug << "type:" << item.d_ptr->type - << "func:" << item.d_ptr->func; + << "func:" << reinterpret_cast(item.d_ptr->func); if (item.d_ptr->config) { debug << QString::fromLatin1("period:%1").arg(item.d_ptr->config->_p, 0, 'f', 20) << QString::fromLatin1("amp:%1").arg(item.d_ptr->config->_a, 0, 'f', 20) diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 967b713096..f882908708 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -88,6 +88,10 @@ class QMainWindowLayoutSeparatorHelper QWidget *window() { return layout()->parentWidget(); } public: + Q_DISABLE_COPY_MOVE(QMainWindowLayoutSeparatorHelper) + + QMainWindowLayoutSeparatorHelper() = default; + QList hoverSeparator; QPoint hoverPos; -- cgit v1.2.3 From 6b835d5e51bafe93090286fa2acb36f3d5d8f719 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 3 Jan 2020 09:13:34 +0100 Subject: QTextDocument: Set the font family to be after the families set This amends a1f4321bbba2f3bff24d753ce766be738dbfa61a as the font families should take precedence over the font family set. If the font family is already included in the families then it should keep its placement. Otherwise it should be appended. Task-number: QTBUG-80475 Change-Id: I0049189c88b6879e57619815ec780960e9c0a300 Reviewed-by: Ulf Hermann Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextdocument.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 25c153910d..1353568ec1 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2301,10 +2301,8 @@ static QStringList resolvedFontFamilies(const QTextCharFormat &format) { QStringList fontFamilies = format.fontFamilies().toStringList(); const QString mainFontFamily = format.fontFamily(); - if (!mainFontFamily.isEmpty() && !fontFamilies.startsWith(mainFontFamily)) { - fontFamilies.removeAll(mainFontFamily); - fontFamilies.prepend(mainFontFamily); - } + if (!mainFontFamily.isEmpty() && !fontFamilies.contains(mainFontFamily)) + fontFamilies.append(mainFontFamily); return fontFamilies; } -- cgit v1.2.3 From 1535fc9fb9ddbfce1680979c0634b4fdf8d75fca Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 20 Dec 2019 15:41:32 +0100 Subject: tablets on xcb: report correct local coordinates to nested windows Change e4532224145a0a72cde9b40cb7fd39011624d1c1 tried to map global position directly from the desktop to the window that should receive the event. That's fine for single-window applications; but media players like OBS and VLC often use embedded windows to play video. So the mapping needs to traverse the window parent hierarchy somehow. In this patch it's done by calling QWindow::mapFromGlobal(), but that only works with integer coordinates (QPoint). To preserve the fix for QTBUG-48151 (and other jitter bugs), we need sub-pixel accuracy; so we have to add back the fractional part after mapping the int part. Fixes: QTBUG-77826 Change-Id: Ib52ce14138e477182e0ef53b0ff30ce1eff40372 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4639185416..0a82bbc7a9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -1252,14 +1252,16 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD if (Q_LIKELY(useValuators)) { const qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.x(), physicalScreenArea.width()); global.setX(value); - local.setX(value - window->handle()->geometry().x()); + // mapFromGlobal is ok for nested/embedded windows, but works only with whole-number QPoint; + // so map it first, then add back the sub-pixel position + local.setX(window->mapFromGlobal(QPoint(int(value), 0)).x() + (value - int(value))); } break; case QXcbAtom::AbsY: if (Q_LIKELY(useValuators)) { qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.y(), physicalScreenArea.height()); global.setY(value); - local.setY(value - window->handle()->geometry().y()); + local.setY(window->mapFromGlobal(QPoint(0, int(value))).y() + (value - int(value))); } break; case QXcbAtom::AbsPressure: -- cgit v1.2.3