Commit Graph

1136 Commits

Author SHA1 Message Date
Matthew Vogt f189b8934d Extract Particles code to an independent library
QtQuick clients that do not use particles features should not have
to load these classes.

Task-number: QTBUG-25178
Change-Id: Ib15f7655dc4d821595e06f9160d2770375279027
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
2012-04-16 01:25:54 +02:00
Alan Alpert f19e6d72ac Extra tests for ShaderEffect and CustomParticle
Change-Id: Ieafa97f1f11337c8beac89a05fc5b5706ba6c215
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-04-13 11:09:14 +02:00
Rohan McGovern a2b3882039 test: marked tst_qv8profilerservice as insignificant on mac
This autotest has repeatedly given different results on consecutive test
runs.  It seems to fail about 5% of the time in CI.

Task-number: QTBUG-25288
Change-Id: If7e8675521f6270877f514b7de81c926606cf232
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-04-13 09:48:40 +02:00
Andrew den Exter 96c0e7e576 Don't ignore model changes when the ListView scroll position changes.
If there are pending changes when the ListView viewport changes then
do a full layout instead of a refill.  Likewise for GridView and when
animations finish or the cacheBuffer size changes.

Change-Id: I57a2b01fee5729381558af366dad24ba26c223ef
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-04-13 08:07:16 +02:00
Bea Lam f24f682c83 Measure offsets by rows instead of pixels
Will make it easier to test multiple flows and layout directions.

Change-Id: I33cabb650f65a2fd2932d23d501bf250d71ef80d
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-04-13 01:59:55 +02:00
Pekka Vuorela adf3f8a72a QQuickTextEdit to trigger input method updates on selectAll()
Change-Id: I8642eca0e584b811308b73817e7decf2f392f1b5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-12 13:32:21 +02:00
Alan Alpert a2db142137 Get SpriteGoal and GroupGoal tests running again
Missing from particles.pro, and needed quick-private removed from their
pro files. Also updated to match new sprite API, presumably these were
missed because they weren't running before.

Change-Id: I9be2d7f2b0bacc32c26829d40e91e8907c184906
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-12 04:07:37 +02:00
Matthew Vogt 65bfc35429 Simplify date conversion functions
Do not use the 3rd-party code from JSC, but instead use the QDateTime
functions for millisecond offsets from the epoch.

Note that this change is reviving the earlier change:
http://codereview.qt-project.org/1874.  The test failures for that
change no longer occur due to a change in the QDateTime behavior
applied by: http://codereview.qt-project.org/13169

There is still a semantic difference between QDateTime and the
ECMAScript specification with regards to the application of DST.
ECMAScript requires that the current DST adjustment should be applied
to historical dates, whereas QDateTime will apply the adjustment as
applicable at the epoch date to any prior dates.

Change-Id: Ibebd47c9d2b75a034342ffcda075501a6a527b8d
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-11 03:35:15 +02:00
Frederik Gladhorn 80872d0a45 Create accessible interfaces only for items with attached prop
If the attached property is not found, ignore the item, unless
it is part of the tree. We still create a valid hierarchy this
way, but filter out all irrelevant items. The same goes for
hit-testing.

On the other hand this patch enables the root item to be found
by setting isAccessible on it when updating the flags. Otherwise
the hierarchy is not valid again.

Change-Id: Ied422fd0506d13458757c87a5dad7cdb9d3079bf
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-04-10 21:03:04 +02:00
Chris Adams 5f1b7bf392 Fix erroneous signal emission in Loader
Previously, the incubator wasn't cleared when a Loader was
deactivated.  This commit clears it on deactivate, and also
ensures that the loadedSignal isn't emitted on error.

Finally, it re-enables a network-loading-related unit test.

Change-Id: I5dac92aead2c221c5d45011accf59077f7c9b402
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-05 09:50:05 +02:00
Laszlo Agocs aa959012a8 Properly copy all event parameters in deliverMouseEvent()
Timestamp and capabilities were missing. One of the very special flick
test cases needs to be fixed, because setting the proper timestamp
will now generate correct velocities. A potentially dangerous, legacy
implementation of flick() has also been updated to match how QTestLib
works in Qt 5.

Change-Id: Ibc99f7212ba21d41a419eaadac2fdda730658dc6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-05 09:50:05 +02:00
Matthew Vogt 5874e29b85 Create plugins for Particles and Window submodules
To prevent errors when QML files import QtQuick.Particles or
QtQuick.Window before importing QtQuick itself, create plugins for
these submodules that make their import statements independent of
the QtQuick import.

Remove the automatic re-ordering of the imports list prior to loading
to ensure registered name conflicts can be resolved by changing the
order of import statements.

Task-number: QTBUG-24369
Change-Id: I248625fa30a813dddd2a64feb9a489768931939f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-05 07:21:51 +02:00
Charles Yin 82a048c3cf Fix some issues with init_data() for qmltest
1. should not use hasOwnProperty, replace it with 'in'
2. the default init_data() method is unnessary
3. when init_data() returns empty, the test function should run in non data driven mode

Change-Id: I8cb19d3499b285d07c8b3d04abd9ddf33b1c5395
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-04-05 05:14:56 +02:00
Roberto Raggi 9218820804 Remove sharing of V4 subscriptions
Unfortunately, sharing subscriptions doesn't play nice
with the linked lists we maintain to observe QML
bindings.

Change-Id: I8ab351987138caf8fa7fbdeff4dbf2b34184a05c
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-04-04 15:34:59 +02:00
Aaron Kennedy 8b0831f0b0 Do not execute overwritten bindings
During the construction of an object, internal bindings can be
overwritten by the initialization of objects with outer scope.

Task-number: QTBUG-23138
Change-Id: I46a187d9cdc41f4dd96d068f39788a2255b8888d
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-04 13:29:19 +02:00
Aaron Kennedy 03a6db7fc1 Revert "Do not execute overwritten bindings"
This reverts commit 639208cc7f.

There were two problems with this submit:
    1. Maintaining a hash of all the properties we have assigned bindings
       to is massively inefficient.
    2. The autotest was in the qquickbinding testcase which is for the
       QtQuick "Binding" element, not for generic binding tests.

Change-Id: Id2150dbfe86c6844cc0b115d7f941ae8d6a60643
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-04 13:29:13 +02:00
Matthew Vogt 38d535bd9a Do not crash on invalid binding diagnostic
If there is no meta object for the property type of the recipient of
an invalid binding, fall back to QMetaType::typename().

Task-number: QTBUG-25161
Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-04 08:43:50 +02:00
Matthew Vogt 639208cc7f Do not execute overwritten bindings
During the construction of an object, internal bindings can be
overwritten by the initialization of objects with outer scope.

To yield the expected result, suppress the evaluation of inner
bindings that are overwritten by outer bindings, during the
completion phase of object creation.

Task-number: QTBUG-23138
Change-Id: I679309543a9b64c774bb99798ad5ccf518726d10
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-04-04 07:15:44 +02:00
Martin Jones 912c25633e Support snapMode in PathView
PathView missed out on snapMode, which is especially useful for
its SnapOneItem mode.

Change-Id: I0e9b080ef72d9bc1e305445cd8dfde8e21e4e3da
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-04-04 06:00:40 +02:00
Kim Motoyoshi Kalland c71c8c4619 Fixed crash when using 'var' property in ShaderEffect.
Also made CustomParticle and ShaderEffect share some code.

Task-number: QTBUG-23924
Change-Id: I975f71f031b379cf5e29302a9c931e4ead5437ea
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-04-04 03:29:45 +02:00
Aaron Kennedy 7aa4c4164e Don't crash if calling a method on a QObject that has been gc()'d
As we don't actually delete an object immediately when it is collected,
it is possible to get into a situation where a method is called on an
object after the collector has marked it to be destroyed.  This fixes
a crash in this case.

Change-Id: I131d4c5d7ed788a91aa52f6af2e5c089d9bf5e08
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-03 16:22:04 +02:00
Roberto Raggi 411066bdf2 Fix QML_BINDINGS_TEST and the V4 auto tests
Also, enable all the V4 auto tests.

Change-Id: I014a95298e6a834784a4a573ad3310e59e932ec4
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-04-03 16:22:04 +02:00
Roberto Raggi 187fe50cf5 Add support for floating conversions.
Change-Id: I4feee2a3c5fcfa32b89859ddbfe17e6163983ab9
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-04-03 16:22:04 +02:00
Frederik Gladhorn 60b9151d36 Do not automatically mark all text items as accessible.
This adds more confusion and fails more often due
to invisible items and overlays that it helps.
The test saw lots of "children" before that were
text elements, these are gone now.

With this the hack to make children based on
item role invisible can go away.

Change-Id: Ic5a3bba6e271747237e0e85168f4290bf596bc8a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-04-03 15:07:40 +02:00
Michael Brasser 817c0741d1 Allow objects created in QML with incubateObject to be destroyed.
Change-Id: I8a0678ea8dff6f4a40ac367395a99dd025f7f08a
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-03 07:50:17 +02:00
Andrew den Exter b3264e2cb6 Fix QQuickTextInput test instability.
Use a QWindow to steal focus rather than a second QQuickView, as it
appears there may be some issue with shared GL resources between views.

Change-Id: I8a134e3b4a1e54f645d0071543ec8f94338ff315
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-04-03 06:36:14 +02:00
Andrew den Exter 368a3a736c Set cursorVisible to false when im cursor length is 0.
If the length of the QInputMethodEvent::Cursor attribute is 0 the
cursor is supposed to be hidden.  To ensure this and any other IM
state is reverted when the input method is reset send a empty
event to the editor when preedit is cancelled or removed and
count formatting or cursor changes when determining if the
input method is composing (i.e has state that needs to be reset).

Change-Id: Ifca69aa0c18776b1aef355ed6ae9aecc40b9d475
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-04-02 10:45:55 +02:00
Andrew den Exter 9cddbbff9d Fix crash when changing the grandparent of an item with focus.
When an item was reparented it's sub focus item was cleared and those
of it's children were cleared along with those in the tree the item was
removed from.  Since we now rely on the focus state of an unparented
tree to be correct we need to restore the sub focus items of the
unparented tree.

Change-Id: I236c512751b99092c7e9a39194f4680304bfacc5
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-02 08:03:23 +02:00
Simjees Abraham ed31de7f04 irrelevant qDebug removed
syncing debugutil with the change done to remove the irrelevant qDebug
at stat of debug session.

Change-Id: I17520319684e6e213037b09550d1a97b493150cd
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-30 17:02:48 +02:00
Simjees Abraham 1e8dc1636c irrelevant qDebug removed
Irrelevant debug statement which gets printed at start of debug session
is removed. The same is removed in Auto-tests as well.

Change-Id: If8f44950952f08b55ff884c1fe42670108e2369d
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-30 14:37:14 +02:00
Aaron Kennedy 833336fa96 Loosen shared binding tests
Previously we blocked all function calls, but only because we were trying
to prevent "eval" calls from appearing in shared bindings.  Instead this
test allows function calls as long as the identifier "eval" doesn't
appear.

This also exposed a crash with v8 bindings that is also fixed.

Change-Id: I22eefd290c7b82d9c01b2cd2907a46e560ae4db9
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 12:55:23 +02:00
Friedemann Kleint 5534768481 Fix warnings in qtdeclarative.
- QString from ASCII conversions
- Unused variables
- Pointer mismatches

Change-Id: I5f76dce4f2ba481c2c2bce8681cf8107bd629566
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 11:18:26 +02:00
Kai Koehne 831c2bf638 Debugger: Fix v8profiler failures on mac
Make the test more robust.

Change-Id: Id4e5d25e9f9cb0bdbe14670a060d7348bceeb823
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-30 11:17:38 +02:00
Chris Adams bb5afc485d Fix crash in QUrl-to-int conversion in v4
Also adds various unit tests for other conversion operations.
Note that many of the conversion operations produce the wrong results,
and have been marked with QTBUG-24706.

Task-number: QTBUG-24706
Change-Id: Id96a7409e31f2e889dce6b501247f58b59fa6a98
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 07:54:14 +02:00
Andrew den Exter d2447feece Fix forceActiveFocus() with multiple items having focus: true
Ensure focus is cleared from an item if it is parented to an item that
already has a sub focus item.  Checking scopedFocusItem() didn't allow
for the case where an unparented item is the root of the focus tree
but not itself a focus scope, checking the unguarded subFocusItem
member will.

Change-Id: I482779e8077e9f282d22bd0090e669840764e52a
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-30 07:53:56 +02:00
Martin Jones 2ab873ed5f Size loaded item before bindings are evaluated
If the Loader size is set explicitly we can set the item size
before the bindings are run, and avoiding an additional
anchor layout.

Also ensure item implict size changes are propagated/notified in the
Loader.

Change-Id: Ie22b018b22be8457ccf30b907a26e44260b9cef7
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 07:40:32 +02:00
Chris Adams b8f6e3736c Improve Flipable element unit tests
Ensure that the reported side is updated correctly due to a rotation
transform triggered by a state change.

Change-Id: I039c6bcba872c7731c810137551e760414fabc05
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 05:53:48 +02:00
Charles Yin 200f783745 Fix context2d transform issues
After calling transform related methods, the current path should be transformed with the same method but in reversal mode.
So that during painting, the painter will apply the CTM to this path again, otherwise path will be transformed twice.

Change-Id: I7e12bdff82dabb408f47152ba07b608872d4093f
Task-number: QTBUG-24988
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-30 05:18:32 +02:00
Aurindam Jana e5595f3dc1 QmlDebugging: Send parent debug id with object info
Change-Id: Ic197656b90a309d1d9e72b9d6648fee86164c3e1
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-29 11:06:54 +02:00
Chris Adams 53d5deb503 Use minimal javascript expression for bound signals
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>
2012-03-29 00:40:48 +02:00
Matthew Vogt e4baefacff Re-order imports statements to import nested imports later
Re-order the imports for a script by increasing order of URI length.
This ensures that an import of the type 'import X.Y' is processed
after the import of 'import X' which contains the type definitions for
the namespace X.Y.

Task-number: QTBUG-24369
Change-Id: I1b06e9d114a97c9f47279f8f33383a27e0efb4bb
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-29 00:36:49 +02:00
Kurt Korbatits 5de103291d Fixed unittests skipping for cross_compile option
- qmlmin, qqmlparser, examples unittests to skip source dependent
  tests when cross_compile option used as content not available.

Change-Id: Ieaadeff0c303f0a633b8a3cc506a764ea995cf42
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-29 00:35:32 +02:00
Michael Brasser 7f5bbcbc3c Replace usage of QCursor, and update hoverVisible test.
QCursor::pos() doesn't work well with mouse events generated by the test
framework.

Change-Id: I62ee2228c194f21cf17f6271c662056a90c5ef2d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 14:08:27 +02:00
Matthew Vogt 4d3ccce54a Warn on incompatible v4 binding object type
For QObject-derived properties, verify that the type of the source
object is convertible to the type of the target object, and report
an error for incompatible assignment attempts.

Task-number: QTBUG-24986
Change-Id: Ieece29a017222e48351cd433c1b2f9e2d93a5fd7
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-28 04:35:52 +02:00
Martin Jones 0ad4550ac0 Fix imports in GridView test
Were still importing QtQuick 1.0 and not checking whether the
components were created.

Change-Id: Ie42e5d1b3a134af39c62c5eb54a1d620c59cefee
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-28 03:10:21 +02:00
Martin Jones 4f08f48017 Section comparison should be case insensitive.
Allows use of mixed case model data without having to add a
special role just for sectioning.

Change-Id: I0a747e51542b5bf0f9db8fc2732882928a6cc676
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-28 03:10:14 +02:00
Julian de Bhal 7d1996c1f4 Fix qquicktext tests to use QQmlComponent not QDeclarativeComponent
Change-Id: I340e01b9fa6d77343f25180abaa021454c7a0767
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-28 00:20:54 +02:00
Pekka Vuorela fc1d66130b TextInput to use password mask delay if platform style defines one
Change-Id: I05b98db2d7855f29b11749524a74e04a71178347
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-03-27 16:03:16 +02:00
Bea Lam 19977e9686 Buffer changes received during layout()
Otherwise, changes received by a view during layout() may
override the changes that are currently being processed.

Change-Id: Iabc4db682f85ceb7d04c3f7442fb6c98ebdb94f1
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-03-27 09:46:00 +02:00
Miikka Heikkinen 9734187f9e Remove insignification from some fixed tests
These tests no longer fail on Windows, so remove insignification from
them.

Change-Id: Ic4fd2fa83a0f706c1cbd5299d5243f65c3251f93
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-03-26 13:45:29 +02:00