summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Use QTaggedPointer in QPropertyObserverSimon Hausmann2020-03-194-78/+70
| | | | | | | | | | This replaces the private tagged pointer and the use of enums for the tag makes the observer handling code more readable. The pointer-to-tagged-pointer class remains in qpropertyprivate.h due to its exoticness. Change-Id: Icc88799136c6839426d994b42368526463265e66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for explicitly marking a property as dirtySimon Hausmann2020-03-192-0/+9
| | | | | | | | When a binding is backed by old-style property captures, then having this API is needed for Qml. Change-Id: Icf51efe057eaf845969ed2cda52d082dedde677e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Enable generic property bindings to QProperty<T>Simon Hausmann2020-03-194-13/+68
| | | | | | | | | | A generic binding allows implementing the binding function in a way that enables the QML engine to run binding scripts and convert the V4::Value into a QVariant and then assign the value to the property with the help of QMetaType::construct. Change-Id: Id4807be92eee7e3501908e6c5e4c861cfcb7772a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove garbageLars Knoll2020-03-181-1/+1
| | | | | Change-Id: Ie0b891b9e9c6d12d8684c85a7717d0828fcf1c0c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add support for exposing public QProperty members in the meta-object systemSimon Hausmann2020-03-184-1/+20
| | | | | | | | | | At the moment this makes the type as well as the setter/getter available through the meta-call as well as the ability to register observers and bindings. Only QProperty members that are annotated with Q_PROPERTY(type name) are made public through the meta-object. Change-Id: I16b98fd318122c722b85ce61e39975284e0c2404 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Property binding system: Fix developer build with MSVC 2019 (16.4.1)Friedemann Kleint2020-03-172-2/+4
| | | | | | | | | | | | | | | | | | | - Fix wrong forward declaration - De-inline constructor of QUntypedPropertyBinding(), fixing: qtbase\include/src/corelib/tools/qshareddata.h(184): error C2027: use of undefined type 'QPropertyBindingPrivate' qtbase\include/src/corelib/kernel/qpropertyprivate.h(60): note: see declaration of 'QPropertyBindingPrivate' qtbase\include/src/corelib/tools/qshareddata.h(184): note: while compiling class template member function 'QExplicitlySharedDataPointer<QPropertyBindingPrivate>::~QExplicitlySharedDataPointer(void)' qtbase\src\corelib\kernel\qproperty.h(143): note: see reference to function template instantiation 'QExplicitlySharedDataPointer<QPropertyBindingPrivate>::~QExplicitlySharedDataPointer(void)' being compiled qtbase\src\corelib\kernel\qproperty.h(142): note: see reference to class template instantiation 'QExplicitlySharedDataPointer<QPropertyBindingPrivate>' being compiled qtbase\include\/src/corelib/tools/qshareddata.h(184): warning C4150: deletion of pointer to incomplete type 'QPropertyBindingPrivate'; no destructor called qtbase\include\/src/corelib/kernel/qpropertyprivate.h(60): note: see declaration of 'QPropertyBindingPrivate' Amends 9f9049b486a47aef0c7e2e3852b20aa4ffdce748. Change-Id: Idd613e2487d5ab7f8ead74747acd976d5d210c28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce always constexpr variants of qNextPowerOfTwoFabian Kosmale2020-03-171-18/+35
| | | | | | | | | Amends e464e1eb8eb63c631fb0916c3ea4540a88d8aad3. qNextPowerOfTwo has the same issue as qCountTrailingZeroBits. Change-Id: Ib1905986e932ac130bce7a1d98f4f7b5ef73991f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compilation with -no-feature-regularexpressionEskil Abrahamsen Blomfeldt2020-03-173-1/+12
| | | | | | | | | This -no-feature has probably not been tested for a while and seems to have rotted a bit, both some unprotected uses and some warnings on unused parameters. Change-Id: Ie20a06c78d3b4c36860dab49d6615eaa8ffc9077 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Simon Hausmann2020-03-164-174/+128
|\
| * Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-164-174/+128
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| | * macOS: Merge qcore_mac cpp and mm filesTor Arne Vestbø2020-03-123-169/+123
| | | | | | | | | | | | | | | | | | | | | | | | Files ending with .mm are Objective-C++ files, so we don't need a separate file for the C++ parts. Change-Id: I3ef52bc98291fd461b889978a538e81630d17c6e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * Fix minor errors in QDeadlineTimer docsEdward Welbourne2020-03-111-5/+5
| | | | | | | | | | | | | | | | | | Change-Id: I0f33094da29300ca8a609cfffd700c2a82d86ad1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-111-1/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary.cpp src/corelib/plugin/qlibrary_unix.cpp src/corelib/plugin/qpluginloader.cpp Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
| | | * Port from deprecated std::is_pod to is_trivial + is_standard_layoutMarc Mutz2020-03-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The std::is_pod trait is deprecated in C++20; is_trivial and is_standard_layout exist since C++11. Change-Id: I4b901d8edf1a55001764445aee9c338d3dc23b21 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Initial import of the Qt C++ property binding systemSimon Hausmann2020-03-167-2/+1736
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the core value based property binding system with automatic dependency tracking. More features are to be added later, and the documentation will need further improvements as well. Change-Id: I77ec9163ba4dace6c4451f5933962ebe1b3b4b14 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | High-DPI: Enable AA_UseHighDpiPixmaps by defaultMorten Johan Sørvig2020-03-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The effect of this is that QIcon::pixmap() will/may return a pixmap larger than the requested size (with an appropriate devicePixelRatio set), suitable for high-dpi displays. Many use cases, such as painting the image with QPainter, will be unaffected by this change. User code which e.g. iterate over image pixels may have to be updated. Change-Id: I63e867cc1e3f2a0b5cad92e1ffab4fe4de33ae19 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-111-2/+2
|\| | | | | | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| * | Doc: Mark QColorSpace enum as introduced in Qt 5.15Kai Koehne2020-03-061-2/+2
| | | | | | | | | | | | | | | Change-Id: Ibf2da1ebb4eb9520a2a507ed6afb89f7176391bb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Fix typoSimon Hausmann2020-03-101-3/+3
| | | | | | | | | | | | | | | Change-Id: I4923efb537c1d1b5778bf97955dbf247eaa6220a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Small typo fixSimon Hausmann2020-03-101-13/+13
| | | | | | | | | | | | | | | | | | Change-Id: Ie26dce967af59f140ebf03debe06aba19bd6a8e8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Remove template leftoverFabian Kosmale2020-03-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 33cd680ddbaccf6139e215d851a39e657ae36394, which removed the Qt5CompatiblityHook class. However, the template line above it was not removed, and now applied to isBuiltinType. As that function should not be a template, we remove it now. Change-Id: If8e276daebce5480b59d9c21b049818f9a46ec98 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Fix warning in qmetaobjectbuilder.cppMitch Curtis2020-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | src\corelib\kernel\qmetaobjectbuilder.cpp(1489): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I9cf9bdcb62b796eb8d3f3c633640b648cb11b39f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-03-043-4/+10
|\| | | | | | | | | | | Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
| * | QEventDispatcherWin32: unregister event notifiers on closeAlex Trotsenko2020-03-033-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QEventDispatcherWin32::closingDown() is called, threadData->eventDispatcher is already nullptr and the application will no longer process the events. Thus, just as it works for socket notifiers and timers, it makes sense to disable all active event notifiers at this point. Otherwise, it seems possible that an object in signalled state can provoke a data race in the notifier's callback on 'edp' pointer, if QWin32EventDispatcher destructor is running simultaneously. Task-number: QTBUG-64152 Task-number: QTBUG-70214 Change-Id: I6e77f3eeca1b0ea639021e73b86798cba0200ebf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | MSVC: Suppress warning C4910 for exported extern templatesMårten Nordheim2020-03-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warnings like the following started showing up in dev after 3c0cd7566cf858d0fd23fecad5ef9faec798cf5f. Not a problem in CI but it is treated as an error in develop-builds, suppress them for now since it still manages to build. warning C4910: 'QtPrivate::QMetaTypeForType<bool>': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation Amends 3c0cd7566cf858d0fd23fecad5ef9faec798cf5f Task-number: QTBUG-82403 Change-Id: I1ee6731afafd4636102a49555d4d892f39a21bc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QMetaType: support manual unregistrationFabian Kosmale2020-03-033-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtDeclarative registers types in plugins, and supports un- and reloading those plugins. Those types would leave pointers to unmapped memory in the type registry on macOs, which would later cause crashes. We therefore add private API to manually remove the types from the registry, which can then be used in declarative. Lastly, as a precaution for re-registering the types, we reset QMetaTypeInterface::typeId to 0, as the memory is most likely not reset to 0 when reloading the plugin. Change-Id: Ic3fc08759f3d4481dca44a91b33baf3ea9e7198e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-032-3/+3
|\| | | | | | | | | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
| * | Core: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Doc: Fix punctuation for QMetaType::QMetaType()Kai Koehne2020-02-281-1/+1
| | | | | | | | | | | | | | | Change-Id: I99d78ae475844f3d145952fd789c5753979745f7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Doc: Fix wording of operator=!(QMetaType, QMetaType()Kai Koehne2020-02-281-1/+1
| | | | | | | | | | | | | | | Change-Id: I02ca10f968acb42a6e0d793cad78d7d0baa7f472 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Lars Knoll2020-02-281-0/+4
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-02-281-0/+4
| |\| | | | | | | | | | | | | | Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Lars Knoll2020-02-271-0/+4
| | |\| | | | | | | | | | | | | Change-Id: I4212d070d5752275085e754b96f0392113604dba
| | | * QObject: treat T* -> bool conversions as narrowingMarc Mutz2020-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following wg21.link/LWG3228, it was found that a proper variant fix requires that T* -> bool conversions be treated as narrowing conversions in subclause wg21.link/dcl.init.lst. wg21.link/P1957R2 was accepted in Prague 2020 as a DR and retroactively applies to older C++ standards. Since we hard-code the algorithm of [dcl.init.lst], we can and must add this manually. [ChangeLog][QtCore][QObject] For the purposes of QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer (incl. pointer-to-member) to bool conversions are now considered narrowing. This matches the resolution of a defect report in C++ itself. Change-Id: Ifa9a3724c9c8ccd3dd6614928dbbe37477591dc1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | | Get rid of QMatrixJarek Kobus2020-02-284-7/+2
|/ / / | | | | | | | | | | | | | | | Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Pass QDate and QTime as value classesEdward Welbourne2020-02-272-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's what they are, so const refs are needless burden. In the process, consolidate two of the affected methods (one of which just adds another argument to the other's signature) into one. Change-Id: I80de35ffe078a652d1999889dede0b10302abaa9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-265-13/+63
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * | Doc: Fix documentation warnings for Qt CoreTopi Reinio2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - QCborError: Classes cannot relate to header files; use \inheaderfile instead and link to the class from header file documentation. - QRecursiveMutex: QDoc doesn't allow shared documentation comments for duplicating \fn docs between the base and deriving classes. Remove the sharing, the function documentation is available under 'All Members' doc for QRecursiveMutex. - QMultiMap: unite() and one overload of insert() were not recognized because their definitions in the same header file interfered with QDoc - use Q_CLANG_QDOC macro to comment them out, and tag \fn comments to ensure that the function documentation is matched. Change-Id: Ic96869904a72d92453e4ffa6901000147571969b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-221-1/+1
| |\| | | | | | | | | | Change-Id: Iace12004afdfe765a3068dfcf6f1320c1123c539
| | * Replace usage of std::result_of with decltypeMårten Nordheim2020-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's slated for removal in c++20 Fixes: QTBUG-82240 Change-Id: I7b35c151413b131ca49b2c09b6382efc3fc8ccb6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * wasm: add platform qsettingsLorn Potter2020-02-181-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the backend is async, the settings will not be ready to read/write instantly as on other platforms, but only be ready after the filesystem has been synced to the sandbox. This takes at least 250 to 500 ms. The QSettings status() or isWritable() can be used to discern when the settings are ready for use. This also fixes a crash in threaded wasm Task-number: QTBUG-70002 Change-Id: I080bdb940aa8e9a126d7358b524f32477db151b6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | Doc: Remove \pagekeywords commandTopi Reinio2020-02-211-2/+0
| | | | | | | | | | | | | | | | | | | | | The command does nothing, it was not implemented by QDoc. Change-Id: Id1e5fcc02101723e9089df55d9f8949e50c89b3f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | QMetaObject::connectSlotsByName(): Add output of connectionsFriedemann Kleint2020-02-171-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Help porting connections over by printing the connection statements. [ChangeLog][QtCore][QObject] A logging category qt.core.qmetaobject.connectslotsbyname was added, which will produce about the connections made by QMetaObject::connectSlotsByName(). Task-number: QTBUG-76375 Change-Id: I9a57cae574156fc8ae5a4fb8e960c2f9a47a5e47 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Improve error message when mixing incompatible Qt library versionsTor Arne Vestbø2020-02-142-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of the check has been moved to a single helper function. The reason for doing this check in QWidgetPrivate as well, when it's already done in QObjectPrivate, is to catch incompatible libraries where QtWidgets is the odd one out, e.g.: QtSomeModule 5.15.0 -> QtWidget 5.15.1 -> QtCore 5.15.0 Technically any non-final subclass of QObjectPrivate should have this check. Change-Id: Ia74064ad27de7335040a6d6b37d11574f818c878 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | MetaObject: store the QMetaType of the propertiesOlivier Goffart2020-02-255-116/+64
| | | | | | | | | | | | | | | Change-Id: I563e7232b70e94de4184f2c23a581319313dcf5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use the new QMetaType API in QVariantOlivier Goffart2020-02-256-363/+264
| | | | | | | | | | | | | | | Change-Id: I5495ee1159864ebd64083fadbfac7e07177ed406 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix crashes with MSVC 2019Olivier Goffart2020-02-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently the compiler bug causing MSVC to mix lambdas is not fixed in MSVC 2019 Fixes: QTBUG-82405 Change-Id: Ifafde3497ff264cda931ebfba79fcef1d5130510 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Export an extern template for QMetaTypeForType for builtin typesOlivier Goffart2020-02-202-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | That way not every translation unit generates the QMetaTypeInterface for the builtin types Change-Id: Id703c14532646a58f4088e8f3914564ce35e398e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Normalize types at compile timeOlivier Goffart2020-02-203-185/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fix the normalization algorithm: - Some 'const' after pointers were not removed as they should. - No need to keep the space in '> >' and '< :' in C++11 anymore - Fix normalization of 'long unsigned int' and similar Change-Id: I2b72f0fede96c1063e7b155d9f25a85fccfc7bf9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | New QMetaType representationOlivier Goffart2020-02-203-1361/+528
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the QMetaType is represented as a pointer to a "vtable" in the form of a QtPrivate::QMetaTypeInterface* The recomanded use of QMetaType is to construct an object with QMetaType::fromType. This does not require any registration. There is still an id() function which will do some registration for compatibility with Qt5. Also the patch does not really touch the other extra things that can be registered (data stream operator, comparison operator, iteratable, ...) and this still uses the previous system. This is only the change in QMetaType, other changes to use it in QVariant and QMetaObject will follow Change-Id: Iffad20085cf33f33447f58a68236013a8b60fdbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>