aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlboundsignal.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-261-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickutilmodule.cpp tools/qmllint/main.cpp Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
| * Fix support for QJSValue as C++ signal parameter type, part 2Simon Hausmann2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd we wouldn't crash anymore, if QJSValue::UndefinedValue was provided as value for a QJSValue C++ signal parameter. However that was not a complete fix for the regression of commit aa869cbb06bcf005e238059a2cb0205947ff0b5f, as other primitive values stored in QJSValue as QVariant were not converted, so for example QJSValue(42). So let's fix this once and for all by using QJSValuePrivate::valueForData, that handles all types of QJSValuePrivate encodings. Task-number: QTBUG-58133 Change-Id: Ib7c0461b18df6260ccd4bce729ae2348281eb7f3 Reviewed-by: Arnaud Vrac <avrac@freebox.fr> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-141-1/+4
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
| * Fix crash when C++ QJSValue parameterized signal interacts with JSSimon Hausmann2017-01-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | When converting the parameters of a C++ signal to JS values to provide to a signal handler written in JS, the conversion of a QJSValue to a QV4::Value* may yield a null pointer in case of a default constructed QJSValue for example. This is a regression from commit aa869cbb06bcf005e238059a2cb0205947ff0b5f and we must check for this. Task-number: QTBUG-58133 Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that qmlInfo actually reports info messages, we want to change existing callers to use warning-level messages to preserve the original message level. This was done through: perl -p -i -e "s/qmlInfo\(/qmlWarning\(/" **/*.{cpp,h,qdoc} .. with a little care taken to only add the hunks that should be changed. Change-Id: I511cee11ce0a26ec1048cd2b84c7536b812a0d89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-44/+24
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Get rid of QQmlJavaScriptExpression::setFunctionObject()Lars Knoll2016-12-091-1/+2
| | | | | | | | | | | | | | | | It was only used in one place now, and the code is actually cleaner when calling setupFunction() instead. Change-Id: Idfe2842b81e765569f2c70f3d5dcd1862442a2ee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Pass a QV4::Function to the QQmlBoundSignalExpression constructorLars Knoll2016-12-091-3/+4
| | | | | | | | | | | | | | And avoid the creation of a temporary FunctionObject Change-Id: Idaacfd978ac4ee26960bdf185272cc44d6618a71 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Get rid of FunctionObject::createQmlFunctionLars Knoll2016-12-091-6/+14
| | | | | | | | | | | | | | | | Instead, simply create a QmlContext, and setup the bindings with the QV4::Function itself. Change-Id: I9db93b15112e43a6d5e275d126fb20f9c8833e8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Limit access to m_function to QQmlJavaScriptExpressionLars Knoll2016-12-091-3/+7
| | | | | | | | | | Change-Id: I070f73f106440667fce2c7fe33310369a6aa1376 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Don't create a QML function is the signal parameters are invalidLars Knoll2016-12-091-3/+1
| | | | | | | | | | | | | | Moves the error checking to where the error occurs. Change-Id: I2590d3a9d41f41c16d19e4f5883b78a8b28a883c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Remove some dead codeLars Knoll2016-12-091-4/+0
| | | | | | | | | | Change-Id: Ibf6d50926edd85ebee545bcfdfcd14cb0eeab969 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Mostly use the QV4::Function in javascript expressionsLars Knoll2016-12-091-17/+2
| | | | | | | | | | | | | | | | | | Move the function() accessor from QQmlBoundSIgnal to QQmlJavaScriptExpression. Change the profiler to operate on QV4::Function objects for binding profiling. Change-Id: Ic7ce83c487ceb69cad4b16e3dab42026238b7e82 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add sourceLocation() accessor to QQmlJavascriptExpressionLars Knoll2016-12-091-13/+0
| | | | | | | | | | | | | | | | And remove it from the derived QQmlBoundSignalExpression class. Change-Id: I93cdc67136ddd916474acd2169faf380e296a900 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Qml, Imports: mark some methods as constAnton Kudryavtsev2016-10-131-1/+1
|/ | | | | | | These methods do not modify objects. Change-Id: I67b1a10cfd0b32688500fca3265a96f53afd1b57 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qml: optimize string usageAnton Kudryavtsev2016-08-091-2/+2
| | | | | | | | | | Use QStringBuilder more. Use QString::asprintf instead of arg()'s chain. Use += operator to reserve extra capacity for possible free following append/prepend/+= call. Change-Id: Ib65398b91566994339d2c4bbfaf94e49806b7471 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QML: Clarify a parameter's usage in QQmlPropertyCacheErik Verbruggen2016-07-061-2/+2
| | | | | | | | | Give the template type a fitting name, use a parameter name that is slightly more descriptive than "dummy", and pass it around by pointer like we do in other places. Change-Id: Ie7051a6053fc8d2f9c3ea92ee3ce18e57dc5e62a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Qml: replace QStringLiteral with QL1SAnton Kudryavtsev2016-07-051-2/+2
| | | | | | | | | | | | | | ... or with QL1C in such cases: - if there is overloaded function - in QStringBuilder expressions Saves ~1.5 KB in text size. Build config: ubuntu 16.04 x64, gcc 5.3 Change-Id: Icc0789f1c244ce20a3182494b0c7f35c9d77e41d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-301-1/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quickwidgets/qquickwidget.cpp tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp Change-Id: Idf279cb88e0df2a383489af5b6afdf04d04ae611
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-291-1/+4
| |\ | | | | | | | | | Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
| | * Add missing signal handling for QJSValueMichal Klocek2016-06-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emitting signal with QJSValue argument ends in QVariant converstion in qml bound signal expression evaluation. Create missing handling for arguments of type QJSValue. Change-Id: I3d51a5455c09d0eef1123941066d20ad68f4074d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | V4: Pass scope around as parameters inside the runtime.Erik Verbruggen2016-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of many (or all) runtime functions consist of first creating a QV4::Scope, which saves and restores the JS stack pointer. It also prevents tail-calls because of that restoring behavior. In many cases it suffices to do that at the entry-point of the runtime. The return value of a JS function call is now also stored in the scope. Previously, all return values were stored in a ScopedValue, got loaded on return, and immediately stored in another ScopedValue in the caller. This resulted in a lot of stores, where now there is only one store needed, and no extra ScopedValue for every function. Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnitSimon Hausmann2016-06-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlCompiledData used to contain the binary data for instantiating QML types in the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler create a QV4::CompiledData::CompilationUnit. Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-241-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/qml/jsruntime/qv4runtime_p.h src/qml/qml/qqmldelayedcallqueue.cpp src/qml/qml/qqmlvaluetypewrapper.cpp src/qml/qml/qqmlvmemetaobject.cpp src/qml/qml/v8/qv8engine_p.h tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
| * | V4: allow inlining of ExecutionEngine::{qml,js}Engine()Erik Verbruggen2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | All other changes are just to be able to include qv8engine_p.h in qv4engine_p.h Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Scrape off a few allocations by using the QStringBuilderFrank Meerkoetter2016-05-091-7/+2
| | | | | | | | | | | | | | | Change-Id: I7689fabb5398c2c2d2781b2c788dcc60f4e1ea44 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Cleanup QStringBuilder usageFrank Meerkoetter2016-05-091-1/+0
|/ / | | | | | | | | | | | | | | | | Modules in QtDeclarative are built with QT_USE_QSTRINGBUILDER. There is no need to include qstringbuilder.h. This also means the + operator can be used instead of the %. Change-Id: I9fc374c25174a66c276f7f67a0abcd8e62a6a485 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-221-0/+22
|\| | | | | | | Change-Id: I4af0bf8ec1569097d97f8ce0bb8bf1a0e4a989ec
| * Provide access to signal parameters in SignalTransition::onTriggered.Michael Brasser2016-01-191-0/+22
| | | | | | | | | | | | | | Change-Id: Ib74d3f5e9a357a86b818e27dd7249e2ecdf1e513 Task-number: QTBUG-46897 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-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: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-1/+1
|\| | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmldebug.cpp Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
| * Move createQmlCallableForFunction out of the binding wrapperLars Knoll2015-09-081-1/+1
| | | | | | | | | | | | | | | | | | It's now QV4::FunctionObject::createQmlFunction, which I believe is a better place and name for the method, esp. as it has no real connnection to the binding wrapper anymore. Change-Id: I59e20e120db72e53735b3a986e0b91bc7c3347d7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Decode signal signatures as UTF-8 rather than Latin1Ulf Hermann2015-09-151-3/+3
| | | | | | | | | | | | | | | | QML source code is supposed to be in UTF-8, including signal specifications. Change-Id: Ic2d0aef579addabf39b3910393a77989130bc11a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add enabled property to the QML Connections elementDan Cape2015-09-091-2/+17
|/ | | | | | | | | | | | Now allows a quick way to enable/disable the signal handlers in the QML Connections element. Updated test file to have objectName and added test for this new functionality. Set to be available as of QtQml2.3. [ChangeLog][QML Elements] Allow enabling/disabling of connections established using a Connections element Change-Id: Ib0de2b3c78bb529ef74d5b4bb4ccb0f335cc50de Task-number: QTBUG-36350 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-041-3/+6
| | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal abstract interfaces from debug services.Ulf Hermann2015-08-041-1/+1
| | | | | | | | We will access the services' functionality through those interfaces once they live in their own plugins. Change-Id: I0a0d7e73c07cb874b3b507cc4a9d304588c87bca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal interface from QQmlDebugServer and use it.Ulf Hermann2015-07-301-2/+2
| | | | | | | | | | This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer is the interface exposed to connection plugins. The interface exposed to services is renamed to QQmlDebugConnector, as technically it doesn't have to be a "server". Change-Id: Id508b8c0a6960228e889f45a437b73060392db39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove static proxy methods from QQmlDebugServiceUlf Hermann2015-07-291-1/+2
| | | | | | | | | They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix some function signatures and remove an unused functionLars Knoll2015-06-181-23/+5
| | | | | | | | The returned value of these methods is never used, so save some cycles and return void. Change-Id: I7e2430130853af12de9685c4383197c80c151175 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move setting the callback type for the endpoint to the constructorLars Knoll2015-06-181-2/+2
| | | | | Change-Id: I1881fc3e79f93e3cfe01a201d60956c460c0d196 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Save another pointer in QQmlBoundSignalLars Knoll2015-06-181-5/+2
| | | | | | | | | isEvaluating is not really needed as it's tightly coupled to the isNotifying flag in the parent class. Use that instead, to get rid of it. Change-Id: Ic7274ac54e4d380567522c8a549b98d5ed1a1798 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* No need to store the same data twiceLars Knoll2015-06-181-13/+4
| | | | | | | | Remove the index member from QQmlBoundSignal, as the NotifierEndpoint already stores the index. Change-Id: Idd8848ae1ca97b964ca1be0bab1c8aba540ace43 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of QQmlBoundSignalExpression::ExtraDataLars Knoll2015-06-181-115/+75
| | | | | | | | | | | | | The extra data was only used to delay initialization of the required FunctionObject to the first time evaluate got called. In addition, the constructor using ExtraData was only ever called from the debugger. In that case performance can't be critical, so we can just as well do function object creation at construction time. This saves one pointer in the object. Change-Id: I46ce9aa325f0fa95b5b0e374e9c07d673e454dd4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of QQmlAbstractBoundSignalLars Knoll2015-06-181-30/+24
| | | | | | | | QQmlBoundSignal is the only class inheriting from it, so we might as well get rid of the abstract base class. Change-Id: I1b59a5d30d9a6ff1111e54f47530687b47f39d70 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move m_function into the base classLars Knoll2015-04-271-3/+3
| | | | | Change-Id: I2ebc0ac8f5085157f5d1ec71a1b75559c6a46f8b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup: remove context argument from evaluate methodsLars Knoll2015-04-261-1/+1
| | | | | | | | We always called evaluate with our own context, so there's no need to pass it along as an argument. Change-Id: I3463165eb2947b230c7acf54e7c29dd5d3b8e17c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove the manual vtable from QQmlJavaScriptExpressionLars Knoll2015-04-251-12/+6
| | | | | | | | Now that the class got unified with QQmlAbstractExpression, it has a vtable anyway, so we can just as well remove the old hack. Change-Id: Ifa095297e3d75564c4305ce3655eaa57436ef4a8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+1
| | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* More cleanupsLars Knoll2015-04-211-1/+1
| | | | | | | | Get rid of Value::asObject(), and pass const Managed pointers into some more vtable methods. Change-Id: Ia4f427d5fd8868f77b4015d1ce5424d32bfc2115 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* 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>