summaryrefslogtreecommitdiffstats
path: root/src/dbus
Commit message (Collapse)AuthorAgeFilesLines
* dbus: Fix typosJonas Kvinge2021-10-144-4/+4
| | | | | | Pick-to: 5.15 6.2 Change-Id: I9efce6a3163ca6564d511c994776ff96999909b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix usage of \summary macroTopi Reinio2021-10-121-6/+6
| | | | | | | | | The macro takes only one parameter, sentences must be wrapped in {}. Pick-to: 6.2 Fixes: QTBUG-97441 Change-Id: I7177548a32a67d720c2b551d16c09d898b0fda51 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Make it explicit when CMake API is definedKai Köhne2021-10-052-0/+13
| | | | | | | | Task-number: QTBUG-96239 Pick-to: 6.2 Change-Id: Iaa99024f98f5422aa39f148a89594186b40344bf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add overview pages to CMake APIKai Köhne2021-10-042-0/+15
| | | | | | | | | | | | | | So far the pages were only 'rooted' in the separate qtcmake documentation. Let them have a page per module too, so that it's easy to navigate. At the same time rename the cmake-macros-qtcore group to cmake-commands-qtcore. This will require a fixup in qtdoc repository. Pick-to: 6.2 Change-Id: Ifc09b27a6c220b5feab64686ca47c60d3342e71a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add summary to CMake commandsKai Köhne2021-10-041-5/+5
| | | | | | | | | | | | For normal \page elements, \brief is just showing in the \generatelist or \annotatedlist commands. Make sure the description is also visible in the actual CMake command/variable/property page by defining a \summary macro. Pick-to: 6.2 Change-Id: I12bc854d547059a2f6309a5922bb0b2a36d4e41c Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* DBus: do not mix QList iterators and raw pointersGiuseppe D'Angelo2021-09-202-7/+8
| | | | | | | | | | | | | In Qt 5, QVector::iterator was actually a raw pointer. In Qt 6, QVector = QList, and QList::iterator isn't a pointer, but converts to one (for backwards compatibility). Some code in QtDBus exploits this by mixing iterators and raw pointers. In preparation for deprecating conversions between them, adjust this code by "converting" explicitly when needed. Change-Id: I1efab72b33d27742b339cf848cefd5cc258cd215 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Handle empty string args for versionless wrappers of dbus CMake commandsCraig Scott2021-09-201-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | CMake silently drops empty list items when passing ${someVar} to a function unquoted. The versionless wrapper functions typically use ${ARGV} or ${ARGN} to pass through arguments from the caller to the versioned implementation, but this doesn't preserve empty arguments. For qt_add_dbus_adaptor() in particular, this was problematic because that meant arguments after the empty arg effectively "moved left" and were interpreted as the wrong arguments. Use named arguments and pass through each one explicitly for the qt_add_dbus_adaptor(). This takes advantage of the implementation of the versioned function, which also checks each optional positional argument explicitly. We can only do this because we know the upper bound on the number of arguments, so it is possible to represent each argument with its own variable. A more general solution that didn't need to know the number of arguments would require the cmake_language(EVAL) command, but that requires CMake 3.18 or later. Fixes: QTBUG-96594 Pick-to: 6.2 Change-Id: Ibb1de19217191768ca5ead969b20a1d28c466868 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Add version and description to Qt-DBus documentationKai Köhne2021-09-171-1/+3
| | | | | | | | This makes sure that the Qt version is part of the HTML title. Pick-to: 6.2 Change-Id: I2ad8535a9289616d21c18bd9e92d4a91f6faced0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Revert "Ensure versionless wrappers do not introduce a new variable scope"Craig Scott2021-09-061-14/+17
| | | | | | | | | | | | | This reverts commit 08180e76e6116f0ef66476ca00b2b676b3aa50da. Macros add another level of escaping that functions do not. The conversion of the versionless wrappers to macros may alter the behavior, so revert that change. Task-number: QTBUG-96219 Pick-to: 6.2 Change-Id: Ic5dcff3081123d957888584ba1d76ae0580d9083 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Ensure versionless wrappers do not introduce a new variable scopeCraig Scott2021-08-311-17/+14
| | | | | | | | | | | | | | Using function instead of macro prevented the wrappers from being able to pass back any variables set in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Pick-to: 6.2 Change-Id: Ic4486de668694c06b47e466587b2cdcb969ea047 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qdbuscpp2xml: add support for custom types with a new -t optionDavid Faure2021-08-252-0/+19
| | | | | | | | | | | | | | | | | qdbuscpp2xml can't know about custom types registered with qDBusRegisterMetaType<> in the server application whose header file it's parsing. So add support for custom types using a command line argument. For example: qdbuscpp2xml -t 'std::vector<Person>=a{ssss}' peopleserver.h which generates <arg name="people" type="a{ssss}" direction="in"/> <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="std::vector&lt;Person&gt;"/> [ChangeLog][QtDBus][qdbuscpp2xml] Added a -t option to specify how to handle custom types. Change-Id: Ic0cad4f4eec8d5dfa48055c3a46cc772b1a60174 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: fix ExportScriptableInvokables to allow calling scriptable invokablesDavid Faure2021-08-231-6/+11
| | | | | | | | | The "wantedMask" check in the xml generator didn't distinguish slots from invokables, so exporting an object with just ExportScriptableInvokables didn't allow calling Q_SCRIPTABLE methods. Change-Id: I7b408755da5b28e67a9384d9df95e22dc5de2369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Add global \versionlessCMakeCommandsNote qdoc macroJoerg Bornemann2021-08-231-15/+8
| | | | | | | | | | | | | | When documenting a CMake command, document the unversioned command 'qt_foo' and use '\versionlessCMakeCommandNote qt6_foo' to refer to the versioned command. This avoids duplicating the command signature. Use the new macro where applicable. Pick-to: 6.2 Task-number: QTBUG-95796 Change-Id: I2e4180fbda0b89acf3d8c036459f591eb2f46475 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QDBusMarshaller: fix -Wformat-overflowMarc Mutz2021-07-082-26/+16
| | | | | | | | | | | | | | | | | | | | | Says GCC: qdbusmarshaller.cpp: In member function ‘QDBusMarshaller* QDBusMarshaller::beginMap(QMetaType, QMetaType)’: qdbusmarshaller.cpp:286:17: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 286 | qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " | ^ Fix by manual checking. It's a False Positive, because QString::asprintf() can handle nullptr strings just find, but let's make GCC happy. Since the code snippet appears multiple times, even though GCC only warns about one of them, take this opportunity to factor the code out into a cold helper function. Change-Id: I1d642f2465f34b670b179646185cba05cb16e573 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-06-252-15/+2
| | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: Idc160b594987b2c765e75bd669aae851b4366282 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qdbus: add support for "aay" (QByteArrayList)David Faure2021-05-021-0/+3
| | | | | | | | | (I wish these common mappings were centralized though, so that annotations in the XML file wouldn't be needed) Pick-to: 6.0 6.1 5.15 Change-Id: Ie3e8731e44b6e0338c8a044408c34160cf0a3a1e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QDBusServiceWatcher::watchedServices to bindable propertiesAndreas Buhr2021-04-282-12/+50
| | | | | | | | Fixes: QTBUG-92993 Change-Id: I379c67c75bc536e387889de5303b01aef9399fcd Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port of QDBusServiceWatcher::watchMode to new property systemAndreas Buhr2021-04-192-6/+22
| | | | | | | | | | | Port watchMode in QDBusServiceWatcher to the new property system. This is the easiest part. Task-number: QTBUG-85520 Change-Id: I588212af205e77765862b8fecdbdcbf871717142 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Introduce QMetaObject::metaTypeFabian Kosmale2021-03-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function returns the metatype corresponding to the metaobject, or an invalid metatype for namespaces. This works as follows: First we increment the metaobject revision for new metaobjects. Metaobjects with older revisions are handled by doing a lookup by name. That fallback is also used for dynamic metaobjects (from QtDBUS and those created by QMetaObjectBuilder). For new metaobjects, we store the metatype in its metatype array, behind the property metatypes. This avoids any changes to the property and method metatype extraction logic: For properties, the metatype access does not change, as the new metatype is after their metatypes. For method metatypes, we already have an indirection layer (using offsets), so by adjusting those offsets by one, the same logic keeps working. To distinguish between namespaces and dynamic metaobjects, namespaces store the metatypeinterface pointer for void in the metatype array, whereas dynamic metaobjects store a nullptr. One nice additional benefit is that this simplifies the generator logic in moc, as the metatype array is now never empty. Task-number: QTBUG-92077 Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Change section titles that cause bad linksPaul Wicking2021-03-111-5/+5
| | | | | | | | | | | Section titles are valid targets for QDoc's autolinker. When they are identical to other valid link targets, such as for example a class, these sections may cause invalid links. Pick-to: 6.0 6.1 Fixes: QTBUG-91141 Change-Id: Ie9a6258d2bf83932335976d8c0b5fc59f2028ae5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Fix warnings about wrong snippet path or missing .pro fileNico Vertriest2021-02-191-0/+3
| | | | | | Task-number: QTBUG-91147 Change-Id: I6a55b2b713dd70cf1cbb0b93a8d4152e175e2c4d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Several fixes to porting guidesAlex Blasche2021-02-101-2/+4
| | | | | Change-Id: I46b1754103d33d21e6cdeb338e3c6e3b0d0a4e29 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-121-76/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-121-1/+1
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-072-107/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use (new) erase()/erase_if() algorithmsMarc Mutz2020-12-051-5/+2
| | | | | Change-Id: I45c18fd45c20b226e44d16315e3ebb6c305d4ab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Deprecate QScopedPointer::take()Giuseppe D'Angelo2020-11-201-3/+3
| | | | | | | | | | | | | | | | | | | We've decided that QScopedPointer shouldn't be movable, because it would break the semantics of being "scoped" (the pointer/pointee won't survive the scope). Then, QScopedPointer shouldn't allow for take() either. If you need those semantics, reach for unique_ptr. [ChangeLog][QtCore][QScopedPointer] The take() function has been deprecated. This was an API mistake, as it allowed the pointer/pointee to escape from the scope, defeating the point of the QScopedPointer class. If you need such semantics, use std::unique_ptr (and call release()). Change-Id: I3236f085f763b04eb98e3242abc06f7c54fb3d8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix memory corruption in QDBusInterface signal emissionsRobert Griebl2020-11-191-1/+3
| | | | | | | | | | | | | | | If more than one signal parameter required conversions (e.g. 2 QVariantMaps), then the auxParameter list would be reallocated on the second append. This resulted in the reference to the first conversion (stored in params) to be broken. Found with valgrind after the QtApplicationManager started crashing weirdly when built against Qt 6. The same code is in Qt 5, but it just works fine there: I guess the reallocation strategy in QList is different there, so we never have to reallocate the list. Change-Id: I2e0c8906ebc9474c4ec9f53cafc1689003d5c4c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update landing pages and module pages in qtbaseJerome Pasion2020-11-172-14/+11
| | | | | | | | | | -Qt SQL, Qt D-BUS, Qt GUI, Qt OpenGL, Qt Widgets, Qt Test, Qt Concurrent, Qt XML, Qt Network, Qt Core -language edits for consistency, add links Task-number: QTBUG-87155 Change-Id: Ic61350c9fa15090c802a42d8e9116219591eba73 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-121-5/+4
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add Qt6 QDBus porting guideKarsten Heimrich2020-11-111-1/+21
| | | | | | | Fixes: QTBUG-88027 Change-Id: Ic4fa2070aa7068a1d0ff02d43aa6a3d1d10db0d7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-092-3/+3
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: Ib59de7976fae19e7b39962e80161df6628e4070b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Update documentation of CMake commands for Qt 6 for DBusKai Koehne2020-11-081-12/+10
| | | | | Change-Id: Iec86b42a0a1b52ea4688226f3c71fc2bfc6d48ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix links to the CMake manualTopi Reinio2020-10-301-1/+1
| | | | | | Task-number: QTBUG-86295 Change-Id: I7b2208284d65ec9182352490bd4c92458c5e5e37 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Document versionless variants for CMake commands for DBusKai Koehne2020-10-252-15/+37
| | | | | | Pick-to: 5.15 Change-Id: I7168a2d2589ef72d6e6f4bc568c5a914faa777df Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-233-4/+4
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename the QMetaType::MovableType flag to RelocatableTypeLars Knoll2020-10-231-1/+1
| | | | | | | Keep this in sync with the changes we have done in QTypeInfo. Change-Id: Iaacb0f3cc5c46d3486084a1f6eca480a233d5e1a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix qdoc warnings in QtDBusVolker Hilsheimer2020-10-214-19/+20
| | | | | | | And remove the limitation to 8 types from the documentation. Change-Id: I92c67368e53d69fd851886c621f3f894f638bae9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port some more /*implicit*/-like comments to Q_IMPLICITGiuseppe D'Angelo2020-10-162-5/+5
| | | | | Change-Id: Ib70ad3f29365153af647deea54fc45467c413cb9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove dead codeLars Knoll2020-10-122-6/+0
| | | | | | | This code has been deprecated in Qt 5. Change-Id: Ia8e0bc791ac1f43df7124b4f30db3d0bb9966015 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-3/+3
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Switch Q_DECL_DEPRECATED to use C++14 [[deprecated]]Allan Sandfeld Jensen2020-10-032-20/+0
| | | | | | | | | | As a C++ attribute it must be on the beginning of the line or after the function name however. And for friend declarations can only be on the definition. Change-Id: I456884428f36e1f1c621089c7b1addee13ada0fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of some #ifdef qt6Allan Sandfeld Jensen2020-09-302-8/+0
| | | | | | | | | None of this code is even compiled in qt6. Change-Id: I5891cc9459320083ad3908fcbf646f3ba75b8a4d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QMetaType instead of integer based type idsLars Knoll2020-09-2325-171/+160
| | | | | | | | | Change the implementation of Qt DBus to use QMetaType directly instead of integer based type ids. Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use a hash to store the DBus marshalling dataLars Knoll2020-09-232-38/+44
| | | | | | | | | | A QList<int> where int is the metaType id is a bad idea in Qt 6, as custom types will start at index 65536. Use a QHash instead. Also fix the API to use QMetaType as arguments and return values. Change-Id: Ia0b894126271be1f01dc4593b5155fb75d713720 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup DBus type registration codeLars Knoll2020-09-2310-68/+44
| | | | | | | | Modernize the code base, use QMetaType and avoid reinterpret_casts. Change-Id: I0bad2ee393a0f850cf40b248cb9439b06ed9f663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QDBusPendingReplyLars Knoll2020-09-232-96/+93
| | | | | | | | | | | | Remove the limitation of max 8 arguments and clean up the template code. This required a bit of special work to ensure QDBusPendingReply<void> works the same way as QDBusPendingReply<>. Change-Id: I8e822b2f97f0712746b917056ea8f3d5c219c7f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-232-8/+8
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>