diff options
author | Mate Barany <mate.barany@qt.io> | 2023-05-25 17:52:52 +0200 |
---|---|---|
committer | Mate Barany <mate.barany@qt.io> | 2023-06-07 15:48:41 +0200 |
commit | 1ba0938e80df63e47511d546b9c2d5caac4fdcf9 (patch) | |
tree | c96b3bab73c4425df4629a6f46790a87aaa63e21 /examples | |
parent | 8fc1b0de9dadb840f91027776636a5943301a03a (diff) |
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>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/mqtt/websocketsubscription/main.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/mqtt/websocketsubscription/main.cpp b/examples/mqtt/websocketsubscription/main.cpp index 9b00b8c..4a8774e 100644 --- a/examples/mqtt/websocketsubscription/main.cpp +++ b/examples/mqtt/websocketsubscription/main.cpp @@ -19,20 +19,19 @@ int main(int argc, char *argv[]) auto help = parser.addHelpOption(); // Use http://www.hivemq.com/demos/websocket-client/ in browser to publish - QCommandLineOption urlOption(QStringList() << "host" << "url" << "broker", + 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", + 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", - u"Enable Debug mode"_s); + QCommandLineOption debugOption(QStringList{ u"d"_s, u"debug"_s }, u"Enable Debug mode"_s); parser.addOption(debugOption); - QCommandLineOption versionOption(QStringList() << "v" << "version", + 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); |