aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Initialize all members of QQmlPropertyDatav5.11.0-beta2Lars Knoll2018-03-081-9/+10
| | | | | | | This lead to quite a few valgrind warnings in test cases. Change-Id: Icef0fc5f93a68e4fe67e1ecd4755b456ad4778a9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix compiler warnings on gcc 7.2Lars Knoll2018-03-082-9/+9
| | | | | | | | | | | | | gcc 7.2 gives tons of warnings of the form: ./3rdparty/masm/wtf/Assertions.h:186:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] In practice the marco expansion to (defined FOO && FOO) can safely be reduced to simply FOO, as #if FOO will expand to #if 0 if FOO is not defined. Change-Id: Idc1b09990725b99bbfa2c3bc949565254ea4174f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix issue with allocating huge objects in the memory managerLars Knoll2018-03-082-3/+24
| | | | | | | | | | | | | | We shouldn't allocate objects that are larger than the size of a standard memory segment through the chunk allocator, as this can lead to problems when freeing the segment and then re-using it again. Instead allocate a private MemorySegment for these objects, and free it when the object gets garbage collected. Task-number: QTBUG-66732 Change-Id: Ic24ff65d204977f313ab0adaf7a8132883e525f0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rebuild property cache in QObjectWrapper::getProperty if deletedDavid Edmundson2018-03-081-0/+5
| | | | | | | | | | | | | | | QQmlData is shared between engines, but the relevant QObjectWrapper is not. Since 749a7212e903d8e8c6f256edb1836b9449cc7fe1 when a QObjectWrapper is deleted it resets the shared QQmlData propertyCache. ab5d4c78224c9ec79165e8890e5f8b8e838e0709 fixed this situation for bindings, however we would still hit effectively the same crash in the same situation if a function is evaluated before a binding. Change-Id: I20cd91cd8e31fd0176d542822c67e81a790599ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix group property bindings for aliases that point to id objectsSimon Hausmann2018-03-086-41/+106
| | | | | | | | | | | | | | | | | | When declaring bindings within a group property and that group property itself is a locally declared alias, then by the time we try to determine property caches for the group property we will fail as the aliases haven't been resolved yet. To fix this we can keep track of such group property declarations (encapsulated in the QQmlInstantiatingBindingContext that has all we need) and after we've resolved the aliases (added them to the property caches), we can go back and fill in the entries in the propertyCaches array for the group properties. Task-number: QTBUG-51043 Change-Id: I5613513db3977934bcc51a3df530de47d57326f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix calling Qt.createComponent() from QQmlEngine::evaluate()Simon Hausmann2018-03-081-0/+10
| | | | | | | | | | | | | If we're run from a top-level evaluate() call from the JS engine, then let's assume that any created components are top-level components that belong to the root QML engine context. This is not quite a typical use-case, but our API allows for this and this seems like an easy and sensible solution. Task-number: QTBUG-66792 Change-Id: Ic1c9171c257e8e60c0b2c43f9194bd038744ed2d Reviewed-by: Oleg Yadrov <oleg.yadrov@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add an example of binding LayoutMirroring to the app's layoutDirectionMitch Curtis2018-03-081-0/+7
| | | | | Change-Id: I81aa96641d9bef35e003b67e691607a926c087d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix regression involving aliases on case-insensitive file systemsMitch Curtis2018-03-081-1/+3
| | | | | | | | | | | | | | When initializing a QQmlProperty with the following syntax: QQmlProperty property(root, "testType.objectName", QQmlEngine::contextForObject(root)); only try to look up types (for each token after splitting on the '.') if the token starts with an uppercase letter, as 1e350a8c now enforces that type names begin with an uppercase letter. Task-number: QTBUG-66715 Change-Id: Iab64be1deb971dca256fc65d358c773837222a57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve documentation on component creation contextMichael Brasser2018-03-082-1/+4
| | | | | Change-Id: I55adc9c261529ee4b88fbb5591b3955e396437a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* touchDevice: don't lose bits from QTouchDevice::capabilitiesShawn Rutledge2018-03-081-2/+1
| | | | | | | | | | | | It was a bug that we made a local QQuickPointerDevice::Capabilities instance and didn't pass it to the QQuickPointerDevice constructor. Further, we've now reserved the entire lower byte for storing QTouchDevice::capabilities, and the upper byte for storing QtQuick- specific capabilities, so we can copy the whole lower byte instead of just the lower nybble. Change-Id: Ia21b6a1503ea870a1e16cebe70a20f4e21903054 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* TapHandler: add singleTapped and doubleTapped signalsShawn Rutledge2018-03-022-3/+29
| | | | | | | | | | | | | This is for convenience. It's nicer not to need to test tapCount in JavaScript if you know you want to react on double-click: onTapped: if (tapCount === 2) doSomething() becomes onDoubleTapped: doSomething() Neither of these are guaranteed to be exclusive though: singleTapped occurs first, then doubleTapped if you tap again quickly, then tapCount keeps increasing as long as you keep tapping. Change-Id: I6fff10880831d5be0848b9957141311db8c2c0f0 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* doc: Add special module header to qtqmltest.qdocconfMartin Smith2018-03-021-1/+1
| | | | | | | | | | Added this variable to qtqmltest.qdocconf because the module and the module header have different names: moduleheader = QtQuickTest Change-Id: Ie9bd61598c063b3f16ef889e5e7bd2f1b33d1fc5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Change QtQuickTest to QtQmlTestMartin Smith2018-03-022-28/+28
| | | | | | | | | | | | | The creation of module QtQmlTest remains incomplete, but this update improves the situation a bit. In qtqmltest.qdocconf, all instances of QtQuickTest are changed to QtQmlTest. In qtquick.qdocconf, qtqmltest is added as a dependency. This remains incomplete, because the module header is still called QtQuickTest, but the number of qdoc warnings in qtdeclarative is reduced. Change-Id: Id545f9b5ecb2165d3f0972a059a8a4a4cfd52f2f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Fix another link to page titleMartin Smith2018-03-021-1/+1
| | | | | | | Added the word OpenGL, which was missing. Change-Id: Ie09ba1ec59615d2f139ef72e0743f67b6c8ff33d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Fix link to page titleMartin Smith2018-03-021-1/+1
| | | | | | | Removed the word Overview, which had been deleted from the title. Change-Id: I1af6cc48b0f3c38e2fabe11346b023de317b1fd7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Add qtquickcontrols2 to the dependency listMartin Smith2018-03-021-1/+1
| | | | | | | | qtquickcontrols2 was missing from the dependency list in qtquick.qdocconf. Change-Id: I29231c097ca9f748ed8b3ae49100466318da8352 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Fix one link commandMartin Smith2018-03-021-1/+1
| | | | | | | This update fixes a \l command that used the wrong syntax. Change-Id: Icf5cc82eb4118332b42fe67d9d31bb7de07de3fc Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* allow DeviceType and PointerType enums 16 bits each; bit packingShawn Rutledge2018-03-021-11/+13
| | | | | | | | | | | | Now in QQuickPointerDevice, the types, flags and capabilities take up 64 bits together, and we reserve enough bits to add more types later. In C++11 enums can be strongly typed by "inheriting" an integer type, so we do that. They are signed because button count and maximum touch points are signed, and because MS compilers do that by default with enums. Change-Id: I45f27bcceeef275cbee256472b35f78fbdeeaad6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Don't crash if DragHandler have target: nullJan Arve Sæther2018-03-021-6/+8
| | | | | Change-Id: Ie5c5367439f8773eb523ef5d639a018a2fd59c65 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix: Do not read texture files when backend is not openglEirik Aavitsland2018-03-011-5/+21
| | | | | | | | | | | | The software backend would assert for the compressed GL texture files. Autotests updated for this functionality. Moved tests of the optional texture-file support out of qmltest (where it did not belong) and into tst_qquickimage, side by side with the tests of the optional svg format. Change-Id: I98c407093ccebeb70ba5a93ff0882dbd0b8060d5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Silence a GCC 8 warning in qqmlprofilereventVille Voutilainen2018-02-281-2/+2
| | | | | | | | qtdeclarative/src/qmldebug/qqmlprofilerevent_p.h:100:55: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct QQmlProfilerEvent’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] memcpy(this, &other, sizeof(QQmlProfilerEvent)); Change-Id: I72a03da54784ba3dcd89def5ae44c1ae26a68e53 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence another GCC 8 warning in qpodvectorVille Voutilainen2018-02-281-1/+1
| | | | | | | | qtdeclarative/src/qml/qml/ftw/qpodvector_p.h:119:22: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] ::memmove(m_data + idx, m_data + idx + count, Change-Id: I049703a0a6bb4432dfd3d3ce3c8cef13e9c2e31a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence a GCC 8 warning in qquickanimationVille Voutilainen2018-02-281-3/+3
| | | | | | | | qtdeclarative/src/quick/util/qquickanimation.cpp:1669:109: error: cast between incompatible function types from ‘QVariant (*)(qreal&, qreal&, qreal)’ {aka ‘QVariant (*)(double&, double&, double)’} to ‘QVariantAnimation::Interpolator’ {aka ‘QVariant (*)(const void*, const void*, double)’} [-Werror=cast-function-type] d->interpolator = reinterpret_cast<QVariantAnimation::Interpolator>(&_q_interpolateClockwiseRotation); Change-Id: I8da70ef666deb3cbdbf05c5bac89f705a2ec5ea8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence GCC 8 warnings in qpodvectorVille Voutilainen2018-02-281-4/+4
| | | | | | | | | | | qpodvector_p.h:90:34: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess] m_data = (T *)realloc(m_data, m_capacity * sizeof(T)); qpodvector_p.h:94:22: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] ::memmove(m_data + idx + 1, m_data + idx, moveCount * sizeof(T)); Change-Id: I37088986a0f8613152a355ed6f3f9572316fa607 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence a GCC 8 warning in qv4stringVille Voutilainen2018-02-281-1/+1
| | | | | | | | qtdeclarative/src/qml/jsruntime/qv4string.cpp:224:76: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QChar’ from an array of ‘short unsigned int’ [-Werror=class-memaccess] memcpy(ch, item->text->data(), item->text->size * sizeof(QChar)); Change-Id: Ibbb91fb017fe3cc382e4a4641f899c8ea4ef989a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence a GCC 8 warning in qv4engineVille Voutilainen2018-02-281-1/+1
| | | | | | | | qtdeclarative/src/qml/jsruntime/qv4engine.cpp:913:78: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct QV4::Property’ with no trivial copy-assignment [-Werror=class-memaccess] memcpy(argumentsAccessors, oldAccessors, oldSize*sizeof(Property)); Change-Id: I6e3d6a1a26fda33aa47c315a183edba9dcd0c0b9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence a GCC 8 warning in qqmljsparserVille Voutilainen2018-02-281-1/+1
| | | | | | | | qtdeclarative/src/qml/parser/qqmljsparser.cpp:82:129: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘class QStringRef’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess] string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef))); Change-Id: I670b8a860bf3dc9c20126306f7848f38acd75ca9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: correct references to snippetNico Vertriest2018-02-282-113/+28
| | | | | | | | | - replace by \quotefromfile statements from existing code - if no example in existing code: use \badcode - this makes dbransaction.js redundant Change-Id: I748fd1b3ee564556d71e9af5ca2dbc70ec37ecc2 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Fix: do data size check of pkm format compressed texture filesEirik Aavitsland2018-02-281-3/+2
| | | | | | | | | | Reintroduce reading - and sanity checking - the data size from the file header of pkm files. This was commented out during the refactoring, since it lacked the fix for ETC2_EAC format (ref. 16cd1f8 on 5.10 branch). This commit also includes that fix. Change-Id: Id85547fb6bee254d58e49ddff4593704f7ab83ed Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Doc: add code examples and GIFs of AnimatedSpriteMitch Curtis2018-02-285-3/+61
| | | | | Change-Id: Ie1c7541e526e2777af83a46d6ff01b3f7a9a0d3e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* finish renaming of containsMask -> containmentMaskShawn Rutledge2018-02-283-6/+6
| | | | | | | | Followup to 6fa746fa6 to rename setContainsMask and registerAsContainsMask Change-Id: Ifdfaf58dccb5fd3665615418e7f1ea09cb914c55 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* TapHandler: document that DragThreshold is the default gesturePolicyShawn Rutledge2018-02-281-18/+19
| | | | | | | Followup to 6eaa95662c2d4ba287ac5d1de5ec49bd3a9f59e6 Change-Id: I082d0a52588a90f6c066f31e4595a01302e19241 Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Fix some odds and ends in qdoc commentsMartin Smith2018-02-283-6/+10
| | | | | | | | | | | A few incorrent link commands were fixed. A few "No such parameter..." errors were fixed. A \qmlproperty return type qwas adjusted. A comment was removed from between a qdoc coment and its function definition. And a missing \reimp comment was added. Change-Id: I79c0882d730c77a179a4daf98bc6a46916c585d5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Fix some odds and ends in qdoc commentsMartin Smith2018-02-281-1/+1
| | | | | | | | | | A few incorrent link commands were fixed. A few "No such parameter..." errors were fixed. A \qmlproperty return type qwas adjusted. A comment was removed from between a qdoc coment and its function definition. And a missing \reimp comment was added. Change-Id: Ia1775715b5343d279ca3701e6875abacfadb0cfe Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Remove duplicate qdoc commentMartin Smith2018-02-281-17/+0
| | | | | | | | | \qmlmodule Qt.labs.handlers 1.0 appeared twice. This one is being removed because it was older and less complete than the other one, which can be seen in qtquickhandlers.qdoc. Change-Id: Id4866eec8c61a2f30920edb661edb1e6bd3fddb5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Fix several Can't link to errorsMartin Smith2018-02-282-26/+49
| | | | | | | | This update corrects several "Can't link to..." errors and splits a \qmlpropertygroup into two separate \qmlpropertygroups. Change-Id: Ic9b89a11eef64069154a932dd9dedf18279506a2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rename containsMask to containmentMaskShawn Rutledge2018-02-272-9/+9
| | | | | | | | | It was pointed out that containsMask sounds like it ought to be a boolean property. Change-Id: I2b56823b60d64f9903b0d5108c6428e691c09ed0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Do not write JSC files when debuggingErik Verbruggen2018-02-271-1/+1
| | | | | | | | | These will include Debug interpreter instructions, which wreck havoc when no debugger is attached. Task-number: QTBUG-66593 Change-Id: I0692207e51df6d52d0616f37a06ade76b6b2d54a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix memory leak in compressed texture file readingEirik Aavitsland2018-02-273-0/+7
| | | | | | | The format handler object would never be deleted. Change-Id: I44e0740f8ab0404ebb2951865bfedc5a4c8227f3 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-2774-232/+232
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* AnimatedSprite: set implicit size based on implicit frame sizeMitch Curtis2018-02-261-1/+13
| | | | | | | | | | | | | | By doing so, users no longer need to set an implicit or explicit size for AnimatedSprite. [ChangeLog][QtQuick][AnimatedSprite] AnimatedSprite's implicitWidth and implicitHeight are now based on frameWidth and frameHeight, respectively. This means it is no longer necessary to explicitly size AnimatedSprite. Task-number: QTBUG-36341 Change-Id: I3eb87e9b1c6bb93b3c667123c345341f34e2eee8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix QQmlEngine::retranslate() with PropertyChangesSimon Hausmann2018-02-261-8/+17
| | | | | | | | | When changing the language, we need to re-apply the state of items and re-run the translations if present. Task-number: QTBUG-66541 Change-Id: I83a542af033990ef9a0f92801c5f52d3a5ec722c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove unused testing codeSimon Hausmann2018-02-261-2/+0
| | | | | | | | | The helper function added in commit 2659c308792967322564b5088e0e21bb371e0283 is not needed - it was added by accident. Change-Id: I29c3cd31f726a46a24a056b27173e96a112eb8a6 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-2661-528/+359
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Sprite, SpriteAnimation: document that frameDuration is in millisecondsMitch Curtis2018-02-262-2/+2
| | | | | Change-Id: I849661f6bed1c5d15edb79ac05e0f74212ce1e02 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-26497-2907/+2907
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* doc: Correct mostly linking errorsMartin Smith2018-02-2310-80/+130
| | | | | | | | | This update corrects many qdoc warnings, mostly of the "Can't link to..." variety, but there were also a few qdoc comments added. As of this update, the qdoc warning count is 46 in QtDeclarative. Change-Id: Icf2d34c7ce7010ebfd9b474feacfe8af42f3fd5f Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Correct several QML property linksMartin Smith2018-02-231-24/+29
| | | | | | | | | | | | This update corrects several QML property links. Currently, the best way to link to a QML property is like this: \l {QtQuick::EventPoint::velocity} {velocity} In other words, use the full path to the property as the link, using '::' as the separator, and use the property name as the label. Enclose both the link and the label in curly braces. Change-Id: I19231403b82d41ad89096dd27787eff57c91b8ae Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: QtQuick must see the index file for QtSqlMartin Smith2018-02-231-1/+1
| | | | | | | The qdocconffile for QtQuick is updated to include the dependency on QtSql. Change-Id: I9d0315e4d52958bd213afa611c2898b386c4c728 Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Fix remaining "Can't tie this..." errorsMartin Smith2018-02-237-21/+18
| | | | | | | | This update mostly removes qdoc comment markers from comments that should not have been qdoc comments. Change-Id: I8ccaa7fd4ae610371e25066e048fcba6cfba8038 Reviewed-by: Martin Smith <martin.smith@qt.io>