aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlboundsignal_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersJani Heikkinen2015-02-121-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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-1/+1
| | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make sure we always have an engine when assigning to a PersistentLars Knoll2015-01-131-1/+1
| | | | | | | This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QQmlBoundSignalExpression: Remove extra padding.Robin Burchell2014-09-151-1/+1
| | | | | | | Size goes from 104 to 96 bytes on x86_64. Change-Id: I84614d9e4949e4470e841c0efb6a674e1cb74778 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Avoid recompiling of signal handlers defined in QtQuick state changes and ↵Simon Hausmann2014-04-021-0/+2
| | | | | | | | | | Connection objects We can re-use the expression we've compiled at QML type compilation time, as long as we "inject" the signal parameters in the dynamic qml lookup chain. Change-Id: Icc417531c41dea06ff5d033011179af49b03f542 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Save another 4/8 bytes per QQmlBoundSignalExpressionSimon Hausmann2014-03-271-1/+1
| | | | | | | | We can move the persistent to hold the scope for a string compiled binding into the extra data. Change-Id: I033aa6d080402a1eb19cdae540f9af2c5c3a3fc7 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Combine the source file, line and column number triplet in a common structureSimon Hausmann2014-03-041-6/+2
| | | | | | | | | This avoids unnecessary function calls when all of the three pieces need to be retrieved from a QQmlBoundSignalExpression. Change-Id: Ibcd498c907ea723baf6439cf32ca5fc704f204b5 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reduce size of QQmlBoundSignalExpression in the common case.Michael Brasser2014-03-041-14/+26
| | | | | | | | | | This reduces the base size of QQmlBoundSignalExpression by 20 bytes, by moving member variables specific to runtime rewrites in to an "extra" structure. Task-number: QTBUG-37134 Change-Id: I235895a395ba4304a7ea071d88aa9aebcfff61cb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Retrieve detailed location information when profiling signal handlersUlf Hermann2014-01-211-0/+1
| | | | | | | | | Use the Functions associated with signal handlers to find out which exact code is being executed. Task-number: QTCREATORBUG-11100 Change-Id: Idfae9d188b17977b55f551e6fe766042fe24e786 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-1/+1
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* [new compiler] Initial implementation of signal handler supportSimon Hausmann2013-09-201-0/+3
| | | | | | | | | | Signal handlers start out in the parser as binding expressions. A new SignalHandlerConverter converts the bindings then so that the expression is turned into a function declaration where the function parameters match the parameters of the signal. Change-Id: I3ea5aa3b80a6ee3b095c6841c63c3e3bb0b47e4f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix regression in tst_qqmlecmascript::signalAssignmentSimon Hausmann2013-07-051-1/+3
| | | | | | | | | | Detect errors in the signal declaration already at compile time, re-introducing the earlier code in qqmlcompiler.cpp that checked that. This also means that the parameter string construction can be done once for each signal and not for each handler. Change-Id: Icf6242a793939466bbc44d43bf041281164ad1b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of the signal expression rewriterSimon Hausmann2013-07-031-13/+5
| | | | | | | | | | | | | This replaces the entire rewriter with more or less: expressionToEval = "(function(<named params here>) { " + expr + " } )" This also fixes crashes at run-time when the signal rewriter was executed from the loader thread and tried to use a v4 identifier hash with the same engine that's also in the main thread. Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change some v8::Persistent to QV4::PersistentValueLars Knoll2013-05-071-2/+2
| | | | | Change-Id: I2c4e98cf7e778de9aafabdbd68e6682106343d12 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid dynamic lookup of signal handler argumentsMichael Brasser2012-08-241-20/+21
| | | | | | | | | | | Rewrite signal handlers to include the parameters in the rewrite. Also check whether parameters are actually used when possible, and if not don't provide them to the expression. Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-6/+7
| | | | | | | | | | Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Reduce size of QQmlNotifierEndpointAaron Kennedy2012-05-241-2/+2
| | | | | Change-Id: I4d4a22f5f3d88d4ad2fcd738753fd8da2d8a9263 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-1/+1
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Detect and abort if an object is deleted during signal handlingKent Hansen2012-05-211-0/+1
| | | | | | | | | | | | | | | | | | | | If an object gets deleted while one of its own signal handler expressions is being evaluated, a subsequent crash is inevitable. While we could introduce guards/checks in the signal handler kernel (QMetaObject::activate(), QQmlNotifier::emitNotify() and friends) to detect and mask the sender deletion, this arguably isn't helpful; the code that emitted the signal is likely to access member variables directly after emitting the signal, causing semi-random crashes. This situation is a symptom of misbehaving application code. Catch it early rather than later, and issue a qFatal() with a helpful message. Coupled with a backtrace, this should make it easier to track down the flawed C++ application logic. Change-Id: I8c77800e49c475def613224f208181c2d0af60e6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Improve memory usage of Connections and signal handlers.Michael Brasser2012-05-181-3/+7
| | | | | | | | Following the pattern of 330152354aed8496ac78d145e14b25ee2d7bf8fb, store the source as Utf8. Keep one less copy of the source when possible. Change-Id: Ifa5f5fdc9ea3d48e904489dc262145eff36e710c Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-3/+3
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Permit signals to be emitted in a different threadAaron Kennedy2012-05-111-1/+1
| | | | | | | | | | | | The QQmlNotifier approach to connecting to signals did not support the cross-thread signal/slot model used elsewhere in Qt. This change allows one specific case of that - emitting a signal in a different thread than the one the QObject lives - to work. Task-number: QTBUG-25647 Change-Id: Ia8fdaf4c7d7e2ccd7ff7657bb1d8e26277eb60aa Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* More robust tracking of signal handler expression ownership.Michael Brasser2012-05-011-5/+10
| | | | | | | Reference count the expressions, and improve testing. Change-Id: I810509eae1c7608b367e9ff5f7891a294667a692 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Optimise memory usage of bound signalsChris Adams2012-04-261-5/+11
| | | | | | | We can save a few bytes per bound signal by using a flag pointer. Change-Id: I96d23dc287722e549e21e4c5d978bed0ba2f4bed Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Support and use parameters in QQmlNotifierEndpoint.Michael Brasser2012-04-231-6/+8
| | | | | | | | | Allow QQmlNotifierEndpoint to support signals with parameters. Update QQmlBoundSignal to use this support. Change-Id: Ie2a245b39283b0b66d66bd2350e8bc85fe519bb5 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use scope, not owner to look up enums in QQmlBoundSignal.Michael Brasser2012-04-031-5/+6
| | | | | | | | With this, we no longer need to keep a pointer to the owner, so remove it as well. Change-Id: I0c38645b924bf5b0caadb46444cf6dd09abc1eb2 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Revert "Add QQmlBoundSignalNoParams"Michael Brasser2012-04-031-26/+0
| | | | | | | | | | | | This reverts commit ec7deb3d123bb44b5d57590615a60ed48b1d2860. Other Qt modules may be relying on QObject::receivers() to know when there is a QML signal handler for a signal, and using QQmlNotifierEndpoint in QQmlBoundSignalNoParams breaks this assumption. Change-Id: I1b8085254697d909f85a88617eb4e3f258b88950 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use minimal javascript expression for bound signalsChris Adams2012-03-291-10/+47
| | | | | | | | | | | Previously, QQmlBoundSignal used QQmlExpression internally. This commit adds a new, more optimal QQmlJavaScriptExpression subclass specifically designed for QQmlBoundSignal, and converts the code to use it instead of QQmlExpression where appropriate. Task-number: QTBUG-24460 Change-Id: I2865a119ce840235e27a7722d8052ca61c265f69 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add QQmlBoundSignalNoParamsqt-v5.0.0-alpha1Michael Brasser2012-03-271-0/+26
| | | | | | | | This class is used for signal handlers with no parameters, and is more lightweight than QQmlBoundSignal. Change-Id: Ie63eb989d334906657fd16fe35386df198654c28 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove QObject parenting from QQmlAbstractBoundSignal.Michael Brasser2012-03-261-8/+18
| | | | | Change-Id: If549cf57bbac18a986a2a0e63fdc76902d2dae43 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use QQmlAbstractBoundSignal where appropriate.Michael Brasser2012-03-261-2/+4
| | | | | | | Prepare for the addition of another subclass. Change-Id: I340f735503e661d9d735f3316a065f807294921b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+103
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>