summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Add a QBindingStorage classLars Knoll2020-09-021-0/+12
| | | | | | | | | | | | | | | | | | | QBindingStorage is a class that can store a set of binding objects for the properties of a QObject. This will get used to reduce the memory overhead of the property system when adding bindable properties to QObject based classes. The binding storage has a pointer to the TLS entry containing the currently evaluating binding. Like that we avoid repeated TLS lookups and reduce the overhead of the property system to one pointer lookup and one compare for the case that properties aren't being used. Each QObject now owns one binding storage object, that can be used to store binding data for properties that members of the QObject. Change-Id: I27427c03c2ba281f072e074be96147bdbcaac246 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObject: add a single shot connection flagGiuseppe D'Angelo2020-09-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one needed to listen to a signal just once, one had to store the QMetaObject::Connection object returned by connect() and use it to disconnect the slot after the first signal activation. This has led to a proliferation of using wrappers (and enough TMP); they usually look like this: 1) create a shared_ptr<QMO::Connection>, allocating its payload; 2) create a lambda, capturing the shared_ptr by value; 3) in the lambda, disconnect the connection (through the shared_ptr), and call the actual slot; 4) connect the signal to the lambda, storing the returned QMO::Connection into the shared_ptr. This is expensive, error prone for newcomers, and tricky to support as a general facility inside one's projects. We can do better, just support single shot connections right in QObject. [ChangeLog][QtCore][QObject] Added the Qt::SingleShotConnection flag. When a connection is established with this flag set, the slot is going to be activated at most once; when the signal is emitted, the connection gets automatically broken by Qt. Change-Id: I5f5feeae7f76c9c3d6323d841efba81c8f98ce7e Fixes: QTBUG-44219 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Use QMetaType in QMetaCallEventLars Knoll2020-08-241-3/+3
| | | | | | | And don't use int based type mapping anymore. Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid warnings regarding bit-field signednessDimitrios Apostolou2020-07-161-1/+1
| | | | | | | | | | | Up to (including) C++11, integral bitfields of unspecified signedness have implementation dependent signedness. Detected by LGTM.com static analyzer. Pick-to: 5.15 Change-Id: Ibaa0fdc6e443495a3cd40330c4573c9cc6ccdf5b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in corelibJarek Kobus2020-06-251-6/+5
| | | | | | | | | | Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-6/+6
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-261-0/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Improve error message when mixing incompatible Qt library versionsTor Arne Vestbø2020-02-141-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-041-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| * Get rid of the getter for QObjectPrivate::threadDataGiuseppe D'Angelo2019-12-171-1/+0
| | | | | | | | | | | | | | The dependent changes have now landed. Change-Id: I502377ab5603d67ada9e5577de1abfccdfa0fa09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-251-2/+7
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| * Make QObjectPrivate::threadData a proper atomicGiuseppe D'Angelo2019-11-131-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QObjectPrivate::threadData used to be a QThreadData *, and was read and written from multiple threads without proper synchronization. As an example, it was read from QCoreApplication::postEvent and written from QObject::moveToThread, therefore causing UB. Port threadData to a proper atomic, removing the races. Fix all usage points. In general, QObject is documented to be simply reentrant, not thread-safe, and certain bits (e.g. timers, moveToThread) are not even reentrant. The reasoning therefore is that a given QObject's threadData is not supposed to be touched by multiple threads without some synchronization happening elsewhere, and therefore relaxed loads should be sufficient. As drive-by change: refactor QCoreApplication::postEvent. It was particularly subtle, because it had a loop using a volatile to cope with the possibility of the receiver object switching thread while we tried to lock its thread's event queue. However, volatile does not achieve any synchronization, so drop it, and refactor the algorithm using better locking primitives. Put this algorithm in a common place, and also reuse it from removePostedEvents, which was lacking any synchronization. Change-Id: Icc755f7eb418ff54b33db4bdd87fd8eaf4e82c7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-301-0/+1
|\| | | | | | | Change-Id: I7f11733bda960196a96c6452bdabeb7072a8430d
| * Add a getter for QObjectPrivate::threadDataGiuseppe D'Angelo2019-10-281-0/+1
| | | | | | | | | | | | | | Strictly a temporary measure to deal with cross-module merges. Change-Id: I344bb3f20f68f04367041834e608669122ff70b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove leftovers from QML1Lars Knoll2019-10-101-9/+0
| | | | | | | | | | | | | | QML1 is not supported anymore, remove the leftover hooks for it. Change-Id: I2900726714c5faea3523b2ebe39bb393364b3bfb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-09-041-16/+34
|\| | | | | | | Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
| * Remove obsolete API after qtdeclarative migratedVolker Hilsheimer2019-08-221-6/+0
| | | | | | | | | | | | | | | | This is a follow-up to commit b7d073e9905bf9812ba96cecdcf6871a95517d30, which refactored memory allocation of QMetaCallEvent. Change-Id: I363256c80ee941b545e6f9c659c65556fff5c907 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Refactor memory allocation for arguments of QMetaCallEventsVolker Hilsheimer2019-08-101-16/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cases: In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory and instead passes already existing pointers through. A QSemaphore is used to serialize data access between threads. So the constructor taking a QSemaphore can be simplified to only accept an existing arg array. In a QueuedConnection, QMetaCallEvent needs to make deep copies of the arguments, and memory needs to be allocated based on the number of arguments. The previous code put the burden of memory allocation on the code generating the event, while the memory was free'd by ~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility to allocate and free the memory as needed, and adjust the code generating QMetaCallEvents. We can allocate the memory for types and pointers to arguments in a single block, starting with the space for the array of void*, followed by the space for the array of integers to avoid byte alignment issues. By pre-allocating the space that's needed by three arguments, we can avoid all mallocs for the majority of QMetaCallEvents. Until this change has propagated through qt5.git, we need to keep the old API that is still used by QtDeclarative around. Once QtDeclarative has migrated to the new API, it can be removed. Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QObject: remove the undocumented userData() featureMarc Mutz2019-08-121-3/+0
|/ | | | | Change-Id: I74445b964eb32bf60f389fcb50bd4929de01230e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QAbstractMetaCallEvent: fix compilation with out feature.thread on ClangMarc Mutz2019-07-141-2/+7
| | | | | | | | Clang warns that the private field semaphore_ is unused, and is correct, of course. Change-Id: Ic1372cedd3f4b2facca9f6f6be398d26f406b379 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Port from implicit to explicit atomic pointer operationsMarc Mutz2019-06-291-1/+1
| | | | | | | | | | | | The old code used the implicit conversions from QAtomicPointer<T> to T* and vice versa. The semantics of these differ from the ones std::atomic uses, so we're going to deprecate these, like we did for load() and store(), too. This patch fixex some users of these APIs before we deprecate them. Change-Id: I0a88bb1c359392538bb64b511bfc62381a56a468 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from implicit to explicit atomic integer operationsMarc Mutz2019-06-281-1/+1
| | | | | | | | | | | | The old code used the implicit conversions from QAtomicInteger<T> to T and vice versa. The semantics of these differ from the ones std::atomic uses, so we're going to deprecate these, like we did for load() and store(), too. This patch fixex some users of these APIs before we deprecate them. Change-Id: I4877276581757cd57e042efea8296fe535a493d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-14/+14
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* qobject_p.h: Const-correctness fixKevin Funk2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Note: This function is being called inside GammaRay Change-Id: I4260d2b720d87eec829758cf3b86bc0593d964f2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Get rid of the locking in activate()Lars Knoll2019-03-291-87/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing connections and resizing the signal vector now happens in a way that will not interfere with activate(), as the old objects won't get deleted if we are somewhere inside a signal emission. This means that we don't need to lock the senders mutex in activate anymore, as long as the reference counting on the ConnectionData is atomic and we are in the senders thread. This implies that we now need to lock the receivers mutex in queued_activate() abd blocking queued activation to ensure it hasn't been deleted while we are emitting. In addition, some precautions need to be taken to not read from the receiver without holding the lock, as it could get deleted while we're activating (if it's in a different thread). To make that possible store the receivers thread id in the connection data. Use atomic pointers for all variables that can get modified with the signalSlotLock() held and that are being read without the lock being held. This gives us a very nice additional speed improvement for signal emissions. without change with change string based connect: 3287 2436 pointer based connect: 3941 3265 not connected: 403 400 disconnected: 460 489 5 slots connected: 9112 4515 Change-Id: Ib7324bb74c389dcc3b6581a03c31469a6e589fc2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add safe way to resize the signalVectorLars Knoll2019-03-291-15/+70
| | | | | Change-Id: Ib55da020f22e981bc379af3b4cf3431bf0fa0c20 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add a QAbstractMetaCallEventLars Knoll2019-03-291-8/+22
| | | | | | | | And use it to clean up the reimplementations in Qt DBus. Change-Id: I8e3fe35e8db6405cbcbfb45b42a8f2efecc1cef0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Change cleanup mechanism for orphaned connectionsLars Knoll2019-03-291-10/+99
| | | | | | | | | | | | | | | | Put all connections that get disconnected into a singly linked orphaned list. Whenever the refcount on the connectionData drops down to one, this list can safely be cleared, even with the planned removal of locking in activate(). Use an id integer in the connection to acoid activating newly added connections. Fixes: QTBUG-72649 Change-Id: Ide3d116ae7fc9ca497598c1c2b71d43b4339c92d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Don't iterate over the connections without holding a lockLars Knoll2019-03-211-0/+1
| | | | | | | | | | | | | When checking whether a slot is connected to a signal, we need to hold the signalSlotLock to be sure about the answer, or we can get crashes when a connection gets removed while doing the check. The check in activate() can handle some uncertainty as it's only a shortcut to the longer path. Fixes: QTBUG-74604 Change-Id: I3fc822455fbadc0223ef68632f5fb3df3ff3e86d Reviewed-by: Aapo Keskimolo <aapo.keskimolo@qt.io>
* Replace the ConnectionData::inUse int with a proper refcountLars Knoll2019-02-081-3/+13
| | | | | | | | | | The main difference is that QObject itself also holds on reference on the structure. Also rename the orphaned flag to objectDeleted for clarity. Change-Id: Ief9b9ff9c8b9cc3630dcfd29806ed24cd07150e4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Move all connection related data into one data structureLars Knoll2019-02-081-7/+40
| | | | | | | | | | | Adn create that data structure on demand on the heap. This reduces the size of QObjectPrivate if there are no connections. If we have connections, it'll use the same amount of allocations and memory as before. Change-Id: I900f6980a2cd8a5f72c3ad18697b5dd49100217d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Simplify the code required for switching the current senderLars Knoll2019-02-081-27/+23
| | | | | | | | Squeezes another percent of performance out of QMetaObject::activate(). Change-Id: I620b8c578681280efcc9bec50cfb1020d2afc928 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Shave ~5% off from signal emission timeLars Knoll2019-02-081-2/+2
| | | | | | | | | | | | | | | | | Refactor activate(), so that we eliminate almost all checks for signal hooks in the common case. Here are the benchmark numbers showing the improvement for 100M signal emissions without change with change string based connect: 3836 3693 pointer based connect: 4571 4510 not connected: 479 433 disconnected: 559 522 Change-Id: I394e6ea5d5bc96e298e8cc0c763eed78c8041876 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Get rid of the connectedSignals bitflagsLars Knoll2019-02-081-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Measurements show that it's just almost as fast to simply query the connectionlist directly and avoid both the memory overhead of the bitfield and the associated bookkeeping. For connected signals, the difference is not relevant at all. With a signal that was never connected, removing the bitfield will cause signal emission to be ~2.5% faster. And if you ever disconnect from a signal, the bitfields might not be accurate and this can cause a major slowdown. Here are some numbers to validate this. All times are measured in ms for 100M signal emissions: without change with change string based connect: 3817 3836 pointer based connect: 4552 4571 not connected: 493 479 disconnected: 2113 559 Change-Id: Ia2c85036afaa7f991b883c8ff812f69cf4580f7e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: hjk <hjk@qt.io>
* Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-121-1/+1
| | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-041-1/+1
|\ | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
| * qobject_p.h: Use nullptr everywhereKevin Funk2018-11-281-1/+1
| | | | | | | | | | Change-Id: I605e44607cc09775548c1e6b781d476c1627c9c7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix a few overrides in Qt CoreAlessandro Portale2018-09-251-2/+2
|/ | | | | | | | | | | | | | | | This change removes redundant 'virtual' from function declarations. Clang Tidy's modernize-use-override check reports: warning: 'virtual' is redundant since the function is already declared 'override' CppCoreGuidelines say: C.128: Virtual functions should specify exactly one of virtual, override, or final Change-Id: I9a4bdd6cc041d46ae64b25597ba4f7268ac4c2b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-2/+2
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix zero-as-null-pointer-constant warning in QObjectJesus Fernandez2017-09-051-6/+6
| | | | | | | Change-Id: Icf0c836b96cd750edeee71c144e2bd9917a96815 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-0/+1
|\ | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()Olivier Goffart2017-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixup of commit b4995eb7491c1b4784a1bf48db834c11c42b8d9d. We can't call QWidgetPrivate::get(w) on a deleted QWidget, because of the call to the member function QWidget::d_func. We can however call QObjectPrivate::get since we still are in the QObject destructor. tst_qstackedlayout now pass without ubsan Warnings. Change-Id: I4e839a97ddbd1cf21435a8fca76523b98a1f7d9b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Make relation of currentChildBeingDeleted and isDeletingChildren more obviousBernhard Übelacker2017-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a comment, to describe the relation of QObjectPrivate::currentChildBeingDeleted and QObjectData::isDeletingChildren, given that this field is defined in an entirely other file on a base-class, making it severely non-obvious to the reader. Task-number: QTBUG-57714 Change-Id: I7b8b24693c4ccc6192e9f9f34f951202b7fdddb0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Sprinkle Q_DECLARE_TYPEINFO on types used in containersGiuseppe D'Angelo2017-02-231-0/+1
|/ | | | | Change-Id: I6c71ed8c20cd5e785037ad25c2d3da8994e8e3a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-251-0/+1
| | | | | | | | | | | | The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tune fast-exit for signal activation for QML.Erik Verbruggen2016-05-031-4/+10
| | | | | | | | | | | | | When using QML, it quite often happens that only the QML engine is connected to a signal, and no C++ handlers. By splitting up the fast-exit case and handling QML separately, we can prevent a call to QThread::currentThreadId, and locking+unlocking the mutex. On x86 this saves ~130 instructions according to valgrind. Change-Id: I947fe42afe351922339ac982a6d498bc2f7b5192 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Reduce memory usage of dynamic propertiesSimon Hausmann2015-08-101-1/+1
| | | | | | | | | The dynamic property variants are stored as QList<QVariant>, which unfortunately results in QList to behave as array-list because of the size of QVariant. By storing the variants in a vector directly we can eliminate the array-list element pointers. Change-Id: I8736e1cf48b9fc97df3007df4a439b793933f346 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* De-duplicate vtables, part I: exported private classesMarc Mutz2015-06-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. In this first batch, we de-inline destructors of exported private classes. Since they are already exported, users of these classes are unaffected by the change, and since it's private API, we don't need to avoid adding code to the out-of-line destructor until Qt 6. Change-Id: I450707877d2cb6a77f79ae1dd355facb98d6c517 Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>