This restores the QT_NO_FOREACH macro originally added in
1725346233 and then lost in the cmake
port.
Luckily, no new uses have crept in in the meantime.
Change-Id: Ic874d95763c0271e606420dba1df147cdedd42ee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The californium docker container is updated, and now provides a
different binary to run.
This patch adjusts the tests and docker script:
* update the docker script to call the proper binary
* update the number of resources exposed by the californium server
* update the expected returned tokens to be uppercase
Task-number: QTBUG-114798
Pick-to: 6.6 6.5
Change-Id: I733793cc472769e433144a08b8f02f0120f6f29b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
The docker containers were moved to the 'tqtc' account on docker hub,
Some of them were also updated to fix SSL-related errors.
This patch updates the example documentation to refer to proper docker
containers.
Task-number: QTBUG-114798
Pick-to: 6.6 6.5
Change-Id: Ib02a33eb6281156350400eb6538c371fb1e2157c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
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
Change-Id: I3cf53886be277abc86b5ec54d399cd6933fbe882
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.
Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor
Manual adjustments were made where the code was inserted in the wrong
location.
Task-number: QTBUG-93020
Change-Id: Idc25fe2da6e4d6dbefa9fc669401e127beec2ae4
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Do not use the "Example" word in the title
* Set the proper example category
* Add a note about running the example from QtCreator
* Add a note on how to terminate docker containers after usage
* Update the documentation about exposing C++ types to QML. Describe
the modern way of doing it.
* Introduce a section about changes to build files.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Iec125357001d950efe61b1ec0755d2feaba6b80f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
These were mostly unqualified access warnings, which were fixed by
explicitly specifying the id.
Also replace injection of a context propertly with setting the initial
properties for the engine. This allows to declare 'hostsModel' as a
required property in the Main.qml
Another common warning is M325 "Logical value does not depend
on actual values". It is fixed by explicitly casting
securityModelGroup.checkedButton to RadioButton.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ic334122892510b6bbd5e06ac9d00d99893b7e46c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
"Qt CoAP Example" does not seem to be a good organization name. And
the example does not use it anyhow. So just remove this call.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I07b236e06ee9ee6046de3d3c19f24501f84b6675
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's deprecated and has no effect in Qt 6, as High-DPI is always
enabled. The following warning is generated when using it:
warning: ‘Qt::AA_EnableHighDpiScaling’ is deprecated: High-DPI
scaling is always enabled. This attribute no longer has any
effect. [-Wdeprecated-declarations]
Remove this line to get rid of a warning.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Idfdc7715e5c80138fe477a374abf9cf02f91d040
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It was used for StandardPaths and FileDialog.
StandardPaths are now available in QtCore QML module, and FileDialog
is available in QtQuick.Dialogs.
So use those instead.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ie8efba5b792245dba56824bac88fcb8bbb565db6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
... and also update build files to use QML modules
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I522c0c8785e85e99f94feedaa9954a232b677da6
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Use qt_standard_project_setup() instead of manually enabling moc
(CMake only)
* Use PRIVATE linking (CMake only)
* Do not use C++11 config - we're on C++17 now (qmake only)
* Remove the QT_DEPRECATED_WARNINGS definition - it has no effect since
Qt 5.13 (both qmake and CMake)
This commit is a preparation for using qml modules
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Iad798bf7bc0471dc2bdf04b093547b7717d74e30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Do not use the "Example" word in the title
* Set the proper example category
* Add a note about running the example from QtCreator
* Add a note on how to terminate docker containers after usage
* Update the screenshot to reflect the changes in the UI, switch to
webp format
* Update the documentation about exposing C++ types to QML. Describe
the modern way of doing it.
* Introduce a section about changes to build files.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I1ff3cdc4be673affa791a28d5f4641351060b13b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The height of the delegate which shows the discovered resources was
hardcoded to 60 px. It works fine until someone wants to increase the
default system font size, in which case the data will not fit into the
rectangle anymore.
Fix it by using the implicitHeight of the Column which actually
contains the data. As a drive-by - also add a bottom padding, to center
the content in the delegate rectangle.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I25349005d2edf236ff9e685d7cd8519e30625f97
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Multicast discovery takes several minutes by default, and so far the
example did not provide any means to stop it.
Fix it by introducing a new 'isDiscovering' property which allows to
check the current state of the client from QML, and a new invokable
'stopDiscovery()' method, which aborts the current request.
While on it, also delete the finished replies explicitly by calling
deleteLater(). Previously the replies were deleted only when the
parent QmlCoapMulticastClient was destroyed.
On QML side, adjust the discoverButton logic, so that it can start or
stop the discovery, depending on the current state.
Also introduce a new button which allows to clear all the discovered
resources.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I7ec3bc2fd5fee1b3c589de74b00862ffb9d6983e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Take the objects by const reference, not by value
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Id81181292b37aff269316967d3db50dfb7cab0fe
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The example had a bunch of unqualified access warnings.
Fix them by doing the following:
* use 'pragma ComponentBehavior: Bound' to limit the context of the
delegates, and introduce required properties to pass needed data to
them
* add some missing ids and explicitly use them when accessing the
objects
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: If42661c3c8272f16edfa2d0e21466cf254062184
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Fix the warnings like
Parameter "resource" is not declared. Injection of parameters into
signal handlers is deprecated. Use JavaScript functions with formal
parameters instead.
by doing what is recommended.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ia936cdc620457c438ae1f8dd70f1ad120f46de67
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The CoapMulticastClient.onError handler was actually trying to handle
the base QCoapClient::error signal which is using a QCoapReply* as a
parameter. This type is not known to QML, so this produced a qmllint
warning.
Fix it by processing the QCoapClient::error() signal on the C++ side,
and converting it to the existing QmlCoapMulticastClient::finished()
signal with only one int parameter, because the QCoapReply is really
not needed for this example.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I5b41dd9d19f44d813051f4705521d0026ab55848
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's deprecated and has no effect in Qt 6, as High-DPI is always
enabled. The following warning is generated when using it:
warning: ‘Qt::AA_EnableHighDpiScaling’ is deprecated: High-DPI
scaling is always enabled. This attribute no longer has any
effect. [-Wdeprecated-declarations]
Remove this line to get rid of a warning.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I9f8cdfade553c07ea60e31672f719ee29e6f9b1c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
... and also update build files to use QML modules
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I6dbbe05abc0ec345f923f5b2ff5c95cdacda234c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use qt_standard_project_setup() instead of manually enabling moc and
uic (CMake only)
* Use PRIVATE linking (CMake only)
* Do not use C++11 config - we're on C++17 now (qmake only)
* Remove the QT_DEPRECATED_WARNINGS definition - it has no effect since
Qt 5.13 (both qmake and CMake)
This commit is a preparation for using qml modules
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I9bd07769514e26e54fd7ad5829dd6d0c1351be46
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The example demonstrates a subset of features from Simple CoAP Client
example, but does not have any UI, and also provides only a basic
documentation page.
It can be safely removed, and other examples should be used instead.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Iec63aa530d1bf35c403151341057ceb7dd2fac66
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
... and Qt::StringLiterals on string that do not require
translation.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ie31d997925f2efd627f2aac7cdc2b763f5cefca4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The QtCoap namespace clashes with the QtCoap module, when it comes to
linking in qdoc. Because of that it was not possible to link to the
namespace.
Add a
\keyword {QtCoap Namespace}
command to the QtCoap namespace, so that it could be
referenced using \l {QtCoap Namespace}.
Pick-to: 6.6 6.5
Change-Id: I066504dac6107a5bbc7f5d40a7f0c3924c2e8acb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Do not use the "Example" word in the title
* Set the proper example category
* Add a note about running the example from QtCreator
* Add a note on how to terminate docker container after usage
* Update the screenshot to reflect the changes in the UI, switch
to webp format
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I1338d2d4d501bef8ef92b38f4cf2dc485acde989
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The options dialog is re-created every time we press the "Add Options"
button. As a result, it looses all the options that were set, even
if the message was not yet sent. This is inconvenient, as it does not
allow the user to append forgotten options, or simply to double-check
which options are used.
This patch passes the current options to the OptionDialog's c-tor, so
that the dialog opens with the list of the relevant options.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ia11754706884229b3971526e94c0f8470b5d89b2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Add possibility to remove individual entries from the options table.
Also change the selection behavior of the table to allow selection of
individual rows only. This makes sense, because we do not allow to
change values in the already-added entries anyway, and row-selection
makes more sense when deleting entries.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: Ica56c697c79c758d473f647831afc793c7ca35b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Forward-declare classes, where possible, and add the missing includes
to the cpp file.
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I647f00c6f56aea13a4e3c1771beee7963537399c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use qt_standard_project_setup() instead of manually enabling moc and
uic (CMake only)
* Use PRIVATE linking (CMake only)
* Do not use C++11 config - we're on C++17 now (qmake only)
* Remove the QT_DEPRECATED_WARNINGS definition - it has no effect since
Qt 5.13 (both qmake and CMake)
Task-number: QTBUG-113858
Pick-to: 6.6 6.5
Change-Id: I8d2eaf3edac289a49c2749fc2805aba94c77f522
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
To fix the AddressSanitizer error:
AddressSanitizer: new-delete-type-mismatch in thread T0:
object passed to delete has wrong type:
size of the allocated type: 104 bytes;
size of the deallocated type: 80 bytes.
QCoapMessage stores an instance of QCoapMessagePrivate in a
QSharedDataPointer. There is also a QCoapRequest class, which is
derived from QCoapMessage, and a QCoapRequestPrivate, which is derived
from QCoapMessagePrivate.
The QCoapRequest constructor creates an instance of QCoapRequestPrivate
and stores it in base class' d_ptr (which is
QSharedDataPointer<QCoapMessagePrivate>). This leads to an error shown
above.
Fix it by making QCoapMessagePrivate's d-tor virtual.
This revealed another issue - the non-const d_func() calls on
QCoapMessage were always calling QCoapMessagePrivate's copy c-tor,
which is incorrect if the d_ptr stores a QCoapRequestPrivate instance.
Fix it by introducing a virtual QCoapMessagePrivate::clone() function,
implementing it for both classes in the hierarchy, and providing a
specialization for QSharedDataPointer<QCoapMessagePrivate>, which uses
the clone() method.
This way we ensure that the detach goes via a virtual method, not via
a copy constructor.
Also make the copy constructors protected, to prevent future bugs.
Pick-to: 6.6 6.5 6.2
Change-Id: I865b8ce4733500120c12ac562a97e08b11c01c4c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>