diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-28 03:01:52 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-28 03:01:52 +0200 |
commit | 79cdb34bb06d0bceb0453908cbe9c6a1b76fd06e (patch) | |
tree | 4c4b9eb3055245ba364ad7b146a3db406cab27ed | |
parent | 90724e0261e1a8388ed4d59f4bfab6fd1fcefe63 (diff) | |
parent | e643c01efa467b336fdb6e0d33ad5274291f8a66 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I254733596091997000e9452d4094b7fe6f939463
-rw-r--r-- | dist/changes-5.12.5 | 30 | ||||
-rw-r--r-- | dist/changes-5.13.1 | 20 | ||||
-rw-r--r-- | src/serialbus/qcanbusdevice.cpp | 18 | ||||
-rw-r--r-- | src/serialbus/qcanbusdevice.h | 15 | ||||
-rw-r--r-- | src/tools/canbusutil/main.cpp | 4 | ||||
-rw-r--r-- | src/tools/canbusutil/readtask.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp | 2 |
7 files changed, 74 insertions, 19 deletions
diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5 new file mode 100644 index 0000000..828ca9f --- /dev/null +++ b/dist/changes-5.12.5 @@ -0,0 +1,30 @@ +Qt 5.12.5 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.4. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.12.5 Changes * +**************************************************************************** + +QtSerialBus +----------- + + - CAN Plugins: + * [QTBUG-76957] Fixed the compiler error "‘SIOCGSTAMP’ was not declared" + in the SocketCAN plugin + diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1 new file mode 100644 index 0000000..57ebdbe --- /dev/null +++ b/dist/changes-5.13.1 @@ -0,0 +1,20 @@ +Qt 5.13.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.13.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.13 series is binary compatible with the 5.12.x series. +Applications compiled for 5.12 will continue to run with 5.13. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/src/serialbus/qcanbusdevice.cpp b/src/serialbus/qcanbusdevice.cpp index 9256bc8..222f19c 100644 --- a/src/serialbus/qcanbusdevice.cpp +++ b/src/serialbus/qcanbusdevice.cpp @@ -150,16 +150,18 @@ Q_LOGGING_CATEGORY(QT_CANBUS, "qt.canbus") */ /*! - \fn QCanBusDevice::Filter::operator==(const Filter &other) + \fn bool operator==(const QCanBusDevice::Filter &a, const QCanBusDevice::Filter &b) + \relates QCanBusDevice::Filter - Returns true, if the filter \a other is equal to this filter, + Returns true, if the filter \a a is equal to the filter \a b, otherwise returns false. */ /*! - \fn QCanBusDevice::Filter::operator!=(const Filter &other) + \fn bool operator!=(const QCanBusDevice::Filter &a, const QCanBusDevice::Filter &b) + \relates QCanBusDevice::Filter - Returns true, if the filter \a other is not equal to this filter, + Returns true, if the filter \a a is not equal to the filter \a b, otherwise returns false. */ @@ -347,11 +349,11 @@ bool QCanBusDevice::hasOutgoingFrames() const * Called from the derived plugin to register a function that performs the * CAN controller hardware reset when \a resetController() is called. */ -void QCanBusDevice::setResetControllerFunction(std::function<void()> &resetter) +void QCanBusDevice::setResetControllerFunction(std::function<void()> resetter) { Q_D(QCanBusDevice); - d->m_resetControllerFunction = resetter; + d->m_resetControllerFunction = std::move(resetter); } /*! @@ -359,11 +361,11 @@ void QCanBusDevice::setResetControllerFunction(std::function<void()> &resetter) * Called from the derived plugin to register a function that returns the * CAN controller bus status when \a busStatus() is called. */ -void QCanBusDevice::setCanBusStatusGetter(std::function<CanBusStatus()> &busStatusGetter) +void QCanBusDevice::setCanBusStatusGetter(std::function<CanBusStatus()> busStatusGetter) { Q_D(QCanBusDevice); - d->m_busStatusGetter = busStatusGetter; + d->m_busStatusGetter = std::move(busStatusGetter); } /*! diff --git a/src/serialbus/qcanbusdevice.h b/src/serialbus/qcanbusdevice.h index 1844f4b..5d2d976 100644 --- a/src/serialbus/qcanbusdevice.h +++ b/src/serialbus/qcanbusdevice.h @@ -98,15 +98,15 @@ public: struct Filter { - bool operator==(const Filter &other) const + friend constexpr bool operator==(const Filter &a, const Filter &b) noexcept { - return frameId == other.frameId && frameIdMask == other.frameIdMask - && type == other.type && format == other.format; + return a.frameId == b.frameId && a.frameIdMask == b.frameIdMask + && a.type == b.type && a.format == b.format; } - bool operator!=(const Filter &other) const + friend constexpr bool operator!=(const Filter &a, const Filter &b) noexcept { - return !operator==(other); + return !operator==(a, b); } enum FormatFilter { @@ -182,8 +182,8 @@ protected: virtual bool open() = 0; virtual void close() = 0; - void setResetControllerFunction(std::function<void()> &resetter); - void setCanBusStatusGetter(std::function<CanBusStatus()> &busStatusGetter); + void setResetControllerFunction(std::function<void()> resetter); + void setCanBusStatusGetter(std::function<CanBusStatus()> busStatusGetter); static QCanBusDeviceInfo createDeviceInfo(const QString &name, bool isVirtual = false, @@ -204,7 +204,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QCanBusDevice::Directions) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QCanBusDevice::Filter) Q_DECLARE_METATYPE(QCanBusDevice::Filter::FormatFilter) Q_DECLARE_METATYPE(QList<QCanBusDevice::Filter>) diff --git a/src/tools/canbusutil/main.cpp b/src/tools/canbusutil/main.cpp index 1277325..cbb7d7f 100644 --- a/src/tools/canbusutil/main.cpp +++ b/src/tools/canbusutil/main.cpp @@ -155,7 +155,9 @@ int main(int argc, char *argv[]) data = args.at(2); } else if (args.size() == 1 && parser.isSet(listDevicesOption)) { return util.printDevices(args.at(0)); - } else if (args.size() != 2) { + } + + if (args.size() < 2 || args.size() > 3) { output << CanBusUtil::tr("Invalid number of arguments (%1 given).").arg(args.size()); output << Qt::endl << Qt::endl << parser.helpText(); return 1; diff --git a/src/tools/canbusutil/readtask.cpp b/src/tools/canbusutil/readtask.cpp index 86dfb73..1b07fe8 100644 --- a/src/tools/canbusutil/readtask.cpp +++ b/src/tools/canbusutil/readtask.cpp @@ -68,13 +68,13 @@ void ReadTask::handleFrames() { QString view; if (m_showTimeStamp) { - view = QString::fromLatin1("%1.%2 ") + view = QStringLiteral("%1.%2 ") .arg(frame.timeStamp().seconds(), 10, 10, QLatin1Char(' ')) .arg(frame.timeStamp().microSeconds() / 100, 4, 10, QLatin1Char('0')); } if (m_showFlags) { - QString flags = QLatin1String("- - - "); + QLatin1String flags("- - - "); if (frame.hasBitrateSwitch()) flags[0] = QLatin1Char('B'); diff --git a/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp b/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp index e0b30f0..61d30c0 100644 --- a/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp +++ b/tests/auto/qcanbusdevice/tst_qcanbusdevice.cpp @@ -44,6 +44,8 @@ #include <memory> +Q_DECLARE_METATYPE(QCanBusDevice::Filter) + class tst_Backend : public QCanBusDevice { Q_OBJECT |