Commit Graph

2279 Commits

Author SHA1 Message Date
Simon Hausmann ac57f185d1 Fix calls to overloaded slots for QObjects not created by QML
If we don't have a property cache, we need to fall back to a slower method of
determining the overload methods. We have the code for that in RelatedMethod,
once we determine that we're calling overloads, but we never hit that code path
because we did not _initially_ determine that the method was an overload.

Task-number: QTBUG-37157
Change-Id: I8ff39156e5668236b3797400b4086ed545624398
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 22:29:51 +01:00
Simon Hausmann 06479ddfe3 [new compiler] Add the correct object index to the custom parser
Without the correct index the calls to astForBinding run out of bounds. Fixes
tst_qqmllistmodel crash.

Change-Id: I6fb8b77866cbf247e7373cdbece6833c92be3615
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 22:29:27 +01:00
Simon Hausmann 16e70231d7 Add a column to the default method error message
This brings both compilers in sync by reporting line and column if doing a signal object
assignment without a default method.

Change-Id: I8b1bf90c4ce3cd7b117ad7eecdbfe319b07b1191
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 17:10:51 +01:00
Simon Hausmann 849de77470 [new compiler] Fix implicit component determination inside group properties
Don't only scan full-typed objects for property bindings that may define
components implicitly, do this for any types we know (propertyCache populated)
and that aren't explicitly of Component type.

Change-Id: I918b636be6d524e919cdd4efd49c33e63da64de3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 14:48:59 +01:00
Simon Hausmann bf47d66216 [new compiler] Fix evaluateEnum for custom parsers
When storing the string for a script binding - next to to the AST node - then
for expression statements skip the (potentially synthetically inserted)
semicolon. Its omission is required for the use of QQmlCustomParser::evaluateEnum.

Change-Id: I3b556fd6a884f5c9c290d7d793eeab4dd135343e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 14:48:49 +01:00
Simon Hausmann cf5c3d686d Fix debug output when tests fail
The tests with expected .errors.txt files support setting the DEBUG=1
environment variable to produce string output. Unfortunately "Actual:"
and "Expected:" were swapped in the output.

Change-Id: I2b378b0d9dcc6e513d82837abf9f8b0d5d7e1392
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 11:45:55 +01:00
J-P Nurmi 0b2d05093c QQuickWindow: fix content item size
Resize content item in QQuickWindow::resizeEvent() instead of using
signals and slots. The signal-slot connections were only established
when child items were added in QML. It should work in C++ too, since
QQuickWindow and QQuickItem are part of the public C++ API and using
them in C++ is a perfectly valid use case.

Resizing the content item in resizeEvent() is not only faster than
using signals and slots, but also in theory a bit more flexible as
one would be able to override the event handler and implement their
own layouting.

Task-number: QTBUG-36938
Change-Id: Id05d4cf6d547021803050633e6f0a3359129a9f3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-02-28 14:32:47 +01:00
J-P Nurmi 78cee4eb22 Fix tst_qquicktext::hover()
Task-number: QTBUG-36938
Change-Id: I28da25235ae7b8805ebc474777a5edd43ceef941
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-02-28 02:36:18 +01:00
J-P Nurmi 4693102d94 Canvas: do not emit paint signal when invisible
Task-number: QTBUG-31830
Change-Id: I23c6fc822547120f14c2d9a09f01a8f985745e2a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-02-28 00:02:44 +01:00
J-P Nurmi 24d5fe8113 Revert "Fix item polishing"
This caused items like positioners and itemviews to not
relayout or update as appropriate when items were hidden,
and therefore caused problems all over in eg. controls.

This reverts commits
- 43f983350a
- 01e609e9fa
- 439f31f128

Task-number: QTBUG-36954
Task-number: QTBUG-36934
Task-number: QTBUG-31830
Change-Id: If04cdce51206568c360a45e24efc0bd04764750b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-28 00:02:38 +01:00
J-P Nurmi 0e770a79a7 Mark tst_qquickpathview insignificant on OS X
Task-number: QTBUG-27740
Change-Id: I0dbf74b9fb8a4e7542d9d5b3c4f1d0516b04cd36
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-27 19:18:09 +01:00
Nils Jeisecke 1061c7e5cf Make GridView/ListView attached "view" property available to all delegate types
This is useful for accessing the view (e.g. "width", "cellWidth", ... properties)
from within section (ListView only), header, footer and highlight delegate components.

A typical usecase are components that are used in multiple views and therefore
cannot use the views's id for access.

The only attached property valid for those non-item delegates is "view". This
has been added to the documentation.

Change-Id: I33d976da778be23ed531a3b193ceee95ed9800d2
Task-number: QTBUG-32836
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-02-26 09:19:23 +01:00
Michael Brasser 7d25db8ff4 Fix global object handling in worker script JS files.
Task-number: QTBUG-36874
Task-number: QTBUG-36881
Change-Id: Iacf4807dd37862e792ad1ba4ce540a6d48f1e495
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-25 20:01:12 +01:00
Shawn Rutledge 360a51efbe tst_qquickpathview: show window before flicking
It's uncertain whether this caused any actual CI failures, but other
tests show the window first, and this one tests interactive
functionality so it makes sense that it should be visible.

Change-Id: I92c26ce596f556765917409ca4e9037bdaccfa23
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-25 17:08:02 +01:00
Gunnar Sletta aaea23708a Introduced a few more signals to QQuickWindow.
Also marked the new afterAnimation() signal as \since 5.3 and
introduced proper revisioning on the new signals.

[Changelog][QtQuick] Added QQuickWindow::afterSynchronizing(),
openglContextCreated(), sceneGraphAboutToStop(). Useful for
deeper integration with the rendering.

Change-Id: I5532b310506c2432325595e55ef9307b8934abee
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-25 17:08:02 +01:00
Lars Knoll cad3ba5fd4 Clean up our internal namespaces
QQmlJS::MASM -> QV4::JIT
QQmlJS::V4IR -> QV4::IR

Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-23 09:39:52 +01:00
Jan Arve Saether 109889428e Update QQuickTextInput's baselineOffset when only height changes
Task-number: QTBUG-36529

Change-Id: I2cd577013c4965e76c9350abaebb9b7a6e4e0270
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-02-22 03:00:37 +01:00
J-P Nurmi db32813a86 QQuickTimeLine: add missing time checks
The same check is done in QQuickTimeLine::pause(), move() and moveBy(),
where the time is passed as an argument. QQuickTimeLine::accel() and
accelDistance() calculate the time based on velocity and acceleration
or distance. With tiny values this calculation can result to a negative
time due to integer overflow.

Task-number: QTBUG-35046
Change-Id: I000e73d3f787375946e8f87a5d24153ae919bc8d
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-02-21 18:55:31 +01:00
Gunnar Sletta c6c95915f0 Make sure we update filtering options on atlas textures.
We had had an optimization which tried to reduce state changes,
but filtering is also changed in QSGTexture::updateBindOptions
which Atlas::bind() didn't know anything about. Solution: don't
try to be so clever.

Task-number: QTBUG-35457
Change-Id: I39ac0106396921e1b652db2b2aa5a9923b35e825
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-02-21 06:39:34 +01:00
J-P Nurmi 43f983350a Fix item polishing
After "Dont call updatePolish if an item is not visible" (439f31f) and
"Fix polishItems bug" (01e609e), desktop style animations for QtQuick
Controls were no longer running. This was because QQuickItem::polish()
no longer polished a _visible_ item when there were other _hidden_
items in the queue to be polished.

This change restores the old logic that QQuickWindow only keeps track
of visible items to be polished, whilst the idea of hidden items not
being polished still remains valid. QQuickItem is made responsible
for polishing itself if necessary when it becomes visible.

Task-number: QTBUG-36934
Change-Id: I4d48d3a3e2c841d337cd52ec4fd27092f84a8626
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-20 21:25:32 +01:00
Laszlo Agocs 6df89c3b9d Add a signal for syncing external animation systems
[ChangeLog] QQuickWindow will now emit the afterAnimating() signal
from the gui thread before each scenegraph sync request.

Change-Id: I4897c82f75066238e781455d4fce4fb6bbe2558e
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-20 12:51:38 +01:00
J-P Nurmi 691469c05c Fix ListModel::setProperty() to accept date roles
Task-number: QTBUG-33564
Change-Id: Ifbc1c5014d41b26223c57fafdc616e9b4ddee5b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-02-20 12:45:41 +01:00
Michael Brasser bd510dfa02 Ensure Behavior stops animating when a new value is set while disabled.
Otherwise the Behavior could cause the property value to end up in an
unwanted and inconsistent state. For example, in the following case:

x: myXValue
Behavior on x { NumberAnimation {} }

x could end up *not equal* to myXValue if myXValue was changed while
the Behavior was still animating but currently disabled.

Change-Id: I3826fdc3f48b2722e778638b116546db7e831e87
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2014-02-20 04:27:24 +01:00
Simon Hausmann 2528fce0a8 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-18 10:02:27 +01:00
Simon Hausmann 3c0bf1c0a8 [new compiler] Fix error reporting null object group property access
The new code path reported line and column, the latter was missing from the old
code path and is easily added.

Change-Id: I730e56f0fe4e99091dfb10e5f601faf1d3b8949c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-18 10:01:48 +01:00
Simon Hausmann ba9ca0e3d6 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/qml/jsruntime/qv4functionobject.cpp
	src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h

Change-Id: Id164f6c3b45501aa466908659ec4e3b957323753
2014-02-18 09:58:57 +01:00
Simon Hausmann 2f3f19e6f7 Prospective iOS build fix for tst_qqmlmoduleplugin
Include unistd.h for _PC_CASE_SENSITIVE

Change-Id: I0c57d7d84fa4c7379502dbf95fd22476724d5fa3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-16 16:06:31 +01:00
Ulf Hermann 8609402bd7 Test case for V4 profiler and its adapter
Change-Id: I64af195a16189cd1306ca80d13c0ef002fa31f59
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-13 10:43:07 +01:00
Ulf Hermann eb8a091457 V4 profiler adapter
This adapter attaches the V4 profiler to the QML profiling
infrastructure.

Change-Id: Ifaf77a3ba0790bc56d4b155260b0e05593ac799e
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-13 08:18:59 +01:00
Ulf Hermann eeaba26596 Infrastructure for supporting multiple profilers in qqmlprofilerservice
The concepts of "global" and "engine" profilers are introduced. Profilers
can either be attached to specific QML engines and run in their threads
or they can be unspecific global profilers running in arbitrary threads.

Change-Id: I3862fc65c07ccb33a1ca08cd2425e4079d3ffc02
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-13 08:18:42 +01:00
Jani Heikkinen 0b4e717f17 Disable Flickable tests on Mac OS X.
Task-number: QTBUG-36804
Change-Id: I6bff9360d785bd7496131e3b56a24b11871257fe
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-13 06:34:55 +01:00
Simon Hausmann a6a3fa309a Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-12 14:14:58 +01:00
Mitch Curtis 8730085fe4 Expose Qt Quick gradient conversion code privately.
Rectangle is currently the only item that supports gradients, but other
items have been introduced (within Qt Quick Enterprise Controls) which
need QQuickGradient => QLinearGradient conversion, and it doesn't make
sense to duplicate the gradient stop conversion code.

The QQuickGradient and QQuickGradientStop classes need to be privately
exported so that modules that use private Qt API can use the classes
with quick-private.

Change-Id: I8b130ff5384d9481d3f29510b3de61f7d8f775e2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-12 10:34:50 +01:00
Gunnar Sletta 15999f14f1 Add Image::mipmap to support mipmapping of images.
[ChangeLog][QtQuick] New feature: Image.mipmap

Task-number: QTBUG-19961

Change-Id: I13acb2408d5b126790adaf9d324ad4beda1e3646
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2014-02-12 09:24:40 +01:00
Gunnar Sletta 4cf4d18b98 Disable Flickable tests on Mac OS X.
Task-number: QTBUG-36804

Change-Id: Ic38e4172f4a6978ad4e9b9a460106cadaaaeff3a
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-12 09:24:25 +01:00
Jan Arve Saether f9bafac9ef Fixed wrong baseline alignment for TextInput
[ChangeLog][QtQuick][Fixed wrong baseline alignment for TextInput]

Task-number: QTBUG-36749
Change-Id: I6920fb0681f30d9e9943d1bd01f76cc3ae204f30
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-02-12 09:06:29 +01:00
Simon Hausmann 7c9497a6d4 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/qml/jsruntime/qv4arrayobject.cpp
	src/qml/jsruntime/qv4context.cpp

Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
2014-02-11 12:00:31 +01:00
Frederik Gladhorn 024c81a58d Fix memory leak in test
Change-Id: I026ce85a6e593d5eccecdf032ee2f0763a2bef87
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-02-11 00:24:08 +01:00
John Brooks 8efc7c190b Fix origin for short reversed item views
Reversed (BottomToTop and RightToLeft) item views would report an
impossible positive value for origin when contentHeight < height. The
correct value will be effectively equivalent to the position of the
footer, and always negative.

Match other logic using lastPosition() by negating its value for
reversed views.

This fixes a bug with content disappearing in a Controls ScrollView on
a BottomToTop view.

Change-Id: Ieedbb64ce8fc7c0fb36e5256e437ddeb3e757761
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2014-02-10 23:15:36 +01:00
Ulf Hermann 67ba88947f Add a debug service for controlling qml engines
Like this we can control the starting and stopping of qml engines from
the client without having to extend each of the other debug services.

Change-Id: I5f1c077b6cfa0e628c32e8bcdea2ec053e310509
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-10 14:28:26 +01:00
Simon Hausmann 77686f3b94 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-07 17:46:39 +01:00
Simon Hausmann fbada9b1c1 Skip mysteriously failing test for now
Task-number: QTBUG-363717

Change-Id: I0085cd7d5bb2b964c8701e061f897926b30cfac0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-07 17:46:37 +01:00
Simon Hausmann 7f0faa7fb5 Fix exception thrown in slot without Qml Engine
Don't crash when an exception is thrown in a JS slot but we don't have
a Qml engine.

Change-Id: I1530d5c1c8cb9b9b33b9fdd0d45639fd4a0516f7
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-07 14:40:41 +01:00
Simon Hausmann 5dc7649f5a [Regression] Fix lazy binding evaluation
Commit 04774bb14c long time ago introduced the
concept of fixed order binding initialization with lazy evaluation, where a bit
is reserved for each binding that indicates whether it's been initialized the
first time or not. When reading a property on a QObject, we'd check if the
corresponding binding for the property has been initialized or not and flush
(i.e. execute) the binding if necessary.

As part of the V4/V8 clean-up, commit 1eb4120094
removed the StoreV8Binding instruction, which made the call for setting the
this-binding-is-not-evaluated-yet bit. Nowadays we only use StoreBinding, for
which this optimization was never implemented (and not needed really). Now that
we have a unified JS code path, we need to set the pending binding bit and also
make sure that we call flushPendingBinding for any JS side property access
(accelerated or not).

Also flushPendingBindingImpl had two bugs:

   * In an attempt of trying to find the binding to flush, it could happen that
     we'd try to flush a previously destroyed binding (m_mePtr is null), so
     the b variable would remain the first binding in the object and we'd flush
     the wrong one (instead of none). Added a missing check to verify that the
     property index matches.
   * Also resetting the mePtr must be done through clear(), to ensure that the
     pointer in bindValues in the VME is also cleared, to avoid re-enabling the
     same binding again in complete();

Task-number: QTBUG-36441

Change-Id: Icdb0c8fb036051fd5d6c4d33b10cd0c0ed9a9d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-06 13:53:31 +01:00
Simon Hausmann 37019a96db [new compiler] Fix propagation of imported scripts for anonymous components
We must take the imported scripts from the creation context. Fixes various
errors in Qt Quick Controls.

Change-Id: I336d8ffa0537cefd4eeac15f98bbf1b0a5c784af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:48:26 +01:00
Simon Hausmann 48144d3b29 Fix canvas tests after commit 439f31f128
We must make sure that the canvas is created somewhere in the item hierarchy of
a scene-graph initialized (thus visible) window. A Window { visible: true }
type of item is not sufficient, but we can simply use our testcase as
parent/associated item, because that one is equipped with a when: windowShown
condition.

Change-Id: I67a65208fae1a6fd953493eaa2898a324a6cc917
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-04 14:45:33 +01:00
Ulf Hermann 33d5e6996f Set breakpoints before connect() in JS debugging unit test
connect() starts the JS engine. Any break point set after that may be
missed because the engine has already passed its location when the
breakpoint request arrives. The problem can easily be visualized by
inserting an artificial delay (e.g. sleep(1)) between connect() and
setBreakpoint().
I'm also removing a piece of dead code that gets that wrong and has
never actually worked.

Change-Id: Ie4410ac3eaf89f02993c653b17148c14048652ab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-04 12:52:22 +01:00
Simon Hausmann 5d8a642f21 [new compiler] Fix error message when assigning lists to singular properties
Also adjust the error message for the other compiler when trying to assign
lists to script strings.

Change-Id: I50f833c340f3634a59c5b36f30aeafc53003e65e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-03 14:38:12 +01:00
Liang Qi 7c1e3dea8b Revert "Skip unstable test"
This reverts commit 8e0c5b59f5.

This test doesn't fail any more.

Task-number: QTBUG-23976
Change-Id: I77704e7811c4c335cb5836ba7645a8804c13e12d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-03 06:07:37 +01:00
Gabriel de Dietrich ae19cdacbe alloca() is declared in stdlib.h on BSD systems
... except on Darwin.

Bonus change: Updated auto-tests trying to include 'alloca.h'.

This is a follow up on 24c43a5748.

Change-Id: I299de00bf0dca7842470b158282daea221a10f2d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-02 14:29:07 +01:00