Fix the function arguments processing. Both generated_files and
generation_options were visible because of scope visibility and
were not processed by _qt_internal_protoc_generate correctly.
Fix this by using and processing arguments the proper way.
Pick-to: 6.5
Change-Id: I1eaad92cecfd9d8b415ec2d06cb947979d6baba6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The fieldindexrange.qpb.h file is not used in test.
Pick-to: 6.5
Change-Id: I0e55cdf9bd9cdcd87eb8e3b750921960b4a77ae5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Add the interface that allows reading metadata information received
from the server from the grpc streams and call replies.
TODO: This commit only add interface that should be used in channel
implementation.
Task-number: QTBUG-113663
Change-Id: I9e3d1810d1ee6a3b4e04fbd3555e093789b623ce
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Comparing steams by value shouldn't happen, it's artifact that left
from the stream reuse mechanism.
Pick-to: 6.5
Change-Id: Ib9c5ee3e616d1a0bc75853a87ab15461dbf76f91
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Update left over old style license disclaimer
to SPDX-License-Identifier.
Pick-to: 6.5
Task-number: QTBUG-67283
Change-Id: I01a04a8b6ac8103aba263411145da903ef0c3427
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Use QGrpcChannelOptions and QGrpcMetadata to set up user-password
authentication for SimpleChatEngine.
Task-number: QTBUG-111037
Change-Id: I2e7dea87d542b4f7585b0724a45c1398fa2047b5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Introduce alias to std::multimap names QGrpcMetadata, to represent
additional HTTP headers, that can be added to channel and call options.
Then channel implementations can use QGrpcMetadata and append all
metadata do each call (TODO).
Task-number: QTBUG-111037
Change-Id: Ie16e658407a57a5f44bc1a0ff54dcb3ca8b06fe1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Remove unused parts of old credentials system. QAbstractGrpcCredentials
and QGrpcCredentials provided combination class for both
Channel and Call. Now, channel and call credentials are
used separately in channel and call options.
Task-number: QTBUG-111037
Change-Id: Id1e62c249148cb9bc1a66050308c23fdbae19735
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Remove QGrpcSslCredentials. They are replaced by
QGrpcChannelOptions::withSslConfiguration() method.
[ChangeLog] Removed QGrpcSslCredentials. Please use
QGrpcChannelOptions::withSslConfiguration() to setup QSslConfiguration
for the channel.
Task-number: QTBUG-111037
Change-Id: I6719ce60668238251abbba5c08232dca26084909
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Remove QGrpcInsecureCredentials, as they are unused after introducing
QtGRPC call/channel options.
[ChangeLog] Removed QGrpcInsecureCredentials. Now insecure
connection is default option for QGrpcChannelOptions and
QGrpcCallOptions.
Task-number: QTBUG-111037
Change-Id: I125e1a5a75b7f75a5afdbe8411baf01788140db7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Use the new classes to store call and channel options used to
create gRPC channels and perform gRPC calls.
Add QGrpcCallOptions parameter to call() and startStream() methods.
Change constructor parameter of QGrpcHttp2Channel and QGrpcChannel
to QGrpcChannelOptions that stores previous parameters used to
construct channel. Add additional deadline option to be able to
configure call timeout.
[ChangeLog] Add QGrpcCallOptions to store and process additional
call options.
[ChangeLog] Add QGrpcChannelOptions to store and process channel
options and default call options.
Task-number: QTBUG-111037
Change-Id: Icd92e95c036fb5b4c268907ab912fcf59ef9a69a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Add the manual conformance test for QtProtobuf. The test uses standard
input/output pipe to communicate with the reference
conformance_test_runner. By setting QT_PROTOBUF_CONFORMANCE_TEST_RUNNER
either CMake or environment variables the test will be added to the
autotest set. QT_PROTOBUF_CONFORMANCE_TEST_RUNNER should point to the
conformance_test_runner executable location.
Test downloads and uses the .proto schemas from the relevant version
of protobuf. The version can be adjusted using
QT_PROTOBUF_CONFORMANCE_VERSION variable. The expected format of the
variable is 'major.minor'.
If any tests are expected to fail they should be listed in
the expect_failing_tests.txt file that is provided to
conformance_test_runner in the --failure_list argument.
conformance_test_runner is not a part of the
standard protobuf delivery and needs to be built explictily.
To enable building conformance_test_runner you need to set the
protobuf_BUILD_CONFORMANCE CMake variable to ON when configuring
protobuf. The resulting executable will be located in the
'CMAKE_BINARY_DIR/bin' directory.
Due to the reference protobuf issues we cannot enable build
conformance_test_runner in CI.
TODO: Generation and testing of the wellknown types(except Any) is
disabled. See QTBUG-112430.
Task-number: QTBUG-104064
Change-Id: I3a95a0879f2b2ce0ec80db84c2465dfd23dcaecc
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
QtProtobufgen registers global and local enums in QML context now.
Registration is in qml extension plugin part.
Task-number: QTBUG-104513
Change-Id: Iecbc08d4b915113e7d5753b1f1d24d3c34088ba2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The warnings don't depend on the type, so factor them out to avoid
strewing this code across all template instantations.
As a drive-by, convert the qWarning() from iostreams- to printf-
style, which means less executable code and no need to include
<QDebug>.
Change-Id: Ie02dc6d57d6480b70fde3bfa401d5ffe15cece05
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Replace the AUTORESOURCE_PREFIX argument with the explicit
RESOURCE_PREFIX.
Pick-to: 6.5
Change-Id: Iac73ba194ed1af07456dde7df9cd95fa55e5e024
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Qt Q_NAMESPACE_EXPORT works exactly like the Q_NAMESPACE macro, but with
the supplied EXPORT_MACRO qualifier. It is required, if the target is,
or we will create, a shared library.
Currently in cases when qt6_add_protobuf() is not being used for
creation a shared library, qtprotobufgen generates Q_NAMESPACE_EXPORT()
with empty parameter inside.
If check Q_NAMESPACE macro definition then we see the same:
"#define Q_NAMESPACE Q_NAMESPACE_EXPORT()"
So from functional perspective there are no changes.
But from my point of view Q_NAMESPACE looks better in such case,
and creates less questions then export macro without actual export
parameter.
Change-Id: I09607ad8503bbe8298b1ba653ac3a164584e419a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The function sets the required CMake variables and policies.
Pick-to: 6.5
Task-number: QTBUG-112685
Change-Id: Ib5c5673e7cdb7124ccfc49f452813eb181f7dd3c
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
If the property is not found we should return empty variant, but not
the constructed implicitly QVariant with bool value 'false'.
Amends dc69102f4f
Pick-to: 6.5
Change-Id: I0c36905927b17689d00de16024ec486d0fce39c4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Updated the message-property name (PropertyMessageTemplate), that is
internal property and used only by the serializer.
It cannot be used in QML context, since pointers to qgadget are not
supported there for now. It means, for QML should be used another one
property (PropertyQmlMessageTemplate).
Task-number: QTBUG-104513
Change-Id: Ie1c8750ecedb0291c2f593f6f8fa8b6c98ad4a48
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
As per the conformance "Merge" test expectations we should reuse the
existing message value and merge values received from the wire or
override existing. Check if the value stored in the property of the
message type is not 'null' and reuse the message stored when
deserialing the property more than once.
[ChangeLog][Important Behavior Changes] Initialized message fields of
the message type are reused when deserializinng the message. Previously
message fields of the message type were deserialized to a freshly
created message object. This change removes creating of the new message
object at each deserialization cycle and reuses the exising field value
if it's not 'null'. If fields of this message object are received from
wire they will be overritten, if not they will store the previous value.
Fixes: QTBUG-112421
Fixes: QTBUG-112422
Fixes: QTBUG-112429
Change-Id: I73a792e72064af68b5a2a1e61e944c52a79eb412
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
LocalTime test-case is refactored.
Idea of particular test is serialize/de-serialize object and verify
with expected constant result.
But in case LocalTime is used for QDateTime creation, the resulting
QDateTime object will always be different depending on system time zone
of concrete user.
So it makes sense to preset timezone before LocalTime object creation,
and returned it back after.
Fixes: QTBUG-113342
Change-Id: Ic4dfd033ff00d525225669fe771de6fb386d1b0b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Oneof field enum should follow the same convension as the one we
use for the message field naming. Othewise oneof field enum fields
will be different of the message member and method names.
Amends ae2f22dce2
Task-number: QTBUG-109126
Change-Id: Ie9d5758c227d5229043ef1dc3e2ba80d5708dce6
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Enable QML flag for qtgrpcgen/qtprotobufgen plugins.
Generated output is updated: QProtobufMessage classes are Q_GADGETs,
such classes can be registered in QML code via QML_VALUE_TYPE macros only.
Also QProtobufMessages are not inherited from QObject class, it means
there is no full qmetaobject system support (no signals!).
Task-number: QTBUG-104513
Change-Id: I18c8f93782884efb8d923843df716ff8284ed8fb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The vast majority of users (the tests) will transparently use the new
new overload, because they pass temporaries.
Change-Id: I4630e44ed19f32ac367c48097afe0cda5222bfcf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Allows to take advantage of the recently-added QMetaProperty::write()
rvalue-QVariant overload.
Task-number: QTBUG-112762
Change-Id: I4fc6cc10cd3949dcf924f75966c21066d82563ef
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
One overload each for string and field-info lookup.
These will be used in a subsequent commit to add rvalue-QVariant
overloads, but commit this separately to avoid introducing
unnecessary differences to our LTS branch, by picking to 6.5.
Task-number: QTBUG-112762
Pick-to: 6.5
Change-Id: I87951851f32a1fa44caa48baa0bdaf0068154781
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
All _p.h files must include another _p.h, or else qglobal_p.h, for
private symbol version tagging to work.
As a drive-by, sort some include blocks correctly (non-exhaustive):
1. own header
2. own module's headers
3. other Qt module's headers, from most to least specialized (ending
in QtCore)
4. 3rd-party C++ headers
5. std C++ headers
6. 3rd-party C headers
7. std C headers
Pick-to: 6.5
Change-Id: I3b7b2a1c3667888c1a85814889447de66c797a06
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
These warnings slipped in during a time period where documentation
testing in the CI was disabled.
Fix incorrect argument type for QAbstractGrpcClient::call() and
remove trailing semi-colons.
Remove documentation for non-existent overload of
QAbstractGrpcClient::startStream().
Add a documentation dependency to qtwidgets to fix broken link to
QLineEdit.
Pick-to: 6.5
Change-Id: Ie429d94535860b3c85aaf95010a49d1fd90e8307
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Make QGrpcOperation use QAbstractProtobufSerializer to perform
serialization.
Fixes: QTBUG-111406
Change-Id: I48e7ca97e043de3827d7c655ae508e221d3d4ca8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Due to infrastructure issues (specifically, missing replication of
repositories to code.qt.io), Qt GRPC and Qt Protobuf relied on falling
back to QDoc's built-in generation of lists of files that comprise an
example rather than a link to code.qt.io, the latter of which is the
preferred option for examples in Qt. Said list limits its output to
files identified by the `examples.fileextensions` QDoc configuration
variable. However, the `.proto` file extension was not added to the
documentation configuration for these modules.
Since the module released, repository replication issues have been
resolved. Thus, it is now possible to link to code.qt.io, as preferred.
This change adds the `.proto` file extension to the configuration,
and sets the `url.examples` configuration variable such that QDoc will
generate a link to code.qt.io. The file extension change is still
considered relevant, in case the fallback is required in the future,
and `.proto` is not part of the default set of file extensions for Qt's
examples.
Fixes: QTBUG-112754
Pick-to: 6.5
Change-Id: I61fcc1fac0aa11a4dcf278deabbd7c12c091d894
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>