aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* Add a facility to version type information for debugginghjk2016-09-221-0/+18
| | | | | | | | This serves the same purpose as qtbase/corelib/global/qhooks.cpp, but is meant to be in sync with changes in Qt Declarative internals. Change-Id: I5a4a7d9ca5c340367581749e05d09380590c46fb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Give SquareButton types a side property to mediate being square.Edward Welbourne2016-09-213-5/+9
| | | | | | | | | | | | | | We shouldn't be setting width and height for each square; we should only need to set their side, which determines their width and height - so that they're actually square ! More pertinently, this could later serve as an illustration of how to use properties and bindings. Ideally, we'd do this in some way that actually ensures setting width or height changes side; but the simple approach will do for now. Change-Id: I0df89e11221dde5d1d2930c4a779b59cf0d46654 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6.2' into 5.6Liang Qi2016-09-161-0/+4
|\ | | | | | | Change-Id: I410c2bd25a1bddc0e395316d62791437684b8942
| * QtQml: Disable new optimizer of MSVC2015/Update 3Friedemann Kleint2016-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | Add compiler option -d2SSAOptimizer- for this version of the compiler since it causes crashes. Task-number: QTBUG-55238 Change-Id: I9b38c669ad25f519150dd352b402dec982dc5555 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Destroy an incubating delegate if it is removed before incubation completesMartin Jones2016-09-151-3/+17
| | | | | | | | | | | | | | | | | | Removing an item from a model after its delegate has started incubation, but before it has completed results is an orphaned item. Task-number: QTBUG-55901 Change-Id: I3d3136dc05a950ca38d53687ae7d38a6d0c7ec35 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | Document that attached properties are created in C++Mitch Curtis2016-09-051-1/+2
|/ | | | | | | | | | | | There was some uncertainty about whether or not it could be done from QML, which it can't. This patch also links to the documentation for creating custom attached objects. Change-Id: Icb9eff0ec96e7911b8d401bd38813bbd6eda227d Reviewed-by: Gavin Kistner <gkistner@nvidia.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow for garbage collection of types with errors in trimCache()Michael Brasser2016-08-301-2/+4
| | | | | | | Change-Id: I821ea14f60871735bface4e2cf4e61fcb61b2784 Task-number: QTBUG-55567 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Workaround crashes in QtQml code related to dead-store eliminationJonathan Liu2016-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | When compiled in release mode with GCC 6, QtQml may crash. This is because the C++ compiler is more aggressive about dead-store elimination in situations where a memory store to a location precedes the construction of an object at that memory location. The QV4::MemoryManager::allocate{Managed,Object} functions allocate memory and write to it before the caller does a placement new to construct an object in the same memory. The compiler considers these writes before the constructor as "dead stores" and eliminates them. The -fno-lifetime-dse compiler flag is added to disable this more aggressive dead-store eliminiation optimization. This is a temporary workaround until a proper solution is found. Task-number: QTBUG-55482 Change-Id: I7dbae6e9e613e53ce5fb25957c449bc6657803b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove some double-meaning text from documentationFrederik Schwarzer2016-08-181-1/+1
| | | | | Change-Id: I9b69dbe929947795bdfbff4e0e3a16a47fa94197 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Do not register dependencies of deleted bindingErik Verbruggen2016-08-181-1/+1
| | | | | | | Because it can lead to a use-after-free. Change-Id: I6701b370c0ecee4967e5f749f673a6f9ee3d504c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QV4Object: fix GCC 6.1 tautologial compare warningMarc Mutz2016-08-171-1/+3
| | | | | | | | | | | | | | GCC warned: qtdeclarative/src/imports/localstorage/plugin.cpp:152:126: error: self-comparison always evaluates to true [-Werror=tautological-compare] Fix by comparing the types for equality instead of the addresses of their static_vtbls. Task-number: QTBUG-53373 Change-Id: Idd1598610ad6381c03c3a46abe56a332726bd6a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix throwing an exception inside a finally block with a return in catchSimon Hausmann2016-08-162-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | When exiting a catch block with a return statement, we'll unwind the exception handling manually and emit finally statements right before jumping to the exit block. If we throw an exception in the final block, we'll end up using the exception handler of the catch block that contains the return statement, which means we'll end up popping the exception scope one too many times, once through ScopeAndFinally::CatchScope in unwindException() and then when executing the exception handler block. The latter we should not be executing, instead we should jump straight to the exit block. Therefore any statements emitted as part of the manual exception unwinding (finally block here) need to be part of a new basic block with no exception handler. This bug became visible in debug builds where the Scope destructor compares the scope mark against the engine stack top to ensure correct cleanup order (which was wrong). However that in turn was hidden in debug builds again due to an accidental = instead of == in a Q_ASSERT. With the Q_ASSERT fixed this use-case is covered by ch12/12.14/S12.14_A13_T3 Change-Id: Id74a1b2bb3e063871b89cc05353b601dd60df08e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Change instances of 'OS X' to 'macOS'Topi Reinio2016-08-153-3/+3
| | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the Mac platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase). Change-Id: Iea114ac73c01d74401bcd77373b41a825d2636c9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Move the moth stack slot allocator into qmldevtoolsSimon Hausmann2016-08-122-162/+164
| | | | | | | This way it's accessible to the QML compiler. Change-Id: I3918a796c698fc75e134b29a61eed2ec028bc851 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQmlObjectCreator: prefer initializer syntax over assignmentEdward Welbourne2016-08-111-5/+4
| | | | | | | | Greater uniformity; also opens the door to potential const-ing, should this ever be worht considering. Change-Id: I91b44472cb7d84f85b3033f14a763beeea837459 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlObjectCreator: initialize _bindingTargetEdward Welbourne2016-08-111-0/+1
| | | | | | | Coverity (CID 163180) noticed _bindingTarget wasn't initialized. Change-Id: Ia727d00a161e514c437a72084b6ef01a7ebf4abc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix char conversions in QMLChristian Strømme2016-08-092-27/+11
| | | | | | | | | | | | | | This is a partial revert of 90b06e2773842, as it had unwanted side effects. The original intention was to make assignment from char to string possible, or more specifically, we wanted a solution where a QChar could be assigned to a QString, as a character and not a string representation of its value. While this behavior is desirable for QChar, we most likely want the opposite for the regular character types. Task-number: QTBUG-49232 Change-Id: I82d5f72b900fe984c4db1478fd52a9eb69ad2ee6 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Clarify doc on modification of the global object in JS imported by QMLMitch Curtis2016-08-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, reading the documentation for modification of the global object in JavaScript can be confusing. http://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html says: JavaScript code cannot modify the global object. In QML, the global object is constant - existing properties cannot be modified or deleted, and no new properties may be created. ... Any attempt to modify the global object - either implicitly or explicitly - will cause an exception. If uncaught, this will result in a warning being printed, that includes the file and line number of the offending code. http://doc.qt.io/qt-5/qjsengine.html#globalObject says: Returns this engine's Global Object. By default, the Global Object contains the built-in objects that are part of ECMA-262, such as Math, Date and String. Additionally, you can set properties of the Global Object to make your own extensions available to all script code. Non-local variables in script code will be created as properties of the Global Object, as well as local variables in global code. If QQmlEngine "is-a" QJSEngine, and QJSEngine can have its global object modified, it might seem reasonable to expect that imported JavaScript code should be able to modify the global object. This patch aims to be more explicit about the restrictions and give examples of how libraries should expose their APIs correctly for use by QML code. Change-Id: I11beb894a88d52038be90ffe6baa9337943810db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash with Component.onDestructionSimon Hausmann2016-08-051-1/+12
| | | | | | | | | | | | | | | A call to a handler of Component.onDestruction may end up causing WeakValues such as QQmlData::jsWrapper to be set again, even though they've been set to undefined in an earlier iteration of the loop that walks through the weak references. That in turn may result in invalid object references to objects that are scheduled for destruction by the collector. So after calling all destroy handlers for QObjects, reset all of the weak values again. Task-number: QTBUG-54939 Change-Id: I00ebabb76274e296fb1bd90d8d3e21dbbb920b57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash when cache property can not be foundFilipe Azevedo2016-08-051-1/+1
| | | | | | | | | | | For some reason if a cache property is not found this cause an application crash instead of just reporting an error. Now instead of a crash we get this kind of error visible: qrc:///the_file.qml line 64 column 30: Cannot assign object to property Change-Id: Ic420713df30603f1d164da439cba30a18af8f2bc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix recursion during aggressive GCSimon Hausmann2016-08-041-0/+3
| | | | | | | | With aggressive GC enabled we may end up calling the GC recursively, which does not work at all, so disable that. Change-Id: I9ce0abbdb7b2bfa8499b33fd0be0d6e4a5212a15 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix grammar in JavaScript Host Environment docMitch Curtis2016-08-041-2/+2
| | | | | | Change-Id: Ib7bc3f62fc27e982f59f1c8b2c2e0cf26306c3b9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QQmlComponent: fix handling of relative pathsDavid Faure2016-08-031-2/+5
| | | | | | | | Calling QUrl::fromLocalFile() on a relative path leads to a non-relative URL, as per the definition of QUrl::isRelative(). Change-Id: Ibaa9ecac56c6a14f6e41c5cf5250d7bbafed9837 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix documentation of Component.createObjectGiuseppe D'Angelo2016-07-261-1/+1
| | | | | | | The parent argument should really be any QObject, not just Items. Change-Id: I4d105722b9d76585dd353eddf464a1ec39fea75e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Mention Q_FLAG in C++ <=> QML type conversion documentationMitch Curtis2016-07-261-0/+2
| | | | | | | | | For a user visiting doc.qt.io/qt-5/qtqml-cppintegration-data.html, it's very difficult to know how to use an enum as flags in QML, because it's not mentioned anywhere on this page. Change-Id: I35065bff825b8aebab1477ec883d17cbab92b3ba Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QQmlPropertyMap: Don't spuriously emit valueChanged() signalThomas McGuire2016-07-251-1/+1
| | | | | | | | | | The valueChanged() signal was emitted when the property was written with the same value. This increased the potential for binding loops in user code. Change-Id: Ifeb8f6f23e2022aa35cb6cac7cf1a3dbc0e8ca2f Task-number: QTBUG-48136 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix string property assignments to 2d vectors and quaternionsSimon Hausmann2016-07-212-0/+50
| | | | | | | | | Just like it's possible to assign "1,2,3" to a QVector3D, the same should be possible for a QVector2D and a QQuaternion. Task-number: QTBUG-54858 Change-Id: I8f394279dcdf5c057876efaa316b4bad51a4c126 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix QQmlEngine crash on big endian 64 bit architectures (s390x)Maximiliano Curia2016-07-201-2/+2
| | | | | | | | | | | | This change disables the BIG_ENDIAN 32 bits words mangling in 64 bits machines (where the words are 64 bits long); this would otherwise result in a segfault. Task-number: QTBUG-54717 Change-Id: I6b5ab6f213880b030795185c05e609d290168901 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Timo Jyrinki <timo.jyrinki@iki.fi> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* JS: Check for errors before using sub-expression resultsErik Verbruggen2016-07-201-21/+95
| | | | | | | | Specifically: don't de-reference a result and assume that it's not-null. Task-number: QTBUG-54687 Change-Id: If07d3250a95a7815ab7a3262b88e0227965ef8e7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix logic bug when deleting properties of JS objectsLars Knoll2016-07-141-4/+4
| | | | | | | | | | | | | The code used the size of the internal class in an inconsistent way. It should simply compute and work with the old internal class size, as that reflects the old object layout. [ChangeLog][QtQml] Fix assertion when deleting properties of JS objects Task-number: QTBUG-54589 Change-Id: Ie3db70437e780215d08a1a96491db75f8b859754 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix QQmlTypeData object leakJian Liang2016-06-251-2/+2
| | | | | | | | Don't forget to drop refcount of QQmlTypeData object in QQmlType::resolveCompositeBaseType() to prevent leakage. Change-Id: I079839a3347def1c2ac8f9cc07a52debb885b36e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* 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>
* Doc: Refactor cpp integration Message sampleSamuel Gaist2016-06-191-5/+5
| | | | | | | | | | Since MyItem.qml is a GUI element, the example as is triggers a segfault when starting. This patch refactors the cpp code to make it a GUI application. Change-Id: I983c8c1945bd4be364c988ab9fdfa69e35e7b9de Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Fix reference to Windows RT which actually meant Windows Runtime.Jake Petroules2016-06-161-1/+1
| | | | | Change-Id: I701b25bc73cf84b1daae481eebfd2dc19003ce78 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* V4: Always set the tag when boxing a pointer in QV4::Value.Erik Verbruggen2016-06-165-72/+62
| | | | | | | | | All setters now store tags, so no-one can play loosy-goosy with the boxed values (and accidentally forget to "tag" a value, resulting in random garbage). Change-Id: Ia0b78aa038d3ff46d5292b14bd593de310da16a0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add QNX to an x86-64 gcc/g++ listJames McDonnell2016-06-141-1/+1
| | | | | | | QNX 7.0 will support x86-64. Change-Id: I91d79f41161324fb992e17c2067e0648b476c773 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Make some QNX only code Dinkum specificJames McDonnell2016-06-141-1/+1
| | | | | | | The undefines won't be needed for QNX 7.0 with GNU libc++. Change-Id: Ibcea09aad54a956fc056ceaac5db6a0d53cd176c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Only release types if they aren't referenced anymoreUlf Hermann2016-06-101-1/+2
| | | | | | | | | | | Just checking for references on m_compiledData is not enough. The actual component can also be referenced. Thus it won't be deleted on release(), but cannot be found in the type cache anymore. Task-number: QTBUG-53761 Change-Id: I8567af8e75a078598e4fed31e4717134e1332278 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlIncubator: correct documentation snippet about waiting for ReadyShawn Rutledge2016-06-101-1/+1
| | | | | | | | | It makes more sense to process events until the incubator is Ready rather than while it's already Ready. Change-Id: If8b0c5057dd88ffdbb2dd39f53b5b9676d0b9d19 Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com> Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* Fix crash when using with statement with an expression that throwsSimon Hausmann2016-06-071-2/+3
| | | | | | | | | | | | | | We need to evaluate the expression for the "with" statement that is supposed to define the new scope _before_ opening up the scope, otherwise - when the evaluation of the expression throws an exception - we'll try to pop the "with" scope we couldn't open in the first place. [ChangeLog][QtQml] Fix crash when using the "with" statement with an expression that throws an exception. Task-number: QTBUG-53794 Change-Id: I7733f5a4c5d844916302b9a91c789a0f6b421e8a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6.1' into 5.6Liang Qi2016-05-311-0/+5
|\ | | | | | | Change-Id: I7d9e0c90645d856e501ff70d97d55ffd615a2e31
| * Workaround for crashes in QtQml code relating to null this pointersv5.6.1Thiago Macieira2016-05-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | When compiled in release mode with GCC 6, QtQml crashes. This option gets works around the issue by instructing the compiler not to delete null pointer checks for pointers that the standard says cannot be null, yet apparently are. This is a temporary workaround until a proper solution is found. Change-Id: Id3aab65533904562a6cbfffd14501a185fc91179 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | RegAllocInfo: Initialize member _currentStmt.Edward Welbourne2016-05-301-0/+1
| | | | | | | | | | | | | | As pointed out by Coverity (CID 22368). Change-Id: I67bdda3f747b68a0197a4cb2e2aa750aa322b6ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | V4: Mirror jsAlloc behavior at stack allocation.Erik Verbruggen2016-05-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | Allocating from the JS stack will zero out the memory, and thus indicate to valgrind that memory is not uninitialized. By first marking the whole stack as uninitialized and only then allocating 2 entries, the behavior for those two entries will now match the allocation behavior. This fixes a false positive when using valgrind. Change-Id: Icdb5279e1cfbfe6b5c385cc42c556edf721fa74b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix crash with SignalTransitionSimon Hausmann2016-05-251-1/+1
| | | | | | | | | | | | | | | | | | Don't crash when using SignalTransition with a signal object instead of the slot used to emit the signal. A signal object is just as good. Task-number: QTBUG-53596 Change-Id: I8a419d16ec0c257c9a798a83ee5bad338794cdd2 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Fix crash for unknown QQmlListModel roles in debug buildsFilipe Azevedo2016-05-231-0/+2
| | | | | | | | | | | | | | | | | | If a role is unknown, trying to access it will crash in getExistingRole. Fixed that and now return QVariant() for unknown roles. Change-Id: Iad5c1292a4faee893fbc5a69984cf776aca85d70 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6.1' into 5.6Liang Qi2016-05-199-26/+23
|\| | | | | | | Change-Id: Ib7f8c60143c1efab279476dba390a3d9837ccc37
| * Fix crashes when incubating objects asynchronously with initial propertiesSimon Hausmann2016-05-184-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | This is a regression from commit 94e337fa95425d259e81b4d21f4d0853108553bd where we accidentally ended up not having a calling QML context set anymore when initializing the properties on newly incubated objects as provided by the caller. The QML context is necessary as for example when we set a URL property, the URL can be relative and it will be resolved to the base url of the context when written, such as in in QQmlPropertyPrivate::write. Change-Id: I1d896381fc92f653a7d76f4d82174bca48828f5e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * QML: Fix asynchronous cached loading.Erik Verbruggen2016-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | When calling CachedLoader::loadAsync, queue the load on the QML thread instead of asking the thread to load it synchronously. The problem showed when a QML file triggered a plugin load, that would ask the engine to create a component while initializing that plugin. Change-Id: I3714ef285e432eb1aa294c4fd0208ba188d97ee9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Doc: Remove repository name from examplesinstallpathTopi Reinio2016-05-131-1/+1
| | | | | | | | | | | | | | | | Examples in binary packages now directly match the install path. Change-Id: I8cbef85c8bef840d6ff87ac308e2e82a835adcc7 Task-number: QTBUG-52953 Reviewed-by: Antti Kokko <antti.kokko@qt.io>