Use the vcpkg manifest to configure and build QtProtobuf sensors
example. This allows automating the dependency installation using
vcpkg.
Pick-to: 6.9
Task-number: QTBUG-132738
Change-Id: Icae7acf46d97d834a064d7663623757a7ec35742
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All new enums should be scoped.
Drive-by change: Remove the redundant suffixes of the enum elements.
It's obvious from the scope that those are errors.
Pick-to: 6.8
Task-number: QTBUG-123626
Change-Id: Ided4ab4a1ddb2d14713f876ffe4fe339af39ae6b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This will unlock the use of enum fields duplicates in the same scope
if the respective feature will be supported by the reference protobuf.
Pick-to: 6.8
Task-number: QTBUG-126992
Change-Id: Ib38e313b62885042e2f75376836d1cb0ad2574db
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Rename the deserializationError(String) interfaces to
lastError(String). The new interface encourages to write the errors
not only during deserialization but also serialization.
TODO: Add serialization error handling to the existing
QAbstractProtobufSerializer implementations. See QTBUG-128331.
[ChangeLog][Protobuf] QAbstractProtobufSerializer::DeserializationError
is renamed to QAbstractProtobufSerializer::Error and now contains list
of both possible serialization and deserialization errors.
[ChangeLog][Protobuf][QAbstractProtobufSerializer] deserializationError
and deserializationErrorString renamed to lastError and lastErrorString
respecively. Interfaces return the error from the last operation,
either serialization or deserialization.
Pick-to: 6.8
Task-number: QTBUG-123626
Change-Id: I705eb69e07393aa6601cc79712845200873235a0
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
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: If6b8c8eb88c8880e6e277f472dfdd5b380a5c83d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Protobuf allows the following construction:
message A {
enum AEnum {
AVal0 = 0;
}
B.BEnum val = 1;
}
message B {
enum BEnum {
BVal0 = 0;
}
A.AEnum val = 1;
}
This requires forward declaration of nested enums, that is not possible
in C++. To solve this problem we may do the same trick that we do
for nested messages already.
This patch moves the nested enum type out of class to the
_QtProtobufNested namespace. The solution require the enum name
specification when using enums from this moment, since the owning
messages only contain type aliases now. So from example above to access
the AVal0 you need to use the full qualifier:
A::AEnum::AVal0
The new generated code structure registrates Qml types using the built-in
macros, that unlocks direct linking of backing library without the need
of Qml plugin usage.
[ChangeLog][Protobuf] Nested enums moved out of message classes to the
nested namespace, same as the nested messages.
[ChangeLog][Protobuf][Qml] The geneated protobuf Qml modules do not
require the use of Qml plugins.
Fixes: QTBUG-115800
Change-Id: Ia67fcbecf492c3fd41350eada4d62fc9e5ea4dab
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Q_ASSERT_X is empty in release-like configs, so the actual functionality
is eaten by macro. Fix issue in sensor example.
Pick-to: 6.5 6.6
Change-Id: Ib162a09a6552b9f1a522daadc998b8e597780e8a
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
The '\meta category' command was used for tagging examples with a
specific category, used in Qt Creators Welcome mode.
As we want to also generate lists of examples belonging to a category
elsewhere in the documentation, replace the command with a macro that
expands to the original \meta command and also adds the example to
a group using the \ingroup command. This way, the category names can
be used as arguments to the \generatelist or \annotatedlist commands.
Pick-to: 6.5
Task-number: QTBUG-112731
Change-Id: I38b38c524b35ad4c0049f2978f5fc65d03c6a1cd
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Add the protobuf example that emulates the work of dummy sensors that
send data to the sensor client. The example uses UDP sockets to send
datagrams that contain protobuf messages. Messages consist of two
layers:
- The Type-Length-Value wrapping message that specifies the the
message type and allows to verify the message size.
- Sensor message that contains a sensor data.
The example intends to show how to generate the code from the protobuf
schema and use it in simple UDP signalling protocol on both sender and
receiver sides.
Both client and emulator have simple UI implemented using QtWidgets.
Task-number: QTBUG-109598
Pick-to: 6.5
Change-Id: I13e2c5bcd995b8aa6d873c495a7bd83f6651a061
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>