From 00674a1643422de2e56ac23c89174c0ead83eb18 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 25 Sep 2018 15:02:58 +0200 Subject: Treat shorts as int in QVariant::canConvert() Follow the pattern of char and float, and treat shorts as a more generic type in QVariant::canConvert() Task-number: QTBUG-60914 Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe Reviewed-by: Thiago Macieira --- src/corelib/kernel/qvariant.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 0b4c3f387f..6541b97595 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -3523,13 +3523,19 @@ bool QVariant::canConvert(int targetTypeId) const } // TODO Reimplement this function, currently it works but it is a historical mess. - uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type); + uint currentType = d.type; if (currentType == QMetaType::SChar || currentType == QMetaType::Char) currentType = QMetaType::UInt; if (targetTypeId == QMetaType::SChar || currentType == QMetaType::Char) targetTypeId = QMetaType::UInt; - if (uint(targetTypeId) == uint(QMetaType::Float)) targetTypeId = QVariant::Double; - + if (currentType == QMetaType::Short || currentType == QMetaType::UShort) + currentType = QMetaType::Int; + if (targetTypeId == QMetaType::Short || currentType == QMetaType::UShort) + targetTypeId = QMetaType::Int; + if (currentType == QMetaType::Float) + currentType = QMetaType::Double; + if (targetTypeId == QMetaType::Float) + targetTypeId = QMetaType::Double; if (currentType == uint(targetTypeId)) return true; -- cgit v1.2.3 From c6af950bfd79182eb21438fa63096d4509f90404 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 23 Oct 2018 16:11:10 +0200 Subject: QtCore/Windows: Output unknown messages in hex in the debug operator for MSG Task-number: QTBUG-71257 Change-Id: I89335799529e8c518113925d402571a8f7ada244 Reviewed-by: Andre de la Rocha --- src/corelib/kernel/qcoreapplication_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 0c57ad34b9..b373267fcb 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -717,7 +717,7 @@ QString decodeMSG(const MSG& msg) else if (const char *wmmsgC = findWMstr(msg.message)) message = QString::fromLatin1(wmmsgC); else - message = QString::fromLatin1("WM_(%1)").arg(msg.message); // Unknown WM_, so use number + message = QString::fromLatin1("WM_(0x%1)").arg(msg.message, 0, 16); // Unknown WM_, so use number // Yes, we want to give the WM_ names 20 chars of space before showing the // decoded message, since some of the common messages are quite long, and -- cgit v1.2.3 From ceeecbae510af6e2d1ebbf865761e4761d404033 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 22 Oct 2018 15:53:35 +0200 Subject: Update various qt_attribution.json files Marking various as final because no upstream is known or available. Listing versions of others, where I was able to discover them. Updated a stale link (that helpfully redirected). Task-number: QTBUG-70008 Change-Id: Id00f34827133c560735c68793b4f1353f2b2ca85 Reviewed-by: Tobias Koenig Reviewed-by: Lars Knoll Reviewed-by: Jani Heikkinen Reviewed-by: Volker Hilsheimer --- src/corelib/kernel/qt_attribution.json | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qt_attribution.json b/src/corelib/kernel/qt_attribution.json index 37764a5330..6d8f4f2abc 100644 --- a/src/corelib/kernel/qt_attribution.json +++ b/src/corelib/kernel/qt_attribution.json @@ -5,6 +5,7 @@ "QtUsage": "Used in Qt Core on macOS.", "Path": "qeventdispatcher_cf_p.h", + "Description": "Treat as final version; no upstream known", "Description": "Implementation of QAbstractEventDispatcher for macOS.", "License": "BSD 3-clause \"New\" or \"Revised\" License", "LicenseId": "BSD-3-Clause", -- cgit v1.2.3