summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Port from qAsConst() to std::as_const()Marc Mutz2022-11-141-2/+2
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Windows: guard against closing the connection while processing incoming dataIvan Solovev2022-06-281-2/+5
| | | | | | | | | | | | | | | | | | | Before the patch we could end up using an already deleted QWinOverlappedIoNotifier instance if the incoming queue has more than one message, and the user decides to close the connection (and so delete the notifier) before processing all of them. This patch adds an explicit check that the QWinOverlappedIoNotifier instance is still valid. This commit amends f3a306a30fc4f40d1c96fee0ed44517fe8b43d76 Task-number: QTBUG-101444 Change-Id: Ieae622d248629827ed627bc9c17f7b5be491b717 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 089f1cd197e93c216aae094ffbca2b4beacf57b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: fix soft memory leak in synchronous modeIvan Solovev2022-06-131-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWinOverlappedIoNotifier is using an atomic 'waiting' variable to make sure that it does not emit _q_notify() signals in synchronous mode. However this does not work in practice, because a notification from the I/O completion port thread can come before we enter the blocking waiting function, and the signal will be emitted anyway. Those signals migth never processed when using synchronous read/write, because in such scenarios QSerialPort works in an infinite loop in its own thread, probably without leaving a change for proper event processing. This leads to a situation when a lot of signals are queued on the event loop, and the memory consumption grows. This patch introduces another atomic variable to make sure that a new signal is never emitted until the previous one is processed. With such approach we have maximum one signal pending on the queue. The drawback of this approach is that when working in asynchronous mode, notifications might come faster than we process them, so the processing queue might grow. To solve this, we update the code that is handles notifications in asynchronous mode to process the whole input queue instead of only one item. This commit was manually picked from 01e0371f9d69943e62619fdbfe6a9d87f2a2fa16 Fixes: QTBUG-101444 Fixes: QTBUG-103822 Fixes: QTBUG-93865 Fixes: QTBUG-91237 Fixes: QTBUG-87151 Change-Id: Iad3c14ea5f0d3f3f3f9d483a1e6ab3e8b3c6c573 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit f3a306a30fc4f40d1c96fee0ed44517fe8b43d76) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-06-1021-762/+66
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I18aa521d1732fa721c9ad064b5d2f4d1abccd9cb Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit bb05a26d52c834cc7f3c549f3e5d66f76baf42a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2022-05-121-1/+1
| | | | | | | | | | | Using REQUIRED as a prefix instead of suffix works better with OPTIONAL_COMPONENTS, and is also the order in the CMake manual. Task-number: QTBUG-98867 Pick-to: 6.3 Change-Id: Ibbad0b969010c06469c12895f71ac57e627daa9e Reviewed-by: Rui Oliveira Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port from QScopedPointer to std::unique_ptrMarc Mutz2022-05-043-34/+28
| | | | | | | | | | | | | | | | The swap() in QSerialPortPrivate/Unix is actually deprecated. But instead of fixing yet one more QScopedPointer, I've fixed them all. Also simplified the udev deleters by using a statically-polymophic deleter. QScopedPointer::swap() is deperecated since 6.1, so Pick-to: 6.3 6.2 Change-Id: I5ceeeb8e13bc080afa5dc46a1421038a1169f30e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix QScopedPointer::swap deprecation warningMårten Nordheim2022-03-243-10/+7
| | | | | | | | | | By switching to unique_ptr. Also remove the QSerialPortInfoPrivateDeleter since it's not needed. Fixes: QTBUG-102001 Change-Id: I48d7b5982a28b57085883f127ba09d1cae94b196 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Make sure all private headers include at least one otherThiago Macieira2022-03-082-2/+4
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove unused qt_internal_extend_target for SerialPort targetAlexey Edelev2021-12-092-6/+1
| | | | | | | | | | | | | | | | | QT_NO_REDEFINE_GUID_DEVINTERFACE_MODEM definition is already set using qt_feature_definition. Also config_ntddmodm seems never defined, so whole codeblock is never used. Also remove the NEGATE option from the existing definition. If the feature is enabled, that means 'TEST_ntddmodm' passes, and we were able to compile the test with the included ntddmodm.h. QT_NO_REDEFINE_GUID_DEVINTERFACE_MODEM also enables the branch that includes ntddmodm.h and supposed to not redefine GUID_DEVINTERFACE_MODEM. Change-Id: I54fcb52803fc061d7ac664c602b6750f1c379b60 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move Q_DECLARE_PUBLIC to the public sectionJani Heikkinen2021-11-301-1/+2
| | | | | | | | | | This is now required to use QObjectPrivate::connect. Fixes: QTBUG-98735 Pick-to: 6.2 Change-Id: Iec32a4726faa34b3fe57d9cd97c5d806db6b0377 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix warnings-are-errors buildJoerg Bornemann2021-10-261-1/+1
| | | | | | | | Add missing override specifier to QWinIoCompletionPort::run(). Pick-to: 6.2 Change-Id: Idcce9778b4602c708a78188df00e9893ebe00649 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix base class for OpenMode flagsKai Köhne2021-10-221-3/+3
| | | | | | Pick-to: 6.2 Change-Id: Iad037b6cf87cf847814baa6144fb62f66577cc3a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix error comparison of integer expressions of different signednessKarsten Heimrich2021-10-191-2/+2
| | | | | | Change-Id: Iaff90a303703f82b1aee856caba1965309ae6981 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Revert "QSerialPort: Port to alertable I/O functions on Windows"Karsten Heimrich2021-10-196-416/+216
| | | | | | | | | | This reverts commit a0faf986fccdce1d36f3308dc520cdac001f5264. Part of chain revert to go back to QWinOverlappedIoNotifier. Fixes: QTBUG-93865 Change-Id: Id4b6516282f35ccb3e81f20893872b4d1bcd3e05 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Revert "Emit _q_notify only if there's no notification pending"Karsten Heimrich2021-10-191-7/+3
| | | | | | | | | | This reverts commit 85ee2c658a45d2958a54045951d236769640337f. Part of chain revert to go back to QWinOverlappedIoNotifier. Task-number: QTBUG-93865 Change-Id: I2f6c56127b86a8ffdc7ed52421d18f35fa349af9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Revert "Revert "Emit _q_notify only if there's no notification pending""Karsten Heimrich2021-10-191-3/+7
| | | | | | | | | | This reverts commit f6b43c36b3839dae54308a6437bbdd99ae9a44de. Part of chain revert to go back to QWinOverlappedIoNotifier. Task-number: QTBUG-93865 Change-Id: Ibf7328558690faac41375fe4c08d128e928a5a66 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Revert "Avoid possible symbol clashes on static builds on Windows"Karsten Heimrich2021-10-192-4/+4
| | | | | | | | | | This reverts commit aa00e8eb623d5cb4ba32860dd3671a87f3763f89. Part of chain revert to go back to QWinOverlappedIoNotifier. Task-number: QTBUG-93865 Change-Id: I5456e792a22c76daf207d8c052ed14cd7976976c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-09-272-14/+2
| | | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: Ia457fc7f39b4c4b3e4db26e72b9dc04873a61720 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove old configure-related filesJoerg Bornemann2021-09-201-41/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Pick-to: 6.2 Task-number: QTBUG-89536 Change-Id: Iec9754c73c65999cdceb9f37a1fda617d9570e5f Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Remove unsupported customFiltersKai Köhne2021-08-251-4/+0
| | | | | | Task-number: QTBUG-95987 Change-Id: I2a868d428d07af59854af75b25e55e3a68df1c70 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Remove superfluous \qtcmakepackageKai Köhne2021-07-201-1/+0
| | | | | | | | Fixes (qdoc) warning: Command '\qtcmakepackage' is only meaningful in '\module'. Pick-to: 6.2 Change-Id: If4a7138ff0dc544bcf994f18a52c13e3f9cc909d Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Hook Qt SerialPort's porting guide to Qt6 into the module's index pageAlex Blasche2021-05-101-0/+4
| | | | | Change-Id: I14202aa94adfb5957c1c2a4abc6b0fc878c01cab Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Qt SerialPort: update documentationKarsten Heimrich2021-02-104-10/+103
| | | | | | | Fixes: QTBUG-89883 Change-Id: Ifd3e77c80aca1102800cce853c359179310b558d Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Qt SerialPort: dump 'master' and 'slave' terminologyKarsten Heimrich2021-02-102-0/+0
| | | | | | Task-number: QTBUG-89882 Change-Id: I9fe2048e3aa6572af8556d58afc11ff4c4929f28 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Qt6: Migrate useful properties to new property systemKarsten Heimrich2021-02-013-42/+116
| | | | | | | Task-number: QTBUG-89885 Change-Id: I883c139e7be4ff44823170959b7daf2aa6740675 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Qt6: remove overridden atEnd() methodKarsten Heimrich2021-01-292-28/+0
| | | | | | | Task-number: QTBUG-89880 Change-Id: I0f71a210f4807f391b4dd7a303c229bddb141b80 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QtSerialPort: apply API changes for Qt6Karsten Heimrich2021-01-228-440/+5
| | | | | | Task-number: QTBUG-89880 Change-Id: If64f461fa8b6bb207dd6f116f104bd894f04a4e4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Qt6: Port module to cmake build systemKarsten Heimrich2021-01-157-66/+116
| | | | | | | | Fixes: QTBUG-89767 Fixes: QTBUG-89878 Change-Id: I860ae7b9dbb0f79e9e952d594b9737d4c452579a Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Qt6: Remove Qt4 supportKarsten Heimrich2021-01-151-1/+0
| | | | | | | | Change-Id: I6404cc3dd6360531d971c6aefada6e20bba5b4b8 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Use QList instead of QVectorJarek Kobus2020-06-252-18/+18
| | | | | | Task-number: QTBUG-84469 Change-Id: Ibe37e34aec910948ac2f5cdbcc99335c09447d5a Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Qt6: Port QtSerialport to QStringViewKarsten Heimrich2020-06-101-2/+2
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I15867ef796d87cb700daaee06940e273db79866a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Doc: Fix documentation warningsTopi Reinio2019-11-111-0/+2
| | | | | | | | | | | | | | The header file for QWinOverlappedIoNotifier is not available when building on non-Windows platform - as the class is \internal anyway, suppress the Clang-parser warnings by marking also the member functions as \internal. Remove a link to example file page terminal/console.cpp, as QDoc no longer treats these files as linkable targets. Fixes: QTBUG-79809 Change-Id: Ic3bc33c1c27bc234513fe6977877116ed16c22eb Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove excess module conditionv5.14.0-beta2Joerg Bornemann2019-10-151-1/+0
| | | | | | | | That condition overwrites the actual condition at the top of the file. Fixes: QTBUG-79208 Change-Id: I70905ed693b30b6aa15b29bbf42acf33d9df2b35 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Avoid possible symbol clashes on static builds on Windowsv5.14.0-beta1Denis Shienkov2019-09-252-4/+4
| | | | | | | | | | | | | We have same 'resolveSymbols' functions names in the global namespace as in the qtserialport module and as in the qtserialbus module. This can lead to the arbitrary call of this function from a different module that can lead to the crash or other issue (e.g. to this issue QTBUG-78546). So, we can just to rename this function that solves this issue in the future. Change-Id: I25f9d2a33c6858c5194d8c76eefd518eecfb6f7b Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port ntddmodm config test to new configure systemv5.14.0-alpha1Liang Qi2019-09-181-0/+42
| | | | | | | Change-Id: Ib8c633534df0cf025b8d9845de6322b8285e73c1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-171-7/+3
|\ | | | | | | Change-Id: I946c7c1cfb6b34e15f21f83e7a3ce01f34874839
| * Revert "Emit _q_notify only if there's no notification pending"Denis Shienkov2019-09-091-7/+3
| | | | | | | | | | | | | | | | | | | | This reverts commit 85ee2c658a45d2958a54045951d236769640337f. That commit completely breaks the I/O on Windows. Task-number: QTBUG-78086 Change-Id: I9125967d6cb5b1cb4e33d0bad80ee66322e5ccc7 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | Mark QSerialPortInfo::isBusy as obsolete/deprecated in the docsAlex Blasche2019-08-061-0/+1
| | | | | | | | | | | | Change-Id: I007eb08f66a17d6e8ba200dc2e4e0529ba696ffa Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Remove usages of deprecated APIsSona Kurazyan2019-08-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | - Fixed the build with disabled deprecated APIs. - Made the docs for deprecated APIs to compile conditionally, based on the deprecation version. Task-number: QTBUG-76491 Change-Id: I38fbd84254d3d35b2bc208994c9fd70142450ad8 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-223-2/+435
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I0f003a4aef121836be3ed7f1b82e23321fdfe884
| * Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"Qt Forward Merge Bot2019-07-111-3/+7
| |\
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-111-3/+7
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5ce880f305ebb0af7f7803769cecf2c899bede12
| | | * Emit _q_notify only if there's no notification pendingJoerg Bornemann2019-07-011-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the waitXXX functions in a loop, many _q_notify signals are emitted. They are connection via Qt::QueuedConnection, but the event loop never gets the chance to process them. Introduce a counter to count the attempts to send a notification, but only send it once. Fixes: QTBUG-74961 Change-Id: I0ee4522db63844bdd37169d3a31bde2d6f92f383 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
| * | | Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-07-091-0/+1
| |/ / | | | | | | | | | | | | | | | Task-number: QTBUG-74391 Change-Id: I5a468676a2dd9dd44aa80d39a614b06acb0aed81 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-111-2/+10
| |\| | | | | | | | | | Change-Id: I3d5718006e8fee8fa3c2f97aec03183a4db1aa7c
| | * QSerialPortInfo: Fix enumeration of 'Gadget' serial devices on LinuxDenis Shienkov2019-05-071-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'gadget' serial devices have no parent nodes and were skipped from enumeration. We need to check the names of these devices against the 'ttyGS' prefix and then add matching devices to the enumeration. [ChangeLog] Fixed enumeration of 'Gadget' (/dev/ttyGS*) serial devices on Linux. Change-Id: I88afd80358153795152c1b2c929ca5bfb3adbabb Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | QSerialPort: Port to alertable I/O functions on WindowsDenis Shienkov2019-06-087-637/+418
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the QWinOverlappedIoNotifier in favor of alertable I/O functions like {Read|Write}FileEx(). The reason is that the QWinOverlappedIoNotifier is very complex to maintain. To use the alertable functions in the serial port we need an alertable analog of WaitCommEvent function. This function does not exist in the Win32 API, but we implement it trough a set of the system NtXXX and RtlXXX functions, which are resolved dynamically. This patch was tested with auto-tests and the examples using the: * com0com virtual serial port driver. * eltima virtual serial port driver. * pl2303 USB/serial converters. Task-number: QTBUG-74961 Change-Id: Idc428173eee7a1066a4693de00aa38416c4ee86c Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1v5.13.0-alpha1Qt Forward Merge Bot2019-02-021-2/+2
|\| | | | | | | Change-Id: I3931aca16393acc9c698dcf018801e1d031004bc
| * Android: Enable building again with the supported NDK versionAndy Shaw2019-01-231-2/+2
| | | | | | | | | | Change-Id: I9cf8c41c4fb37728154bc0cd74124a549b00e3ff Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-241-1/+1
|\| | | | | | | Change-Id: I35bc56c0e1bc2efa96c86c7a0a33322e72a4fdd9