diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-06-20 11:41:05 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-06-24 09:51:01 +0200 |
commit | 65329501805b45765fbade4418f73d9e04c984c0 (patch) | |
tree | 9df267de66ba5c05a57cd9787fa0c5bea32fcfec /src | |
parent | 0c8a6c80e489e6ee4592f5dd5ca9a8bd568d9997 (diff) |
Fix Qt6 build
Added 'Qt::' prefixes where missing.
Change-Id: I97d5d9fa78d7c1feaef4caae72b735ea0625a081
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialbus/qmodbuspdu.cpp | 2 | ||||
-rw-r--r-- | src/serialbus/qmodbustcpclient_p.h | 10 | ||||
-rw-r--r-- | src/serialbus/qmodbustcpserver_p.h | 2 | ||||
-rw-r--r-- | src/tools/canbusutil/canbusutil.cpp | 30 | ||||
-rw-r--r-- | src/tools/canbusutil/main.cpp | 2 | ||||
-rw-r--r-- | src/tools/canbusutil/readtask.cpp | 4 | ||||
-rw-r--r-- | src/tools/canbusutil/sigtermhandler.cpp | 2 |
7 files changed, 26 insertions, 26 deletions
diff --git a/src/serialbus/qmodbuspdu.cpp b/src/serialbus/qmodbuspdu.cpp index c42352d..ed78a69 100644 --- a/src/serialbus/qmodbuspdu.cpp +++ b/src/serialbus/qmodbuspdu.cpp @@ -439,7 +439,7 @@ static QDataStream &pduFromStream(QDataStream &stream, QModbusPdu &pdu, Type typ QDebug operator<<(QDebug debug, const QModbusPdu &pdu) { QDebugStateSaver _(debug); - debug.nospace().noquote() << "0x" << hex << qSetFieldWidth(2) << qSetPadChar('0') + debug.nospace().noquote() << "0x" << Qt::hex << qSetFieldWidth(2) << qSetPadChar('0') << (pdu.isException() ? pdu.functionCode() | QModbusPdu::ExceptionByte : pdu.functionCode()) << qSetFieldWidth(0) << pdu.data().toHex(); return debug; diff --git a/src/serialbus/qmodbustcpclient_p.h b/src/serialbus/qmodbustcpclient_p.h index 43a394e..16f81c2 100644 --- a/src/serialbus/qmodbustcpclient_p.h +++ b/src/serialbus/qmodbustcpclient_p.h @@ -121,7 +121,7 @@ public: if (knownTransaction && m_transactionStore[transactionId].timer) m_transactionStore[transactionId].timer->stop(); - qCDebug(QT_MODBUS) << "(TCP client) tid:" << hex << transactionId << "size:" + qCDebug(QT_MODBUS) << "(TCP client) tid:" << Qt::hex << transactionId << "size:" << bytesPdu << "server address:" << serverAddress; // The length field is the byte count of the following fields, including the Unit @@ -169,7 +169,7 @@ public: return false; } qCDebug(QT_MODBUS_LOW) << "(TCP client) Sent TCP ADU:" << buffer.toHex(); - qCDebug(QT_MODBUS) << "(TCP client) Sent TCP PDU:" << request << "with tId:" << hex + qCDebug(QT_MODBUS) << "(TCP client) Sent TCP PDU:" << request << "with tId:" <<Qt:: hex << tId; return true; }; @@ -210,9 +210,9 @@ public: return; m_transactionStore.insert(tId, elem); elem.timer->start(); - qCDebug(QT_MODBUS) << "(TCP client) Resend request with tId:" << hex << tId; + qCDebug(QT_MODBUS) << "(TCP client) Resend request with tId:" << Qt::hex << tId; } else { - qCDebug(QT_MODBUS) << "(TCP client) Timeout of request with tId:" << hex << tId; + qCDebug(QT_MODBUS) << "(TCP client) Timeout of request with tId:" <<Qt::hex << tId; elem.reply->setError(QModbusDevice::TimeoutError, QModbusClient::tr("Request timeout.")); } @@ -220,7 +220,7 @@ public: element.timer->start(); } else { qCWarning(QT_MODBUS) << "(TCP client) No response timeout timer for request with tId:" - << hex << tId << ". Expected timeout:" << m_responseTimeoutDuration; + << Qt::hex << tId << ". Expected timeout:" << m_responseTimeoutDuration; } incrementTransactionId(); diff --git a/src/serialbus/qmodbustcpserver_p.h b/src/serialbus/qmodbustcpserver_p.h index a5cfaeb..3e73de3 100644 --- a/src/serialbus/qmodbustcpserver_p.h +++ b/src/serialbus/qmodbustcpserver_p.h @@ -167,7 +167,7 @@ public: input >> transactionId >> protocolId >> bytesPdu >> unitId; qCDebug(QT_MODBUS_LOW) << "(TCP server) Request MBPA:" << "Transaction Id:" - << hex << transactionId << "Protocol Id:" << protocolId << "PDU bytes:" + << Qt::hex << transactionId << "Protocol Id:" << protocolId << "PDU bytes:" << bytesPdu << "Unit Id:" << unitId; // The length field is the byte count of the following fields, including the Unit diff --git a/src/tools/canbusutil/canbusutil.cpp b/src/tools/canbusutil/canbusutil.cpp index a4e1a58..3ca96fa 100644 --- a/src/tools/canbusutil/canbusutil.cpp +++ b/src/tools/canbusutil/canbusutil.cpp @@ -67,7 +67,7 @@ void CanBusUtil::setConfigurationParameter(QCanBusDevice::ConfigurationKey key, bool CanBusUtil::start(const QString &pluginName, const QString &deviceName, const QString &data) { if (!m_canBus) { - m_output << tr("Error: Cannot create QCanBus.") << endl; + m_output << tr("Error: Cannot create QCanBus.") << Qt::endl; return false; } @@ -96,32 +96,32 @@ bool CanBusUtil::start(const QString &pluginName, const QString &deviceName, con int CanBusUtil::printPlugins() { if (!m_canBus) { - m_output << tr("Error: Cannot create QCanBus.") << endl; + m_output << tr("Error: Cannot create QCanBus.") << Qt::endl; return 1; } const QStringList plugins = m_canBus->plugins(); for (const QString &plugin : plugins) - m_output << plugin << endl; + m_output << plugin << Qt::endl; return 0; } int CanBusUtil::printDevices(const QString &pluginName) { if (!m_canBus) { - m_output << tr("Error: Cannot create QCanBus.") << endl; + m_output << tr("Error: Cannot create QCanBus.") << Qt::endl; return 1; } QString errorMessage; const QList<QCanBusDeviceInfo> devices = m_canBus->availableDevices(pluginName, &errorMessage); if (!errorMessage.isEmpty()) { - m_output << tr("Error gathering available devices: '%1'").arg(errorMessage) << endl; + m_output << tr("Error gathering available devices: '%1'").arg(errorMessage) << Qt::endl; return 1; } for (const QCanBusDeviceInfo &info : devices) - m_output << info.name() << endl; + m_output << info.name() << Qt::endl; return 0; } @@ -129,7 +129,7 @@ bool CanBusUtil::parseDataField(quint32 &id, QString &payload) { int hashMarkPos = m_data.indexOf('#'); if (hashMarkPos < 0) { - m_output << tr("Data field invalid: No hash mark found!") << endl; + m_output << tr("Data field invalid: No hash mark found!") << Qt::endl; return false; } @@ -154,7 +154,7 @@ bool CanBusUtil::setFrameFromPayload(QString payload, QCanBusFrame *frame) return true; } - m_output << tr("Error: RTR frame length must be between 0 and 8 (including).") << endl; + m_output << tr("Error: RTR frame length must be between 0 and 8 (including).") << Qt::endl; return false; } @@ -165,7 +165,7 @@ bool CanBusUtil::setFrameFromPayload(QString payload, QCanBusFrame *frame) const QRegularExpression re(QStringLiteral("^[0-9A-Fa-f]*$")); if (!re.match(payload).hasMatch()) { - m_output << tr("Data field invalid: Only hex numbers allowed.") << endl; + m_output << tr("Data field invalid: Only hex numbers allowed.") << Qt::endl; return false; } @@ -177,7 +177,7 @@ bool CanBusUtil::setFrameFromPayload(QString payload, QCanBusFrame *frame) frame->setErrorStateIndicator(flags & ErrorStateIndicatorFlag); payload.remove(0, 1); } else { - m_output << tr("Data field invalid: Size is not multiple of two.") << endl; + m_output << tr("Data field invalid: Size is not multiple of two.") << Qt::endl; return false; } } @@ -186,7 +186,7 @@ bool CanBusUtil::setFrameFromPayload(QString payload, QCanBusFrame *frame) const int maxSize = frame->hasFlexibleDataRateFormat() ? 64 : 8; if (bytes.size() > maxSize) { - m_output << tr("Data field invalid: Size is longer than %1 bytes.").arg(maxSize) << endl; + m_output << tr("Data field invalid: Size is longer than %1 bytes.").arg(maxSize) << Qt::endl; return false; } @@ -198,13 +198,13 @@ bool CanBusUtil::setFrameFromPayload(QString payload, QCanBusFrame *frame) bool CanBusUtil::connectCanDevice() { if (!m_canBus->plugins().contains(m_pluginName)) { - m_output << tr("Cannot find CAN bus plugin '%1'.").arg(m_pluginName) << endl; + m_output << tr("Cannot find CAN bus plugin '%1'.").arg(m_pluginName) << Qt::endl; return false; } m_canDevice.reset(m_canBus->createDevice(m_pluginName, m_deviceName)); if (!m_canDevice) { - m_output << tr("Cannot create CAN bus device: '%1'").arg(m_deviceName) << endl; + m_output << tr("Cannot create CAN bus device: '%1'").arg(m_deviceName) << Qt::endl; return false; } @@ -214,7 +214,7 @@ bool CanBusUtil::connectCanDevice() connect(m_canDevice.data(), &QCanBusDevice::errorOccurred, m_readTask, &ReadTask::handleError); if (!m_canDevice->connectDevice()) { - m_output << tr("Cannot create CAN bus device: '%1'").arg(m_deviceName) << endl; + m_output << tr("Cannot create CAN bus device: '%1'").arg(m_deviceName) << Qt::endl; return false; } @@ -234,7 +234,7 @@ bool CanBusUtil::sendData() return false; if (id > 0x1FFFFFFF) { // 29 bits - m_output << tr("Cannot send invalid frame ID: '%1'").arg(id, 0, 16) << endl; + m_output << tr("Cannot send invalid frame ID: '%1'").arg(id, 0, 16) << Qt::endl; return false; } diff --git a/src/tools/canbusutil/main.cpp b/src/tools/canbusutil/main.cpp index 3a71192..e0f4c0e 100644 --- a/src/tools/canbusutil/main.cpp +++ b/src/tools/canbusutil/main.cpp @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) return util.printDevices(args.at(0)); } else if (args.size() != 2) { output << CanBusUtil::tr("Invalid number of arguments (%1 given).").arg(args.size()); - output << endl << endl << parser.helpText(); + output << Qt::endl << Qt::endl << parser.helpText(); return 1; } diff --git a/src/tools/canbusutil/readtask.cpp b/src/tools/canbusutil/readtask.cpp index 2bde509..287540f 100644 --- a/src/tools/canbusutil/readtask.cpp +++ b/src/tools/canbusutil/readtask.cpp @@ -87,7 +87,7 @@ void ReadTask::handleFrames() { else view += frame.toString(); - m_output << view << endl; + m_output << view << Qt::endl; } } @@ -99,5 +99,5 @@ void ReadTask::handleError(QCanBusDevice::CanBusError /*error*/) return; } - m_output << tr("Read error: '%1'").arg(canDevice->errorString()) << endl; + m_output << tr("Read error: '%1'").arg(canDevice->errorString()) << Qt::endl; } diff --git a/src/tools/canbusutil/sigtermhandler.cpp b/src/tools/canbusutil/sigtermhandler.cpp index 8611916..a882a55 100644 --- a/src/tools/canbusutil/sigtermhandler.cpp +++ b/src/tools/canbusutil/sigtermhandler.cpp @@ -47,7 +47,7 @@ SigTermHandler *SigTermHandler::instance() void SigTermHandler::handle(int s) { QTextStream out(stdout); - out << " Caught signal " << s << endl; + out << " Caught signal " << s << Qt::endl; emit instance()->sigTermSignal(); } |