aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
* Fix loading of .ui.qml form files with cached compilation unitsSimon Hausmann2014-12-021-15/+21
| | | | | | | | | Simplify the type loading logic and try the Type -> Type.qml and Type -> Type.ui.qml mapping in a simple loop that tries off-disk and cached compilation unit loading. Change-Id: I537feabd0a158a71f330bede9e6988291298ae81 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Document Qt.application.supportsMultipleWindows property.Mitch Curtis2014-11-251-0/+6
| | | | | | | | | The documentation was not added in 0df606e2ab8f3b60e1ad57dba245acf2e7810612. Change-Id: I0a5802a66021e17d1280f3969981c9e8a62c8119 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix memory leak in QQmlLocaleDataLiang Jian2014-11-041-1/+1
| | | | | | | | Call the correct destructor in QQmlLocaleData::destroy() to prevent memory leak. Change-Id: Id5b7657443521fbb46486bfbc5575d914c7c7b71 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of !this and similar constructsLars Knoll2014-10-318-74/+52
| | | | | | | | | The C++ standard doesn't allow calling member functions on a mull object. Fix all such places, by moving the checks to the caller where required. Change-Id: I10fb22acaf0324d8ffd3a6d8e19152e5d32f56bb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix ICC-on-Mac warning about unknown #pragmaThiago Macieira2014-10-301-2/+2
| | | | | | | qqml.h(506): warning #161: unrecognized #pragma Change-Id: I089007db4c4d0701eff32ce0b1c2fff1f65d5c48 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert: use the new form of QTranslator::load() for more flexibilityShawn Rutledge2014-10-281-4/+2
| | | | | | | | | | | | | | | | | | | This reverts commit 427646b8d7c52e5b84240e07ffd391217ce3bfa8. It seems that it should have been more correct, but we are still not shipping English translations, and static QString find_translation() in qtranslator.cpp will return any language which is in QLocale::uiLanguages() for which the translation file is found. That is a long list on OSX. Reverting the patch means find_translation() is not called in such cases. This change can be re-done whenever we are more sure that the attempt to find a translation will succeed in finding a sensible one, or fall back to not translating, rather than choosing a language that the user didn't intend. Task-number: QTBUG-41977 Change-Id: I425946cc71cec96b4f38629eb2b7e80220c5236d Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* QmlEngine: Use separate mutex for network access managerKai Koehne2014-10-232-2/+3
| | | | | | | | | | | | | Creating the network access manager can involve blocking calls to DBus, which apparently can take quite long in pathological cases. Using the same mutex in this case like for instance registering objects can therefore result in a freezing UI. Mitigate this by introducing a separate mutex. Task-number: QTBUG-41183 Change-Id: I55bd8453d8e4bbc0bda1591eb3fd48b50ca921c1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix assignment to QObject pointer propertiesSimon Hausmann2014-10-231-5/+4
| | | | | | | | | | | This commit ammends 59ed8c355b99df0b949003a438ab850274261aa0 to always query the Qt meta-type registry to retrieve the QMetaObject for a QObject pointer type. Change-Id: I70d876a5acfa23967fd1a57c96fcd5ac853eaf49 Task-number: QTBUG-39614 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* Fix a PIDLIST_ABSOLUTE leak in QQmlEngine on WindowsJocelyn Turcotte2014-10-221-1/+5
| | | | | | | | | | | | | | The documentation of SHParseDisplayName doesn't mention that you need to free the ppidl parameter, but the documentation of the ITEMIDLIST does mention that you need to ILFree any ITEMIDLIST passed as PIDLIST_ABSOLUTE. Reproduced the leak by repeatedly showing and closing the window on the task's example. Task-number: QTBUG-41588 Change-Id: I91d08728fc907c59e56ae344a2d12f0865031120 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix QQmlExpression/QQmlScriptString/QQmlBinding crashesSimon Hausmann2014-10-099-45/+22
| | | | | | | | | | | | | | | | | | | | | | | | In the QQmlScriptString we store the binding id and it is an index into the runtimeFunctions array of the compilation unit. However we don't store the compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve it from the cache via the context url (we have the context after all). That turns out to be not a reliable way, as sometimes the URL might slightly differ from the originally compiled cache (qrc:/// turning to qrc:/ maybe). Consequently the type is (unnecessarily) compiled again and unfortunately not _linked_, therefore the runtime functions array is empty. Another option is that when the component was created from a QByteArray, then no entry exists in the cache in the first place. This patch addresses the problem by storing a reference to the compilation unit in the QQmlContextData. That we can safely retrieve and it'll make sure the compilation unit also stays alive. In the process of that the manual reference counting was switched over to QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit. Task-number: QTBUG-41193 Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* use the new form of QTranslator::load() for more flexibilityShawn Rutledge2014-10-011-2/+4
| | | | | | | | | | | | | | As the docs explain, the variant of QTranslator::load() taking a const QLocale& is better because it "uses QLocale::uiLanguages() and not simply the locale name, which refers to the formatting of dates and numbers and not necessarily the UI language." And, using a default-constructed QLocale permits QLocale::setDefault() to override the system locale, so for example an application's main.cpp can do that before constructing a QQmlApplicationEngine. Task-number: QTBUG-7329 Change-Id: Ia29a4c894087c92b071c0fe484728866f2660fe6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* qmldir parser: add support for "depends component version" syntaxShawn Rutledge2014-10-012-0/+30
| | | | | | | | | | | | Dependency declarations are initially for the benefit of qmlimportscanner which does not (yet) use this parser. This patch adds support for dependencies into the qmldir parser for completeness, along with autotests. It is necessary to prevent errors at runtime when parsing a qmldir which contains the "depends" declaration. Task-number: QTBUG-41489 Change-Id: Ief2524a30140c42874f94f1735755b171e15dcf7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Document that QQmlApplicationEngine's root item must be a window.Mitch Curtis2014-09-301-1/+5
| | | | | Change-Id: I22466e82105c9b56894a53400394d1124191f93d Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Allow multiple cached qml unit registration functionsSimon Hausmann2014-09-241-5/+7
| | | | | | | | Only few will be necessary, but this allows for greater flexibility at run-time. Change-Id: Ia03abeb6296a5dee97544209c578dc2974af7cbc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: apply title case to all section1 titlesNico Vertriest2014-09-241-1/+1
| | | | | | Task-number: QTBUG-41250 Change-Id: I303d989992c9685f73baae50c64accf71b43549f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix deadlock with QQuickView embedded via QWidget::createWindowContainerDyami Caliri2014-09-221-2/+9
| | | | | | | | | | | A QQuickView embedded in a widget application will be deleted in the QApplication destructor. At that point, events are not being posted, so the QQmlThread cannot properly shut down, and will deadlock waiting for an event. Task-number: QTBUG-36115 Change-Id: I4595f03e0afcf9463cfbc2ba95146d4777d19c56 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix compiler warnings in qv8engine.cpp.Friedemann Kleint2014-09-191-1/+5
| | | | | | | | qml\v8\qv8engine.cpp(91) : warning C4805: '|' : unsafe mix of type 'bool' and type 'int' in operation Task-number: QTBUG-40431 Change-Id: Ibdc96907aaab132956c87dd6aec2eab2f3bf0e9f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix mapping of JS objects/arrays to C++Simon Hausmann2014-09-172-190/+129
| | | | | | | | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] When a JavaScript object/array is passed to C++ through a QVariant, the engine no longer immediately converts the object recursively into a QVariantMap or QVariantList but instead stores a QJSValue in the QVariant. This prevents a loss of data when the JS object contains non-primitive types such as function objects for example. Code that expects the variant type to be exactly QVariant::Map or QVariant::List may need to be adapted. Registered conversion functions however ensure that code that merely calls toMap() or toList() continues to work. Task-number: QTBUG-40431 Change-Id: I1dbc1d5f8e78ad28bb62db3681b9a0b34557e7f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleaned up the documentation for QQmlEngine::ObjectOwnership.Kavindra Palaraja2014-09-161-34/+30
| | | | | | | The paragraphs needed a bit of polish. Change-Id: I5c6b41fad34f3f58a372aa1bf8be627769871cf8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fixed documentation for QQmlEngine::ObjectOwnership.Kavindra Palaraja2014-09-161-1/+1
| | | | | | | | | The ObjectOwnership enum's documentation mentioned that QObjects returned from property access are indestructible, which they aren't. Task-number: QTBUG-35426 Change-Id: Ic936b33b736ff7a45482cf1b626977d34ac4ebb2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't start QQmlThreads from their constructorUlf Hermann2014-09-163-6/+13
| | | | | | | | | | In the case of derived classes (like the only user of QQmlThread) we cannot guarantee that the class is completely constructed when the thread starts. This includes the vtable which is necessary to decide which virtual functions to call. Change-Id: Ieaea67a72cc3b4f845b8621b34ca2928185917fb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Select specific features to be recorded when profiling QMLUlf Hermann2014-09-111-1/+1
| | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix roundtrip conversion between JS var and QVariantLars Knoll2014-09-112-3/+12
| | | | | | | | | | | | | | Always convert null to a QVariant(VoidStar) as documented in QJSValue. Make sure the reverse conversion will lead back to a null JS value. Adjusted two test cases that expected an invalid QVariant when setting the property to null, and added test cases for the correct conversion. Task-number: QTBUG-40880 Change-Id: I6eb01f0067f2c89779c53fd2cd0a1193047ed2cc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fix link to Qt namespacev5.4.0-alpha1Topi Reinio2014-09-051-1/+1
| | | | | | | | | Linking to 'Qt Namespace' will link to the Detailed Description section on the Qt namespace doc. Use the new linking format to link to the start of the page instead. Change-Id: Ib7e1b2b91fd9987262fc1a083ae94ef086260766 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Remove use of anonymous struct in header fileKai Koehne2014-09-011-4/+2
| | | | | | | | | | | | | Although all compilers seem to support this, anonymous structs have only been added formally to C++ 11. Also, this breaks with a change that adds a constructor to QElapsedTimer: error: member 'QElapsedTimer QQmlInstantiationInterrupt::<anonymous struct>::timer' with constructor not allowed in anonymous aggregate QElapsedTimer timer; ^ Change-Id: I5672060e3a623a5d9c4eb1d4e2981c67b96a1192 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* introduce *.ui.qml file types as new forms file typeTim Jenssen2014-08-291-0/+7
| | | | | Change-Id: I1f07b6c1ab8afac7ee7ad05e988fe313ba904705 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* Add new property "designersupported" to qmldirTim Jenssen2014-08-286-1/+38
| | | | | | | | | | | | | | | | | This patch adds a property called "designersupported" to qmldir. This allows the Qt Quick Designer to only load plugins that have the line ""designersupported"" in their qmldir file. So the designer can load sub components without risking to load plugins that have never been tested in the designer and that might crash. The check for "designersupported"" is activated by using QQmlImports::setDesignerSupportRequired(). Change-Id: I4bf07cc163faa47996eacb1365a7961c51c51060 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Simon Hausmann2014-08-266-15/+40
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-266-15/+40
| |\ | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlobjectcreator_p.h Change-Id: I60858ddb46866a8fa1a8576bb05b412afeeb4e41
| | * Fix crash with early QObject property accessSimon Hausmann2014-08-252-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the reported bug, it can happen that we try to access the compile-time resolved QObject property of an object that is referenced by id. The binding that uses this is triggered when the property changes but _also_ when the id referenced object gets either created or deleted. The first time the binding is evaluated is very early on, when the id referenced object is not created yet, so the binding evaluation fails. However the dependency is set up, and so later then the id referenced object is created and the id property is set on the context, the notification triggers and the binding is re-evaluated. During that binding evaluation a QObject property access happens by index on an object that doesn't have its VME meta-object set up yet. Therefore the property access fails and a crash occurs or the Q_ASSERT(property) assertion fails. The fix is to set register the id named object in the context _after_ the VME meta-object is setup. Task-number: QTBUG-40018 Change-Id: Ic2d7b4a0c49635efe68e93f2f6c316eb65f0c309 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Protect some members in QQmlObjectCreatorLars Knoll2014-08-252-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | Avoid dangling pointers when nested incubators are being used. Task-number: QTBUG-40437 Change-Id: I73922d2f373b2efbc00983305cdea9e8d60f0c41 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Protect incubation against its creator being deleted.Gunnar Sletta2014-08-231-1/+1
| | | | | | | | | | | | | | | Change-Id: Ica7ed02c9b67243310ddce3feaf91935b699086d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Fix crash with recursively loading cached compilation unitsSimon Hausmann2014-08-222-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a cached compilation unit depends on an import that is implemented as a Qml C++ plugin and that plugin in turn loads an asynchronous component that is cached, we would get a crash in the typeloader and a failing assertion (ASSERT: "d->m_mainThreadWaiting == false" in file qml/ftw/qqmlthread.cpp, line 300) This is because we did not implement the asynchronous loading within the loader thread for cached compilation units. This is simply done using a posted event, using the same mechanism used for other async load methods. Change-Id: Iefce67ab634ce26122c348dcdfc8e66b00fec671 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | QSM: Reintroduce guard argument evaluationSebastian Sauer2014-08-252-0/+41
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Implements the suggestion from Simon Hausmann (codereview 89716 from 08-05 14:46) to use QQmlScriptString rather then the previous used MetaObject-manipulation. This also introduces comparison operators for QQmlScriptString to be able to determinate if a QQmlScriptString changed what is needed cause there is otherwise no way to access (all) the needed details within QQmlScriptStringPrivate. Change-Id: I198479eac8fd37cbdd98a99aacdd8eebf7b75d21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Update license headers and add new licensesJani Heikkinen2014-08-25160-3030/+1750
| | | | | | | | | | | | | | | | | | - 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>
* | Add const & to argumentsAlbert Astals Cid2014-08-242-1/+14
| | | | | | | | | | Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | v4: Enable primitive conversation to QQmlScriptString in javascriptSebastian Sauer2014-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes following QML-code proper working: ParentChange { x: 0 Component.onCompleted: x = 10 } where x is a QQmlScriptString. Before this patch an error-message would be thrown that the bool/int/string/etc cannot be converted to a QQmlScriptString. With the patch primitive types including null and undefined are proper converted to a QQmlScriptString. The patch ignores (as in not implements) function/binding assignment. Unfortunately since commit aa25ad8d5f4 its not possible any longer to instanciate QQmlScriptString what means there is otherwise no (easy) way to inject a QQmlScriptString from within Javascript. Change-Id: I18aac6a6e9a57f3b7d0a2d66cdab2be6c3c153c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix setContextObject to re-evaluate bindingsAlex Montgomery2014-08-151-0/+1
| | | | | | | | | | | | | | | | | | Fix QQmlContext::setContextObject to reevaluate bindings as the documentation says that it should. Task-number: QTBUG-40798 Change-Id: Ifbd97c7a07a5432f4948937da863370b05705206 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | CleanupSimon Hausmann2014-08-157-40/+36
| | | | | | | | | | | | | | | | | | Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS units it means a slight increase of memory usage by a few bytes, but overall it makes the code a lot simpler. Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Simon Hausmann2014-08-122-9/+7
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-122-9/+7
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| | * Avoid double deletion when deleting an incubating component.Martin Jones2014-08-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The guard in QQmlIncubatorPrivate::clear() was invalidated by clearing the guards in QQmlIncubatorPrivate::incubate() when a deletion was detected. If we detect a deletion, leave the guards in place, to be handled in QQmlIncubatorPrivate::clear(). Task-number: QTBUG-40685 Change-Id: I1bf7422fda97745f1f7a3b42285a399244c09a1f Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Clarify Component.onCompleted/onDestruction docsGunnar Sletta2014-08-061-5/+4
| | | | | | | | | | | | | | | Change-Id: I86bb6b85043282f4f46a685e30b435a2f7430430 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | | Doc: Remove duplicated wordsTopi Reinio2014-08-121-1/+1
|/ / | | | | | | | | | | | | | | Removes duplicated (repeated) words and fixes other minor documentation issues. Change-Id: I891f2b3e60194b207737425c1dcc1d35a5bd921a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* | Merge "Merge branch '5.3' into dev" into refs/staging/devGunnar Sletta2014-08-081-1/+0
|\ \
| * | Merge branch '5.3' into devGunnar Sletta2014-08-071-1/+0
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcontext2d.cpp src/quick/items/context2d/qquickcontext2dtexture.cpp Change-Id: I1a9b911b3a92333a5dddbaf43275f71bad2006f0
| | * Fix assertion: ASSERT: "hasException" in file jsruntime/qv4engine.cpp, line 933Robin Burchell2014-07-311-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was seemingly tripped by trying to catch the exception twice: once with catchException and once with catchExceptionAsQmlError. Change-Id: I7176d56fe6e6f748e80d0894e314ed2b8f6e751d Done-by: Mikko Harju <mikko.harju@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | Accelerate property lookups for C++-based QObject singletons.Michael Brasser2014-08-073-1/+16
|/ / | | | | | | | | Change-Id: Icbdf06a077014db5dd57cba42f84591433ec4196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-293-7/+23
|\| | | | | | | Change-Id: Id95f7b01de36bccecbb7b73acc041654a1fe2ebe
| * Don't dereference null pointer.Sérgio Martins2014-07-281-1/+1
| | | | | | | | | | | | Task-number: QTBUG-40448 Change-Id: I75eb886ae765191101d6b01ebd038211e5fe8fba Reviewed-by: Lars Knoll <lars.knoll@digia.com>