MQTT is a machine-to-machine (M2M) protocol utilizing the publish-and-subscribe paradigm. Its purpose is to provide a channel with minimal communication overhead.
Generally, MQTT is used on top of a TCP connection. However, the base requirement is defined as an ordered, lossless, bidirectional connection.
The Qt MQTT module provides a standard compliant implementation of the MQTT protocol specification. It enables applications to act as telemetry displays and devices to publish telemetry data. The supported versions are MQTT 3.1, MQTT 3.1.1, and MQTT 5.0.
Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
Use the find_package()
command to locate the needed module components in the Qt6
package:
find_package(Qt6 REQUIRED COMPONENTS Mqtt)
target_link_libraries(mytarget PRIVATE Qt6::Mqtt)
See also the Build with CMake overview.
To configure the module for building with qmake, add the module as a value of the QT
variable in the project's .pro file:
QT += mqtt
Qt MQTT is available under commercial licenses from The Qt Company. In addition, it is available under the GNU General Public License, version 3.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: