1
0
mirror of https://github.com/qt/qtmqtt.git synced 2026-10-25 16:16:26 +00:00

Compare commits

...

415 Commits

Author SHA1 Message Date
Topi Reinio
5238fdb1c3 Doc: Include namespaces in TOC
The QMqtt namespace was missing from the TOC as the .qhp subproject
selected only classes and headers.

Pick-to: 6.12
Change-Id: I5692ae2e77b80d9b3c4361945891e84c1ef4ccf7
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
2026-10-25 15:09:56 +00:00
Tatiana Borisova
407ac111fd QMqttConnection: distinguish read errors from zero values
- The readBufferTyped<T>() method returns T{0} when it fails. But
in QtMqtt the value 0 is also used as "Success" return code.
In particular, src/mqtt/qmqttconnection.cpp
=> readBufferTyped<T>() returns 0 on failure, and finalize_connack()
reads the login result with it. src/mqtt/qmqttglobal.h =>
QMqtt::ReasonCode defines Success = 0.
So our failure value and the protocol's success value are the same
number.

- To fix this problem I make readBufferTyped<>() return std::nullopt
when the read fails, while using the returned value to represent
uccessfully read data. This allows callers to distinguish read errors
from valid zero values.

[ChangeLog][QMqttConnection][Important Behavior Changes] The Qt MQTT
client now stops parsing and closes the connection with the
ProtocolViolation error when a read error occurs while
parsing a packet.

Task-number: QTBUG-149867
Change-Id: I829a34cecfcb49ba330d5eb65aba755eee9326b0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-10-23 10:09:58 +00:00
Qt Submodule Update Bot
d8fa0e633f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I628aa6161920a7d3fa21db807f594e4d25b58f61
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-22 17:20:29 +00:00
Tatiana Borisova
51fe8b4f2e Limit MQTT packet size for MQTT 3.x connections
- Enforce the configured packet size limit locally for MQTT 3.1/3.1.1.
- Close the connection if the broker sends a packet exceeding the limit.

MQTT 3.1 and 3.1.1 have no way to tell the broker the maximum packet
size the client accepts, so the limit can only be applied on the
client side. This is helpful for clients on embedded devices, where
memory is limited and a very large packet from the broker could
exhaust it.

[ChangeLog][QMqttClient] The maximumPacketSize connection property is
now also enforced for MQTT 3.1 and 3.1.1 connections. Previously it was
only honored for MQTT 5.0. The client now closes the connection if the
broker sends a packet larger than this limit. This helps clients on
embedded devices to protect their limited memory. The default behavior
is unchanged: if no limit is set, only the protocol maximum of 256 MB
applies.

Change-Id: I26625325f490e2396fa493005c1f322253007a33
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-10-20 11:48:44 +00:00
Qt Submodule Update Bot
457877b453 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ifba06f310ebdadd2fd94311e0f2c2d5c4085cc9c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-20 09:32:25 +00:00
Qt Submodule Update Bot
529a2ed7d9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7f1d48e7c4a059139d53409bd77f61a5e3e5392b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-14 10:28:41 +00:00
Qt Submodule Update Bot
39f5d8bc63 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4eda259e19bee548ad55c257ac4de89d6562e865
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-13 20:31:00 +00:00
Tatiana Borisova
a4ba93f3ca Add the readBufferSize property to limit the read buffer for clients
- this function should be used to protect your socket against receiving
too much data, which may eventually cause your application to run out
of memory.
- setSocketReadBufferSize(size) sets the size of internal read buffer
to be 'size' bytes.

[ChangeLog][QMqttClient] Added a readBufferSize property to limit
the transport buffer size.

Task-number: QTBUG-149866
Change-Id: I6ff843b66b50d019ecf620c25c47e0d779518113
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-10-09 15:34:07 +00:00
Tatiana Borisova
d24a6483d0 Document blocking I/O and threading considerations
- Document that disconnectFromHost() may block while waiting for pending
data to be written, with a timeout of up to 30 seconds.

- Recommend keeping QMqttClient and its transport outside the UI thread
because blocking I/O may occur and affect UI responsiveness.

Pick-to: 6.12
Task-number: QTBUG-150345
Change-Id: I27d300210750710c4a5138f8c3f97c7c929466af
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-10-08 09:42:57 +00:00
Qt Submodule Update Bot
e147dedea3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4d3b281b7ba556b9753806639db2b8f2a03db743
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-10-07 21:19:11 +00:00
Tatiana Borisova
1316c02fe7 MQTT 5: Add Maximum Packet Size check
Disconnect with reason code 0x95 (Packet too large) if a packet
exceeds the Maximum Packet Size limit, as required by section 3.1.2.11.4
of the MQTT 5 spec.

Note: This fix doesn't protect against memory exhaustion in user apps.
It just implements the spec requirement about message limit.

Pick-to: 6.12
Task-number: QTBUG-149866
Change-Id: I2baa8ceb95e4a045437e2caa51e5508b2fa8b2eb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-10-06 13:05:52 +00:00
Qt Submodule Update Bot
ece01bf0ee Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iad96afcd2d25ef4c6d1f0b085f782d1b81089ff3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-30 21:41:02 +00:00
Qt Submodule Update Bot
24678da81e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0c6fb192baf73ae18b8ced356af0890d1d402c57
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-22 13:35:15 +00:00
Tatiana Borisova
21b866609f The Qt app can freeze forever if the broker sends a bad message
- When QMqttConnection reads a message, it keeps a count of the bytes
left to read -> by the dataSize argument. If a read fails, the count
is never reduced.
- The fix cleaning up the count of the bytes left to read, since
the reading is not working anymore and parsing should be stopped.
It allows to get read of potential freezes.

The patch also updates the QByteArray specialization to return a
default-constructed QBA in case of an error. This is more in line
with the default implementation.

Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149563
Change-Id: I8c8c5ef354103a996ac6e360fbc5c8f61d965f3d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-09-15 09:06:31 +00:00
Qt Submodule Update Bot
6bdaef48c7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I23dabe0789f9adc00ba3ab1e9af553c6e2eb3c67
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-14 22:30:33 +00:00
Qt Submodule Update Bot
c58aedad7a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id764db97c594b958cfc84a80ae85b6c5c0ad5574
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-10 00:05:42 +00:00
Qt Submodule Update Bot
dd767d7a57 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic7d9314b90e2ff088c84f49acbc8a46f4258b1fb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-02 05:07:22 +00:00
Tatiana Borisova
06d301aa50 Read the Remaining Length as a variable byte integer everywhere
- Every MQTT packet begins with a fixed header, whose second field is the
Remaining Length: the number of bytes that follow. It is not a byte. It
is spread over one to four bytes, seven value bits each, with the top
bit meaning "another byte follows". So values up to 127 take one byte,
and larger values take more.

Six packet types read it as a single quint8: SUBACK, UNSUBACK, PUBACK,
PUBREC, PUBREL and PUBCOMP. For most of them that used to be correct.
In MQTT 3.1.1 those packets contain nothing but a two byte identifier,
so the length was always exactly 2, which always fits in one byte. The
code did not even use the byte it read: it checked that the value was 2
and then hardcoded the length.

MQTT 5.0 support (ac66658) gave those packets an optional reason code
and properties, so the length can now be far above 127. That commit
switched off the "must be 2" check for MQTT 5.0 and began using the
byte as the real length, but kept reading only one byte. The check had
been the only thing making a one byte read safe, because a multi-byte
length always has its top bit set and so could never equal 2.

SUBACK never had a fixed length at all, since its payload carries one
reason code per subscribed topic filter. It has been misparsed for any
SUBACK above 127 bytes since the parser was written (d96011b).

Reading one byte of a two byte length consumes one byte too few, so the
remainder of the packet is then read as the next packet's header. The
client rejects a valid acknowledgement and stays out of step for the
rest of the connection. Brokers trigger this on ordinary traffic as
soon as they attach a reason string or user properties.

All six now use readVariableByteInteger(), and each rejects a length too
short to hold the fields the specification requires.

PUBREL also accepted a length of exactly 2 even for MQTT 5.0, which
rejected valid PUBREL packets carrying a reason code. It now accepts 2
or more there, and still requires exactly 2 for MQTT 3.1.1.

- Adds three regression tests driving the parser through the existing
FakeServer, so they need no broker.

Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149569
Change-Id: Ib239d836556e0cc14e13c116dee757fdd1a7ae81
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-09-01 17:40:37 +00:00
Tatiana Borisova
33538c5143 PINGRESP from the network should not push the counter below zero
- finalize_pingresp() lowers m_pingTimeout every time, with no lower
limit. A broker can send a pile of unasked-for replies to push the
counter deep below zero, and then the client can spend some unexpected
amount of time to reach back the number that means:
"the broker has stopped answering, drop the link.”
- The fix prohibits pushing the counter below zero.

Task-number: QTBUG-149662
Pick-to: 6.11 6.12 6.8
Change-Id: I7b25e8ac3f83fa262a19010df9a91b2ee1c006fd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-09-01 14:32:40 +00:00
Tatiana Borisova
9e0428b917 Skip remaining data for messages with unknown requests
- finalize_suback() and finalize_unsuback() read the 2-byte request ID.
If no matching request was found, they returned immediately.
However, m_missingData remained non-zero.
The leftover bytes are then incorrectly interpreted as the header of
the next message!

- This change fixes the issue universally for all handlers in the
processDataHelper().

Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149570
Change-Id: I06c86414c3297caa386059a02fdec5c3765a0315
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-09-01 10:52:32 +00:00
Qt Submodule Update Bot
c7f7555d8e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic8fadb4442f209a70a15a076d56b166f4d122f75
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-09-01 00:54:22 +00:00
Tatiana Borisova
011eb1e424 Fix topic alias bounds and storage sizes
- In the f8ecf4d56a we found that the
m_receiveAliases bounds check used a wrong property:
m_clientPrivate->m_serverConnectionProperties.maximumTopicAlias(),
but it must use instead:
m_clientPrivate->m_connectionProperties.maximumTopicAlias().

So, the idea is m_receiveAliases is sized according to the maximum
topic alias value declared by the client in CONNECT, while
m_publishAliases is sized according to the maximum value declared
by the server in CONNACK.

The previous fix did not update all related code.
1) The resize() calls for m_receiveAliases and m_publishAliases
still used the wrong properties.
2) The bounds check for m_publishAliases still used the client's
maximumTopicAlias() value instead of the server's.

- Update the resize() calls to use the appropriate connection
properties and fix the bounds check for m_publishAliases.

Amends f8ecf4d56a

Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149564
Change-Id: I252c67966bf28c6994f34b19024d1b7894748473
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-08-28 17:36:29 +00:00
Qt Submodule Update Bot
ee16836877 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I13a69da7a50229cdfc602dda0edac4f2645da59e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-28 16:01:26 +00:00
Tatiana Borisova
c94175ff43 Stop parsing after closeConnection()
- Parsing continued after closeConnection(), leaving the client in the
"connected" state with a dead socket. This led to a permanent,
unrecoverable wedge in Release builds and a crash in Debug builds.

- Check whether the client is already disconnected before changing its
state to BrokerConnected.

Pick-to: 6.11 6.12 6.8
Task-number: QTBUG-149565
Change-Id: I13d45c24d24fe862d9aec6a7e421f5ef4d494db0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-08-28 12:07:32 +00:00
Tatiana Borisova
13288574c1 Check readVariableByteInteger() return value
- On error, readVariableByteInteger() closes the connection and
returns-1. In this case, message handling should stop.

- Add checks for the return value to stop processing when -1 is returned.

Pick-to: 6.11 6.8 6.12
Task-number: QTBUG-149565
Change-Id: I8f6cc8d6f3011a89d3bd4033a3432f383e1e9164
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-08-28 12:07:30 +00:00
Tatiana Borisova
ecaf42152e Number overflow while rejecting a too-long length
- The length reader checked its 4-byte limit after doing the maths.
So, a 5th byte was multiplied in and overflows before the value
was thrown away. But it was not noticed, because we thrown it away
and returned -1.

- The fix moves iteration++ and if (iteration > 4) before the
calculation, preventing the overflow.

Pick-to: 6.11 6.8 6.12
Task-number: QTBUG-149571
Change-Id: I78c2063c7e01af3e8f196f824216d31de92fab48
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-08-28 12:07:28 +00:00
Qt Submodule Update Bot
ba2b82223a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie3ba332b167426218e86a904bc99a0bed0e4556c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-26 06:34:34 +00:00
Qt Submodule Update Bot
90f2efdd5d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I45f8e4efaf7d02f0ef886257dd1ccaa1ad4f457e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-22 02:39:59 +00:00
Qt Submodule Update Bot
b73e4d4ffc Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2751f6696663e560d274e1df7889943a578a6914
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-18 00:22:08 +00:00
Tatiana Borisova
96d602b65f Update to coin_module_test_template_v3.yaml
- The main differences between v2 and v3 are:
  * `coin_module_test_template_v2.yaml` ignores autotest return
    codes because the `COIN_CTEST_IGNORE_EXIT_CODE` flag is set.
  * The Axivion build was moved from coin_module_build_template_v2.yaml
    to coin_module_test_template_v3.yaml in commit
    c3ddec2f15a1cf806d8df444952cb2c2231ae4ad
- Switch the qtmqtt submodule to the newer v3 version to improve
the submodule CI experience for autotests and restore Axivion
checks.

Pick-to: 6.12 6.11
Change-Id: I1695c8ca1af616512dff437a0a4cdbd0491412d4
Reviewed-by: Toni Saario <toni.saario@qt.io>
2026-08-17 09:51:21 +00:00
Qt Submodule Update Bot
fe85eff00c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I49e7ca4073c1c483370a22ff51d8cde8d63345f4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-14 10:49:39 +00:00
Qt Submodule Update Bot
16862e4fa7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5706ec8cff106f1a19fcf9652ba06ae7a3076bab
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-08-04 15:26:25 +00:00
Qt Submodule Update Bot
2caa279c61 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8126f0e67a0c58f8f671890050d3c13bf6e8e8d8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-29 15:25:41 +00:00
Jani Heikkinen
ebd3d87293 Replace Q_ENUMS with Q_ENUM
Amends ea3dc64d3f,
7467bbdc84, and
ea0d792a44 (all before 6.0).

Fixes: QTBUG-148625
Pick-to: 6.12 6.11 6.8
Change-Id: I2f9b24f7e32d437cce258dfdce0d669c8d2638e1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2026-07-29 11:40:44 +00:00
Tatiana Borisova
14de26f60b Fix Qt-RangeLoopDetach Axivion warnings
- use std::as_const() where possible, and introduce an intermediate
  local const variable where it is not.

Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV34
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV35
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV36
Axivion-Id: qt_Add-ons_qtmqtt_dev_linux:SV37
Pick-to: 6.12
Task-number: QTBUG-144762
Change-Id: I7b6d53116269007aca7d6f050b2abeb2515e9390
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2026-07-22 10:41:05 +00:00
Qt Submodule Update Bot
a85b5c3ecf Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I63842312d21575b3cb7f0722446ec14149aa2a5e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-18 21:34:00 +00:00
Qt Submodule Update Bot
2dc7e69f0e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I23bbd285e1aa00624ee2e21a65b54ec3693d416f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-15 00:24:21 +00:00
Qt Submodule Update Bot
9cc2b3859d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8d5b1115587cdc9e4625785a23acba9cd770936a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-09 20:08:18 +00:00
Qt Submodule Update Bot
088b583810 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I92ec408cffa255a953e07fe93761fe9bf5fcc27b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-07 15:18:07 +00:00
Qt Submodule Update Bot
fa9b04ab15 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2828b08e810e9fd3de8b3536472d21c17c67bf9f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-07-01 17:52:59 +00:00
Qt Submodule Update Bot
53aba306b9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7f19ead9837dcb5a80b0fabae0f3e2aae1562752
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-25 07:49:14 +00:00
Qt Submodule Update Bot
3b476b23eb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie71907f1afdf7b36ba1a363db0855716b731d96a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-18 21:00:58 +00:00
Qt Submodule Update Bot
cf66710eb6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibbf482f41eb56bea86a418094a81516fa913ae07
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-04 21:59:53 +00:00
Jani Heikkinen
5d592b2aa3 Bump version to 6.13.0
Change-Id: I63790a12e9734c478bb9f0bb86ff4527cd69b9e1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-04 21:59:51 +00:00
Qt Submodule Update Bot
ae08a87fc4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If9e34b78b899338e3bf3587caea8f5ef929fa39e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-03 01:35:30 +00:00
Qt Submodule Update Bot
1d7f954339 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6b6c3fe3edd69ee2444bc7246d1c6916e3f8ba5d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-06-02 05:06:50 +00:00
Qt Submodule Update Bot
f7267c6452 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ieff8861b81fe08d9e05eae5343ad6716d7698383
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-31 15:44:17 +00:00
Qt Submodule Update Bot
cefbe34e78 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ieb10ad55da60b7ef62c9d84479fe98f5ea515209
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-29 01:11:37 +00:00
Qt Submodule Update Bot
b7d124d65f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I858f5ccddc5f368659f43646fa005537dce71a87
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-25 20:20:43 +00:00
Qt Submodule Update Bot
e7616f09c1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I77d9159d75ac22b8fff8996dc4e403bc42421563
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-22 12:04:27 +00:00
Qt Submodule Update Bot
ba85d5db5c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I72a5e492509e54a18ee16a953e6a6c222a9aa124
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-15 12:13:24 +00:00
Qt Submodule Update Bot
396d0f90e7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iefedb03a0bf4aa12a5f13fd36d92a89d5631e685
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-08 05:41:49 +00:00
Qt Submodule Update Bot
468dfd5357 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idcc316e0dea54aeb45941abebab5c4e28a55cd62
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-05-05 14:50:43 +00:00
Marc Mutz
24ec59ffbb Disable 1-to-2-arg qHash() adapter in qtmqtt
Pick-to: 6.11
Task-number: QTBUG-145851
Change-Id: Ic9f6a64b8aa99aad7682e5e6379d304bcff3a7d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2026-05-04 10:43:37 +00:00
Qt Submodule Update Bot
c0f5cee7eb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I421dcdadb5e23c65b453f555a25c3d0f9bba8dd1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-30 13:10:00 +00:00
Kai Köhne
5287cf1442 Add CONTRIBUTING.md file
Point potential contributors to contribute.qt-project.org.

Change-Id: Id4dbc0dda57fe316f5d338dd0ef407b278287671
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2026-04-21 07:22:04 +00:00
Qt Submodule Update Bot
778fa2d33c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I40d407b8b63b744c47ba731c02e72c66529bb241
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-20 19:01:00 +00:00
Qt Submodule Update Bot
92c214f82a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibfb2ad9bb0924abb7a074358c4ba1f877c81c489
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-17 18:55:29 +00:00
Qt Submodule Update Bot
ed2aeb5392 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7483d2540c6338db7b3f8b444cbf05daf07564a8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-04-16 07:38:06 +00:00
Qt Submodule Update Bot
fe7422c165 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5dfd827abd2d9fe68403371fd40659ea2e9c459e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-30 09:25:50 +00:00
Qt Submodule Update Bot
8c32cf60c0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9110839ce13a2e73145908973465dd8024d2594c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-27 08:24:11 +00:00
Qt Submodule Update Bot
92de735434 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0fdb37e81eea6ed61cd084b60b6c772d851acc90
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-26 08:20:47 +00:00
Marc Mutz
a3c58404a4 Tst_QMqttSubscription: fix -Wunused-lambda-capture
Says Clang:

  tst_qmqttsubscription.cpp:515:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    515 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~
  tst_qmqttsubscription.cpp:545:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    545 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~
  tst_qmqttsubscription.cpp:576:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    576 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~

Fix by removing the problematic capture. I don't know why it doesn't
complain about `topic`, which also looks unused.

Amends c383083270 (picked to 6.8).

Pick-to: 6.11 6.10 6.8
Change-Id: I52850ae4ff9b5e2faee86cd8252d78ce5f0908ff
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2026-03-24 08:50:18 +01:00
Qt Submodule Update Bot
3e904a3eb4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I63b95f05c9dde6633111f63b6008920cec54da21
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-23 23:46:51 +00:00
Qt Submodule Update Bot
8931b61d89 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I11332b97298dde75f48ae3cfb5eb1b9452447a94
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-18 17:43:38 +00:00
Qt Submodule Update Bot
0ec04b89e2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I08c40165efeebfb2df661bdac17e8ad2db48fb49
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-17 14:05:05 +00:00
Qt Submodule Update Bot
6d7b27ab94 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0d18827d5f92c8ba488a7ccac5a7550444e7400b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-13 15:47:14 +00:00
Qt Submodule Update Bot
00a8eb7b67 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie1d5820003ae40418f00ae2c3d67c2891068c92c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-11 19:11:40 +00:00
Jerome Pasion
34656ac5ba Doc: Add alt text for \image tags for qtmqtt
Alternate text (alt text) improves the documentation experience for
screen readers and for other accessibility tools.

Task-number: QTBUG-135098
Pick-to: 6.11
Change-Id: Ia1793ff3e0bacd8cfdad2e8c04725a5093ed30aa
Reviewed-by: David Boddie <david.boddie@qt.io>
2026-03-11 14:32:53 +01:00
Qt Submodule Update Bot
39260ae2da Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I546348735b48a645c452395b24393c6989299e33
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-10 06:57:24 +00:00
Qt Submodule Update Bot
b29077d7a8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib2e0d05e73020cc2e1215e76841417b5b8d3e76c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-09 10:06:28 +00:00
Qt Submodule Update Bot
3f7a78ee7a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib0d6c76b924a6615c804c25113d663cb94bdaea3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-03-05 10:31:13 +00:00
Qt Submodule Update Bot
e67dafc7f0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1fcbfb7adb0b827e6335765762b8fdc93818af8f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-02-17 16:00:25 +00:00
Qt Submodule Update Bot
d29b14762a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If1bf7c2f766842b21393cee6e5ae3d1d8eca172c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-02-11 01:32:08 +00:00
Qt Submodule Update Bot
9b6034ed76 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibce7dde41a8136a6986c9fabac8ad7c48f06e336
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-02-09 00:06:17 +00:00
Qt Submodule Update Bot
3ba3066570 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1f069b0755e58e6f1f049c6b0194e043b768ff21
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-02-03 12:02:40 +00:00
Qt Submodule Update Bot
66508a4eb9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I151ad0cb4c1667d46b199a065ab8903fda2ac063
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-29 15:14:14 +00:00
Qt Submodule Update Bot
a7e5abab46 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If85193ce60865df2fb92425715bb187c5e8f225d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-25 16:52:48 +00:00
Qt Submodule Update Bot
b4bcd45be0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7b92d3d4456e78d32af59118422bffcc1a37bfcc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-20 00:10:09 +00:00
Qt Submodule Update Bot
2bc0a35600 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4b7e6ac674561afb0df13d537fd5332a6105bf13
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-17 02:14:55 +00:00
Qt Submodule Update Bot
9713f3ce3c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I32610627abd76b060c7adea079d67e0970586957
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-14 14:43:57 +00:00
Ivan Solovev
e2ae1fc992 Fix docs for new items of QMqttClient::TransportType
Mention that the transport uses QWebSocket, not QIODevice.

Technically, the implementation is still based on QIODevice, but that
is not what we want to highlight in the docs.

Amends dec643fc61.

Pick-to: 6.11 6.10
Change-Id: If561b3828cf8ffce4f245f7b4688a168a2ae3857
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2026-01-14 09:24:32 +00:00
Qt Submodule Update Bot
8e5acbae56 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib20ce2a7150e5de68de88bfc6fd6795939c7b828
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2026-01-05 13:57:08 +00:00
Qt Submodule Update Bot
c588c20e66 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I255f088dfb1a6623b9847b977d3d9158d2a25b7e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-20 00:59:24 +00:00
Jani Heikkinen
f86a1256ea Bump version to 6.12.0
Change-Id: I60f51632b5e24ba98afe6d9d1bb156bf08989b82
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
2025-12-16 22:38:11 +00:00
Qt Submodule Update Bot
cf63fbc069 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7578986ec8bac24afdc5cfe7a325fa3ded0ba340
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-16 22:38:10 +00:00
Qt Submodule Update Bot
18f56919ea Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I27aaf4c2d2ef97d7f3978e47acbe952bc3939ea0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-12 17:56:25 +00:00
Qt Submodule Update Bot
4f6e8dd0f1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7ee826f2a6539fe2fe764f1e6df6ad17de721bac
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-05 12:44:08 +00:00
Qt Submodule Update Bot
10b203bfa2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I51c421442b87aacc46e628661319e3e1983dffae
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-05 03:01:55 +00:00
Qt Submodule Update Bot
b50be0baf7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3ee675366b1355cfa625f18803d3874a47065214
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-02 10:46:02 +00:00
Eren Bursali
1189064b88 QT_NO_AS_CONST: rename "QT_NO_AS_CONST" to "QT_NO_QASCONST"
QT_NO_AS_CONST got renamed in qtbase.git in commit
03baf08d2bb9

Task-number: QTBUG-141558
Change-Id: Iadf4ab8b56ae714cccee2e6093009555c710c41b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-12-02 09:39:22 +01:00
Qt Submodule Update Bot
977115a9cb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iec832909c05cb475a08eb71f86349c551a81c5a1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-12-01 10:01:53 +00:00
Qt Submodule Update Bot
db2c48bf61 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I30a8b40542a8badb8272ec30ed4bcabb6d9e605d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-28 11:03:30 +00:00
Qt Submodule Update Bot
c4be55826e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I009322caf810db5402f98788ef63886ef712213b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-26 11:25:09 +00:00
Qt Submodule Update Bot
c6ea0e6059 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I74249232f221b19d0568210eb8039caf1b97e98c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-25 05:49:34 +00:00
Qt Submodule Update Bot
00190db47e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I444bf8b12e27a117d534a8a1ef03362ed5508e68
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-20 19:24:30 +00:00
Qt Submodule Update Bot
f6a803d24c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I917bda3b42bd8be0f0d5624501ac9a0edc6f0fd2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-19 12:08:30 +00:00
Qt Submodule Update Bot
6372682e14 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7159d919f11488a9d5edefdb619dd3af3aeea42d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-18 16:43:07 +00:00
Qt Submodule Update Bot
2b011198f1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iafffb7c835835bcf57de5e2653cc88c563a5891a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-15 00:54:26 +00:00
Qt Submodule Update Bot
f18faa609a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I43e38acf9b1fc30ab43f0143391b5fac8fa7eb84
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-14 01:30:50 +00:00
Qt Submodule Update Bot
f1cee95bbd Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ifb01c321e1c15f74ccb87a67fef782511a250902
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-12 13:28:58 +00:00
Qt Submodule Update Bot
0d21bdef58 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib5b9196a1eb9bf856c06c24fd0547f8a273b8f21
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-11 21:44:14 +00:00
Qt Submodule Update Bot
ad34c67816 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia883cd3b309fa9ce3424e0b2ec051207ecde375f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-10 23:04:08 +00:00
Qt Submodule Update Bot
7bf74eac1d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4f439ced40d37d13cf09f008f8efa9de37d570d9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-07 13:36:33 +00:00
Qt Submodule Update Bot
44c50b2b66 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3d21a10d68e7fba47f1c24738f0d09e286eb3a77
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-06 01:13:17 +00:00
Qt Submodule Update Bot
6e29d031b5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If5ae9b44030e08f90b776cf9d47481117c2a3eb9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-01 18:34:55 +00:00
Qt Submodule Update Bot
bd81918910 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1ac66064a7f6aa9782979bbd35ce10694ebac8df
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-30 23:06:19 +00:00
Qt Submodule Update Bot
32f954d6c2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idd4bfa5846ee2cddbc25e12d8aa99bf9c3e50eb4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-27 20:02:37 +00:00
Qt Submodule Update Bot
467f31cc1b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Icc8643527c208d6df601d2a9e0254de0ce1e0818
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-24 02:32:26 +00:00
Ivan Solovev
b5c1e3aeb6 Mark more files as security-critical
The qmqttclient.cpp file contains parts of the MQTT protocol
implementation, and hence marked as security-critical.

The qmqtttopicname.cpp file contains the code that validates the topic
name and also parses the levels -> it is a data-parser, so should be
security-critical as well.

Amends 18548033e1, which incorrectly
marked these files as significant.

Not picking to 6.9 anymore, because that branch is already closed.

Task-number: QTBUG-135764
Pick-to: 6.10 6.8
Change-Id: I0e8b72fb1d24b7bbf6ac5edab63e137f9d36dd30
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-10-15 10:17:04 +02:00
Qt Submodule Update Bot
6740c49752 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I98731db56278fdcfec8432b6021a434946b04333
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-09 12:01:52 +00:00
Qt Submodule Update Bot
d2118973e7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Icb670b8c44894305bd5d818fc3a8aeb737f406c0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-03 11:28:27 +00:00
Qt Submodule Update Bot
9f1c2af872 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia42e0000115cc06ef2d76bced89ac5df3a7f3027
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-30 23:15:30 +00:00
Qt Submodule Update Bot
13b1e8f4db Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If877ba8189738ea27003a9e3dee1237ad8ed5f01
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-29 11:25:32 +00:00
Qt Submodule Update Bot
ccb2349722 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3db6f7d4eca7ba5e3fe54dbf6433cce04c47d105
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-26 18:49:50 +00:00
Qt Submodule Update Bot
6624b461eb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I34f9de26d6e05f500604f11264716160034ac989
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-20 15:03:54 +00:00
Qt Submodule Update Bot
7cd379444a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie9d561227fe3154099c38cbdae9818f9e708cc36
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-18 13:42:52 +00:00
Even Oscar Andersen
635ae612f1 Implement waitForBytesWritten for the websockets case
Not implementing this function causes a lot if Invalid Socket
Specified in the tests.

Also fixed a problem with broker_connection.h where
DefaultVersionTestData did not evaluate to version(0)
if MQTT_TEST_PROTOCOL was defined.

Fixes: QTBUG-137305
Pick-to: 6.10
Change-Id: I4b825196548a3f5bf07c3bb4203a0b46033004ba
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-09-10 11:39:48 +02:00
Qt Submodule Update Bot
2c9be38a7c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0e8d9b044a8a2cf8a1940fcd54a381cd469d4fc0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-05 14:35:58 +00:00
Qt Submodule Update Bot
d5c3a3334c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4fb85f3bf08501514df0adefe1dc31fab56bc705
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-01 22:01:06 +00:00
Qt Submodule Update Bot
fae7ba0455 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0876db987f0144f03beb88d17020798dbb0228a8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-08 23:06:26 +00:00
Topi Reinio
1cc23b20ef Doc: Fix incorrect usage of \generatelist
The \generatelist command takes an optional argument
that affect how the members are listed, for example,
`classesbymodule` which creates an annotated list of
the classes in a named C++ module.

`groupsbymodule` is not recognized or documented. QDoc
falls back to generating a list of all members of a
group in this case. While the end result is correct,
this relies on an undocumented feature that is likely
to change and break.

Replace these instances with an explicit \annotatedlist
command that produces the same output.

Pick-to: 6.10
Task-number: QTBUG-138901
Change-Id: I4c36087ff39efc740bc938888aa2531f635d9b67
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-08-06 09:16:23 +00:00
Qt Submodule Update Bot
96ec1750fe Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Icda5f2dddf8307463100183c8be1740f217d9b7f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-08-05 11:16:37 +00:00
Ivan Solovev
111328866c QMqttClient: optimize client id generation
Use the QUuid::Id128 format when converting a QUuid to string.
This format does not use curly braces and dashes, so we do not need
to remove them later.

Change-Id: I9b76c4eea03a4ba150e2a95ed8d108a6b1d9b8e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-07-29 15:11:27 +02:00
Ivan Solovev
18548033e1 Mark the rest of sources as security-significant
This is the default level. All critical parts were identified in the
previous commits.

Fixes: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: Ib9df3db37e3efe3074f0fbc99eb60d31281d5a5a
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-07-29 14:06:19 +02:00
Ivan Solovev
7674ec983f Mark qmqtttopicfilter.cpp as security-critical
The QMqttTopicFilter::isValid() method parses the user-provided
string and validates it according to the MQTT protocol.

Task-number: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: I841bf83bbf29a2cdf4cf3faec93615a33f597241
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-07-29 14:06:17 +02:00
Ivan Solovev
13a98e39e7 Mark files that implement MQTT protocol as security-critical
The qmqttconnection.cpp file implements parts of the MQTT protocol,
including proper packet generation
(e.g. in QMqttConnection::sendControlConnect()) and parsing
(e.g. in QMqttConnection::processDataHelper()).

The qmqttcontrolpacket.cpp file implements payload serialization
in QMqttControlPacket::serializePayload().

Task-number: QTBUG-135764
Pick-to: 6.10 6.9 6.8
Change-Id: I5b398c8739e549ba849fcc31f25cd05ca3384f30
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-07-29 14:06:14 +02:00
Qt Submodule Update Bot
0342578df5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I13d5a5e3ea13b2cf9e31ca22748b12f50cee48e5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-18 14:16:23 +00:00
Qt Submodule Update Bot
7a968c89c9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I64fe155aec3684907356e7b21dcd33cf5eda5774
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-15 09:36:36 +00:00
Lucie Gérard
0cd68dbd7b Remove year from Qt Copyright in REUSE.toml
Change-Id: I52b3893620e9b027db6ba7da7dcb38780b085e6e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-07-09 11:01:49 +02:00
Qt Submodule Update Bot
06c368d44f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3bd4366c6510c2e610fa684e9ab6db1cf504ab6d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-07 11:01:40 +00:00
Qt Submodule Update Bot
f4398ac583 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0d8c1a212a44147d69ec92c5ff97257d533636fe
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-03 17:47:37 +00:00
Qt Submodule Update Bot
8141fbbb6c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I745c707bea84130fa451c8178f9ad0f5d46f2e45
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-07-02 00:01:47 +00:00
Qt Submodule Update Bot
3f99de6d17 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2c7f6a2c5622c60af230dac827f144ffa81bb531
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-30 15:55:49 +00:00
Qt Submodule Update Bot
7cbde7dc91 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9ba15372af59a99a409d7aeb3556f5aa8d1ad6fe
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-27 16:23:42 +00:00
Qt Submodule Update Bot
f2c7593a55 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8f2203f45802b9dc7bd8c19835bb22ad97bfb28c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-25 23:28:27 +00:00
Even Oscar Andersen
c383083270 Make sure unsubscribe followed by subscribe returns new subscription
Since we could only have one subscription for each topic it was
not possible to return a new subscription when a subscription
request comes in on a topic that is scheduled for destruction.

We solve this by switching to a QMultiHash for the active
subscriptions, allowing more then one subscription for a
given topic. However, at most one of these subscriptions
are not present in the list of subscriptions scheduled to
be unsubscribed

This patch also changes multiple unsubscribes to the
same topic. Earlier all would return true, and
m_pendingUnsubscriptions would be updated for all
requests.
The new behavior is that only the first unsubscribe
is acted upon. Furthere requests will return false.

Fixes: QTBUG-135653
Pick-to: 6.8 6.9 6.10
Change-Id: I5a79efb68b3191e185325a89cc2042c773bb5c12
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-06-24 13:14:36 +02:00
Cristian Le
a0a4633308 Move qt_internal_project_setup as early as possible
The earliest we can move this is right after `BuildInternals`. This
allows us to add function calls before navigating the `find_package`
tree of the dependents.

Task-number: QTBUG-135233
Change-Id: I2ee7bb0cb5addc422405768ba5706607a7257d6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-20 15:33:39 +02:00
Qt Submodule Update Bot
b47cff69bf Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idaf84020852076585ef93858717f5a752a0b3a19
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-18 01:10:05 +00:00
Qt Submodule Update Bot
9c0cef3350 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iaa91353a84251a60f0e01dd2db6a611684c1320c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-14 05:35:06 +00:00
Jani Heikkinen
ae33492ca8 Bump version to 6.11.0
Change-Id: I086e87ea2dcc44e5acd11d298cf893dd26dba16b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-06-14 06:35:05 +01:00
Even Oscar Andersen
6eb01cac46 Mention in websockets subscription example that websockets are builtin
Added a \note, but keeping the example to show how to create custom
transports.

Pick-to: 6.10
Change-Id: Idf3b22532f6e0b94a0113cea6152a36e81398ea9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-06-12 13:40:32 +02:00
Even Oscar Andersen
2978075162 Add missing trailing comma for enums
Found in api-review.

Task-number: QTBUG-137478
Pick-to: 6.10
Change-Id: I73984caae5714c0f3cddd0f1770ddf19fd6fcd49
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-06-12 09:32:21 +02:00
Even Oscar Andersen
951ea815b8 cosmetic fix in qmqttclient.h after API review
Moved declaration of the new connectToHostWebSocket[Secure]
afer connectToHostEncrypted

Task-number: QTBUG-137478
Pick-to: 6.10
Change-Id: I58ef8da23bf9759a1744908e02c6b9ef5db405f1
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-06-12 08:23:11 +02:00
Qt Submodule Update Bot
27a5c3ce6b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1de43ec97d385dfb22be3908444106d911b0dfc6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-24 01:05:08 +00:00
Qt Submodule Update Bot
d09d1fbf67 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5856f01258f66531f630498d347d9e7b4abc1841
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-21 11:10:34 +00:00
Qt Submodule Update Bot
f542cfa1a4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0684185387dd54082efc089b588d10aec101a8a6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-18 11:34:05 +00:00
Qt Submodule Update Bot
22b5735162 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I178cf8b191d92ccd0b5eff57b07f70ee25f09c63
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-13 21:31:06 +00:00
Qt Submodule Update Bot
5b5dee5f74 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib21e6cac99074663dc91eee737af41225a3aa7e0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-08 16:39:13 +00:00
Qt Submodule Update Bot
9c04ffb5c3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib2312b9c2a8a2f5d61b56bfa405d259cc7cb3dda
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-03 03:37:03 +00:00
Qt Submodule Update Bot
7ce0033a38 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6308729917e195f4a8aec5328285f00fff913410
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-05-01 09:33:52 +00:00
Qt Submodule Update Bot
ec49cefbaf Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib0f38c485af7f093122f5a2739ee90f365103ada
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-29 15:16:48 +00:00
Qt Submodule Update Bot
11172cfa34 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idaac3051ff5ff6656e43f0327cc8d9c4da0946cb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-24 10:35:47 +00:00
Michal Klocek
9929b7c148 Band-aid patch for overriding mosquitto installation detection
Currently installation is detected by looking for 'mqtt.conf' files,
which are set during provisioning in install-mosquitto-mqtt.sh
and install-mosquitto.ps1. However, this only reflects installation on
the build machine and not on test node. Therefore, add a way to disable
it on WOA also when cross compiled despite of existence of
'mqtt.conf' files on build node.

This is just barely a band aid patch as handling should be really done
during provisioning by Set-EnvironmentVariable, which than could be
read directly by test node as {{.Env.XXX}. However, it would also require the test to detect the setting during runtime and not during compile time.

Note the native arm64 windows setup has no mosquitto installation,
therefore this patch does not change anything for current native windows
arm setup, it only overrides setup for cross compilation node.

Task-number: COIN-1211
Change-Id: Ie6e84b6b04da48c1df284a388022f31ba1eea93e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-04-11 08:01:20 +00:00
Qt Submodule Update Bot
97fd1f585f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id96ae45b056d46ea5bf62bc0c89eb4b92f65e0ed
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-03 16:38:58 +00:00
Qt Submodule Update Bot
2465b63c36 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3f33036115fd78c2bb44973ead264a0bed78bd07
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-04-01 13:26:22 +00:00
Qt Submodule Update Bot
c04fcebf93 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I573c1e68a9c5d65c57eca4b56a214b8cfa65c6ea
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-03-29 16:47:26 +00:00
Paul Wicking
2cfbbfd24e Add .gitreview file
`git-review` is a command line tool for interacting with Gerrit.
Some IDEs offer support for this tool, either natively or through
plugins. The tool relies on a configuration file, .gitreview. Adding
this configuration file to our repositories simplifies initial setup
for contributors that use the tool directly or through their IDE of
choice.

The configuration file adds a remote called 'gerrit'. This is the
default for the tool, and also the name set for
codereview.qt-project.org by Qt's `init-repository` script. Thus,
the configuration should work seamlessly alongside other repository
helpers.

Task-number: QTBUG-132604
Pick-to: 6.9 6.8
Change-Id: I5b2f0c79f58d97fcc9cb339d663d9cb15cd09c57
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2025-03-24 15:22:02 +01:00
Qt Submodule Update Bot
b5bd818d22 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id6dfed84e1357377c11ab0171d3b615cbbf879d2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-03-19 18:31:03 +00:00
Lucie Gérard
0c91902e7e Update licensing of files with infrastructure type
A QUIP 18[1] update sets git files, REUSE.toml and licenseRule.json
as infrastructure type files. They are licensed with:
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.9 6.8
Change-Id: I03d77977a9ee6e41d0a7b45dbe9dc3006c2cce83
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-03-14 13:37:56 +01:00
Lucie Gérard
609f3fe7eb Remove unnecessary comment
Pick-to: 6.9 6.8
Change-Id: Ib2c53483e2fe011c239df0918663a75e98641e0e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-03-05 09:37:10 +01:00
Qt Submodule Update Bot
9048f80e3a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia06b68d234528992174e8ba1f1b25b0a0752dd33
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-28 09:13:41 +00:00
Lucie Gérard
6b9b462bb5 Make module ready for source SBOM checking
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding exception to the licenseRule.json files
- correcting the licensing given via REUSE.toml files

A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why  correction are needed before turning the
source SBOM check on.

Task-number: QTBUG-131434
Pick-to: 6.9
Change-Id: I5398523eafdae59a234bc2ed5ddd229c0aa923df
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2025-02-21 07:45:57 +00:00
Qt Submodule Update Bot
d0ee0581d0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic6437947f3193cb5b8566d6e8094781925184503
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-20 11:57:14 +00:00
Qt Submodule Update Bot
af0893b8bb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I10122a727ab1fb3273aa3d5a9c2996bba8e0c135
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-19 17:58:37 +00:00
Qt Submodule Update Bot
0473d461f5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I93c88e4acbc28f9976e99a6512fddfd50641aa0a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-19 05:29:38 +00:00
Qt Submodule Update Bot
5d29379dfb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I64add92d00913c692797554b5154ea2220f66055
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-02-18 15:51:34 +00:00
Even Oscar Andersen
f9305b56d9 Add websockets as an optional dependency on qtmqtt
Change-Id: I82e1e809adef35d1d09ec248c69f4f49eca8b0f2
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2025-01-30 09:11:48 +01:00
Even Oscar Andersen
8316766cec Add tests for websocket support for mqtt
For at least one platform run the twelve combinations of:
 Transport: [Tcp,Ssl,Ws,Wss]
 Protocol: [3.1, 3.1.1, 5.0]

This happens if the following defines are present:
  MQTT_TEST_BROKER
  MQTT_TEST_TYPE
  MQTT_TEST_PROTOCOL

If these are not defined, the old test behavior is kept

The logic is that we are replacing the type of VersionClient
to homegrown logic that replaces connectToHost with the
correct function:
  connectToHost
  connectToHostEncrypted,
  connectToHostWebSocket
  connectToHostWebSocketEncrypted

For this to work it is important that the VersionClient
macro is used everywhere.

Also, DefaultVersionTestData has been changed to
return version(0) if MQTT_TEST_PROTOCOL is defined,
we will now run one protocol at the time instead.

This is Change Request 2 of 2 wrt testing.

Task-number: QTBUG-129171
Change-Id: I4f68d7c2ea226a1107f009c80f87f8b749d9f120
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2025-01-29 15:54:55 +01:00
Even Oscar Andersen
967c70f1d5 Use VersionClient macro everywhere
We want to use the VersionClient macro to iterate over
version,connectiontype. To do this (in a later patch)
it is necessary that VersionClient is used everywhere.

This is change request 1 of 2 wrt mqtt tests.

Task-number: QTBUG-129171
Change-Id: Ica2f97bc2fd130cc49191d7381d49e88e8dc4a0c
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2025-01-29 12:40:15 +01:00
Even Oscar Andersen
dec643fc61 Add websocket support for mqtt
Move the example IODevices to be used with websockets
under the mqtt umbrella.

Two (private) devices are created; QMqttSecureWebSocketIO
and QMqttWebSocketIO

Fixes: QTBUG-129171
Change-Id: Ib7d37150c3a229e882a0c04a32cdd8b7929baf3b
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2025-01-29 07:42:34 +01:00
Even Oscar Andersen
24f5eceea2 Replace raw m_transport pointer with std::shared_ptr
Preparing for the add websocket change request.

Using shared_ptr gives automatic lifetime management
and is needed when adding more transport types.

Task-number: QTBUG-129171
Change-Id: I347175c018963130f403f8e9fe764e77203383a9
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2025-01-27 06:42:47 +01:00
Qt Submodule Update Bot
aa2fb73ac4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7cd9aed27c00b0470c2d336156cc581a00597480
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-23 19:56:18 +00:00
Qt Submodule Update Bot
3543195ee0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Icf63208ccf188653718b210a0d6ae529424d7a01
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-20 13:32:20 +00:00
Qt Submodule Update Bot
937974f18c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibbc37bab74636877240d7af614765127a3d144e0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-14 18:18:02 +00:00
Qt Submodule Update Bot
ceeb04c46f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I81b0d58559b4eec930a43c470696233a0998b1fb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-03 14:15:01 +00:00
Jani Heikkinen
d1f445af72 Bump version to 6.10.0
Change-Id: I95e2cd231e584635b5a1efddc04192a45c274378
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-01-03 14:15:00 +00:00
Volker Hilsheimer
7130aadcea Move logging category into new private global header
Addresses header review comemnts, amends
18bed862b2.

Task-number: QTBUG-132090
Fixes: QTBUG-132164
Pick-to: 6.9
Change-Id: I7d8f2b048482e18112b02374fe53f2bbed52021e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-12-17 13:48:37 +01:00
Qt Submodule Update Bot
b118aafb0b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I610c91b8895a9466575dec1e2a47feb784783bb0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-08 17:02:31 +00:00
Qt Submodule Update Bot
9aec010a74 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I11b6c11833d5f35a8bef63ed8dbe0175482de226
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-08 03:30:11 +00:00
Qt Submodule Update Bot
aeac9f7e17 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic9cea01fc588b15225e9245d83231ec09c535325
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-03 13:50:10 +00:00
Qt Submodule Update Bot
5a0b137e9e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0716289397822076834c4ec245cdc5920cc21729
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-12-02 13:50:33 +00:00
Jøger Hansegård
f6f8bc0fe4 Add CMakeUserPresets.json to .gitignore
The CMakeUserPresets.json file can be used to simplify configuring Qt,
particularly with tools such as Visual Studio and Visual Studio Code.

As opposed to the CMakePresets.json, the CMakeUserPresets.json should
only contain user specific configurations, and should never be checked
into source code management system.

This file is already ignored in the top level Qt super-project, but to
facilitate working with each individual submodule, we should also have
this .gitignore in each submodule.

Pick-to: 6.8
Change-Id: Ic12b3cce1b1082f206d076532f5d68452805ed08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-11-28 18:02:47 +01:00
Jøger Hansegård
45ab6b8cd2 Only call find_package when building tests as standalone
This allows us to build manual tests together with Qt by specifying
QT_BUILD_MANUAL_TESTS and QT_BUILD_TESTS. A benefit of doing this, is
that the manual tests show up as debuggable targets with IDEs such as
Visual Studio Code, while keeping full code navigation capabilities into
the Qt code.

Pick-to: 6.8
Change-Id: Idd309c06fb2586fd634386951a3345aa40bc093a
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-11-28 18:02:17 +01:00
Qt Submodule Update Bot
8452101eca Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5a9a7ec519bf43dd2833271c5ae0e2e56020f42a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-28 12:18:13 +00:00
Qt Submodule Update Bot
1de96c8ec1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I48ae9d954bb377a8ab7c71b84ebbcd025ce2e1f8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-26 15:29:21 +00:00
Qt Submodule Update Bot
048d6bebbb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0fff0ee90623922bcaddc6bee4199e492c1ca812
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-25 22:12:51 +00:00
Even Oscar Andersen
b539b0c38b Fix signal/slot problem with quicksubscription example
The example does not build with latest changes.

As it turns out there is a mismatch between the topic property
and the connected signal. Since the signal is not used, it is
removed in the hope that it will then build.

The error message from the build is:

Failure Summary:
The build failed due to a compilation error in 'qmlmqttclient.cpp'.
The function 'QmlMqttSubscription::topicChanged()' was called without
the required 'QString' argument.

Log snippet:
error: no matching function for call to ‘QmlMqttSubscription::topicChanged()’
note: candidate: ‘void QmlMqttSubscription::topicChanged(QString)’
note: candidate expects 1 argument, 0 provided

Change-Id: Ia8cedda578e2f2c082354892bd00cb9fd25b5652
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-20 17:36:32 +01:00
Qt Submodule Update Bot
83db4482e7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I319161c12707baa74acb06a988b34d6170baa6ae
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-20 16:36:28 +00:00
Lucie Gérard
cb00ee0cff Add REUSE.toml files and missing licenses
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

In order to be reuse compliant all the licenses present in the
LICENSES directory must be used. License files not used are removed.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: If5891d7b09a559e55081ef4e9111d91eb49a6b14
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-14 12:24:58 +00:00
Qt Submodule Update Bot
264ce67ade Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0eedefc1a3ee5119970cc3c858e1f2369474e031
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-07 05:22:55 +00:00
Qt Submodule Update Bot
f17511d6f5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I043938cf3dd509f5e28cb4b8fdf62f43d535f834
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-06 11:58:18 +00:00
Topi Reinio
5400305ccf Doc: Enable documentation testing in the CI
Include documentation testing steps in coin/module_config.yaml and
set the warning limit to zero.

Task-number: QTBUG-130559
Change-Id: I00593599b978406ec2fe166273be479d29f3a8e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-11-04 11:24:39 +00:00
Qt Submodule Update Bot
2bf9713ece Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iff52463fb25dbda8fdbba6af713ec99a6cea4806
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-11-01 18:10:00 +00:00
Qt Submodule Update Bot
5f8de4a443 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ifdd09fab0f59f5f3fc5aefbfc3f63d2811a205c6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-30 20:14:55 +00:00
Qt Submodule Update Bot
fd2a5b9d4e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib5946e102f2d7f59a9d8e0e64bd7f81390229bcc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-10-23 03:22:15 +00:00
Qt Submodule Update Bot
e321f4663b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I079d8af75b2929fee57fb625d92741918d460705
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-27 06:59:33 +00:00
Qt Submodule Update Bot
f1b13c908a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ieec8f837a1902f929d9bacddccd54ae6cc1c1597
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-25 04:24:27 +00:00
Qt Submodule Update Bot
ba488ed615 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iba24b0f940d43fceba2fc4d4b99c9af2cbf55e8b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-23 18:09:28 +00:00
Qt Submodule Update Bot
06f07a00a8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6ab3b0900bd92e9fe66d74a56ef96a1384fd0b1d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-20 16:57:40 +00:00
Qt Submodule Update Bot
50677c5da2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie914acb8f8718fa8465a03aee87a11c076f4411a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-11 07:09:17 +00:00
Qt Submodule Update Bot
cec66481b3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib10adc31ce68dc076afaeda8daf22dfa99625758
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-05 05:14:16 +00:00
Qt Submodule Update Bot
575e141bb0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I45d14154ce8830934a5a11102ee64977213c0508
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-09-03 18:42:42 +00:00
Qt Submodule Update Bot
84888e818e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9073c080ab86a24281bb9bfa33b4751915fc3cad
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-31 07:01:24 +00:00
Qt Submodule Update Bot
fefcebc0f3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2452d0f49d0765dab5c729c2a6593d79f708a544
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-29 07:11:20 +00:00
Qt Submodule Update Bot
8dc327b4ba Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I48a5e0e0ab862f6250092df36047104cfe7d1d99
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-28 01:39:07 +00:00
Qt Submodule Update Bot
c15616b0a7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9bedf4a768bf77236570023fef1b1926d97ee3fc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-24 05:54:12 +00:00
Qt Submodule Update Bot
334f06a95f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I17def9c64152d66a7e77cee345c03d030b53e8f4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-21 21:14:12 +00:00
Qt Submodule Update Bot
240875588c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I669882ed4f72ffa329239a574d9d50f186ea832e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-19 11:36:18 +00:00
Qt Submodule Update Bot
0eee872326 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2bd212ad4d12f40487c9299ea9abf8e867eb53c3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-14 21:27:03 +00:00
Qt Submodule Update Bot
6490484c9d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8da68d76d458a7d8578f238260a492102030b842
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-09 12:41:23 +00:00
Alexei Cazacov
5fcdb78b9c Docs: Organize topics in the qtmqtt repo
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer

Task-number: QTBUG-127289
Change-Id: I877bf1c62485161177ebe78f8326a4f979886cc5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-08-07 08:20:14 +00:00
Qt Submodule Update Bot
3a7f631998 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I12fa23e0df7292e3c448e7afe6b1b56c28ccaec3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-06 22:39:14 +00:00
Qt Submodule Update Bot
87d82a895f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I36a06d6ee579ac1d0013b730b4b09c7eb9407240
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-08-01 11:11:38 +00:00
Volker Hilsheimer
18bed862b2 Clean up logging categories
Declare them in a suitable header if they are used across multiple
unrelated files, otherwise use Q_STATIC_LOGGING_CATEGORY.

Unbreaks -Werror built.

Change-Id: Ic0759a2185be4288e8c7791c3a9cf22371d2d477
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2024-07-31 11:40:25 +02:00
Qt Submodule Update Bot
314a9bd0f6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ide41d158581a7fe535f1ac25f6a6b07e396d5ee2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-30 15:09:07 +00:00
Qt Submodule Update Bot
a87700e0d0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5e2899978b80ed0c4733940c15ece1eb0aa7789b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-26 16:10:28 +00:00
Qt Submodule Update Bot
386ca7d5b8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I62492ac5cc1ed55f518ca6d9ddf1e0f62f223e8c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-21 23:40:08 +00:00
Qt Submodule Update Bot
362b9a9e08 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I831b3c834a1044684ad934afa3edc60daee4217e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-17 23:49:10 +00:00
Qt Submodule Update Bot
3813cf3bdd Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If98e6cb3093a6bf27b5a1b4b2f23d3ba0e756d76
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-07-11 14:09:12 +00:00
Alexandru Croitor
45a786170c CMake: Annotate some targets with SBOM information
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I7034d7a15f378b935624b1f957fb251c5cd16ad9
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-07-11 12:02:38 +02:00
Qt Submodule Update Bot
3f24adc297 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I26b774832e3cdf2ae021d304eb1865f51230a000
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-28 23:44:19 +00:00
Qt Submodule Update Bot
a8125e63e4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I55110f65c422af76131371168ebbe5450417a1c8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-25 20:06:49 +00:00
Qt Submodule Update Bot
5c5c9c44d7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic1c26194b6f2d52761b8e4300aa056b81f2a4485
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-20 08:30:09 +00:00
Qt Submodule Update Bot
dd6bf765ed Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I522b1d4dbc31f94ab626e51cc4f66a18dd7c3919
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-18 23:28:04 +00:00
Qt Submodule Update Bot
a66f4ab2aa Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie6fb0cbffaeb52055b45d9cd5f40ddf6d9b3e535
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-14 14:08:15 +00:00
Qt Submodule Update Bot
06e4c4e9b5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia35e9b08f1ed40250067a3517c0bed32f475e6a3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-11 03:13:55 +00:00
Jani Heikkinen
b1317fcbfe Bump version to 6.9.0
Change-Id: Icbf5bb9d13324cb692464a96fd7b5cbca89961ab
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-06 03:49:39 +01:00
Qt Submodule Update Bot
5ce02acf9b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iead1bfbbb6f46429cb53abc20bd789dfa2871ddd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-06-06 02:49:38 +00:00
Alexey Edelev
613fbbab5c Remove the use of GENERATE_CPP_EXPORTS argument
The behavior that argument was enabling is the default one now.

Pick-to: 6.8
Task-number: QTBUG-90492
Change-Id: I4e59f9ce590f76fd077cf1dafa7a423e6f958b5a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-06-05 12:09:25 +00:00
Qt Submodule Update Bot
22cc223fa0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I690bdcbc7b6c922ccb456845e4223f20f16531ec
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-31 20:06:28 +00:00
Qt Submodule Update Bot
fe0b774fea Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I625821b386e83a423824a7b6a3b34f018fd7c2dc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-30 20:31:02 +00:00
Qt Submodule Update Bot
c103de1f3a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id9f2968cf739eeadff64ff2e8e0b4d8f1f1ce6e5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-28 16:33:18 +00:00
Andreas Eliasson
b87c87453f Doc: Add valid value to QMqttClient::protocolVersion
As described in the ProtocolVersion enum description, MQTT Standard 5
is also a valid value.

Fixes: QTBUG-120947
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I27ed8ad1d31201abb195c35ab56ced3ad08494cc
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2024-05-27 14:17:20 +02:00
Qt Submodule Update Bot
feb57c8033 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7859060220b7f1e7830cdaf2f078f7984f58c051
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-25 01:57:35 +00:00
Qt Submodule Update Bot
38e9720eaf Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6ba983089441b837a6412009c8b2eb1e5afd8985
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-23 17:35:34 +00:00
Qt Submodule Update Bot
513d1df905 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idec66fa1a29cfc41d1d347d8f068e7e13a83f580
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-20 14:54:30 +00:00
Qt Submodule Update Bot
783ba75401 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I915ce9849880ab59ba5269cb94ee60c0691c56d5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-16 22:26:44 +00:00
Qt Submodule Update Bot
375df78c68 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id29620ed1f4b2f80aa16f814c281ae0e85d4d7da
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-14 18:08:34 +00:00
Qt Submodule Update Bot
ac1eea17af Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia49da13e0361282c965dd07c9e57672c99c2592d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-10 12:03:11 +00:00
Qt Submodule Update Bot
d28fdf1b6e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia62d2707e29a4f2cf40166d7a28ca8e169d35cc9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-03 08:59:56 +00:00
Qt Submodule Update Bot
f605c53044 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0b2318a9fc5cd499177065dfe7fae90d3371c3e8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-05-02 09:20:55 +00:00
Qt Submodule Update Bot
3f3c030cbe Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie7dbb68f4da08e283a9fc0ec545212512aa4bef3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-29 12:07:21 +00:00
Qt Submodule Update Bot
724b5a12ae Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I59802aab79949becaf9b021839a63634250d0e54
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-25 10:44:40 +00:00
Qt Submodule Update Bot
79cf46057a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibfef1d4b8667ad6fb93aa23ee3f3ea5cfa24cba9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-19 06:43:10 +00:00
Qt Submodule Update Bot
c4a983fa2a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1c6b4b5581ae37c16de3458cf158a52bb39cbfbb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-17 16:25:21 +00:00
Qt Submodule Update Bot
5bceebb527 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4ea7b97fa5d37dfb55fdaa801407de30a4ce7739
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-05 04:07:32 +00:00
Qt Submodule Update Bot
f07e678f77 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I06f57390ead939e2c4cc868d6639faab99770f2f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-25 21:38:44 +00:00
Lucie Gérard
dafd1cd664 Add a licenseRule.json file for checking of SPDX license identifiers
The license test in qtqa reads this file
in order to check the validity of the license used.
This file reproduce the QUIP-18 [1] rules, with some exceptions.

Each entry in the file corresponds to a set of licensing rules.

A set of licensing rules can depend on the file ending,
registered in "file_pattern_ending". The last entry in the
file has no "file_pattern_ending", it sets the rules for the
files whose licensing does not depend on their ending.

The license to be used depends on the location
of the file within the Qt module repository.
Let's call this "<true_location>".
The  "<true_location>" can also correspond to a file name,
offering flexibility for exceptions to the rule.
The "<true_location>" are registered in "location".

For each "<true_location>" there is a
"file type" entry and a "spdx" entry.
The "spdx" entry gives the rule:
the expected license tag(s) in SPDX format
for the file ending (if applicable) and "<true_location>".
The "file type" informs on the QUIP-18 type
the tested file corresponds to. It is purely informational
for the reader.

The set of rules are tested in order of appearance
in the json file. For this reason, a more constraining
ending (like "special.txt") needs to appear in
a "file_pattern_ending" located before
the "file_pattern_ending" of a less constraining ending (like ".txt").
Also, a file ending cannot be present in two "file_pattern_ending".

"file_pattern_ending" and "spdx" should list strings.
"<true_location>" can be regular expressions.

During the test the deeper "<true_location>" are
checked first. The order is which they appear in the json file
does not matter.

To test this file, run
QT_MODULE_TO_TEST=../qtmqtt perl tests/prebuild/license/tst_licenses.pl

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121039
Change-Id: I240ee308911f5f49e45f25ea4cdbf21ce8a3e74c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-20 08:12:20 +01:00
Lucie Gérard
9e1a2c5287 Change license for build files in example
According to QUIP-18 [1], all example files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I1133ca3b2daf487dbbc2ddae6b94d7f20239ed49
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-20 08:12:04 +01:00
Lucie Gérard
1ee999aa48 Change license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: If63837f32f9f5e852292c20e449877e6a6fecc89
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-20 08:11:56 +01:00
Qt Submodule Update Bot
11ee7a10f7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iac893a9cf0c4562de30751e63183e72028dbd825
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-17 12:00:23 +00:00
Qt Submodule Update Bot
6a22ca3c26 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I641799a323c14bb4a726574fa51fc395728417ea
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-16 05:18:17 +00:00
Qt Submodule Update Bot
2a73ae9045 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7485a951bf0525bbb142cf5637b8088a8c111754
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-14 10:44:58 +00:00
Qt Submodule Update Bot
888261dea7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8032cfa4365da290cf4cf34f90825c453ee1264a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-10 16:52:05 +00:00
Qt Submodule Update Bot
68a1d995cb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic4cf52dd1c0e3eff1685b0199b485d465cfb74fd
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-02 15:38:14 +00:00
Qt Submodule Update Bot
c76bb3a41d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1de62095b25250a434ee277e205eaef3e4bac148
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-27 16:11:25 +00:00
Qt Submodule Update Bot
ac0bcc66f8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I346c204e9e2768e713bc5dabfc8b87de9a433611
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-23 22:18:49 +00:00
Qt Submodule Update Bot
a950a4b95d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1dad828ff0e350f2b366010166a1ca0df479df5a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-19 16:41:42 +00:00
Qt Submodule Update Bot
ef60f0ebd6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I274327c4938219301d03cb0290b50fee49d5c6fc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-11 00:39:41 +00:00
Qt Submodule Update Bot
a521510e23 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4fad6641225ebd06cc2d7d72571a7f65173040b9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-09 23:23:45 +00:00
Qt Submodule Update Bot
4268a06756 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I58b0560e0f03308fbdf1905a28bb2026bf5b424e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-02-07 03:44:14 +00:00
Tasuku Suzuki
d7af86d777 Remove extra semi-colons
Change-Id: I748935e1006224955580f4fceeebd486fed7dbf7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2024-02-02 16:27:18 +09:00
Tim Blechmann
7fd54b4961 examples: silence clang's wignored-qualifier
Change-Id: Ibdefee544ced86db73bbf821ea8c62c0d8c5c043
Pick-to: 6.7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2024-02-02 00:08:29 +00:00
Qt Submodule Update Bot
afc4e43234 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I06182ce9cc862b4e1fa11705b365261d69ed1fc3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-26 18:21:42 +00:00
Qt Submodule Update Bot
ee3d6b82a4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2bda28864a31dfdbb5a5ff4b4e32da27cea28b9b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-25 09:18:44 +00:00
Joerg Bornemann
6a4b1669c7 Enable CMake autotests
Task-number: QTBUG-84884
Change-Id: I3d697f371062ee8d358dce96cec22a9d1c182444
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-24 14:16:47 +01:00
Qt Submodule Update Bot
e27369baa9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I34f24176f13a94a9509337855e1d8589280cfcb2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-22 21:42:58 +00:00
Qt Submodule Update Bot
59cffa257a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic97ea3405e746abb1389f677e9501b072f7662f2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-20 14:27:52 +00:00
Qt Submodule Update Bot
158e84c147 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ide412bc93bf865e73003242c0ab0b882bc219662
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-19 14:38:59 +00:00
Qt Submodule Update Bot
d4d3a8be54 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iccfacae68cc7e4e4157414b56013fb67ccbac885
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-18 10:14:43 +00:00
Qt Submodule Update Bot
53d889274d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2b9fc6da00224d12f47c7a2c3d791d1fd0465890
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-15 16:06:03 +00:00
Qt Submodule Update Bot
9aecfd5131 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2536cd4ccbe0fb7db1889eb71acdb74fc54ea31c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-12 11:44:24 +00:00
Qt Submodule Update Bot
c56d2a0f10 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9925e0b795d2b30c3ec2790e97685ba40e5cc067
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-10 18:43:22 +00:00
Qt Submodule Update Bot
d16a193538 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6dd52218d0b4fd81cea32d796082eb614235c3ea
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-01-05 21:25:56 +00:00
Qt Submodule Update Bot
d508030cce Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4477b950d898280fd680046c0be79cf4c8a330c1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-28 07:18:26 +00:00
Qt Submodule Update Bot
57017186a1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iffcc9428b31dc9d1ede1503a847a8d38d57a117f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-21 05:30:34 +00:00
Qt Submodule Update Bot
458de550a8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I619394ab7883b80e13f5c9f5d7380c6c53b3ae08
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-19 22:32:49 +00:00
Qt Submodule Update Bot
e337731ff0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iac04639e8d50cc1884bc42beefd5dd52a7c5b352
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-18 18:38:57 +00:00
Qt Submodule Update Bot
1f543b04c6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I23e757f3c5bf323caf9d4a63aa8e31639f7e125c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-15 17:07:20 +00:00
Qt Submodule Update Bot
7c0ee9ae0e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2229b6155fdebf9436960e48b414dcb4f3d6b676
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-13 11:37:04 +00:00
Jani Heikkinen
5fa79018cf Bump version to 6.8.0
Change-Id: I356471776d6648409c5fc9742279893cda8eca5d
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2023-12-13 13:37:03 +02:00
Qt Submodule Update Bot
853f5c7f42 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I715f0423b3eb17526221c680e76b784079cbc71d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-10 02:13:43 +00:00
Qt Submodule Update Bot
4104f8f27a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I36602423aebbaef1686a4de85d53b09897cffab9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-09 07:39:23 +00:00
Qt Submodule Update Bot
a620570ac2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If7f98bec3514a031ec2e46800ed3622b84981415
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-08 01:16:39 +00:00
Qt Submodule Update Bot
ef90591ec5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If2cd0a2a5363d39b983bf6a4c78ed86220ebac59
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-05 05:56:11 +00:00
Qt Submodule Update Bot
848a9546ba Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7fb573b00decb634c5c5cb1713b56ece608819a3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-04 06:24:29 +00:00
Qt Submodule Update Bot
6e89d971ee Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5aa5a964024381978fbdd43d1bfe797ef616047a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-12-01 17:51:46 +00:00
Qt Submodule Update Bot
8f48ebca23 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I652e68a068244ecfb66d6be579049b5f1bf47e0c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-30 19:54:21 +00:00
Maurice Kalinowski
fb417c44dd Fix topic wildcard checks
A topic can have multiple '+' wildcards, but isValid was searching for
the wrong wildcard at the second instance.

Pick-to: 6.6 6.5 6.2
Change-Id: I83e3fa258ef01b26388c0e6fd8c17a0a140ab75a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2023-11-30 09:57:26 +01:00
Maurice Kalinowski
95b38eafb5 Fix handling of multiple wildcards
The matching check for topic filters did not take into account that a
mixture of wildcards is valid. While # is only allowed a single time,
using + is valid in multiple occasions and can also me mixed with other
wildcards.

Fixes: QTBUG-104478
Pick-to: 6.6 6.5 6.2
Change-Id: I04129d5fbbb21c95115a15d74c6787804a8d0b10
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2023-11-30 09:57:18 +01:00
Qt Submodule Update Bot
648a2da865 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iedf6cf11af246feb2878df6648f41429341fcef5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-29 15:52:02 +00:00
Qt Submodule Update Bot
09bfc3bc5a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib2df5390c751d99fa1ac4134deb7c0ed5766a4ee
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-27 06:29:49 +00:00
Qt Submodule Update Bot
ea742c3bbe Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ifad301e4f8864ed5f27a7c80435d5b683a977af1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-24 17:36:05 +00:00
Qt Submodule Update Bot
fe2d05ab0f Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2e5775ff9d9722356e3981948fd7ffeb29728aa9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-21 12:17:24 +00:00
Qt Submodule Update Bot
f88c37d13a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I14015eba88abfd8263230128008669b347358bf4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-20 06:28:24 +00:00
Qt Submodule Update Bot
07789093a7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I301ce0a074d7a3c72bfc624bd473aa4d05a2e9c3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-16 23:48:14 +00:00
Qt Submodule Update Bot
24b29797d3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia9f260ed90ebbdc27f79b16041d6d48f127b6ed3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-15 06:24:27 +00:00
Qt Submodule Update Bot
ac9f36fd9a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I29294ef6007842b900190d65c08c5da9f0265629
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-13 09:15:14 +00:00
Qt Submodule Update Bot
6438bdc9a2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3f7290b6b8921fb048302d7fada5dabf36354a7b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-11 05:38:02 +00:00
Qt Submodule Update Bot
092e17c795 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7b7f3d129f39f9e6fa630d846fca930d22094369
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-09 21:47:36 +00:00
Qt Submodule Update Bot
cd4c4ee82b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4946e46f64d12de0169fc5771833433dddbbff15
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-02 19:33:54 +00:00
Qt Submodule Update Bot
44b56e21e6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I33d0b1f3a83e0ae87878d62130afad3d92598256
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-11-01 09:46:02 +00:00
Qt Submodule Update Bot
1f111ab504 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib9b17d7a9343382b366095c387f4feadf9945090
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-30 16:45:41 +00:00
Qt Submodule Update Bot
7eae74b09b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iced5d53fb0313800134cb7e9412e5c8165ea41eb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-28 16:35:37 +00:00
Qt Submodule Update Bot
1b9b3a2105 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I04910ff742a8b339e29ea39143f1d5cf570a7f79
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-18 23:31:35 +00:00
Qt Submodule Update Bot
1325375dc1 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib044ed343f26333eb38eb7d7625432b4b28f7a69
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-09 06:43:01 +00:00
Qt Submodule Update Bot
0a10d4697a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I141f78dd592d52bf587d11bb7559851123344e19
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-05 09:16:49 +00:00
Matti Paaso
9ead6623ef Change Axivion configuration
Change-Id: I5eeb198e59cf0cbac0b05ca132944caf9d38a7a0
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
2023-10-04 09:03:31 +03:00
Qt Submodule Update Bot
c6a05dc96a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Icb5cbc95c4c787a173ce96f566983ccbc83ffd4a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-04 02:30:29 +00:00
Qt Submodule Update Bot
3acea150bc Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2b3ed02dd694c575ecc1c5242613312cff923fd4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-02 14:50:41 +00:00
Qt Submodule Update Bot
8403feb629 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idc146ae4915775cdba28fa15c17dd2107e921614
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-28 20:50:22 +00:00
Qt Submodule Update Bot
31e03818fd Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0726d7684d2979a3c128468d16df1a3098ea71f5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-26 21:24:04 +00:00
Qt Submodule Update Bot
e6c9d7ddef Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5621432ba5a9eb9bfd1dde007c0b509149a319d7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-22 04:18:49 +00:00
Qt Submodule Update Bot
7f23a7a848 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ica971aec8b62fb4cf23f576008fa34848226c3d9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-20 22:09:27 +00:00
Qt Submodule Update Bot
a3e0f87250 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I87744e9a7565b092e88e48e8d104475baa7f9711
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-19 12:36:47 +00:00
Qt Submodule Update Bot
07685a86ff Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I19a47f8289c41e5b19d6e52946ccfd435fbbc452
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-18 07:55:20 +00:00
Qt Submodule Update Bot
ae8b3e5081 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ifbb8a95e949d06a5c621de4f2239540d33945aa9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-14 10:56:26 +00:00
Qt Submodule Update Bot
10c325dda5 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I30997b073ad1ec4358b31dc8e3b954c814052e88
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-12 13:44:15 +00:00
Qt Submodule Update Bot
2a46a7fd4b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib065145525207267d4122e760887234c370d3305
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-09-09 18:41:34 +00:00
Jaishree Vyas
86574aa599 Doc: All overviews list categorization
The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.

Task-number: QTBUG-115347
Pick-to: 6.5 6.6
Change-Id: Ib33b450aa0919b0fd3e7a265cd2843af6c7d019c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-09-07 09:06:31 +02:00
Qt Submodule Update Bot
795526146c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9ad47b1bd35829ceb4cba7f64f9b403ace936f2f
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-30 22:20:13 +00:00
Qt Submodule Update Bot
801563aa70 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5dd53a59b13a5cc5e21c3b2748fdfb0a84a85775
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-28 15:53:32 +00:00
Qt Submodule Update Bot
177d93917c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id657c83bfbf04fbedd37dc4e08271a700b5c73a6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-24 19:22:48 +00:00
Qt Submodule Update Bot
c055fbea72 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I17d7af89e3e83cd485379eaf8570a89d3c3004a1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-24 08:08:25 +00:00
Qt Submodule Update Bot
3deda6e7fe Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iedfe29580bc46e19d09b0258c9e7f4cb2f66470b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-22 10:06:42 +00:00
Qt Submodule Update Bot
6881a00804 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I270cbd6bc827180448a73fe2d30a22d1e9d37928
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-16 17:17:27 +00:00
Qt Submodule Update Bot
48627ebd8d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I8c8a5a3dc046da1b81c81a58a23456557e18c9aa
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-14 09:20:56 +00:00
Qt Submodule Update Bot
4fc11030b2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibdea091f1d117a0392d30ae0080d1d69a4e6cfbc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-10 03:29:39 +00:00
Qt Submodule Update Bot
98757c0633 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib243cca18ea08ef721438058d27882986826aa0d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-08 16:20:16 +00:00
Marc Mutz
e74380b565 Mark the module free of Q_FOREACH ... again
This restores the QT_NO_FOREACH macro originally added in
9e7eba636e and then lost in the cmake
port.

Luckily, no new uses have crept in in the meantime.

Change-Id: Ief57253888dc910e5b424db64b2cd315033d4361
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-08-04 15:05:39 +02:00
Qt Submodule Update Bot
83e3dba185 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Iaef83c599f153a3582b00166f99f46ab7a4cfd4d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-03 20:23:06 +00:00
Qt Submodule Update Bot
eea6319f66 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1c542c46313d9c4f341428590f1297fe44d69bd0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-08-02 13:09:02 +00:00
Qt Submodule Update Bot
859e30eba7 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I5a2827b0a61ee2cbe3314ff183d80a0258e1e81a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-07-28 20:27:58 +00:00
Qt Submodule Update Bot
79135b68b2 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If28d0f7d64be8a461537d0f0c9495281a0bd763b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-07-26 16:56:56 +00:00
Alexey Edelev
058836dd27 Remove deprecated sync.profile
Task-number: QTBUG-112418
Change-Id: Ifb7b645420c5c5d4a0006223be3bc846dcf8bade
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-26 12:35:24 +00:00
Jaishree Vyas
9c9499e953 Doc: List of all Qt overviews which are now termed as explanation
The autogenerated list of overviews was adding the \group command which
included all the groups instead of overviews.
The idea here is to categorize the overviews later on once we have
the list of all overviews.

Task-number: QTBUG-114762
Pick-to: 6.5 6.6
Change-Id: Icb72c8d987bfe6290c98635f062a890f37c939ac
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-07-19 11:12:26 +02:00
Qt Submodule Update Bot
be37d80568 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9c07625e1d8e00b0dac381febba9a43f1e8b39ff
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-07-06 17:57:42 +00:00
Qt Submodule Update Bot
24b6d8f390 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id6bd922d2b8b0c24b91122917915d5c493e6a1b3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-07-04 00:57:11 +00:00
Qt Submodule Update Bot
1cdea2c9d8 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id88c1aed1466f70593330d9f5f3513d812f9e89c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-29 15:43:09 +00:00
Qt Submodule Update Bot
908988cf16 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Idd1c0f4479a828b64a6c72db3072be677c0aa96e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-27 09:15:16 +00:00
Mate Barany
1f9e2bf463 Remove redundant call from QuickPublication Example
Remove the call m_client.state(), it seems to be unnecessary (just like
in the Quicksubscription example).

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I460f12f3d4b33388013cb8250149239a6b0f1c94
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-06-26 14:42:43 +02:00
Mate Barany
87223c466a Document the Quickpublication example
Provide the missing documentation for the Quickpublication example

Task-number: QTBUG-110893
Change-Id: I002208e2e036a09acd68621f075bed7a11b6598f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-06-26 12:59:23 +02:00
Mate Barany
770c667325 Revamp documentation for Quicksubscription example
The revamp includes:
- Update the screenshot
- Rename the example
- Add examplecategory : connectivity
- Update the description and snippets to reflect the current
state of the code

Task-number: QTBUG-110893
Change-Id: Id4edd325a539838fb5fa5c6b7fbbbfe4b0c683ce
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-06-26 11:37:28 +02:00
Mate Barany
ebd1c795fc Remove m_client.state() call from QmlMqttClient::setPort
Remove m_client.state() call from QmlMqttClient::setPort, it seems to
be unnecessary.

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I4e1d8d2daf16da6c588f1b0b339ea863a22b32c0
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-06-20 14:07:00 +02:00
Mate Barany
a6581736ff QuickPublication Example: fix qmllint warnings
Fix the qmllint warnings in the quickpublication example.

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: If78a908807ee8a5f6f693d159a05a9ee91b1e38d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-20 13:53:31 +02:00
Mate Barany
f49eaa9b7a QuickPublication Example: Remove version numbers from imports
Remove the version numbers according to revamp the guideline.

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I9e8fdd0fa54b3218efd2c55bd3dac3137d43e756
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2023-06-20 13:35:12 +02:00
Mate Barany
63b5119a3e QuickPublication example: Port CMakeLists.txt to use qt_add_qml_module
Port the CmakeLists.txt and change the source files accordingly:
- rename main.qml to Main.qml
- remove MqttClient import from Main.qml
- add QML macros to qmlmqttclient.h
- revamp main.cpp

Also update the qmake build:
- revamp quickpublication.pro
- add qmldir to project
- remove qml.qrc

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: Iffe3e80e40f318d1520ca108933760c0e5d0c18a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-20 11:33:02 +02:00
Mate Barany
6e3f752fc4 QuickSubscription Example: fix qmllint warnings
Fix the qmllint warnings in the quicksubscription example.

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: I4f633573b8c8f28eb65d7d4a57d4a63d8b7f5881
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-20 10:39:45 +02:00
Qt Submodule Update Bot
ac62a1b927 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0016f24111c28a632f05b69be653f3e04bd333f2
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-19 14:59:51 +00:00
Qt Submodule Update Bot
cbe5ed60b9 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9183d8db061c16b209aa6394c220b8567e90e4de
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-15 11:59:36 +00:00
Jani Heikkinen
1b9b26e334 Bump version to 6.7.0
Change-Id: I944aac65d3ba47d79e743d7d711a354cc61920c3
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2023-06-14 04:04:54 +01:00
Qt Submodule Update Bot
b970eab787 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ice02578f78983ccde883d6fa0662b0a82b400a1e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-14 03:04:52 +00:00
Mate Barany
3cef85357d QuickSubscription Example: Remove version numbers from imports
Remove the version numbers according to the guideline

Task-number: QTBUG-110893
Change-Id: I5e1bf98a6180be039f385a8e4376dcd01df2e8c4
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2023-06-13 09:56:33 +02:00
Mate Barany
03cc0dd512 QuickSubscription example: Port CMakeLists.txt to use qt_add_qml_module
Port the CmakeLists.txt and change the source files accordingly:
- rename main.qml to Main.qml
- remove MqttClient import from Main.qml
- add QML macros to qmlmqttclient.h
- revamp main.cpp

Also update the qmake build:
- revamp quicksubscription.pro
- add qmldir to project
- remove qml.qrc

Pick-to: 6.6 6.5
Task-number: QTBUG-110893
Change-Id: Ie7c0dd260e94c1e1ad4756fb21a70f24f2c60f87
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-12 09:58:14 +02:00
Qt Submodule Update Bot
6918921f71 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib76166aa2f25fe986fa02902fe1a86a1a7828672
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-08 12:36:29 +00:00
Mate Barany
1ba0938e80 Use the list initializer constructor of QStringList
Use the list initializer constructor of QStringList to make the code
more modern/compact.

Task-number: QTBUG-110893
Change-Id: Idf1cfb400e19cad87b70a40735fa17c87cf7fb30
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-07 15:48:41 +02:00
Mate Barany
8fc1b0de9d Replace QLatin1Strings with _L1 literals
As part of revamping the MQTT examples, replace QLatin1Strings with
_L1 literals.

Also replace QLatin1Chars and QStringLiterals with the appropriate
u'' and u""_s literals.

Task-number: QTBUG-110893
Change-Id: I784f5faa23e51666b6edf36eb9692c0f7c186f70
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-07 15:34:39 +02:00
Qt Submodule Update Bot
5f69929b4e Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie673223c5ae05915e230055afe0d4be4817f635e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-06 17:52:30 +00:00
Tor Arne Vestbø
016564d8ae Remove conanfile.py
The conan experiment has ended, and the file is only bitrotting
nowadays.

Pick-to: 6.5 6.6
Change-Id: I26d08e441a8d049fe0a3d04236824c14988bd624
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-06-06 14:41:58 +02:00
Qt Submodule Update Bot
e3d39d1341 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id710f373dcbb064eb6165f60f27d93b4ad0258a0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-05 02:45:18 +00:00
Qt Submodule Update Bot
7a83868ce4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I7e7fb0b54a0e4f1d15278778be5ef7bf7574613e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-02 14:52:50 +00:00
Qt Submodule Update Bot
b4f810f420 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I9ed7c6ff0dadfaeaa28e9b667e9a4df6f7618b33
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-06-01 06:03:01 +00:00
Qt Submodule Update Bot
e2f58cee5c Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I386484c597e15c96e2cefee6386d4a5214bca807
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-29 14:33:39 +00:00
Qt Submodule Update Bot
d2b37c4ce6 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If0eaee4de73badba24bf57962dbb203fcfcfe793
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-26 12:47:33 +00:00
Chris Adams
c9c49bdf47 Examples: websocket IO device must be sequential
When using a websocket as the underlying IO device we must specify
that the device is sequential, to avoid spurious protocol violation
condition when packets are split across websocket frame boundaries.

The standard specifically states: "The receiver MUST NOT assume that
MQTT Control Packets are aligned on WebSocket frame boundaries."
New MQTT brokers like FlashMQ rely on well-behaved receivers.

Change-Id: Ia8e7fb0cf1cc518b364625b1955fb6b9ee44b7ef
Pick-to: 6.5
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-05-26 06:23:14 +00:00
Qt Submodule Update Bot
dcc684359d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I1258cc2f9a7a1c38941bf6f22950712f383c42a5
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-24 07:20:28 +00:00
Mate Barany
e96f355983 Revamp documentation of the Websockets MQTT Subscription Example
Remove "Example" from the name of the example.

Add examplecategory.

Add a short explanation and a few code snippets.

Task-number: QTBUG-110893
Change-Id: I0e4e29b9cd86c4950fdd0263ecec54e8927b2c3c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-05-23 17:20:05 +02:00
Qt Submodule Update Bot
e6eedb4d03 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I56f3411fded491359eb86dccdc699f2bca63fc9d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-22 12:45:06 +00:00
Qt Submodule Update Bot
626ba29093 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I92d813d230dcd24a93aa7b66d9806ef1dfc8d0b8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-19 18:15:05 +00:00
Qt Submodule Update Bot
51332937fe Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I4398abe55e6add3fc6a4bdf4c89b77286ccfc981
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-17 13:14:22 +00:00
Qt Submodule Update Bot
6dd5249b95 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib3b06818056d913b819627f5d2aea26146604985
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-11 18:07:04 +00:00
Alexey Edelev
df0dfd4c53 Add the use of the qt_internal_project_setup function
The function sets the required CMake variables and policies.

Pick-to: 6.5
Task-number: QTBUG-112685
Change-Id: I11a1f26d27e77234a5f4097efd13723e9f9ce01b
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-05-10 18:50:21 +02:00
Qt Submodule Update Bot
139183212a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ibff5fef1025a4ccbf7d826414318416d21e7783b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-10 03:12:21 +00:00
Ville Voutilainen
1f667b251c Disable cmdline-only example on Android
Task-number:QTBUG-111933

Change-Id: Iacd590aa952d4898cde6d60ad591773739cd9b13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-05-08 20:23:49 +03:00
Qt Submodule Update Bot
1f44b2a25a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I2223cc33c1db45469a2bb664b6a03fad20fb1bcb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-05-02 07:10:32 +00:00
Mate Barany
84e3561bf8 Fix some compiler warnings in the MQTT WebsocketSubscription Example
Fix some warnings that were reported by the MSVC compiler with the Wall
setting:
- use static_cast for signed/unsigned conversion
- use QString::fromUtf8 instead of the QByteArray constructor

Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: Ic982d3c16feb1ebcef729b4dfd023cc3b5017fec
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-04-27 16:14:49 +02:00
Qt Submodule Update Bot
15df42c95d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie5e83b02725c4d3c4727f866a22754c0813bd77b
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-27 08:12:13 +00:00
Qt Submodule Update Bot
f3be6f40d0 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic074d98ca61aa97ae9e93276204f66fd71fea110
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-24 15:29:57 +00:00
Mate Barany
816cedb719 Rename MQTT Simple Client example and update screenshot
Remove the word "Example" from the name of the example.

Add the example to the "Connectivity" Category.

Update the screenshot - the example no longer has a ping button.

Task-number: QTBUG-110893
Change-Id: Ieedb32800804fc336ba0e3bd0c8f3b9e4cd13527
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-04-24 16:01:27 +02:00
Mate Barany
9925e316c9 Fix compiler warnings in Simple Client example
Fix some signed/unsigned conversion warnings in the Simple Client
example reported by Visual Studio with the Wall compiler settings.

Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: I0a1851098d314c63195eb2366a6f87f42a4bbed4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-04-20 15:20:10 +02:00
Mate Barany
9e8dbb1509 Fix compiler warnings in MQTT Subscription Example
Fix some signed/unsigned conversion warnings.

Add explicit QMqttSubscription::Unsubscription case.

These warnings were reported by Visual Studio with the Wall compiler
setting.

Pick-to: 6.5
Task-number: QTBUG-110893
Change-Id: Ief64c4a04ba679f52c3e256aa96bb8f239ae68e9
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-04-20 14:57:45 +02:00
Qt Submodule Update Bot
0bb26682f4 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I6dcb7910db1fe137ce776c64b08d4aced2911928
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-20 10:18:59 +00:00
Mate Barany
1c522a09b2 Rename MQTT Subscriptions Example and update screenshot
According to the guideline "Example" should be not part of the name of
the example - remove it.

Add example to the Connectivity category.

Update the screenshot as the current one is obsolete. The application
no longer has a ping button but it has username and password fields.

Task-number: QTBUG-110893
Change-Id: Id9608ea6e76a3a7e89b0fd491d9fb329cfcbedc3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-04-20 08:50:41 +00:00
Qt Submodule Update Bot
dd2043e341 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3d6c65472d92f0d51667e3ca95f45b2eb6366927
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-19 04:52:50 +00:00
Qt Submodule Update Bot
fbdc555d93 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia1d7c3774b836b584d2f434aba3777c6a6bf6464
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-18 15:03:47 +00:00
Qt Submodule Update Bot
db125147af Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I39dc63b8cc3ccaaf718f0a7e3ac15aca4b02db48
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-13 19:08:41 +00:00
Qt Submodule Update Bot
620f4f8b94 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I02625a3d20ffa789844d57e96db5b2dfcdf537a0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-12 16:31:44 +00:00
Qt Submodule Update Bot
164cc3ca1a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ida13d5cb6d131226368d454a91b187127d452b97
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-11 11:53:30 +00:00
Qt Submodule Update Bot
09910ca0c3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I3addc3fb6d2c44aeb7f1f42b7d4d2b32a4bb871d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-05 10:49:23 +00:00
Qt Submodule Update Bot
33121ba989 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I688b8a6e0fa51997106edd8bd7a649452a2ae1c0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-04-04 11:19:35 +00:00
Mate Barany
447db4134b Move the console pub/sub example to manual tests
The example is not documented and it is also missing from the
examples-manifest.xml file. However, it can be still useful
for debugging or for performing small tests, so move it to
the tests/manual folder.

The qmake project files are kept for the examples because the
CI builds the examples with CMake and qmake. Now that this has
been moved to tests/manual, the .pro files can be removed.

Change-Id: Id69c3c6896d98b543ff5bd493592d06a27746496
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-04-01 10:02:50 +02:00
Maurice Kalinowski
c04b21a2dc Windows: Fix crash on QMqttClient destruction
On Windows, sending DISCONNECT might return data before the
QMqttConnection is destroyed, causing it to invoke on bogus QMqttClient
members.

Hence, set a flag to avoid this event, but still aim to send a
disconnect to the broker to nicely quit.

Fixes: QTBUG-111846
Pick-to: 6.5 6.4 6.2
Change-Id: Ia94865c9b404ecbd814150c313679aa10b3f6aa0
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2023-03-30 11:54:01 +01:00
Qt Submodule Update Bot
dfbb02ed03 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib303a294eba37ff2242d97f5570dd55da8119c21
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-28 17:04:07 +00:00
Matti Paaso
21feae97da Add axivion config
Task-number: QTQAINFRA-5244
Change-Id: I4da8dc2a69ed1d3ccc43306ec8b14288c1fc2e1e
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2023-03-23 14:16:25 +00:00
Qt Submodule Update Bot
654f4a121a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib69a85db86092a3c1858420d6068da8aa07dfcfb
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-20 00:05:48 +00:00
Qt Submodule Update Bot
c272a73a5b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Id68ffe5d631fb33a6242106d5d80a06e9ccb29f0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-11 04:07:28 +00:00
Qt Submodule Update Bot
24833a4dad Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If7add97f65597bce37083f76b63183c242c0ac90
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-03-02 23:29:20 +00:00
Qt Submodule Update Bot
f6fd8fdf3b Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ic12186c0de11fc7988895380d51532d59e3859e1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-24 08:31:49 +00:00
Qt Submodule Update Bot
04453ccb3a Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I0c7d4ae778266aed4abbbdad07ee31bc55507b31
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-21 11:15:57 +00:00
Qt Submodule Update Bot
cce292f4f3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ia3dc82ef0a08e8d0ab308b498bea2a472b14a1cc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-13 11:39:57 +00:00
Friedemann Kleint
58abef008e Remove remains of qmake conversion from CMakeLists.txt files
Pick-to: 6.5
Change-Id: I5b961e2c9f5cd1736f7fcce502aeec2d47677818
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-10 11:52:33 +01:00
Qt Submodule Update Bot
d6c35eac92 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I43685b52edc998fe4c4754d95f921442f900669a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-01 22:41:14 +00:00
Qt Submodule Update Bot
134b521b13 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: If72b75c18342624c7b48a92da397d0906bc49d70
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-01 05:28:09 +00:00
Amir Masoud Abdol
4402240ff7 Fix the broken test after the retirement of qt_parse_all_arguments
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.

Task-number: QTBUG-99238
Change-Id: I8dbdad71e6a5b40e944c55c35dd4c772af6b5665
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-20 20:41:24 +01:00
Qt Submodule Update Bot
b7d79e4518 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I518b9119a08a4ce5f30645468238563d1e41d5a3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-20 19:41:22 +00:00
Qt Submodule Update Bot
ea0ff65e68 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I37b03f5ac5d10fa77f813ebced2ad4aa269580e0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-17 14:50:31 +00:00
Qt Submodule Update Bot
e442876fcb Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I884de371dc36edf0e283b1f12e7b2934b623e200
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-12 17:37:59 +00:00
Qt Submodule Update Bot
318416b5e3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I50c608348abd2ccc5faa5e0040de0c5efdfe45f1
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-09 17:49:24 +00:00
Qt Submodule Update Bot
22ad3b80e3 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ib1fb6f4a552665cabb1f95a73e15832ac6d6eb32
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-04 07:58:13 +00:00
Qt Submodule Update Bot
41176f166d Update dependencies on 'dev' in qt/qtmqtt
Change-Id: Ie2bd16f959cc5c9fdda089b453d763d149c467fc
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-01-03 00:26:52 +00:00
Alexey Edelev
8a11ce2d79 Remove QT_USE_SYNCQT_CPP
Option has not effect anymore.

Pick-to: 6.5
Change-Id: I06ba72c237d47a7287fb1f9f347a4467b3c5e87d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2023-01-02 13:24:35 +01:00
Qt Submodule Update Bot
65b7b74580 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I80ec30d9f8fa68b67886debd051e5c1b1881d3de
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2022-12-21 08:17:17 +00:00
Jani Heikkinen
78c0c75990 Bump version to 6.6.0
Change-Id: I1f85e1000aded8a531654fb668be996a083d7b51
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2022-12-16 02:16:26 +02:00
Qt Submodule Update Bot
73ed924a34 Update dependencies on 'dev' in qt/qtmqtt
Change-Id: I70ba0eb28f6f4e6bc559190b468643597e49412a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2022-12-16 00:16:24 +00:00
131 changed files with 3331 additions and 857 deletions

View File

@ -1,5 +1,5 @@
set(QT_REPO_MODULE_VERSION "6.5.0")
set(QT_REPO_MODULE_VERSION "6.13.0")
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
# Use cpp-based syncqt
set(QT_USE_SYNCQT_CPP TRUE)
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_QASCONST=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=1")

1
.gitignore vendored
View File

@ -68,6 +68,7 @@ Makefile*
# QtCtreator CMake
CMakeLists.txt.user*
CMakeUserPresets.json
## Visual Studio
# User-specific files

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=codereview.qt-project.org
project=qt/qtmqtt
defaultbranch=dev

View File

@ -1,8 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Generated from qtmqtt.pro.
cmake_minimum_required(VERSION 3.16)
include(.cmake.conf)
@ -13,7 +11,14 @@ project(QtMqtt
LANGUAGES CXX C
)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network) # special case
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick WebSockets # For tests # special case
Gui Widgets) # For examples # special case
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
# This should be called as early as possible, just after find_package(BuildInternals) where it is
# defined.
qt_internal_project_setup()
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Core Network)
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick # For tests
Gui Widgets WebSockets) # For examples
qt_build_repo()

11
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,11 @@
## Qt contribution guidelines
We welcome contributions to Qt!
Note that we cannot accept pull requests on GitHub. All contributions
to the Qt project are exclusively handled through the
[Gerrit code review system](https://codereview.qt-project.org).
See
[contribute.qt-project.org](https://contribute.qt-project.org/) to learn
more.

View File

@ -1,22 +0,0 @@
The Qt Company GPL Exception 1.0
Exception 1:
As a special exception you may create a larger work which contains the
output of this application and distribute that work under terms of your
choice, so long as the work is not otherwise derived from or based on
this application and so long as the work does not in itself generate
output that contains the output from this application in its original
or modified form.
Exception 2:
As a special exception, you have permission to combine this application
with Plugins licensed under the terms of your choice, to produce an
executable, and to copy and distribute the resulting executable under
the terms of your choice. However, the executable must be accompanied
by a prominent notice offering all users of the executable the entire
source code to this application, excluding the source code of the
independent modules, but including any changes you have made to this
application, under the terms of this license.

44
REUSE.toml Normal file
View File

@ -0,0 +1,44 @@
version = 1
[[annotations]]
path = [".cmake.conf", "**.yaml", "**/ci_config_linux.json", "**.pro", ".tag"]
precedence = "closest"
comment = "build system"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "BSD-3-Clause"
[[annotations]]
path = ["**/.gitattributes", "**.gitignore", "**.gitreview"]
precedence = "closest"
comment = "version control system. Infrastructure"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
[[annotations]]
path = ["**/doc/images/**", "examples/**"]
comment = "this must be after the build system table because example and snippets take precedence over build system"
precedence = "closest"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
[[annotations]]
path = ["**.qdocconf", "src/mqtt/doc/style/style.css",
"tests/README.txt", "CONTRIBUTING.md"]
comment = "documentation"
precedence = "closest"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"
[[annotations]]
path = ["**.toml", "licenseRule.json"]
comment = "infrastructure"
precedence = "override"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause"
[[annotations]]
path = ["**/qt_attribution.json"]
comment = "currently not needed, but ready if such file is added. documentation."
precedence = "override"
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"

View File

@ -0,0 +1,40 @@
{
"Project": {
"BuildSystemIntegration": {
"child_order": [
"GCCSetup",
"CMake",
"LinkLibraries"
]
},
"CMake": {
"_active": true,
"_copy_from": "CMakeIntegration",
"build_environment": {},
"build_options": "-j4",
"generate_options": "--fresh",
"generator": "Ninja"
},
"GCCSetup": {
"_active": true,
"_copy_from": "Command",
"build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/"
},
"LinkLibraries": {
"_active": true,
"_copy_from": "AxivionLinker",
"input_files": [
"build/lib/lib*.so*.ir"
],
"ir": "build/$(env:TESTED_MODULE_COIN).ir"
}
},
"_Format": "1.0",
"_Version": "7.6.2",
"_VersionNum": [
7,
6,
2,
12725
]
}

View File

@ -6,7 +6,23 @@ accept_configuration:
instructions:
Build:
- type: EnvironmentVariable
variableName: VERIFY_SOURCE_SBOM
variableValue: "ON"
- type: EnvironmentVariable
variableName: COIN_NO_MOSQUITTO
variableValue: "1"
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: property
property: target.arch
in_values: ["AARCH64", "ARM64"]
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
Test:
- !include "{{qt/qtbase}}/coin_module_test_template_v2.yaml"
- !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
- !include "{{qt/qtbase}}/coin_module_test_docs.yaml"

View File

@ -1,34 +0,0 @@
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
from conans import ConanFile
import re
from pathlib import Path
def _parse_qt_version_by_key(key: str) -> str:
with open(Path(__file__).parent.resolve() / ".cmake.conf") as f:
m = re.search(fr'{key} .*"(.*)"', f.read())
return m.group(1) if m else ""
def _get_qt_minor_version() -> str:
return ".".join(_parse_qt_version_by_key("QT_REPO_MODULE_VERSION").split(".")[:2])
class QtMqtt(ConanFile):
name = "qtmqtt"
license = "GPL-3.0+, Commercial Qt License Agreement"
author = "The Qt Company <https://www.qt.io/contact-us>"
url = "https://code.qt.io/cgit/qt/qtmqtt.git"
description = (
"Qt MQTT is a machine-to-machine (M2M) protocol utilizing the "
"publish-and-subscribe paradigm."
)
topics = "qt", "qt6", "MQTT", "M2M"
settings = "os", "compiler", "arch", "build_type"
# for referencing the version number and prerelease tag and dependencies info
exports = ".cmake.conf", "dependencies.yaml"
exports_sources = "*", "!conan*.*"
python_requires = f"qt-conan-common/{_get_qt_minor_version()}@qt/everywhere"
python_requires_extend = "qt-conan-common.QtLeafModule"

View File

@ -1,7 +1,10 @@
dependencies:
../qtbase:
ref: fa2153bd10057d7adbc5f5ededa1fd97c4a68161
ref: 537c0040b0c1a1b3bae99e9edca827c9e3a16ee7
required: true
../qtdeclarative:
ref: a39dc2807c22c6819647bab1259ba8f7532e7f32
ref: 3c20488ac4a676c612cef9539144194a4fb86801
required: true
../qtwebsockets:
ref: 217120e4e991ed2de51cac910cccfbf51f912e65
required: false

8
dist/REUSE.toml vendored Normal file
View File

@ -0,0 +1,8 @@
version = 1
[[annotations]]
path = ["*"]
precedence = "override"
comment = "Licensed as documentation."
SPDX-FileCopyrightText = "Copyright (C) The Qt Company Ltd."
SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"

View File

@ -1,5 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
qt_examples_build_begin(EXTERNAL_BUILD)

View File

@ -1,7 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
qt_internal_add_example(consolepubsub)
if(TARGET Qt::Gui AND TARGET Qt::Widgets)
qt_internal_add_example(simpleclient)
qt_internal_add_example(subscriptions)

View File

@ -1,8 +0,0 @@
TEMPLATE = subdirs
SUBDIRS = \
qtmqtt_pub.pro \
qtmqtt_sub.pro
CONFIG += ordered

View File

@ -1,25 +0,0 @@
QT -= gui
QT += mqtt
CONFIG += c++11 console
CONFIG -= app_bundle
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x060000 # disables all APIs deprecated in Qt 6.0.0 and earlier
SOURCES += \
main_pub.cpp
HEADERS += \
configuration.h
target.path = $$[QT_INSTALL_EXAMPLES]/mqtt/consolepubsub
INSTALLS += target

View File

@ -1,25 +0,0 @@
QT -= gui
QT += mqtt
CONFIG += c++11 console
CONFIG -= app_bundle
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x060000 # disables all APIs deprecated in Qt 6.0.0 and earlier
SOURCES += \
main_sub.cpp
HEADERS += \
configuration.h
target.path = $$[QT_INSTALL_EXAMPLES]/mqtt/consolepubsub
INSTALLS += target

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,62 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example quickpublication
\title Qt Quick Publication
\examplecategory {Connectivity}
\ingroup qtmqtt-examples
\brief Use Qt Quick Controls to create an application that can publish on MQTT
topics.
\image quickpublication.png
{MQTT publishing interface with Hostname, Port, Topic, Message, QoS,
and Retain fields}
\e {Qt Quick Publication} demonstrates how to register QMqttClient as a QML type and
use it in a Qt Quick application.
\l {Qt MQTT} does not provide a QML API in its current version. However,
you can make the C++ classes of the module available to QML.
\section1 Creating a Client
Create the wrapper class \c QmlMqttClient that has QMqttClient as a member:
\quotefromfile quickpublication/qmlmqttclient.h
\skipto private
\printuntil }
Connect the wrapper methods to the methods of QMqttClient in the constructor:
\quotefromfile quickpublication/qmlmqttclient.cpp
\skipto QmlMqttClient
\printuntil }
A wrapper method has the same name as the wrapped method. In the simplest case,
it is just a single method call:
\skipto connectToHost
\printuntil }
It is also possible to customize a wrapper method by extending it with some additional
functionality:
\skipto setPort
\printuntil );
\section1 Registering Classes in QML
In the \c main.cpp file, load the QML type Main from the module
publication:
\quotefromfile quickpublication/main.cpp
\skipto (argc
\printuntil loadFromModule
Now use the MqttClient type in the \c Main.qml file to create an
MQTT client:
\quotefromfile quickpublication/Main.qml
\skipto MqttClient {
\printuntil }
*/

View File

@ -3,14 +3,17 @@
/*!
\example quicksubscription
\title Quick MQTT Example
\title Qt Quick Subscription
\examplecategory {Connectivity}
\ingroup qtmqtt-examples
\brief Registering QMqttClient to QML and using it in a Qt Quick user
interface.
\brief Use Qt Quick Controls to create an application that can subscribe to MQTT
topics.
\image quicksubscription.png
{MQTT subscription interface with Hostname, Port, Topic fields, Connect
and Subscribe buttons}
\e {Quick MQTT} demonstrates how to register QMqttClient as a QML type and
\e {Qt Quick Subscription} demonstrates how to register QMqttClient as a QML type and
use it in a Qt Quick application.
\l {Qt MQTT} does not provide a QML API in its current version. However,
@ -18,23 +21,24 @@
\section1 Creating a Client
We create a \c QmlMqttClient class with the QMqttClient class as a base
class:
Connect to QMqttSubscription::messageReceived( ) to receive all messages
sent to the broker:
\quotefromfile quicksubscription/qmlmqttclient.cpp
\skipto QmlMqttSubscription
\printuntil }
Create a \c QmlMqttClient class with the QMqttClient class as a base
class:
\skipto QmlMqttClient(
\printuntil }
We use the \c subscribe() function to create a subscription object:
Use the \c subscribe() function to create a subscription object:
\skipto subscribe
\printuntil }
We connect to QMqttSubscription::messageReceived( ) to receive all messages
sent to the broker:
\printuntil }
We use an QMqttMessage object to store the payload of a received
Use a QMqttMessage object to store the payload of a received
message:
\skipto handleMessage
@ -42,22 +46,17 @@
\section1 Registering Classes in QML
In the \c main.cpp file, we register the \c QmlMqttClient class as a
QML type, MqttClient:
In the \c main.cpp file, load the QML type Main from the module
subscription:
\quotefromfile quicksubscription/main.cpp
\skipto main(int
\printuntil qmlRegisterType
\skipto (argc
\printuntil loadFromModule
In addition, we register the \c QmlMqttSubscription class as an uncreatable
type:
\printuntil qmlRegisterUncreatableType
We can now use the MqttClient type in the \c main.qml file to create an
Now use the MqttClient type in the \c Main.qml file to create an
MQTT client:
\quotefromfile quicksubscription/main.qml
\quotefromfile quicksubscription/Main.qml
\skipto MqttClient {
\printuntil }
*/

View File

@ -3,23 +3,67 @@
/*!
\example simpleclient
\title Simple MQTT Client Example
\examplecategory {Connectivity}
\title Simple MQTT Client
\ingroup qtmqtt-examples
\brief Creating a minimalistic telemetry application.
\image simpleclient.png
{MQTT client with Host, Port, Protocol fields, WebSockets and Secure
options, Topic and Message inputs, and log showing state changes}
\e {Simple MQTT Client} demonstrates how to create a minimalistic client
application.
To use the application, you first specify a broker, such as
\e test.mosquitto.org or \e broker.hivemq.com and the port number 1883, and
connect to it. You can then subscribe to a topic and send a message, which
you will also receive.
To use the application, you first specify a Host, a Port, Secure on/off,
WebSockets on/off, and Protocol. Then click on connect. Afterward you can
subscribe to a topic and send a message, which you will also receive.
You may also run the application twice. Publish in one and Subscribe in
the other, and the messages shall be transmitted.
\note Port number 1883 is not encrypted, and therefore it is suitable only
for development and testing purposes. In production, always use encrypted
connections.
\section1 simpleclient Options
\list
\li Host - you may use test.mosquitto.org or broker.hivemq.com
\li Port - port to connect to, will depend on WebSockets selection and Secure selection
\li WebSockets - you may specify: selected (enabled) or not selected (disabled)
\li Secure - you may specify: selected (enabled) or not selected (disabled)
\li Protocol - you may specify
\list
\li mqtt 3.1
\li mqtt 3.1.1
\li mqtt 5.0
\endlist
\li Topic - A topic to publish or subscribe to
\li Message - A message to send on the topic if you are publishing
\endlist
\section1 Connection Settings
These are the usual combinations, and will work with test.mosquitto.org.
For broker.hivemq.com check the information in the links. Note that if
Secure is enabled it might be necessary to install certificates on the
computer. It might also be necessary to add the certificate to the mqtt
client in code.
\section1
\list
\li Port 1883, Secure=disabled, WebSockets=disabled - mqtt over tcp
\li Port 8883, Secure=enabled, WebSockets=disabled - mqtt over ssl
\li Port 8080, Secure=disabled, WebSockets=enabled - mqtt over websockets
\li Port 8081, Secure=enabled, WebSockets=enabled - mqtt over secure websockets
\endlist
For more information about the brokers see:
\list
\li \l {https://test.mosquitto.org}
\li \l {https://broker.hivemq.com}
\li \l {https://www.hivemq.com/mqtt/public-mqtt-broker}
\endlist
\note Port numbers 1883 and 8080 are not encrypted, and therefore they are
suitable only for development and testing purposes. In production, always
use encrypted connections.
\note WebAssembly only supports WebSockets enabled.
\section1 Creating a Client
@ -47,9 +91,9 @@
\printuntil }
In this example, we subscribe to all topics. For more information about
how to receive messages on particular topics, see
\l {MQTT Subscriptions Example}.
how to receive messages on particular topics, see the
\l {MQTT Subscriptions} example.
For an example of how to use the QMqttClient class in a Qt Quick
application, see \l {Quick MQTT Example}.
application, see \l {Qt Quick Subscription}.
*/

View File

@ -3,11 +3,14 @@
/*!
\example subscriptions
\title MQTT Subscriptions Example
\examplecategory {Connectivity}
\title MQTT Subscriptions
\ingroup qtmqtt-examples
\brief Creating a application that communicates with an MQTT broker.
\image subscriptions.png
{Main window with connection and publishing controls, and two
subscription windows showing received messages on qtmqtt/topic1}
\e {MQTT Subscriptions} shows how to create an application that communicates
with an MQTT broker. A new dialog opens for each subscription, where you can

View File

@ -3,7 +3,8 @@
/*!
\example websocketsubscription
\title WebSockets MQTT Subscription Example
\examplecategory {Connectivity}
\title WebSockets MQTT Subscription
\ingroup qtmqtt-examples
\brief Combining an MQTT client with a web socket connection.
@ -11,4 +12,40 @@
QIODevice to combine a \l {Qt WebSockets}{web socket} connection with
QMqttClient.
\note Since Qt 6.10, WebSockets are supported natively by Qt MQTT.
This example is retained to demonstrate how to implement a custom transport.
\section1 Creating a Custom QIODevice
The new custom device, \c WebSocketIODevice, has to be a subclass of
\l QIODevice:
\quotefromfile websocketsubscription/websocketiodevice.h
\skipto WebSocketIODevice
\printuntil }
\section1 Designing a Class to Manage the Connection and Subscription
\c WebSocketIODevice will be a private member of the \c ClientSubscription
class alongside the QMqttClient and the QMqttSubscription:
\quotefromfile websocketsubscription/clientsubscription.h
\skipto private
\printuntil m_version
\section1 Subscribing to and Receiving Messages
The main logic is implemented in the \c connectAndSubscribe() method of the
\c ClientSubscription class. You need to verify that the web socket has
successfully connected before you can initialize an MQTT connection over
it. After the MQTT connection has been established, the QMqttClient can
subscribe to the topic. If the subscription is successful, the
QMqttSubscription can be used to receive messages from the subscribed topic
that will be handled by the \c handleMessage() method of the
\c ClientSubscription class.
\quotefromfile websocketsubscription/clientsubscription.cpp
\skipto connectAndSubscribe
\printuntil Could
\printuntil }
*/

View File

@ -1,6 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += \
consolepubsub
qtHaveModule(gui):qtHaveModule(widgets): SUBDIRS += \
simpleclient \
subscriptions

View File

@ -1,11 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(quickpublication LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@ -14,9 +12,12 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/mqtt/quickpublication")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Mqtt Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(quickpublication
WIN32
MACOSX_BUNDLE
main.cpp
qmlmqttclient.cpp qmlmqttclient.h
)
set_target_properties(quickpublication PROPERTIES
@ -28,7 +29,7 @@ target_compile_definitions(quickpublication PUBLIC
QT_DEPRECATED_WARNINGS
)
target_link_libraries(quickpublication PUBLIC
target_link_libraries(quickpublication PRIVATE
Qt::Core
Qt::Gui
Qt::Mqtt
@ -36,16 +37,12 @@ target_link_libraries(quickpublication PUBLIC
Qt::Quick
)
# Resources:
set(qml_resource_files
"main.qml"
)
qt6_add_resources(quickpublication "qml"
PREFIX
"/"
FILES
${qml_resource_files}
qt_add_qml_module(quickpublication
URI publication
QML_FILES
"Main.qml"
SOURCES
qmlmqttclient.cpp qmlmqttclient.h
)
install(TARGETS quickpublication

View File

@ -1,17 +1,16 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick 2.8
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import MqttClient 1.0
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
Window {
visible: true
width: 640
height: 480
title: qsTr("Qt Quick MQTT Publish Example")
title: qsTr("Qt Quick Publication")
id: root
MqttClient {
@ -131,7 +130,7 @@ Window {
return
}
client.publish(pubField.text, msgField.text, qosItems.currentText, retain.checked)
addMessage(msgField.text)
root.addMessage(msgField.text)
}
}
}
@ -139,19 +138,22 @@ Window {
ListView {
id: messageView
model: messageModel
height: 300
width: 200
implicitHeight: 300
implicitWidth: 200
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 2
clip: true
delegate: Rectangle {
width: messageView.width
id: delegatedRectangle
required property int index
required property string payload
width: ListView.view.width
height: 30
color: index % 2 ? "#DDDDDD" : "#888888"
radius: 5
Text {
text: payload
text: delegatedRectangle.payload
anchors.centerIn: parent
}
}

View File

@ -1,23 +1,21 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qmlmqttclient.h"
#include <QtQml/qqmlapplicationengine.h>
#include <QtGui/qguiapplication.h>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QLoggingCategory>
using namespace Qt::StringLiterals;
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<QmlMqttClient>("MqttClient", 1, 0, "MqttClient");
QObject::connect(
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
[]() { QCoreApplication::exit(EXIT_FAILURE); }, Qt::QueuedConnection);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
engine.loadFromModule(u"publication"_s, u"Main"_s);
return app.exec();
return QGuiApplication::exec();
}

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,4 @@
module publication
prefer :/qt/qml/publication/
Main 1.0 Main.qml

View File

@ -45,8 +45,6 @@ void QmlMqttClient::setPort(int newPort)
return;
}
m_client.setPort(static_cast<quint16>(newPort));
m_client.state();
}
const QMqttClient::ClientState QmlMqttClient::state() const

View File

@ -7,12 +7,16 @@
#include <QtCore/QMap>
#include <QtMqtt/QMqttClient>
#include <QtQml/qqml.h>
class QmlMqttClient : public QObject
{
Q_OBJECT
Q_PROPERTY(QString hostname READ hostname WRITE setHostname NOTIFY hostnameChanged)
Q_PROPERTY(int port READ port WRITE setPort NOTIFY portChanged)
Q_PROPERTY(QMqttClient::ClientState state READ state WRITE setState NOTIFY stateChanged)
QML_NAMED_ELEMENT(MqttClient)
QML_EXTENDED_NAMESPACE(QMqttClient)
public:
QmlMqttClient(QObject *parent = nullptr);

View File

@ -1,7 +1,8 @@
TEMPLATE = app
TARGET = quickpublication
QT += qml quick mqtt
CONFIG += c++11
CONFIG += qmltypes
SOURCES += main.cpp \
qmlmqttclient.cpp
@ -9,10 +10,15 @@ SOURCES += main.cpp \
HEADERS += \
qmlmqttclient.h
RESOURCES += qml.qrc
qml_resources.files = Main.qml qmldir
qml_resources.prefix = /qt/qml/publication
RESOURCES += qml_resources
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
QML_IMPORT_PATH = $$pwd/.
QML_IMPORT_NAME = publication
QML_IMPORT_MAJOR_VERSION = 1
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

View File

@ -1,11 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(quicksubscription LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@ -14,21 +12,19 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/mqtt/quicksubscription")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Mqtt Qml Quick)
qt_add_executable(quicksubscription
main.cpp
qmlmqttclient.cpp qmlmqttclient.h
)
qt_standard_project_setup(REQUIRES 6.5)
set_target_properties(quicksubscription PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
qt_add_executable(quicksubscription
WIN32
MACOSX_BUNDLE
main.cpp
)
target_compile_definitions(quicksubscription PUBLIC
QT_DEPRECATED_WARNINGS
)
target_link_libraries(quicksubscription PUBLIC
target_link_libraries(quicksubscription PRIVATE
Qt::Core
Qt::Gui
Qt::Mqtt
@ -36,16 +32,12 @@ target_link_libraries(quicksubscription PUBLIC
Qt::Quick
)
# Resources:
set(qml_resource_files
"main.qml"
)
qt6_add_resources(quicksubscription "qml"
PREFIX
"/"
FILES
${qml_resource_files}
qt_add_qml_module(quicksubscription
URI subscription
QML_FILES
"Main.qml"
SOURCES
qmlmqttclient.cpp qmlmqttclient.h
)
install(TARGETS quicksubscription

View File

@ -1,17 +1,16 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick 2.8
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import MqttClient 1.0
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
Window {
visible: true
width: 640
height: 480
title: qsTr("Qt Quick MQTT Subscription Example")
title: qsTr("Qt Quick Subscription")
id: root
property var tempSubscription: 0
@ -75,8 +74,8 @@ Window {
if (client.state === MqttClient.Connected) {
client.disconnectFromHost()
messageModel.clear()
tempSubscription.destroy()
tempSubscription = 0
root.tempSubscription.destroy()
root.tempSubscription = 0
} else
client.connectToHost()
}
@ -95,13 +94,13 @@ Window {
id: subField
placeholderText: "<Subscription topic>"
Layout.fillWidth: true
enabled: tempSubscription === 0
enabled: root.tempSubscription === 0
}
Button {
id: subButton
text: "Subscribe"
visible: tempSubscription === 0
visible: root.tempSubscription === 0
onClicked: {
if (subField.text.length === 0) {
console.log("No topic specified to subscribe to.")
@ -116,19 +115,22 @@ Window {
ListView {
id: messageView
model: messageModel
height: 300
width: 200
implicitHeight: 300
implicitWidth: 200
Layout.columnSpan: 2
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
delegate: Rectangle {
width: messageView.width
id: delegatedRectangle
required property int index
required property string payload
width: ListView.view.width
height: 30
color: index % 2 ? "#DDDDDD" : "#888888"
radius: 5
Text {
text: payload
text: delegatedRectangle.payload
anchors.centerIn: parent
}
}

View File

@ -1,24 +1,21 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "qmlmqttclient.h"
#include <QtQml/qqmlapplicationengine.h>
#include <QtGui/qguiapplication.h>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QLoggingCategory>
using namespace Qt::StringLiterals;
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<QmlMqttClient>("MqttClient", 1, 0, "MqttClient");
qmlRegisterUncreatableType<QmlMqttSubscription>("MqttClient", 1, 0, "MqttSubscription", QLatin1String("Subscriptions are read-only"));
QObject::connect(
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
[]() { QCoreApplication::exit(EXIT_FAILURE); }, Qt::QueuedConnection);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
engine.loadFromModule(u"subscription"_s, u"Main"_s);
return app.exec();
return QGuiApplication::exec();
}

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,4 @@
module subscription
prefer :/qt/qml/subscription/
Main 1.0 Main.qml

View File

@ -9,7 +9,6 @@ QmlMqttSubscription::QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c)
, client(c)
{
connect(sub, &QMqttSubscription::messageReceived, this, &QmlMqttSubscription::handleMessage);
m_topic = sub->topic();
}
QmlMqttSubscription::~QmlMqttSubscription()
@ -68,11 +67,9 @@ void QmlMqttClient::setPort(int newPort)
return;
}
m_client.setPort(static_cast<quint16>(newPort));
m_client.state();
}
const QMqttClient::ClientState QmlMqttClient::state() const
QMqttClient::ClientState QmlMqttClient::state() const
{
return m_client.state();
}

View File

@ -8,18 +8,19 @@
#include <QtMqtt/QMqttClient>
#include <QtMqtt/QMqttSubscription>
#include <QtQml/qqml.h>
class QmlMqttClient;
class QmlMqttSubscription : public QObject
{
Q_OBJECT
Q_PROPERTY(QMqttTopicFilter topic MEMBER m_topic NOTIFY topicChanged)
QML_UNCREATABLE("Not intended to be creatable")
public:
QmlMqttSubscription(QMqttSubscription *s, QmlMqttClient *c);
~QmlMqttSubscription();
Q_SIGNALS:
void topicChanged(QString);
void messageReceived(const QString &msg);
public slots:
@ -29,7 +30,6 @@ private:
Q_DISABLE_COPY(QmlMqttSubscription)
QMqttSubscription *sub;
QmlMqttClient *client;
QMqttTopicFilter m_topic;
};
class QmlMqttClient : public QObject
@ -38,6 +38,8 @@ class QmlMqttClient : public QObject
Q_PROPERTY(QString hostname READ hostname WRITE setHostname NOTIFY hostnameChanged)
Q_PROPERTY(int port READ port WRITE setPort NOTIFY portChanged)
Q_PROPERTY(QMqttClient::ClientState state READ state WRITE setState NOTIFY stateChanged)
QML_NAMED_ELEMENT(MqttClient)
QML_EXTENDED_NAMESPACE(QMqttClient)
public:
QmlMqttClient(QObject *parent = nullptr);
@ -52,7 +54,7 @@ public:
int port() const;
void setPort(int newPort);
const QMqttClient::ClientState state() const;
QMqttClient::ClientState state() const;
void setState(const QMqttClient::ClientState &newState);
signals:

View File

@ -1,7 +1,8 @@
TEMPLATE = app
TARGET = quicksubscription
QT += qml quick mqtt
CONFIG += c++11
CONFIG += qmltypes
SOURCES += main.cpp \
qmlmqttclient.cpp
@ -9,10 +10,15 @@ SOURCES += main.cpp \
HEADERS += \
qmlmqttclient.h
RESOURCES += qml.qrc
qml_resources.files = Main.qml qmldir
qml_resources.prefix = /qt/qml/subscription
RESOURCES += qml_resources
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
QML_IMPORT_PATH = $$pwd/.
QML_IMPORT_NAME = subscription
QML_IMPORT_MAJOR_VERSION = 1
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

View File

@ -1,5 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(simplemqttclient LANGUAGES CXX)

View File

@ -8,6 +8,8 @@
#include <QtMqtt/QMqttClient>
#include <QtWidgets/QMessageBox>
using namespace Qt::StringLiterals;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
@ -16,30 +18,32 @@ MainWindow::MainWindow(QWidget *parent) :
m_client = new QMqttClient(this);
m_client->setHostname(ui->lineEditHost->text());
m_client->setPort(ui->spinBoxPort->value());
m_client->setPort(static_cast<quint16>(ui->spinBoxPort->value()));
connect(m_client, &QMqttClient::stateChanged, this, &MainWindow::updateLogStateChange);
connect(m_client, &QMqttClient::disconnected, this, &MainWindow::brokerDisconnected);
connect(m_client, &QMqttClient::messageReceived, this, [this](const QByteArray &message, const QMqttTopicName &topic) {
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(" Received Topic: ")
+ " Received Topic: "_L1
+ topic.name()
+ QLatin1String(" Message: ")
+ " Message: "_L1
+ message
+ QLatin1Char('\n');
+ u'\n';
ui->editLog->insertPlainText(content);
});
connect(m_client, &QMqttClient::pingResponseReceived, this, [this]() {
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(" PingResponse")
+ QLatin1Char('\n');
+ "PingResponse\n"_L1;
ui->editLog->insertPlainText(content);
});
connect(ui->lineEditHost, &QLineEdit::textChanged, m_client, &QMqttClient::setHostname);
connect(ui->spinBoxPort, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::setClientPort);
connect(ui->checkBoxWebSockets, &QCheckBox::checkStateChanged, this, [this](int ws) { setWebSockets(ws != 0); });
connect(ui->checkBoxSecure, &QCheckBox::checkStateChanged, this, [this](int s) { setSecure(s != 0); } );
connect(ui->comboBoxProtocol, &QComboBox::currentIndexChanged, this, [this](int p) { setProtocol(static_cast<QMqttClient::ProtocolVersion>(p + 3)); });
updateLogStateChange();
}
@ -54,7 +58,27 @@ void MainWindow::on_buttonConnect_clicked()
ui->lineEditHost->setEnabled(false);
ui->spinBoxPort->setEnabled(false);
ui->buttonConnect->setText(tr("Disconnect"));
m_client->connectToHost();
m_client->setProtocolVersion(m_protocol);
if (m_secure && m_webSockets)
m_client->connectToHostWebSocketEncrypted();
#if !defined(QT_NO_SSL) && !defined(Q_OS_WASM)
if (m_secure && !m_webSockets)
m_client->connectToHostEncrypted({});
#endif
if (!m_secure && m_webSockets)
m_client->connectToHostWebSocket();
#if !defined(Q_OS_WASM)
if (!m_secure && !m_webSockets)
m_client->connectToHost();
#endif
if (m_client->state() == QMqttClient::Disconnected) {
ui->lineEditHost->setEnabled(true);
ui->spinBoxPort->setEnabled(true);
ui->buttonConnect->setText(tr("Connect"));
m_client->disconnectFromHost();
}
} else {
ui->lineEditHost->setEnabled(true);
ui->spinBoxPort->setEnabled(true);
@ -71,9 +95,9 @@ void MainWindow::on_buttonQuit_clicked()
void MainWindow::updateLogStateChange()
{
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(": State Change")
+ ": State Change"_L1
+ QString::number(m_client->state())
+ QLatin1Char('\n');
+ u'\n';
ui->editLog->insertPlainText(content);
}
@ -86,20 +110,36 @@ void MainWindow::brokerDisconnected()
void MainWindow::setClientPort(int p)
{
m_client->setPort(p);
m_client->setPort(static_cast<quint16>(p));
}
void MainWindow::setSecure(bool s)
{
m_secure = s;
}
void MainWindow::setWebSockets(bool ws)
{
m_webSockets = ws;
}
void MainWindow::setProtocol(QMqttClient::ProtocolVersion p)
{
m_protocol = p;
}
void MainWindow::on_buttonPublish_clicked()
{
if (m_client->publish(ui->lineEditTopic->text(), ui->lineEditMessage->text().toUtf8()) == -1)
QMessageBox::critical(this, QLatin1String("Error"), QLatin1String("Could not publish message"));
QMessageBox::critical(this, u"Error"_s, u"Could not publish message"_s);
}
void MainWindow::on_buttonSubscribe_clicked()
{
auto subscription = m_client->subscribe(ui->lineEditTopic->text());
if (!subscription) {
QMessageBox::critical(this, QLatin1String("Error"), QLatin1String("Could not subscribe. Is there a valid connection?"));
QMessageBox::critical(this, u"Error"_s,
u"Could not subscribe. Is there a valid connection?"_s);
return;
}
}

View File

@ -23,7 +23,9 @@ public:
public slots:
void setClientPort(int p);
void setSecure(bool s);
void setWebSockets(bool ws);
void setProtocol(QMqttClient::ProtocolVersion p);
private slots:
void on_buttonConnect_clicked();
void on_buttonQuit_clicked();
@ -36,8 +38,11 @@ private slots:
void on_buttonSubscribe_clicked();
private:
Ui::MainWindow *ui;
QMqttClient *m_client;
Ui::MainWindow *ui = nullptr;
QMqttClient *m_client = nullptr;
bool m_secure = false;
bool m_webSockets = false;
QMqttClient::ProtocolVersion m_protocol = QMqttClient::ProtocolVersion::MQTT_3_1_1;
};
#endif // MAINWINDOW_H

View File

@ -18,9 +18,9 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelHost">
<property name="text">
<string>Host:</string>
</property>
@ -33,8 +33,15 @@
</property>
</widget>
</item>
<item row="0" column="2" rowspan="3">
<widget class="QPushButton" name="buttonConnect">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="labelPort">
<property name="text">
<string>Port:</string>
</property>
@ -43,51 +50,69 @@
<item row="2" column="1">
<widget class="QSpinBox" name="spinBoxPort">
<property name="maximum">
<number>99999</number>
<number>65535</number>
</property>
<property name="value">
<number>1883</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelWebSockets">
<property name="text">
<string>WebSockets:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxWebSockets" />
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelSecure">
<property name="text">
<string>Secure:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxSecure" />
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelProtocol">
<property name="text">
<string>Protocol:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxProtocol">
<item>
<property name="text">
<string>mqtt 3.1</string>
</property>
</item>
<item>
<property name="text">
<string>mqtt 3.1.1</string>
</property>
</item>
<item>
<property name="text">
<string>mqtt 5.0</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="buttonConnect">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditMessage">
<layout class="QGridLayout" name="gridLayout2">
<item row="0" column="0">
<widget class="QLabel" name="labelTopic">
<property name="text">
<string>This is a test message</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Message:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="buttonSubscribe">
<property name="text">
<string>Subscribe</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="buttonPublish">
<property name="text">
<string>Publish</string>
<string>Topic:</string>
</property>
</widget>
</item>
@ -98,10 +123,31 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<item row="0" column="2">
<widget class="QPushButton" name="buttonSubscribe">
<property name="text">
<string>Topic:</string>
<string>Subscribe</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelMessage">
<property name="text">
<string>Message:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditMessage">
<property name="text">
<string>This is a test message</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="buttonPublish">
<property name="text">
<string>Publish</string>
</property>
</widget>
</item>
@ -114,7 +160,11 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPlainTextEdit" name="editLog"/>
<widget class="QPlainTextEdit" name="editLog">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
@ -145,37 +195,6 @@
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionQuit"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>

View File

@ -1,5 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(mqttsubscriptions LANGUAGES CXX)

View File

@ -9,6 +9,8 @@
#include <QtMqtt/QMqttClient>
#include <QtWidgets/QMessageBox>
using namespace Qt::StringLiterals;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
@ -17,25 +19,24 @@ MainWindow::MainWindow(QWidget *parent) :
m_client = new QMqttClient(this);
m_client->setHostname(ui->lineEditHost->text());
m_client->setPort(ui->spinBoxPort->value());
m_client->setPort(static_cast<quint16>(ui->spinBoxPort->value()));
connect(m_client, &QMqttClient::stateChanged, this, &MainWindow::updateLogStateChange);
connect(m_client, &QMqttClient::disconnected, this, &MainWindow::brokerDisconnected);
connect(m_client, &QMqttClient::messageReceived, this, [this](const QByteArray &message, const QMqttTopicName &topic) {
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(" Received Topic: ")
+ " Received Topic: "_L1
+ topic.name()
+ QLatin1String(" Message: ")
+ " Message: "_L1
+ message
+ QLatin1Char('\n');
+ u'\n';
ui->editLog->insertPlainText(content);
});
connect(m_client, &QMqttClient::pingResponseReceived, this, [this]() {
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(" PingResponse")
+ QLatin1Char('\n');
+ " PingResponse\n"_L1;
ui->editLog->insertPlainText(content);
});
@ -79,9 +80,9 @@ void MainWindow::on_buttonQuit_clicked()
void MainWindow::updateLogStateChange()
{
const QString content = QDateTime::currentDateTime().toString()
+ QLatin1String(": State Change")
+ ": State Change"_L1
+ QString::number(m_client->state())
+ QLatin1Char('\n');
+ u'\n';
ui->editLog->insertPlainText(content);
}
@ -96,23 +97,25 @@ void MainWindow::brokerDisconnected()
void MainWindow::setClientPort(int p)
{
m_client->setPort(p);
m_client->setPort(static_cast<quint16>(p));
}
void MainWindow::on_buttonPublish_clicked()
{
if (m_client->publish(ui->lineEditTopic->text(),
ui->lineEditMessage->text().toUtf8(),
ui->spinQoS_2->text().toUInt(),
ui->checkBoxRetain->isChecked()) == -1)
QMessageBox::critical(this, QLatin1String("Error"), QLatin1String("Could not publish message"));
if (m_client->publish(ui->lineEditTopic->text(), ui->lineEditMessage->text().toUtf8(),
static_cast<quint8>(ui->spinQoS_2->text().toUInt()),
ui->checkBoxRetain->isChecked())
== -1)
QMessageBox::critical(this, u"Error"_s, u"Could not publish message"_s);
}
void MainWindow::on_buttonSubscribe_clicked()
{
auto subscription = m_client->subscribe(ui->lineEditTopic->text(), ui->spinQoS->text().toUInt());
auto subscription = m_client->subscribe(ui->lineEditTopic->text(),
static_cast<quint8>(ui->spinQoS->text().toUInt()));
if (!subscription) {
QMessageBox::critical(this, QLatin1String("Error"), QLatin1String("Could not subscribe. Is there a valid connection?"));
QMessageBox::critical(this, u"Error"_s,
u"Could not subscribe. Is there a valid connection?"_s);
return;
}
auto subWindow = new SubscriptionWindow(subscription);

View File

@ -4,6 +4,8 @@
#include "subscriptionwindow.h"
#include "ui_subscriptionwindow.h"
using namespace Qt::StringLiterals;
SubscriptionWindow::SubscriptionWindow(QMqttSubscription *sub, QWidget *parent) :
QWidget(parent),
ui(new Ui::SubscriptionWindow),
@ -37,19 +39,22 @@ void SubscriptionWindow::updateStatus(QMqttSubscription::SubscriptionState state
{
switch (state) {
case QMqttSubscription::Unsubscribed:
ui->labelStatus->setText(QLatin1String("Unsubscribed"));
ui->labelStatus->setText(u"Unsubscribed"_s);
break;
case QMqttSubscription::SubscriptionPending:
ui->labelStatus->setText(QLatin1String("Pending"));
ui->labelStatus->setText(u"Pending"_s);
break;
case QMqttSubscription::Subscribed:
ui->labelStatus->setText(QLatin1String("Subscribed"));
ui->labelStatus->setText(u"Subscribed"_s);
break;
case QMqttSubscription::Error:
ui->labelStatus->setText(QLatin1String("Error"));
ui->labelStatus->setText(u"Error"_s);
break;
case QMqttSubscription::UnsubscriptionPending:
ui->labelStatus->setText(u"Pending Unsubscription"_s);
break;
default:
ui->labelStatus->setText(QLatin1String("--Unknown--"));
ui->labelStatus->setText(u"--Unknown--"_s);
break;
}
}

View File

@ -1,5 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(websocketsubscription LANGUAGES CXX)

View File

@ -7,32 +7,33 @@
#include <QtCore/QCommandLineParser>
#include <QtCore/QLoggingCategory>
using namespace Qt::StringLiterals;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCoreApplication::setApplicationVersion("1.0");
QCommandLineParser parser;
parser.setApplicationDescription(QLatin1String("Websocket MQTT subscription tool"));
parser.setApplicationDescription(u"Websocket MQTT subscription tool"_s);
auto help = parser.addHelpOption();
// Use http://www.hivemq.com/demos/websocket-client/ in browser to publish
QCommandLineOption urlOption(QStringList() << "host" << "url" << "broker",
QStringLiteral("Host to connect to, eg ws://broker.hivemq.com:8000/mqtt"),
"host");
QCommandLineOption urlOption(QStringList{ u"host"_s, u"url"_s, u"broker"_s },
u"Host to connect to, eg ws://broker.hivemq.com:8000/mqtt"_s,
u"host"_s);
parser.addOption(urlOption);
QCommandLineOption subscriptionOption(QStringList() << "t" << "topic",
QStringLiteral("Topic to subscribe to"), "topic");
QCommandLineOption subscriptionOption(QStringList{ u"t"_s, u"topic"_s },
u"Topic to subscribe to"_s, u"topic"_s);
parser.addOption(subscriptionOption);
QCommandLineOption debugOption(QStringList() << "d" << "debug",
QStringLiteral("Enable Debug mode"));
QCommandLineOption debugOption(QStringList{ u"d"_s, u"debug"_s }, u"Enable Debug mode"_s);
parser.addOption(debugOption);
QCommandLineOption versionOption(QStringList() << "v" << "version",
QStringLiteral("MQTT protocol version.\n3: MQTT 3.1\n4: MQTT 3.1.1"),
"version", "3");
QCommandLineOption versionOption(QStringList{ u"v"_s, u"version"_s },
u"MQTT protocol version.\n3: MQTT 3.1\n4: MQTT 3.1.1"_s,
u"version"_s, u"3"_s);
parser.addOption(versionOption);
parser.process(a.arguments());

View File

@ -14,10 +14,20 @@ WebSocketIODevice::WebSocketIODevice(QObject *parent)
connect(&m_socket, &QWebSocket::binaryMessageReceived, this, &WebSocketIODevice::handleBinaryMessage);
}
bool WebSocketIODevice::isSequential() const
{
return true;
}
qint64 WebSocketIODevice::bytesAvailable() const
{
return static_cast<qint64>(m_buffer.size()) + QIODevice::bytesAvailable();
}
bool WebSocketIODevice::open(QIODevice::OpenMode mode)
{
QWebSocketHandshakeOptions options;
options.setSubprotocols({m_protocol});
options.setSubprotocols(QStringList{ QString::fromUtf8(m_protocol) });
m_socket.open(m_url, options);
@ -33,7 +43,7 @@ void WebSocketIODevice::close()
qint64 WebSocketIODevice::readData(char *data, qint64 maxlen)
{
qint64 bytesToRead = qMin(maxlen, (qint64)m_buffer.size());
memcpy(data, m_buffer.constData(), bytesToRead);
memcpy(data, m_buffer.constData(), static_cast<size_t>(bytesToRead));
m_buffer = m_buffer.right(m_buffer.size() - bytesToRead);
return bytesToRead;
}

View File

@ -13,6 +13,9 @@ class WebSocketIODevice : public QIODevice
public:
WebSocketIODevice(QObject *parent = nullptr);
bool isSequential() const override;
qint64 bytesAvailable() const override;
bool open(OpenMode mode) override;
void close() override;

109
licenseRule.json Normal file
View File

@ -0,0 +1,109 @@
[
{
"comment": ["file_pattern_ending: strings matched against the end of a file name.",
"location keys: regular expression matched against the beginning of",
"the file path (relative to the git submodule root).",
"spdx: list of SPDX-License-Expression's allowed in the matching files.",
"-------------------------------------------------------",
"Files with the following endings are Build System licensed,",
"unless they are examples",
"Files with other endings can also be build system files"
],
"file_pattern_ending": ["CMakeLists.txt", ".cmake", ".pro", ".pri", ".prf",
"configure", "configure.bat", "cmake.in", "plist.in", "CMakeLists.txt.in",
".cmake.conf", ".tag", "ci_config_linux.json", ".yaml"],
"location": {
"": {
"comment": "Default",
"file type": "build system",
"spdx": ["BSD-3-Clause"]
},
"(.*)(examples/|snippets/)": {
"comment": "Example takes precedence",
"file type": "examples and snippets",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
}
}
},
{
"comments": ["Files with the following endings are infrastructure licensed"],
"file_pattern_ending": [".gitattributes", ".gitignore", ".gitmodules", ".gitreview",
"_clang-format", "licenseRule.json", "REUSE.toml"],
"location":{
"": {
"comment": "Default",
"file type": "infrastructure",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
}
}
},
{
"comments": ["Files with the following endings are Tool licensed,",
"unless they are examples.",
"Files with other endings can also be tool files."],
"file_pattern_ending": [".sh", ".py", ".pl", ".bat", ".ps1"],
"location":{
"": {
"comment": "Default",
"file type": "tools and utils",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
},
"(.*)(examples/|snippets/)": {
"comment": "Example takes precedence",
"file type": "examples and snippets",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
}
}
},
{
"comment": "Files with the following endings are documentation licensed.",
"file_pattern_ending": [".qdoc", ".qdocinc" , ".qdocconf", ".css",
"README.txt", "CONTRIBUTING.md",
"qt_attribution.json"],
"location":{
"": {
"comment": "",
"file type": "documentation",
"spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
}
}
},
{
"comment": ["All other files",
"The licensing is defined only by the file location in the Qt module repository.",
"NO <file_pattern_ending> key for this case!",
"This needs to be the last entry of the file."],
"location": {
"": {
"comment": "Default",
"file type": "module and plugin",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
},
"dist/": {
"comment": "Default",
"file type": "documentation",
"spdx": ["LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only"]
},
"src/": {
"comment": "Default",
"file type": "module and plugin",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
},
"tests/": {
"comment": "Default",
"file type": "test",
"spdx": ["LicenseRef-Qt-Commercial OR GPL-3.0-only"]
},
"(.*)(examples/|snippets/)": {
"comment": "Default",
"file type": "examples and snippets",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
},
".*/doc/images": {
"comment": "Default",
"file type": "examples and snippets",
"spdx": ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
}
}
}
]

View File

@ -1,6 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Generated from src.pro.
set(QT_SBOM_DEFAULT_QT_LICENSE_ID_LIBRARIES "QT_COMMERCIAL_OR_GPL3")
add_subdirectory(mqtt)

View File

@ -1,8 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Generated from mqtt.pro.
#####################################################################
## Mqtt Module:
#####################################################################
@ -14,7 +12,7 @@ qt_internal_add_module(Mqtt
qmqttconnection.cpp qmqttconnection_p.h
qmqttconnectionproperties.cpp qmqttconnectionproperties.h qmqttconnectionproperties_p.h
qmqttcontrolpacket.cpp qmqttcontrolpacket_p.h
qmqttglobal.h
qmqttglobal.h qmqttglobal_p.h
qmqttmessage.cpp qmqttmessage.h qmqttmessage_p.h
qmqttpublishproperties.cpp qmqttpublishproperties.h qmqttpublishproperties_p.h
qmqttsubscription.cpp qmqttsubscription.h qmqttsubscription_p.h
@ -29,8 +27,24 @@ qt_internal_add_module(Mqtt
Qt::Network
PRIVATE_MODULE_INTERFACE
Qt::CorePrivate
GENERATE_CPP_EXPORTS
)
qt_internal_extend_target(Mqtt
CONDITION
TARGET Qt::WebSockets
DEFINES
QT_MQTT_WITH_WEBSOCKETS
PUBLIC_LIBRARIES
Qt::WebSockets
SOURCES
transportLayers/mqtt_websocket_io_base.cpp
transportLayers/mqtt_websocket_io_base_p.h
transportLayers/mqtt_websocket_io.cpp
transportLayers/mqtt_websocket_io_p.h
transportLayers/mqtt_secure_websocket_io.cpp
transportLayers/mqtt_secure_websocket_io_p.h
)
qt_internal_add_docs(Mqtt
doc/qtmqtt.qdocconf
)

View File

@ -14,15 +14,20 @@ qhp.QtMqtt.virtualFolder = qtmqtt
qhp.QtMqtt.indexTitle = Qt MQTT
qhp.QtMqtt.indexRoot =
qhp.QtMqtt.subprojects = classes examples
qhp.QtMqtt.subprojects = overview classes examples
qhp.QtMqtt.subprojects.overview.title = Overview
qhp.QtMqtt.subprojects.overview.indexTitle = Qt MQTT Overview
qhp.QtMqtt.subprojects.overview.selectors = group:none
qhp.QtMqtt.subprojects.classes.title = C++ Classes
qhp.QtMqtt.subprojects.classes.indexTitle = Qt MQTT C++ Classes
qhp.QtMqtt.subprojects.classes.selectors = class fake:headerfile
qhp.QtMqtt.subprojects.classes.selectors = class namespace headerfile
qhp.QtMqtt.subprojects.classes.sortPages = true
qhp.QtMqtt.subprojects.examples.title = Examples
qhp.QtMqtt.subprojects.examples.indexTitle = Qt MQTT Examples
qhp.QtMqtt.subprojects.examples.selectors = fake:example
qhp.QtMqtt.subprojects.examples.selectors = example
qhp.QtMqtt.subprojects.examples.sortPages = true
headerdirs += ..
@ -40,3 +45,6 @@ manifestmeta.thumbnail.names += "QtMqtt/WebSockets MQTT Subscription*"
navigation.landingpage = "Qt MQTT"
navigation.cppclassespage = "Qt MQTT C++ Classes"
# Allow zero warnings when testing documentation in CI
warninglimit = 0

View File

@ -59,5 +59,5 @@
In addition, it is available under the
\l{GNU General Public License, version 3}.
\generatelist{groupsbymodule attributions-qtmqtt}
\annotatedlist attributions-qtmqtt
*/

View File

@ -6,6 +6,7 @@
\page qtmqtt-overview.html
\title Qt MQTT Overview
\brief Provides insight into the MQTT protocol and the Qt MQTT module.
\ingroup explanations-networkingandconnectivity
Qt MQTT enables you to create applications and devices that can communicate
over the MQ telemetry transport (MQTT) protocol. It fully complies to the
@ -20,7 +21,8 @@
broker. The other clients can subscribe to notifications on particular
topics sent by the client.
\image mqtt.png
\image mqtt.png {Broker distributing messages from Client 1 to Client 2
(Topic A) and Client 3 (Topics A and B)}
For example, if \e {Client 2} subscribes to messages on \e {Topic A}, it
receives a notification when \e {Client 1} sends a message on that topic.
@ -177,4 +179,18 @@
discarded. The broker \e{should} store the last message, but \e{may}
also discard it. This depends on the implementation of the broker.
\section1 Threading and Blocking Operations
Consider running \l QMqttClient and its related classes in a thread
separate from the UI thread.\l QMqttClient uses a \l QIODevice as
its transport, and some transport operations may block. For example,
QMqttClient::disconnectFromHost() may wait synchronously for pending
data to be written, with a timeout of up to 30 seconds. Calling it from
the UI thread can therefore block the UI event loop and make the
application unresponsive. Keeping the MQTT client and its transport in
a dedicated thread helps prevent potentially blocking I/O from affecting
UI responsiveness. Use signals and slots or other mechanisms that queue
work to the target thread to communicate between the MQTT thread and
the UI thread.
*/

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttauthenticationproperties.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTAUTHENTICATIONPROPERTIES_H
#define QMQTTAUTHENTICATIONPROPERTIES_H

View File

@ -1,9 +1,15 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qmqttclient.h"
#include "qmqttclient_p.h"
#ifdef QT_MQTT_WITH_WEBSOCKETS
#include "transportLayers/mqtt_websocket_io_p.h"
#include "transportLayers/mqtt_secure_websocket_io_p.h"
#endif // QT_MQTT_WITH_WEBSOCKETS
#include <QtCore/QLoggingCategory>
#include <QtCore/QUuid>
#include <QtCore/QtEndian>
@ -82,6 +88,7 @@ Q_LOGGING_CATEGORY(lcMqttClient, "qt.mqtt.client")
\list
\li 3: MQTT standard version 3.1.
\li 4: MQTT standard version 3.1.1, often referred to MQTT 4.
\li 5: MQTT Standard 5.0.
\endlist
*/
@ -150,6 +157,21 @@ Q_LOGGING_CATEGORY(lcMqttClient, "qt.mqtt.client")
\sa keepAlive(), requestPing(), serverConnectionProperties(), pingResponseReceived()
*/
/*!
\property QMqttClient::readBufferSize
\since 6.13
\brief This property holds the size of the internal read buffer.
The property limits the amount of data that the client can receive
before you call read() or readAll().
A read buffer size of 0 (the default) means that the buffer has no size
limit, ensuring that no data is lost.
\note The limit is not applicable for a plain \c TransportType::IODevice
transport type.
*/
/*!
\enum QMqttClient::TransportType
@ -162,6 +184,12 @@ Q_LOGGING_CATEGORY(lcMqttClient, "qt.mqtt.client")
The transport uses a class based on a QAbstractSocket.
\value SecureSocket
The transport uses a class based on a QSslSocket.
\value [since 6.10] WebSocket
The transport uses a class based on a QIODevice,
which uses a QWebSocket internally.
\value [since 6.10] SecureWebSocket
The transport uses a class based on a QIODevice,
which uses a secure QWebSocket internally.
*/
/*!
@ -311,6 +339,15 @@ Q_LOGGING_CATEGORY(lcMqttClient, "qt.mqtt.client")
\sa authenticationRequested(), authenticate()
*/
/*!
\since 6.13
\fn QMqttClient::readBufferSizeChanged(qint64 size)
This signal is emitted when the \a size of internal read buffer is changed.
\sa readBufferSize()
*/
/*!
Creates a new MQTT client instance with the specified \a parent.
*/
@ -323,10 +360,16 @@ QMqttClient::QMqttClient(QObject *parent) : QObject(*(new QMqttClientPrivate(thi
/*!
Deletes a MQTT client. If the MQTT client was not already disconnected from the MQTT broker,
it will be disconnected from automatically.
\note If a transport is specified with setTransport it must be valid at this point
*/
QMqttClient::~QMqttClient()
{
disconnectFromHost();
Q_D(QMqttClient);
if (d->m_connection.internalState() == QMqttConnection::BrokerConnected) {
d->m_connection.setClientDestruction();
disconnectFromHost();
}
d->m_connection.disconnectAndResetTransport();
}
/*!
@ -337,7 +380,7 @@ QMqttClient::~QMqttClient()
\l Disconnected state.
\note Setting a custom transport for a client does not pass over responsibility
on connection management. The transport has to be opened for QIODevice based
on connection management or ownership. The transport has to be opened for QIODevice based
transports or connected for socket type transports before calling QMqttClient::connectToHost().
*/
void QMqttClient::setTransport(QIODevice *device, QMqttClient::TransportType transport)
@ -349,6 +392,8 @@ void QMqttClient::setTransport(QIODevice *device, QMqttClient::TransportType tra
return;
}
d->m_connection.setTransport(device, transport);
// Set the currently active buffer size for a new transport.
d->m_connection.setReadBufferSize(d->m_readBufferSize);
}
/*!
@ -360,6 +405,74 @@ QIODevice *QMqttClient::transport() const
return d->m_connection.transport();
}
/*!
\since 6.13
Limits the read buffer of the transport used by this client to
\a size bytes. Triggers warning message if the limit could not
be applied.
The transport does not buffer more than \a size bytes: it stops
reading from the network until the client has taken the data out of
the buffer. Use this function to protect the application against a
broker that sends more data than the application can handle, which
could make it run out of memory. A size of \c 0 means that the buffer
has no size limit, which is the default of the underlying transport.
\code
QMqttClient client;
client.setHostname(QStringLiteral("broker.example.com"));
client.setPort(1883);
client.setReadBufferSize(64 * 1024);
client.connectToHost();
\endcode
The size can be set before connecting. It is applied to the transport
when connectToHost() creates it, or when setTransport() sets it. The size
has no effect if the transport is a plain \l QMqttClient::IODevice.
Before Qt 6.13, the \c QMqttClient class provided no way to limit the
amount of incoming data. However, applications using older versions of
\c QMqttClient with certain types of transport, such as transports derived
from \c AbstractSocket, can protect themselves against memory exhaustion
caused by a broker, as shown in the example below:
\code
QMqttClient client;
client.setHostname(QStringLiteral("broker.example.com"));
client.setPort(1883);
QObject::connect(&client, &QMqttClient::connected, &client, [&client]() {
QAbstractSocket *socket = dynamic_cast<QAbstractSocket *>(client.transport());
if (socket)
socket->setReadBufferSize(64 * 1024);
});
client.connectToHost();
\endcode
\note If you use a custom QIODevice-based transport, implement
support for a read buffer limit in the device and configure it
before calling setTransport(). Some devices already support it.
For example, \l QSerialPort provides QSerialPort::setReadBufferSize().
\note This limit and the MQTT 5 maximum packet size protect against
different things. The maximum packet size limits the size of an
individual packet, not the total size of a buffer.
\sa setTransport(), QMqttConnectionProperties::setMaximumPacketSize()
*/
void QMqttClient::setReadBufferSize(qint64 size)
{
Q_D(QMqttClient);
if (d->m_readBufferSize == size)
return;
// Store the size even if there is no transport yet. setTransport() and
// connectToHost() apply it to the transport they set or create.
d->m_readBufferSize = size;
d->m_connection.setReadBufferSize(size);
emit readBufferSizeChanged(d->m_readBufferSize);
}
/*!
Adds a new subscription to receive notifications on \a topic. The parameter
\a qos specifies the level at which security messages are received. For more
@ -507,6 +620,56 @@ quint16 QMqttClient::port() const
return d->m_port;
}
/*!
\since 6.10
Set a web socket transport type and initiates a connection to the MQTT broker.
Earlier transport type is replaced.
If \a webSocket is given, hostname and port is ignored, and connection is done
with that websocket. webSocket is owned by the calling code, and must be valid
for the lifetime of the QMqttClient object.
*/
void QMqttClient::connectToHostWebSocket(QWebSocket *webSocket)
{
#ifndef QT_MQTT_WITH_WEBSOCKETS
Q_UNUSED(webSocket);
qWarning() << " Qt built without websocket support, connect skipped";
#else
Q_D(QMqttClient);
d->m_connection.connectTransport(
TransportType::WebSocket,
std::make_shared<QMqttWebSocketIO>(nullptr, webSocket));
connectToHost();
d->m_connection.m_transportIsSet = false;
#endif // QT_MQTT_WITH_WEBSOCKETS
}
/*!
\since 6.10
Set a secure websocket transport type and initiates a connection to the MQTT broker.
Earlier transport type is replaced.
If \a webSocket is given, hostname and port is ignored, and connection is done
with that websocket. webSocket is owned by the calling code, and must be valid
for the lifetime of the QMqttClient object.
*/
void QMqttClient::connectToHostWebSocketEncrypted(QWebSocket *webSocket)
{
#ifndef QT_MQTT_WITH_WEBSOCKETS
Q_UNUSED(webSocket);
qWarning() << " Qt built without websocket support, connect skipped";
#else
Q_D(QMqttClient);
d->m_connection.connectTransport(
TransportType::SecureWebSocket,
std::make_shared<QMqttSecureWebSocketIO>(nullptr, webSocket));
connectToHost();
d->m_connection.m_transportIsSet = false;
#endif // QT_MQTT_WITH_WEBSOCKETS
}
/*!
Initiates a connection to the MQTT broker.
*/
@ -561,6 +724,11 @@ void QMqttClient::connectToHost(bool encrypted, const QString &sslPeerName)
return;
}
// We can safely set the active buffer size for the new transport here,
// as the transport type has been determined by ensureTransport() or
// connectToHostWebSocket()/connectToHostWebSocketEncrypted() at this point.
d->m_connection.setReadBufferSize(d->m_readBufferSize);
// Once transport has connected, it will invoke
// QMqttConnection::sendControlConnect to
// handshake with the broker
@ -568,6 +736,11 @@ void QMqttClient::connectToHost(bool encrypted, const QString &sslPeerName)
/*!
Disconnects from the MQTT broker.
\note This function may block while waiting for pending data
to be written to the transport.
See \l {Threading and Blocking Operations} for recommended approaches
on handling it.
*/
void QMqttClient::disconnectFromHost()
{
@ -575,6 +748,7 @@ void QMqttClient::disconnectFromHost()
switch (d->m_connection.internalState()) {
case QMqttConnection::BrokerConnected:
case QMqttConnection::ClientDestruction:
d->m_connection.sendControlDisconnect();
break;
case QMqttConnection::BrokerDisconnected:
@ -640,6 +814,12 @@ bool QMqttClient::autoKeepAlive() const
return d->m_autoKeepAlive;
}
qint64 QMqttClient::readBufferSize() const
{
Q_D(const QMqttClient);
return d->m_readBufferSize;
}
/*!
\since 5.12
@ -1013,10 +1193,7 @@ QMqttClientPrivate::QMqttClientPrivate(QMqttClient *c)
: QObjectPrivate()
{
m_client = c;
m_clientId = QUuid::createUuid().toString();
m_clientId.remove(QLatin1Char('{'));
m_clientId.remove(QLatin1Char('}'));
m_clientId.remove(QLatin1Char('-'));
m_clientId = QUuid::createUuid().toString(QUuid::Id128);
m_clientId.resize(23);
#ifdef QT_BUILD_INTERNAL
// Some test servers require a username token

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTMQTTCLIENT_H
#define QTMQTTCLIENT_H
@ -22,6 +23,7 @@
QT_BEGIN_NAMESPACE
class QWebSocket;
class QMqttClientPrivate;
class Q_MQTT_EXPORT QMqttClient : public QObject
@ -30,13 +32,15 @@ public:
enum TransportType {
IODevice = 0,
AbstractSocket,
SecureSocket
SecureSocket,
WebSocket,
SecureWebSocket,
};
enum ClientState {
Disconnected = 0,
Connecting,
Connected
Connected,
};
Q_ENUM(ClientState)
@ -52,22 +56,19 @@ public:
TransportInvalid = 256,
ProtocolViolation,
UnknownError,
Mqtt5SpecificError
Mqtt5SpecificError,
};
Q_ENUM(ClientError)
enum ProtocolVersion {
MQTT_3_1 = 3,
MQTT_3_1_1 = 4,
MQTT_5_0 = 5
MQTT_5_0 = 5,
};
Q_ENUM(ProtocolVersion)
private:
Q_OBJECT
Q_ENUMS(ClientState)
Q_ENUMS(ClientError)
Q_ENUMS(ProtocolVersion)
Q_PROPERTY(QString clientId READ clientId WRITE setClientId NOTIFY clientIdChanged)
Q_PROPERTY(QString hostname READ hostname WRITE setHostname NOTIFY hostnameChanged)
Q_PROPERTY(quint16 port READ port WRITE setPort NOTIFY portChanged)
@ -83,12 +84,15 @@ private:
Q_PROPERTY(quint8 willQoS READ willQoS WRITE setWillQoS NOTIFY willQoSChanged)
Q_PROPERTY(bool willRetain READ willRetain WRITE setWillRetain NOTIFY willRetainChanged)
Q_PROPERTY(bool autoKeepAlive READ autoKeepAlive WRITE setAutoKeepAlive NOTIFY autoKeepAliveChanged)
Q_PROPERTY(qint64 readBufferSize READ readBufferSize WRITE setReadBufferSize NOTIFY readBufferSizeChanged)
public:
explicit QMqttClient(QObject *parent = nullptr);
~QMqttClient() override;
void setTransport(QIODevice *device, TransportType transport);
QIODevice *transport() const;
void setReadBufferSize(qint64 size);
QMqttSubscription *subscribe(const QMqttTopicFilter &topic, quint8 qos = 0);
QMqttSubscription *subscribe(const QMqttTopicFilter &topic,
@ -115,6 +119,8 @@ public:
#ifndef QT_NO_SSL
void connectToHostEncrypted(const QSslConfiguration &conf);
#endif
Q_INVOKABLE void connectToHostWebSocket(QWebSocket *webSocket = nullptr);
Q_INVOKABLE void connectToHostWebSocketEncrypted(QWebSocket *webSocket = nullptr);
Q_INVOKABLE void disconnectFromHost();
ClientState state() const;
@ -129,6 +135,7 @@ public:
QByteArray willMessage() const;
bool willRetain() const;
bool autoKeepAlive() const;
qint64 readBufferSize() const;
void setConnectionProperties(const QMqttConnectionProperties &prop);
QMqttConnectionProperties connectionProperties() const;
@ -164,6 +171,7 @@ Q_SIGNALS:
void willMessageChanged(QByteArray willMessage);
void willRetainChanged(bool willRetain);
void autoKeepAliveChanged(bool autoKeepAlive);
void readBufferSizeChanged(qint64 size);
void authenticationRequested(const QMqttAuthenticationProperties &p);
void authenticationFinished(const QMqttAuthenticationProperties &p);

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTCLIENT_P_H
#define QMQTTCLIENT_P_H
@ -15,6 +16,7 @@
// We mean it.
//
#include "qmqttglobal_p.h"
#include "qmqttclient.h"
#include "qmqttconnection_p.h"
@ -46,6 +48,7 @@ public:
quint8 m_willQoS{0};
bool m_willRetain{false};
bool m_autoKeepAlive{true};
qint64 m_readBufferSize{0};
QString m_username;
QString m_password;
bool m_cleanSession{true};

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTCONNECTION_P_H
#define QMQTTCONNECTION_P_H
@ -26,6 +27,9 @@
#include <QtCore/QSharedPointer>
#include <QtCore/QtEndian>
#include <memory>
#include <optional>
QT_BEGIN_NAMESPACE
class QMqttClientPrivate;
@ -38,13 +42,16 @@ public:
BrokerDisconnected = 0,
BrokerConnecting,
BrokerWaitForConnectAck,
BrokerConnected
BrokerConnected,
ClientDestruction
};
explicit QMqttConnection(QObject *parent = nullptr);
~QMqttConnection() override;
void disconnectAndResetTransport();
void setTransport(QIODevice *device, QMqttClient::TransportType transport);
void connectTransport(QMqttClient::TransportType transport, const std::shared_ptr<QIODevice> &device);
QIODevice *transport() const;
bool ensureTransport(bool createSecureIfNeeded = false);
@ -61,12 +68,13 @@ public:
QMqttSubscription *sendControlSubscribe(const QMqttTopicFilter &topic, quint8 qos, const QMqttSubscriptionProperties &properties);
bool sendControlUnsubscribe(const QMqttTopicFilter &topic, const QMqttUnsubscriptionProperties &properties);
bool sendControlPingRequest(bool isAuto = true);
bool sendControlDisconnect();
bool sendControlDisconnect(std::optional<QMqtt::ReasonCode> reasonCode = std::nullopt);
void setReadBufferSize(qint64 size);
void setClientPrivate(QMqttClientPrivate *clientPrivate);
inline quint16 unusedPacketIdentifier() const;
inline InternalConnectionState internalState() const { return m_internalState; }
inline void setClientDestruction() { m_internalState = ClientDestruction; }
void cleanSubscriptions();
@ -80,9 +88,10 @@ protected:
void timerEvent(QTimerEvent *event) override;
public:
QIODevice *m_transport{nullptr};
std::shared_ptr<QIODevice> m_transport;
QMqttClient::TransportType m_transportType{QMqttClient::IODevice};
bool m_ownTransport{false};
bool m_transportIsSet{false}; // connectTo* does not reset m_transport;
bool m_connectedTransport{false}; // We have connected the signals for m_transport if true
QMqttClientPrivate *m_clientPrivate{nullptr};
#ifndef QT_NO_SSL
QSslConfiguration m_sslConfiguration;
@ -100,11 +109,11 @@ private:
bool processDataHelper();
bool readBuffer(char *data, quint64 size);
qint32 readVariableByteInteger(qint64 *dataSize = nullptr);
void readAuthProperties(QMqttAuthenticationProperties &properties);
void readConnackProperties(QMqttServerConnectionProperties &properties);
void readMessageStatusProperties(QMqttMessageStatusProperties &properties);
void readPublishProperties(QMqttPublishProperties &properties);
void readSubscriptionProperties(QMqttSubscription *sub);
bool readAuthProperties(QMqttAuthenticationProperties &properties);
bool readConnackProperties(QMqttServerConnectionProperties &properties);
bool readMessageStatusProperties(QMqttMessageStatusProperties &properties);
bool readPublishProperties(QMqttPublishProperties &properties);
bool readSubscriptionProperties(QMqttSubscription *sub);
QByteArray writeConnectProperties();
QByteArray writeLastWillProperties() const;
QByteArray writePublishProperties(const QMqttPublishProperties &properties);
@ -112,8 +121,18 @@ private:
QByteArray writeUnsubscriptionProperties(const QMqttUnsubscriptionProperties &properties);
QByteArray writeAuthenticationProperties(const QMqttAuthenticationProperties &properties);
void closeConnection(QMqttClient::ClientError error);
void closeOnMalformedPacket();
QByteArray readBuffer(quint64 size);
template<typename T> T readBufferTyped(qint64 *dataSize = nullptr);
template<typename T> std::optional<T> readBufferTyped(qint64 *dataSize = nullptr);
bool isPendingUnsubscribe(QMqttSubscription *) const;
QMqttSubscription *findActiveSubscription(const QMqttTopicFilter &topic) const;
template <typename T>
void setSocketBufferSize(qint64 size) {
auto *socket = qobject_cast<T *>(m_transport.get());
Q_ASSERT(socket);
socket->setReadBufferSize(size);
}
QByteArray m_readBuffer;
int m_readPosition{0};
qint64 m_missingData{0};
@ -126,9 +145,13 @@ private:
QMqttControlPacket::PacketType m_currentPacket{QMqttControlPacket::UNKNOWN};
bool writePacketToTransport(const QMqttControlPacket &p);
// I: There can be many occurences of different QMqttSubscription * with
// the same QMqttTopicFilter, but only one that is not in
// m_pendingUnsubscriptions.
QHash<quint16, QMqttSubscription *> m_pendingSubscriptionAck;
QHash<quint16, QMqttSubscription *> m_pendingUnsubscriptions;
QHash<QMqttTopicFilter, QMqttSubscription *> m_activeSubscriptions;
QMultiHash<QMqttTopicFilter, QMqttSubscription *> m_activeSubscriptions;
QHash<quint16, QSharedPointer<QMqttControlPacket>> m_pendingMessages;
QHash<quint16, QSharedPointer<QMqttControlPacket>> m_pendingReleaseMessages;
InternalConnectionState m_internalState{BrokerDisconnected};

View File

@ -1,18 +1,15 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttconnectionproperties.h"
#include "qmqttconnectionproperties_p.h"
#include <QtCore/QLoggingCategory>
#include <limits>
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcMqttConnection)
/*!
\class QMqttConnectionProperties
@ -307,6 +304,11 @@ void QMqttConnectionProperties::setMaximumReceive(quint16 maximumReceive)
If no maximum packet size is specified, no limit is imposed beyond the
limitations of the protocol itself.
\note Since Qt 6.13, this limit can be applied to incoming packets
when using MQTT 3.1 or MQTT 3.1.1. These protocol versions cannot announce
the limit to the broker, but the client closes the connection with
\l QMqttClient::ProtocolViolation when it receives a larger packet.
*/
void QMqttConnectionProperties::setMaximumPacketSize(quint32 packetSize)
{

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTCONNECTIONPROPERTIES_H
#define QMQTTCONNECTIONPROPERTIES_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTCONNECTIONPROPERTIES_P_H
#define QMQTTCONNECTIONPROPERTIES_P_H
@ -18,8 +19,12 @@
#include "qmqttconnectionproperties.h"
#include "private/qglobal_p.h"
#include <QtCore/QLoggingCategory>
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcMqttConnection)
class QMqttLastWillPropertiesData : public QSharedData
{
public:

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:network-protocol
#include "qmqttcontrolpacket_p.h"
@ -8,8 +9,6 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcMqttClient)
QMqttControlPacket::QMqttControlPacket()
{

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTCONTROLPACKET_P_H
#define QMQTTCONTROLPACKET_P_H
@ -14,7 +15,7 @@
//
// We mean it.
//
#include "qmqttglobal.h"
#include "qmqttglobal_p.h"
#include <QtCore/QByteArray>
#include <QtCore/QtGlobal>

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTQMQTTGLOBAL_H
#define QTQMQTTGLOBAL_H

28
src/mqtt/qmqttglobal_p.h Normal file
View File

@ -0,0 +1,28 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTQMQTTGLOBAL_P_H
#define QTQMQTTGLOBAL_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtMqtt/qmqttglobal.h>
#include <QtCore/qloggingcategory.h>
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcMqttClient)
QT_END_NAMESPACE
#endif // QTQMQTTGLOBAL_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttmessage.h"
#include "qmqttmessage_p.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTMESSAGE_H
#define QMQTTMESSAGE_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTMESSAGE_P_H
#define QMQTTMESSAGE_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttpublishproperties.h"
#include "qmqttpublishproperties_p.h"
@ -9,8 +10,6 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcMqttClient)
/*!
\class QMqttPublishProperties

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTPUBLISHPROPERTIES_H
#define QMQTTPUBLISHPROPERTIES_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTPUBLISHPROPERTIES_P_H
#define QMQTTPUBLISHPROPERTIES_P_H
@ -15,7 +16,7 @@
// We mean it.
//
#include "qmqttglobal.h"
#include "qmqttglobal_p.h"
#include "qmqttpublishproperties.h"
#include <QtCore/QSharedData>

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttsubscription.h"
#include "qmqttsubscription_p.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTSUBSCRIPTION_H
#define QMQTTSUBSCRIPTION_H
@ -18,7 +19,6 @@ class QMqttSubscriptionPrivate;
class Q_MQTT_EXPORT QMqttSubscription : public QObject
{
Q_OBJECT
Q_ENUMS(SubscriptionState)
Q_PROPERTY(SubscriptionState state READ state NOTIFY stateChanged)
Q_PROPERTY(quint8 qos READ qos NOTIFY qosChanged)
Q_PROPERTY(QMqttTopicFilter topic READ topic)
@ -35,6 +35,7 @@ public:
UnsubscriptionPending,
Error
};
Q_ENUM(SubscriptionState)
SubscriptionState state() const;
QMqttTopicFilter topic() const;

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTSUBSCRIPTION_P_H
#define QMQTTSUBSCRIPTION_P_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqttsubscriptionproperties.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTSUBSCRIPTIONPROPERTIES_H
#define QMQTTSUBSCRIPTIONPROPERTIES_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qmqtttopicfilter.h"
@ -173,7 +174,7 @@ bool QMqttTopicFilter::isValid() const
|| (singleLevelPosition < size - 1 && d->filter.at(singleLevelPosition + 1) != QLatin1Char('/'))) {
return false;
}
singleLevelPosition = d->filter.indexOf(QLatin1Char('#'), singleLevelPosition + 1);
singleLevelPosition = d->filter.indexOf(QLatin1Char('+'), singleLevelPosition + 1);
}
// Shared Subscription syntax
@ -223,7 +224,7 @@ bool QMqttTopicFilter::match(const QMqttTopicName &name, MatchOptions matchOptio
return false;
for (int i = 0; i < filterLevels.size(); ++i) {
if (filterLevels.at(i) != topicLevels.at(i))
if (filterLevels.at(i) != topicLevels.at(i) && filterLevels.at(i) != QLatin1Char('+'))
return false;
}
return true;

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTTOPICFILTER_H
#define QMQTTTOPICFILTER_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:critical reason:data-parser
#include "qmqtttopicname.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2017 Lorenz Haas
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTTOPICNAME_H
#define QMQTTTOPICNAME_H

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "qmqtttype.h"

View File

@ -1,5 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QMQTTTYPE_H
#define QMQTTTYPE_H

View File

@ -0,0 +1,45 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "mqtt_secure_websocket_io_p.h"
#ifdef QT_MQTT_WITH_WEBSOCKETS
QMqttSecureWebSocketIO::~QMqttSecureWebSocketIO()
{
disconnect(m_socket.get(), &QWebSocket::connected, this, &QMqttSecureWebSocketIO::doSocketEncrypted);
}
QMqttSecureWebSocketIO::QMqttSecureWebSocketIO(QObject *parent, QWebSocket *webSocket)
:
QMqttWebSocketIOBase(parent, webSocket)
{
connect(m_socket.get(), &QWebSocket::connected, this, &QMqttSecureWebSocketIO::doSocketEncrypted);
}
void QMqttSecureWebSocketIO::connectToHostEncrypted(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version)
{
setProtocol(version);
if (!isExternalSocket()) {
QUrl url(QString(u"wss://") + hostname + u":" + QString().setNum(port));
QWebSocketHandshakeOptions options;
options.setSubprotocols(QStringList{ QString::fromUtf8(m_protocol) });
m_socket->open(url, options);
}
open(QIODevice::ReadWrite);
}
void QMqttSecureWebSocketIO::close()
{
m_socket->close();
QMqttWebSocketIOBase::close();
}
void QMqttSecureWebSocketIO::doSocketEncrypted()
{
emit encrypted();
}
#include "moc_mqtt_secure_websocket_io_p.cpp"
#endif /* QT_MQTT_WITH_WEBSOCKETS */

View File

@ -0,0 +1,53 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTMQTTCLIENT_SECURE_WEBSOCKET_IODEVICE_H
#define QTMQTTCLIENT_SECURE_WEBSOCKET_IODEVICE_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifdef QT_MQTT_WITH_WEBSOCKETS
#include <QtWebSockets/QWebSocketHandshakeOptions>
#include <QtWebSockets/QWebSocket>
#include <QtCore/QIODevice>
#include "transportLayers/mqtt_websocket_io_base_p.h"
#include "qmqttclient.h"
QT_BEGIN_NAMESPACE
class QMqttSecureWebSocketIO : public QMqttWebSocketIOBase
{
Q_OBJECT
public:
Q_DISABLE_COPY_MOVE(QMqttSecureWebSocketIO)
~QMqttSecureWebSocketIO() override;
QMqttSecureWebSocketIO(QObject *parent = nullptr, QWebSocket *webSocket = nullptr);
void close() override;
void connectToHostEncrypted(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version);
Q_SIGNALS:
void encrypted();
public slots:
void doSocketEncrypted();
};
QT_END_NAMESPACE
#endif /* QT_MQTT_WITH_WEBSOCKETS */
#endif /* QTMQTTCLIENT_SECURE_WEBSOCKET_IODEVICE_H */

View File

@ -0,0 +1,45 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "mqtt_websocket_io_p.h"
#ifdef QT_MQTT_WITH_WEBSOCKETS
QMqttWebSocketIO::~QMqttWebSocketIO()
{
disconnect(m_socket.get(), &QWebSocket::connected, this, &QMqttWebSocketIO::doSocketConnected);
}
QMqttWebSocketIO::QMqttWebSocketIO(QObject *parent, QWebSocket *webSocket)
:
QMqttWebSocketIOBase(parent, webSocket)
{
connect(m_socket.get(), &QWebSocket::connected, this, &QMqttWebSocketIO::doSocketConnected);
}
void QMqttWebSocketIO::connectToHost(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version)
{
setProtocol(version);
if (!isExternalSocket()) {
QUrl url(QString(u"ws://") + hostname + u":" + QString().setNum(port));
QWebSocketHandshakeOptions options;
options.setSubprotocols(QStringList{ QString::fromUtf8(m_protocol) });
m_socket->open(url, options);
}
open(QIODevice::ReadWrite);
}
void QMqttWebSocketIO::close()
{
m_socket->close();
QMqttWebSocketIOBase::close();
}
void QMqttWebSocketIO::doSocketConnected()
{
emit connected();
}
#include "moc_mqtt_websocket_io_p.cpp"
#endif /* QT_MQTT_WITH_WEBSOCKETS */

View File

@ -0,0 +1,103 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#include "mqtt_websocket_io_base_p.h"
#ifdef QT_MQTT_WITH_WEBSOCKETS
QMqttWebSocketIOBase::~QMqttWebSocketIOBase()
{
disconnect(m_socket.get(), &QWebSocket::disconnected, this, &QMqttWebSocketIOBase::doSocketDisconnected);
disconnect(m_socket.get(), &QWebSocket::errorOccurred, this, &QMqttWebSocketIOBase::doSocketErrorOccured);
disconnect(m_socket.get(), &QWebSocket::binaryMessageReceived, this, &QMqttWebSocketIOBase::doSocketHandleBinaryMessage);
}
QMqttWebSocketIOBase::QMqttWebSocketIOBase(QObject *parent, QWebSocket *webSocket)
:
QIODevice(parent)
{
m_externalSocket = (webSocket != nullptr);
if (webSocket)
m_socket = std::shared_ptr<QWebSocket>(webSocket, [](QWebSocket *) { ; }); // skip deleter
else
m_socket = std::make_shared<QWebSocket>();
connect(m_socket.get(), &QWebSocket::disconnected, this, &QMqttWebSocketIOBase::doSocketDisconnected);
connect(m_socket.get(), &QWebSocket::errorOccurred, this, &QMqttWebSocketIOBase::doSocketErrorOccured);
connect(m_socket.get(), &QWebSocket::binaryMessageReceived, this, &QMqttWebSocketIOBase::doSocketHandleBinaryMessage);
setProtocol(QMqttClient::ProtocolVersion::MQTT_3_1);
}
bool QMqttWebSocketIOBase::open(QIODevice::OpenMode mode)
{
if (!QIODevice::open(mode))
{
close();
emit errorOccurred(QAbstractSocket::SocketResourceError);
}
// Will emit onConnectionEstablished or onConnectionError
return false;
}
void QMqttWebSocketIOBase::close()
{
QIODevice::close();
}
qint64 QMqttWebSocketIOBase::readData(char *data, qint64 maxlen)
{
qint64 bytesToRead = qMin(maxlen, (qint64)m_buffer.size());
memcpy(data, m_buffer.constData(), bytesToRead);
m_buffer = m_buffer.right(m_buffer.size() - bytesToRead);
return bytesToRead;
}
qint64 QMqttWebSocketIOBase::writeData(const char *data, qint64 len)
{
QByteArray msg(data, len);
const int length = m_socket->sendBinaryMessage(msg);
emit bytesWritten(length);
return length;
}
void QMqttWebSocketIOBase::setProtocol(QMqttClient::ProtocolVersion version)
{
switch (version) {
case QMqttClient::ProtocolVersion::MQTT_3_1:
setProtocol("mqttv3.1");
break;
case QMqttClient::ProtocolVersion::MQTT_3_1_1:
setProtocol("mqtt");
break;
case QMqttClient::ProtocolVersion::MQTT_5_0:
setProtocol("mqtt");
break;
} /* end-switch */
}
void QMqttWebSocketIOBase::setProtocol(const QByteArray &data)
{
m_protocol = data;
}
void QMqttWebSocketIOBase::doSocketHandleBinaryMessage(const QByteArray &msg)
{
m_buffer.append(msg);
emit readyRead();
}
void QMqttWebSocketIOBase::doSocketDisconnected()
{
emit disconnected();
}
void QMqttWebSocketIOBase::doSocketErrorOccured(QAbstractSocket::SocketError error)
{
emit errorOccurred(error);
}
#include "moc_mqtt_websocket_io_base_p.cpp"
#endif /* QT_MQTT_WITH_WEBSOCKETS */

View File

@ -0,0 +1,105 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTMQTTCLIENT_WEBSOCKET_IODEVICE_BASE_H
#define QTMQTTCLIENT_WEBSOCKET_IODEVICE_BASE_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifdef QT_MQTT_WITH_WEBSOCKETS
#include <QtWebSockets/QWebSocketHandshakeOptions>
#include <QtWebSockets/QWebSocket>
#include <QtCore/QIODevice>
#include "qmqttclient.h"
QT_BEGIN_NAMESPACE
class QMqttWebSocketIOBase : public QIODevice
{
Q_OBJECT
protected:
QMqttWebSocketIOBase(QObject *parent = nullptr, QWebSocket *webSocket = nullptr);
public:
Q_DISABLE_COPY_MOVE(QMqttWebSocketIOBase)
~QMqttWebSocketIOBase() override;
bool open(OpenMode mode) override;
void close() override;
qint64 readData(char *data, qint64 maxlen) override;
qint64 writeData(const char *data, qint64 len) override;
void setProtocol(QMqttClient::ProtocolVersion version);
void setProtocol(const QByteArray &data);
bool isSequential() const override
{
return true;
}
qint64 bytesAvailable() const override
{
return static_cast<qint64>(m_buffer.size()) + QIODevice::bytesAvailable();
}
bool waitForBytesWritten(int msecs) override
{
Q_UNUSED(msecs);
m_socket->flush();
return true;
}
bool isConnected() const
{
return (m_socket->state() == QAbstractSocket::ConnectedState);
}
QAbstractSocket::SocketState state() const
{
return m_socket->state();
}
bool isExternalSocket() const
{
return m_externalSocket;
}
void setReadBufferSize(qint64 size)
{
m_socket->setReadBufferSize(size);
}
Q_SIGNALS:
void disconnected();
void errorOccurred(QAbstractSocket::SocketError error);
public slots:
void doSocketHandleBinaryMessage(const QByteArray &msg);
void doSocketDisconnected();
void doSocketErrorOccured(QAbstractSocket::SocketError error);
protected:
std::shared_ptr<QWebSocket> m_socket;
bool m_externalSocket = false;
QByteArray m_protocol;
QByteArray m_buffer;
};
QT_END_NAMESPACE
#endif /* QT_MQTT_WITH_WEBSOCKETS */
#endif /* QTMQTTCLIENT_WEBSOCKET_IODEVICE_BASE_H */

View File

@ -0,0 +1,54 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// Qt-Security score:significant reason:default
#ifndef QTMQTTCLIENT_WEBSOCKET_IODEVICE_H
#define QTMQTTCLIENT_WEBSOCKET_IODEVICE_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifdef QT_MQTT_WITH_WEBSOCKETS
#include <QtWebSockets/QWebSocketHandshakeOptions>
#include <QtWebSockets/QWebSocket>
#include <QtCore/QIODevice>
#include "transportLayers/mqtt_websocket_io_base_p.h"
#include "qmqttclient.h"
QT_BEGIN_NAMESPACE
class QMqttWebSocketIO : public QMqttWebSocketIOBase
{
Q_OBJECT
public:
Q_DISABLE_COPY_MOVE(QMqttWebSocketIO)
~QMqttWebSocketIO() override;
QMqttWebSocketIO(QObject *parent = nullptr, QWebSocket *webSocket = nullptr);
void close() override;
void connectToHost(const QString &hostname, quint16 port, QMqttClient::ProtocolVersion version);
Q_SIGNALS:
void connected();
public slots:
void doSocketConnected();
};
QT_END_NAMESPACE
#endif /* QT_MQTT_WITH_WEBSOCKETS */
#endif /* QTMQTTCLIENT_WEBSOCKET_IODEVICE_H */

View File

@ -1,7 +0,0 @@
%modules = (
"QtMqtt" => "$basedir/src/mqtt",
);
%dependencies = (
"qtbase" => "",
);

View File

@ -1,7 +1,121 @@
# Copyright (C) 2022 The Qt Company Ltd.
# Copyright (C) 2025 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Generated from tests.pro.
# This function adds the test 12 times if run on a computer where the
# mosquitto broker has been provisioned by running the corresponding
# script located qt6/coin/provisioning/*/*mosquitto*
#
# The script adds the file /etc/mosquitto/conf.d/mqtt.conf on unix-like
# systems, and the file C:\\Program Files\\mosquitto\\conf.d\\mqtt.conf
# on windows like systems. So this is what we test for.
#
# If we are on a provisioned system as detected by the two files above
# we define these variables which the test use
# MQTT_TEST_TYPE= selection from; 3, 4, 5
# 3 -> Vers 3.1
# 4 -> Vers 3.1.1
# 5 -> Vers 5.0
# MQTT_TEST_PROTOCOL= selection from; Tcp,Ssl,Ws,Wss
# MQTT_TEST_BROKER="localhost"
#
# If neither of these files are present, we use the existing
# design which is to run for tcp,3.1.1 by default.
# In this case set the environment variable MQTT_TEST_BROKER
# to localhost
#
# Finally, we allow the test to override for individual test
# cases, if wanted. This is mostly used for MQTT_TEST_TYPE
#
function(qtmqtt_is_mosquitto_installed result)
set(skip $ENV{COIN_NO_MOSQUITTO})
if(skip)
set(${result} FALSE PARENT_SCOPE)
elseif(EXISTS "/etc/mosquitto/conf.d/mqtt.conf" OR
EXISTS "C:\\Program Files\\mosquitto\\conf.d\\mqtt.conf")
set(${result} ON PARENT_SCOPE)
else()
set(${result} FALSE PARENT_SCOPE)
endif()
endfunction()
function(qtmqtt_add_test)
set(options)
set(oneValueArgs TARGET)
set(multiValueArgs SOURCES DEFINES INCLUDE_DIRECTORIES LIBRARIES)
cmake_parse_arguments(
arg_mqtt
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
set(TYPES)
set(PROTOCOLS)
qtmqtt_is_mosquitto_installed(is_installed)
if(${is_installed})
if(WASM)
if(TARGET Qt::WebSockets)
set(TYPES Ws Wss)
set(PROTOCOLS 3 4 5)
endif()
elseif(QT_FEATURE_ssl)
if(TARGET Qt::WebSockets)
set(TYPES Tcp Ssl Ws Wss)
else()
set(TYPES Tcp Ssl)
endif()
set(PROTOCOLS 3 4 5)
else()
if(TARGET Qt::WebSockets)
set(TYPES Tcp Ws)
else()
set(TYPES Tcp)
endif()
set(PROTOCOLS 3 4 5)
endif()
elseif(NOT WASM)
set(TYPES Tcp)
set(PROTOCOLS 4)
endif()
foreach(TYPE ${TYPES})
foreach(PROTOCOL ${PROTOCOLS})
set(EXTRA_DEFINES)
set(EXTRA_LIBS)
if(${is_installed})
set(EXTRA_DEFINES MQTT_TEST_TYPE="${TYPE}" MQTT_TEST_PROTOCOL=${PROTOCOL} MQTT_TEST_BROKER="localhost")
endif()
if(TARGET Qt::WebSockets)
set(EXTRA_DEFINES ${EXTRA_DEFINES} QT_MQTT_WITH_WEBSOCKETS)
set(EXTRA_LIBS Qt::WebSockets)
endif()
qt_internal_add_test(
${arg_mqtt_TARGET}_${TYPE}_${PROTOCOL}
SOURCES
${arg_mqtt_SOURCES}
DEFINES
${arg_mqtt_DEFINES} ${EXTRA_DEFINES}
INCLUDE_DIRECTORIES
${arg_mqtt_INCLUDE_DIRECTORIES}
LIBRARIES
${arg_mqtt_LIBRARIES} ${EXTRA_LIBS}
TESTDATA
"../../certificate/cert.crt"
"../../certificate/cert.key"
BUILTIN_TESTDATA
)
endforeach()
endforeach()
endfunction()
if(QT_BUILD_STANDALONE_TESTS)
# Add qt_find_package calls for extra dependencies that need to be found when building

View File

@ -1,12 +1,8 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Generated from auto.pro.
if(WIN32 OR (LINUX AND NOT CMAKE_CROSSCOMPILING))
# special case begin
# add_subdirectory(cmake)
# special case end
add_subdirectory(cmake)
add_subdirectory(conformance)
add_subdirectory(qmqttconnectionproperties)
add_subdirectory(qmqttcontrolpacket)

Some files were not shown because too many files have changed in this diff Show More