summaryrefslogtreecommitdiffstats
path: root/src/dbus
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* dbus: Skip AUTOUIC on generated sourcesKevin Funk2020-09-211-2/+8
| | | | | | | | | | | | | | | | | | Skip AUTOUIC on sources generated by the qt_add_dbus_interface and qt_add_dbus_adaptor macros. Otherwise CMake will warn due to policy CMP0071: ``` For compatibility, CMake is excluding the GENERATED source file(s): (...) from processing by AUTOMOC and AUTOUIC. (...) ``` Pick-to: 5.15 Change-Id: I7d14b23c9343940964d5bc0d1d18fc19b41b5cd0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Correct link errors qtbaseNico Vertriest2020-09-211-1/+1
| | | | | | Task-number: QTBUG-86295 Change-Id: I27f6bbdadffb08a8794520a14dfe0e2334979575 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add links to Qt 6 changes files from module indexPaul Wicking2020-09-181-0/+4
| | | | | | Task-number: QTBUG-84051 Change-Id: Iac25df135c9d73a990b41243e08cd38ea78296a4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Add porting guide documentsPaul Wicking2020-09-161-0/+46
| | | | | | | | Also add existing such docs to the new document group Task-number: QTBUG-84051 Change-Id: I76f033f0846e09943f249d2beeb1606869eef382 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove some dead codeLars Knoll2020-09-122-160/+0
| | | | | Change-Id: I9d67eaa1b9d32ca245cf606ca2f11c77dafac1df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove two comments that don't make any senseLars Knoll2020-09-121-2/+0
| | | | | Change-Id: I775a81c4e3c0fb3d7eebf403bffb1e82864eff48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup a ### Qt 6Lars Knoll2020-09-052-6/+5
| | | | | | Change-Id: If9dd04e25ddc5164cc23ac7d5684254e38b7eda6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Deprecate int based convert/canConvertLars Knoll2020-08-241-1/+1
| | | | | | | Better to provide the correct meta type to convert to. Change-Id: I8e0d46e4ba482186201c157e302c03874bd38e7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-249-35/+39
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Automatically register data/debug stream operations in QMetaTypeLars Knoll2020-08-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | And remove the old manual registration code for those operators. Add some special handling for long/ulong, as these types could be streamed as a QVariant so far, but are not directly streamable through QDataStream. [ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators() and QMetaType::registerDebugStreamOperator() methods have been removed. The streaming operators for a type are now automatically registered together with the type registration. This implies that the operators should be visible wherever the type is visible and being used. [ChangeLog][Behavior Incompatible Changes] Because the QDataStream and QDebug serialization operators are automatically registered with QMetaType, the declarations of those functions must be present at any point where the type is used with QMetaType and QVariant. Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Workaround building DBus 'car' example with qmakeAlexandru Croitor2020-08-232-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to implement instructions for building examples with qmake in the CI, an issue has surfaced. When building examples with CMake with -DBUILD_EXAMPLES=ON in the CI, the examples are built in-source, aka source dir == build dir. This means that the header files generated by qdbusxml2cpp will be placed in the qtbase source dir. The instructions that try to build examples with qmake build the examples in a separate build dir after building the examples with CMake. Unfortunately the qtbase/examples/dbus/remotecontrolledcar/car example includes the generated DBus adaptor header via a statement like #include "car_adaptor.h" and the compiler prefers to pick up the header file from the example source dir (the one generated by CMake), rather than the one generated by qmake in the example build dir. Because CMake's DBus integration uses different flags than qmake's DBus integration, the generated header file code is not compatible with the qmake generated cpp file, and the example fails to link when building with qmake, because it can't find an appropriate constructor symbol. In an ideal world, we wouldn't do in-source builds with the CMake build, but that leads to other issues which I currently don't recall. To circumvent the issue, adapt the CMake DBus qt6_add_dbus_adaptor function to allow not passing the problematic '-l' flag by making it optional. This shouldn't break existing code, but allows us to generate a compatible header that will be used by qmake and succeed in linking the example. Task-number: QTBUG-85986 Change-Id: I06759f79aeb66bb32da7f158f55dd4734c4a9887 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-157-15/+10
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-313-7/+7
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix passing QDBusUnixFileDescriptors over peer-to-peer connectionsSteffen Kieß2020-07-135-12/+41
| | | | | | | | | | | | | | | | | | | Passing QDBusUnixFileDescriptors over peer-to-peer connections currently does not work, because QDBusConnectionPrivate::setPeer() does not set this->capabilities (unlike QDBusConnectionPrivate::setConnection() which is executed for bus connections). Keep track of whether the connection already has been authenticated, and once the connection does get authenticated, update this->capabilities. Note that sending a message directly after connecting (before any message has been received from the peer) might still fail if the message contains a QDBusUnixFileDescriptor. Pick-to: 5.15 Fixes: QTBUG-85396 Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVectorJarek Kobus2020-07-091-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: Ia365c958e3b2d0c8210f5d693d907bb2012887c2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>