Commit Graph

3671 Commits

Author SHA1 Message Date
Kent Hansen c0f07d5707 Specialize for QJson types in the QObject meta-call binding
Avoid falling back to QVariant conversion; make the overload handling
consistent.

Also make the MaxSizeOf template helper class actually compute the
correct size needed for the argument storage.

Change-Id: I04afb378bd89743d542973cc3bb0ceb729b400d9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-26 10:30:57 +02:00
Matthew Vogt f29c5732f6 Remove relative directory elements in import paths
Avoid unnecessary conversions to/from QUrl.

Change-Id: If52e78cfdaf4fe344f34d961e300b21dd4a11fb2
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-26 03:33:13 +02:00
Aurindam Jana 87327515d7 Debugger: Change name and protocol of QDeclarativeObserverMode
Rename QDeclarativeObserverMode to QmlInspector service.
This is because the current protocol has been changed
completely and just a version change is misleading.

Change-Id: I3b72f081f6ab77eac474dcef7a84375ef69e20dc
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-04-25 14:26:42 +02:00
Kai Koehne e1583664fd Debugger: Fix warnings about declarative_debug in autotests
declarative_debug is deprecated and will be removed eventually.

Change-Id: I1f5a61c91c25e37ff39e9154bcaa3cd74d60e109
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-04-25 13:07:56 +02:00
Kai Koehne b70c84564a Debugger: Improve output of autotests
Change-Id: Ib938d2f39d8a0928c257ef923df5d5fcfa85c4cf
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-04-25 11:46:16 +02:00
Kai Koehne 05e57b7736 Debugger: Make sure stateChanged is called from debugger thread
Make sure stateAboutToBeChanged(), stateChanged() is always called
from the debugger thread. This matches how messageReceived()
is called. On exit, run an event loop until all stateAboutToBeChanged
calls have returned.

Change-Id: I9cd6199cc80552ad97e4b7d504ea91aa116a6a34
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-04-24 15:58:25 +02:00
Thiago Macieira bacc47f5a4 Mark all Latin 1 strings with QString::fromLatin1 or QLatin1String
This is in preparation of QString's constructor using UTF-8 by default

Change-Id: Ibd0a585342af572e3f74636deb97c1b6b3afeb9a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-24 14:33:07 +02:00
Matthew Vogt 5dac3d9f84 Verify that QML can reliably receive datetime info from C++
Since a JavaScript Date object does not contain any information about
the timezone in which it is specified, a C++ module that exports
datetime information to QML must also provide the relevant timezone
data so that clients can correctly interpret the datetime value.

Provide an example of exporting datetime information to QML, verifying
that the data can be correctly interpreted in JS.

Task-number: QTBUG-25262
Change-Id: I732797da225861470e6b034f2e3d89a43df36cf7
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-04-24 00:33:25 +02:00
Matthew Vogt a8e017fbc2 Record current status of date conversion from QML
Ensure that the qqmlecmascript test is not broken by changes in the
time zone of the test environment.

This test documents the existing situation with convertibility
of date information between QML and JS.

Task-number: QTBUG-25262
Change-Id: I42716e0b34ef26daa391fdb4aebc1f31340fcea0
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-04-24 00:33:00 +02:00
Matthew Vogt a36f220e15 Add support for var properties in V4
Support initialization of var properties in V4.  Var properties, which
can only be manipulated by V8, are constructed directly into the form
in which they will be stored.

Task-number: QTBUG-25022
Change-Id: I27c6af9f8a310e7baec91bef2593c8518ec1e462
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-24 00:32:45 +02:00
Chris Adams 6d2ed5d0b6 Add some component path canonicalization tests
Previously, no unit test existed to ensure that url canonicalization
worked correctly, which could result in two import statements using
relative paths to the same actual component triggering two separate
types being generated.

This commit adds a unit test with various relative-addressing and both
static and dynamic imports, to enforce type-consistency.

Change-Id: I7772e3c531069322d5fa44063cbf57a758ed3710
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
2012-04-23 02:05:22 +02:00
Kai Koehne 47927c1f53 Debugger: Improve autotest output on failure
Change-Id: Ia463b198b5d6dac8e480d141412cb4475e54d204
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-04-20 12:49:58 +02:00
Charles Yin 644f469cff Disable local storage if the standard data location is empty
Change-Id: I05ea7fa9521c807099b39e610f965a331e538f6e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-04-20 08:05:15 +02:00
Matthew Vogt b326c0dd5b Move data file to correct location
Change-Id: Iaf5363f6bd0a7983dc937e427131f6537a19b1c3
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-20 04:09:37 +02:00
Michael Brasser 955bac4940 Provide receivers count from QQmlData.
Change-Id: I70b06507158797df3083dc23a119935497aa19f4
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-04-20 04:09:37 +02:00
Matthew Vogt 092aba4d3e Split qquicklistmodel test into two parts
This long-running test was potentially being terminated by the test
framework for simply exceeding the maximum run time.

Change-Id: I7e1be44f25885ae869f05acbce3c0fb1c05f76a6
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-18 11:45:30 +02:00
Lars Knoll 7d3a56f3cf Merge remote-tracking branch 'origin/api_changes'
Change-Id: I39905acde16ba6bb0ba39401cb73082a73dd9167
2012-04-17 22:32:42 +02:00
Aurindam Jana 812997036a QV8DebugService: v8::AfterCompile Events
Do not send v8::AfterCompile events. This speeds up the
debugger.

Change-Id: I84f5d90e24878af42d514e5d26c9e051502605f6
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-04-17 11:10:04 +02:00
Girish Ramakrishnan bf55fe91ed Compile fix for qqmldebugservice test
Change-Id: I8efd3686521c3221be79f5bbf5e28a8ef2bb4e19
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-04-17 04:17:21 +02:00
Kent Hansen e5f45d9b57 Add QJson support to QV8Engine
Make QV8Engine perform direct conversion between JavaScript values
and QJson{Value,Object,Array}.

This implementation always makes a deep clone of the
QJson{Object,Array} when converting to JS; it might make sense to add
a lazy conversion scheme for dealing with large objects.

Change-Id: Id0b65891a19515ce22f1e51fa8a28d9f3e595271
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-16 09:25:06 +02:00
Matthew Vogt 82a3fef910 Add support for variant properties in V4
Support initialization of variant properties in V4.  Variants can
be set to contain basic types in V4, but we can't extract data from
them since they may contain data types that V4 does not comprehend.

Task-number: QTBUG-25022
Change-Id: I1935d77b50c5a3481c4c8ddd86b9d3d970571217
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-04-16 01:26:12 +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
Thiago Macieira 31c5b237c4 Update test after QUrl minor behaviour change
Changes required:
 - Uppercase the hex in percent-encodings
 - The tolerant decoder treats all % as broken if any one is broken
   (Input "%2B50%" is rendered now "%252B50%25", where previously it
   was "%2B50%25)

The extra test is just so we use QString first. If the test fails, we
get a nicer output from QtTest, instead of the hex dump it uses for
QByteArray.

Change-Id: I4c5cbfa3be962c648b50a69dc8bc3c4acc551e62
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-12 05:02:39 +02:00
Thiago Macieira 2d393ae042 Stop stuffing the URL "<Unknown File>" in QML errors
QQmlError already knows how to deal with source scripts with no URL
and it will use "<Unknown File>" when converting to a string.

QUrl in Qt 5 leaves the "<" and ">" characters encoded, which means we
ended up getting warnings about "%3CUnknown File%3E", which isn't
nice.

Change-Id: I504604fa37bb734549048432aaf9db3b1fa568d2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-04-12 05:02:33 +02:00
Lars Knoll a896d4b39e Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	src/qml/debugger/qqmlprofilerservice_p.h
	src/qml/qml/qqmlboundsignal.cpp
	src/qml/qml/v4/qv4bindings.cpp
	src/quick/items/qquickshadereffect.cpp
	src/quick/particles/qquickcustomparticle.cpp
	src/quick/qtquick2.cpp

Change-Id: Ia9c6517035ae912fa75e77473a452bd3383def56
2012-04-11 16:05:03 +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
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
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
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
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
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
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
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
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
Kent Hansen 24fb8dc27e Merge master into api_changes
Conflicts:
	src/qml/debugger/qqmlenginedebugservice.cpp
	src/qml/debugger/qqmlprofilerservice_p.h
	src/qml/qml/qqmlboundsignal.cpp
	src/qml/qml/qqmlpropertycache.cpp
	src/quick/util/qquickimageprovider.cpp

Change-Id: I0609aa5ed54c7769f1e2773a96a7cd43a69f133c
2012-03-27 16:56:14 +02:00
Michael Brasser 68ac4c57c4 Remove QObject parenting from QQmlAbstractBoundSignal.
Change-Id: If549cf57bbac18a986a2a0e63fdc76902d2dae43
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-26 07:24:29 +02:00
Michael Brasser fa3ef5376a Use QQmlAbstractBoundSignal where appropriate.
Prepare for the addition of another subclass.

Change-Id: I340f735503e661d9d735f3316a065f807294921b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-26 07:24:29 +02:00
Chris Adams d3bcce569f Add templated module api registration function
This commit adds a templated module api registration function which
allows clients to provide type information at registration time.
We use this typeinformation in V4 if available, in order to allow
module APIs to be used in v4 bindings.

This commit also clarifies the ownership semantics of QObject module
apis, and updates some documentation references which were missed
during the rename of Declarative to Qml.

Task-number: QTBUG-24894
Change-Id: Iebb61ca8d8eacbb15218549eab715e22f52a1474
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-26 04:55:30 +02:00
Michael Brasser d120c3c383 Support registered QFlags in QML methods and signal handlers.
Change-Id: I2a71122303dcf7af4f07c3ffb73456bcdce62a74
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-26 02:55:20 +02:00
Kent Hansen 0655209fda Merge master into api_changes
Conflicts:
	src/qml/qml/qqmlboundsignal.cpp
	src/qml/qml/qqmlpropertycache.cpp

Change-Id: I5193a193fa301c0b518291645bf626a5fa07118f
2012-03-23 14:31:47 +01:00
Michael Brasser 91f9f123eb Prevent the root object from being garbage collected.
Passing the root object as a return value from a C++ function could
cause the indestructible flag to be set to false.

Change-Id: Ib70c666f0d0ffbb48bca1996c2517fbccafa5dc1
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-23 08:04:08 +01:00
Kent Hansen c3babc03c9 Adapt to QMetaMethod::typeName() behavioral change for "void"
QMetaMethod::typeName() has been changed to return "void",
rather than an empty string, when the return type is void.

Change-Id: Ifc903ba60a06ffaefe27c94fe629698d64904d94
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-03-22 09:15:25 +01:00
Michael Brasser 8dbfddff68 Test unregistered local enums in QML methods and signal handlers.
Also make sure valueC and valueD are initialized.

Change-Id: I8ee78b7b779c37ca792300c7771ae9975f43d8bb
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-21 08:04:33 +01:00
Martin Jones 669cbe4e54 Add new line to last line of qquickfolderlistmodel.pro
Change-Id: Ia4baa8258b9ad40503abc0f88cb8e887b8f996a4
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-21 08:04:33 +01:00
Martin Jones 1343820682 Fix qquickfolderlistmodel includes
Change-Id: I74b1010207b66514d65a383db6e01d396006170f
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-21 05:18:35 +01:00
Chris Adams 4c9d326230 Allow literal enum to int property assignments
Previously, enum to int property assignments were considered bindings.
This commit adds support for assigning enum values to int properties
as enums.

Note that to use an enum in QML, it must have been declared with
Q_ENUMS or otherwise registered as a metatype.  Enum values from the
global Qt object are also usable.

Task-number: QTBUG-23403
Change-Id: I50db6cae54a24400ea472bde43619d547e4ceb78
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-21 05:18:35 +01:00
Andrew den Exter b2722ab31e Fix consistency of parsing ISO 8601 date strings.
Use the UTC timespec for strings with no time zone qualifier as V8 does
so we don't get different QDateTime in bindings depending on whether
the string was bound directly, or parsed by constructing a new JS
Date object.

Task-number: QTBUG-24895
Change-Id: I8f74dae418aaeeaf06df33fe58ab4e3e3fea791b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-21 04:05:38 +01:00
Michael Brasser 16c1928311 Support unregistered Qt namespace enums in QML methods.
This brings the support in line with signal handlers, which should allow
us to reuse the implementation there when appropriate. Also adds tests
for both registered and unregisted Qt namespace enums.

Change-Id: I366846626fc44d6d99b51e93fc9e3cb948c748f9
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-21 01:10:52 +01:00
Michael Brasser 37cd29b2ff Support (registered) non-local enums for signal/slot params in QML.
It's now possible to detect whether a registered type is an enum,
allowing registered non-local enums to be used as parameters in
signals and slots from QML/C++.

Author: Glenn Watson <glenn.watson@nokia.com>
Task-number: QTBUG-20639
Change-Id: I8c439f2dcc7bfd8ec31914b0c86cd3a1de3c038c
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-21 01:10:41 +01:00
Kent Hansen d96d89c63c Make QVariant conversion for JS null type symmetric
If you pass (void*)0 to QJSEngine::toScriptValue(), or you pass a
QVariant of type QMetaType::VoidStar containing a 0 value, you get
back a QJSValue of type null (isNull() returns true); that's fine.

However, if you called QJSValue::toVariant() on a JS null value, you
would get back an invalid QVariant. The expected result is a
QVariant of type QMetaType::VoidStar containing a 0 value. This
makes the conversion of the JS null type symmetric and avoids loss
of data.

Change-Id: Ifa6e788152118f80adf9c2d7be1283f053b44294
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-03-20 06:49:30 +01:00
Charles Yin 11741f9d77 Fix FolderListModel path issue on Windows
Task-number: QTBUG-24777
Change-Id: I819c2e07b23e8740f7570f117dafb2340f7c00e9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-20 05:37:59 +01:00
Michael Brasser 89c57d2859 Support null -> QObject and QObject -> bool conversions in v4.
Change-Id: I66602bf52986a388f9b6fe2bcd4630b862138906
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-20 05:37:59 +01:00
Matthew Vogt ab1e510121 Migrate gui dependencies from QtQml to QtQuick.
Ensure that users of declarative that have no need for functionality
provided by the Qt Gui module do not have to link against it.

Any use of QtGui functionality is delegated to providers that can
be installed by another library; QtQuick adds default providers
for this functionality when linked against QtQml.

Task-number: QTBUG-24559
Change-Id: I5e6a58a4198732dc2f8f52f71abfa1152b871aa7
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-20 03:15:43 +01:00
Matthew Vogt 610df5cdf8 Allow parent to be specified for Qt.createComponent
Add an optional parameter to the Qt.createComponent function which
allows the caller to specify the object that will become the parent
for the created component.

If the parent is not specified by the caller, it becomes the QML
engine; this behavior will change in the near future to allow
these component objects to be collected when no longer referenced.

Task-number: QTBUG-24840
Change-Id: I2742133fe8ab8cbc80d8012a9d9b9fc2e4596fca
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-20 02:58:26 +01:00
Matthew Vogt c5cd60a96d Ensure JS files imported inside modules work correctly
When a module exports functionality provided by a script, ensure
that imported script modules inside that script resolve correctly.

Task-number: QTBUG-24596
Change-Id: I3885dcc56946423f0d7cf00afdcdfaa0cb11967a
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-19 23:20:30 +01:00
Aurindam Jana 3a3515b5a7 QmlEngineDebug: Simplify the utility classes
Change-Id: Ie0e1b6e9edd6a09fef565635cc793f8bdb6c42e7
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:27 +01:00
Aurindam Jana 7f963aa41d QmlEngineDebug: Rename to QmlEngineDebugClient in AutoTest
Change-Id: If20b53d2e47cdc4ed54df0d9360ae1b0566489c6
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:15 +01:00
Miikka Heikkinen 37bd02abf1 Fix data file checkout formats in Windows for some declarative tests
Fixed by adding proper .gitattributes for the tests

Task-number: QTBUG-24780
Change-Id: If8de0161a377c21fb5c6327d69e8da84174ee435
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-19 16:58:21 +01:00
Kai Koehne 69835e0f34 Debugger: Always disable v4 optimizer if v8 debugger is activated
Don't rely on QML_DISABLE_OPTIMIZER environment variable being set.

Change-Id: Ib1a9d83eb9698adcd3c9a5bbcc74cba382836078
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-19 14:35:55 +01:00
Aurindam Jana bfedb27838 QmlEngineDebugService: Rename service to QmlDebugger
Rename service from QDeclarativeEngine to QmlDebugger.
Send a response for each query.

Change-Id: I01cfeaf3e4116bfd7029d170ee228c159973947c
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 14:35:54 +01:00
Kent Hansen 4821058f10 Merge master into api_changes
Conflicts:
	src/qml/debugger/qqmlenginedebugservice.cpp
	src/qml/qml/v8/qv8qobjectwrapper.cpp
	src/quick/util/qquickimageprovider.cpp
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

Change-Id: Ie78ba2fabd32f4812bcae9dbdd66ed289dc11dcb
2012-03-19 12:37:03 +01:00
Simjees Abraham e0e81d6f20 Debugger: Add optional 'host' argument to -qmljsdebugger
Change-Id: I5bb2e48e2ad2019b8a92f6f8842b88027fcd2d28
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 12:05:03 +01:00
Aurindam Jana 5c05f5df1f QmlDebuggingTests: Separate out public and private tests
Remove dependencies on quick-private from all
possible debugging auto tests and list them under public
tests.

Change-Id: I688b5b36fdf3d6fbcb6cef2a975ecd1bf679af2b
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 12:04:54 +01:00
Charles Yin b236cf6f41 Make qqmlinspector test work on Windows
Change-Id: Ib7399f9a005d3674fcb46c605cea3a8d40c21284
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-19 12:02:48 +01:00
Aurindam Jana cad5df2572 QmlDebugging: Object Tree and States List
All created instances are stored under the root context.
Check for the creation context of the object when building
up the tree. Do the same when building up the states list.

Change-Id: I8716d9966a61b8f7cb3ad4b7ab5acd4c94b4cd03
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 10:49:45 +01:00
Martin Jones af3a8708b4 When clearing an incubator also clear incubators it is waiting for.
If an incubator is cleared while waiting for other incubators
to complete also clear the incubators it is waiting for.

Change-Id: I83470920c0fd8a23d0098849192555f7478bb492
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-03-19 10:49:39 +01:00
Michael Brasser 20ffaaf297 Fix bug in v4 strict equality.
Change-Id: I184065e0b7c8c6536f2081b9bf03e98992a4c9fe
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-15 13:18:17 +01:00
Miikka Heikkinen 21e228afa7 Windows: Fix file URL issues in declarative autotests
Fixed by using testFileUrl() shared utility function where appropriate
instead of testFile() or various other ways file URLs were being
incorrectly used.

Task-number: QTBUG-24779
Change-Id: I48cbd297d419238f42ea45132344b7e5a487b6f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 11:25:36 +01:00
Martin Jones 31467e8649 Allow threaded compilation in an async Loader
Enables threaded compilation for a Loader "source".

Change-Id: I2d60a3ace07aab58f3b8f069e45a2864178c959f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-15 10:14:37 +01:00
Chris Adams 25793276e5 Fix crash caused by dereferencing collected v8 data
If a var property of a QObject is read after the v8 data associated
with the qobject has been deleted but prior to the DeferredDelete
event being processed, the varProperties array will be null and
a crash will occur.

This patch ensures that we check for this condition in both the
access and set codepaths for var properties, and also ensures
that an object which has previously been queued for deletion cannot
be referenced in JS.

Finally, it adds a unit test to ensure that we don't regress.

Task-number: QTBUG-24748
Change-Id: Idde384ca01e18f4dcf9e376e9379f2c5eb410e14
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 02:44:40 +01:00
Chris Adams 147247a31a Don't allow tst_QJSEngine or tst_QJSValue instance to be collected
Both of those unit tests currently change the ownership of the test
instance object, which could result in it being collected by the JS
GC and deleted if events were processed.

Change-Id: I5a9821fb56e19af1d52fea46e54755875dfbb29a
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 02:44:40 +01:00
Aaron Kennedy 5ae8caba10 Remove binding dependency on QQmlExpression
This is the first step to creating much lighter weight bindings that
are tuned for the specific scenario in which they're used.

Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 01:33:24 +01:00
Chris Adams b06108350b Ensure that dynamic property storing QObject ptr notifies on delete
Previously, when a QObject ptr was stored in a dynamic variant
property, the value of the property could change (to a zero ptr)
if the QObject was deleted without a notify signal being emitted
by the QDeclarativeVMEMetaObject which stores the property.

This commit ensures that such a notify signal is emitted correctly.

Task-number: QTBUG-23451
Change-Id: I5689abd984b177737f8d5f18950838b73ebde328
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-15 00:22:45 +01:00
Kent Hansen a27fd584df Let V8 throw the exception when QML property lookup fails
Only V8 knows whether a failed property lookup should actually cause
a ReferenceError to be thrown. When evaluating a "typeof" expression,
for example, a ReferenceError should not be thrown even if the
expression involves global variables that don't exist, according to
the ECMA-262 specification.

QML should try to match the standard JavaScript behavior. This is
achieved by simply returning an empty value handle (to signify the
absence of the property), and leaving it to V8 to throw an exception
as appropriate.

Task-number: QTBUG-21864
Task-number: QTBUG-24448
Change-Id: I9945adcab98fc3b801371163367473d6af0ab31a
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-14 19:49:35 +01:00
Miikka Heikkinen 8f077f28c5 Remove warning about missing file from parserstress test
There is no dummy.qml, so trying to find it will cause a warning
and return an empty string. Since the url is optional anyway and
apparently not relevant to this test, just use empty QUrl directly.

Change-Id: I11ba742dedccd6bdea226f680aa57c957afc7dc7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 17:58:22 +01:00
Miikka Heikkinen dfe32bec2d Windows: Mark several declarative test cases insignificant
These tests are marked insignificant for now to make CI runs pass.
Insignifications need to be removed once the related issues are fixed.

Change-Id: I3a1d36e5b17cf2f1b2f00b20b615359d96975f2b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 17:58:22 +01:00
Kent Hansen f91dba1274 Use the same ReferenceError message wording as V8
Instead of "Can't find variable: foo", use "foo is not defined".

This is in preparation of letting V8 throw the exception when a
property lookup fails on the QML scope object (needed for
QTBUG-24448).

Change-Id: I3c747482a8ef138dad9a85530a4f6b5c4c818a03
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-14 16:45:30 +01:00
Kai Koehne e1d688a237 Debugger: Print informational messages via qDebug
This allows users to use QT_FATAL_WARNINGS.

Change-Id: I114825764c841030418c956d23575159157dfd69
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 15:32:55 +01:00
Kai Koehne d6c666f73f Debugger: Fix autotest for shadow builds
Change-Id: I1b53afeb2a9f0d6e571c5ed87304e85896523488
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-14 15:32:55 +01:00
Kai Koehne 39327bbe38 Debugger: Fix autotests on Windows
Remove export macro logic for internal classes.

Change-Id: I4dfa7f8e7bc9b5086e01e40342bd00812d5966bd
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 12:52:58 +01:00
Luis Gabriel Lima b7f3138957 Fix AND expression in v4
The type of the and expressions, e.g. (a && b), were being assigned
to the type of the right hand expression (b). As reported in
QTBUG-24660, this approach could lead to some unexpected behaviors.

Now, when the left and right hand expressions are of different types,
the responsability to deal with the and expression is delegated to v8.

Task-number: QTBUG-24660
Change-Id: Ic42ebb035e62e2f197c337b2106d00453a99f04c
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 10:26:52 +01:00
Michael Brasser 665f860d9a Support module api objects in v4.
Change-Id: I72911a2c8e0a8613e53861da7b38312e51bf57da
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 01:12:35 +01:00
Jędrzej Nowacki 83f11e3374 Crash fix after QMetaType change.
QMetaType::UnknownType was added so we can distinguish between "void"
and an unregistered type.

Change-Id: If8cee21b3f84bf129343dc457d10ab31a9bfc8b8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-13 12:58:48 +01:00
Kent Hansen 7a5651b4f9 Make QFastMetaBuilder generate revision 7 meta-objects
Support for revision <= 6 will go away in Qt5.

This commit updates QFMB to match the latest format generated by moc:
  - Store string table as an array of QByteArrayData (literals)
  - Store only the meta-method name, not the full signature
  - Don't store parameter names as a comma-delimited string
  - Store explicit information about parameters (count, types, names)

Since the meta-data can now hold type ids > 256, there is no need to
store the names of property/parameter types at all anymore.

Change-Id: I487b14d22b2a92d9e6a9aa4e348f4bab181daff4
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-13 12:58:48 +01:00
Kent Hansen 4dd4c442e1 Adapt to Qt5 meta-object changes
QMetaMethod::signature() has been renamed to methodSignature(), and
it now returns a QByteArray. Also, the new function
QMetaMethod::isValid() should be used to determine whether a method
is valid, instead of relying on signature() returning a 0 pointer.

Where it makes sense, the existing code that was using signature()
and parameterTypes() has been changed to use the new API
QMetaMethod::name(), parameterCount(), and parameterType(int).

Also, in the new meta-object revision (7), the QMetaObject stringdata
member is now of type QByteArrayData*. QFastMetaBuilder will be
ported to generate the new format, but for now it's sufficient to
reinterpret_cast the stringdata assignment to keep it compiling.

Change-Id: Ie340ef17bcebc3afa4aae6450dfe2d06e4d881a4
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-13 12:58:48 +01:00
Aurindam Jana 69a1bf1648 QmlDebugging: Modify test JSDebug test cases
Add signals that are emitted on debugger responses for
flaky auto tests.

Change-Id: Ic59f559083b2b19fb8eec920dcb76f23125639a8
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-13 12:39:31 +01:00
Matthew Vogt 784555f303 Merge branch 'master' of git://gitorious.org/qt/qtdeclarative into merge-master
Change-Id: Iaefec13503dadfa200539b8de7a2d80fc5bb3bcf
2012-03-13 15:22:14 +10:00
Chris Adams fa9fcf2fb2 Fix crash when writing property after engine deletion
Previously, the engine pointer stored in a QQmlProperty could be
stale due to engine deletion.  This commit ensures we guard that
pointer.

Also reverts cbb7f8b10e

Task-number: QTBUG-24734
Change-Id: I5349c51fbd19fa46a8710280173c1d224358b96e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-13 05:13:50 +01:00
Chris Adams c71db2cf82 Fix leak in tst_qquicklistmodel unit test
Change-Id: I6883f263648d425240503f6abbd358b744d68506
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
2012-03-13 02:02:49 +01:00
Michael Brasser b021505843 Fix v4 nested object access bug.
Use the correct type to look up the sub property.

Task-number: QTBUG-24606
Change-Id: Iab372ca7440249241bf855d2875a947ad8fe4527
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-12 23:28:40 +01:00
Michael Brasser 31aa6012bf Add additional v4 tests.
Change-Id: Id33eb50e4a01f3450515f6e666e18cb018f1706e
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-12 23:28:31 +01:00
Lars Knoll 16e29f30e3 Remove unneeded dependencies to QtWidgets and QtOpenGL
Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-12 17:04:36 +01:00
Kent Hansen cbb7f8b10e Skip test that accesses deleted QML engine
The test is blocking the CI because it crashes on linux/x64.
By "luck" it doesn't crash on the other test machines -- valgrind
still complains, though.

Task-number: QTBUG-24734
Change-Id: I6bc12ca72f8900339bc9139b40cf828aff8e47ba
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-12 17:04:13 +01:00
Kent Hansen 255357541d Fix flakiness in qquicklistmodel autotest
The worker_remove_element test calls processEvents() before
calling waitForWorker(). It's possible that the worker actually
finishes during the processEvents() call. In such a situation,
waitForWorker() should return right away; otherwise it would
wait for 10000ms for a signal that had already emitted, and the
test would fail.

Change-Id: I8e98a3297cf5f360c1c405b1baa7524cc6593d81
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-12 17:04:04 +01:00
Matthew Vogt 1f52c54301 Merge branch 'master' of git://gitorious.org/qt/qtdeclarative into api_changes
Change-Id: I578b1e2f1bb374da6194e6ba04a0fd459b2632fe
2012-03-12 08:35:40 +10:00
João Abecasis 3c94c7eb7e Don't grow container when desired size is known
QList<Type>::reserve() is used upfront to allocate necessary memory in a one
go. This tells us straight away whether allocation is possible at all and
reduces re-allocations and consequent memory copies.

This also has the side effect that no spare memory is allocated, also allowing
up to (and including) INT_MAX elements to actually be stored in the underlying
QList, as long as enough memory is available to satisfy the allocation request
and subsequent fill.

The qqmlecmascript::sequenceConversionIndexes was changed to not attempt
INT_MAX allocations as, given enough memory and virtual address space, that
might succeed but take a really long time.

Change-Id: I4b0c965e9c23be78874343a70d7c155933c80903
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-09 21:26:40 +01:00
Michael Brasser 9ba6a3b21c Add autotest for v4 nested object bug.
Task-number: QTBUG-24606
Change-Id: I0909d60316f7213b21fc315e8a3d0a6124e84409
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-09 11:03:23 +01:00
Glenn Watson 88a6f771f2 Fix crash in listmodel when data is assigned incorrectly.
If a listmodel with static role types is created, it would crash
if a role was assigned a value type such as string, and then
subsequently assigned an array (sub list) value from a dynamic
meta object (created when using get() from JS).

Change-Id: Ibfd0b0b40be13b04103b49462cfae42a5c9f9fb9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-09 09:56:25 +01:00
Aurindam Jana 5c7b17379d QmlDebugging: Remove QQmlDebugClient
Remove QQmlDebugClient and relevant classes from the
library and move to client code.

Change-Id: I6f526b3f0c92970dcad5e5abd8585bb9b406349e
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-09 09:48:24 +01:00
Lars Knoll 616bbd1988 Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: I121cb9c9316b5e47476dcb982bc28b6f3f358f78
2012-03-07 22:01:11 +01:00
Kai Koehne 3f9b58c089 QML Debugger: Change prefix of warnings
Since we've been changing from QtDeclarativeDebugServer to
QQmlDebugServer anyway, we might as well change it to the more
readable "QML Debugger:" prefix.

Change-Id: I852577233d7cdb1f57adc43ec1b85a14d212574d
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-07 16:21:11 +01:00
Aurindam Jana 21e2a227b9 QmlDebugging: Revert the names of services
Revert the names of the services changed in
b855240b78 to
maintain BC.

Change-Id: I79826d92fd09c41e0020541b0c7bb77b5b2ecb1f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-07 13:14:52 +01:00
Kent Hansen aed15e7762 Make sure QML type "real" always maps to C++ type "double"
The type "real" was documented to be a single-precision float, but
that's incorrect. It's always been double.

However, signal parameters of type "real" would be mapped to the C++
type "qreal", which can be either float or double depending on the
platform.

Since JavaScript floating point numbers have double precision, QML
should use the same, to avoid potential loss of precision.

With this change, "real" behaves the same as the QML "double" type
(which already guaranteed double precision). Even though it's
redundant, "double" is kept to preserve compatibility.

Added tests for the "double" type to the QML meta-object autotest,
and a test for the "real" type that ensures there's no loss of
precision.

Change-Id: I1a77f1fd45082ff670684a935e17d1a46ea75d84
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-07 12:10:27 +01:00
Kurt Korbatits 65764c0334 Changed qml tests to work from install directory
- Changed tests to use TESTDATA
- moved qqmlcontext to private test as it contains private header
- added check for cross_compile option to skip when sources not available

Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-07 06:24:18 +01:00
Matthew Vogt 3bc907d155 Remove uses of QtGui symbols in QQmlEngine.
Move the code dealing with QImage and QPixmap out of QQmlEngine
and into the QtQuick library.  QQmlEngine remains the owner
of image provider resources, but does not use them directly.

Change-Id: I52083581394d9c308db446372883eb7479ccf807
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-07 02:33:24 +01:00
Chris Adams 92b1f9981d Allow function assignment to cause binding for non-var props
This patch maintains the old function-assignment behaviour for non-var
properties, and will be reverted soon.

Change-Id: I523e464501106616c51ff7478f7eb7171c1ca350
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
2012-03-05 10:06:48 +01:00
Chris Adams b6e78b3836 Improve support for var properties
This commit changes the semantics of function assignment in QML.
Previously, function assignment was interpreted as binding assignment.
Now, function assignment is interpreted as function assignment, and
therefore fails for all property types other than "var" properties.

To support imperative binding assignment, a new function was added to
the Qt object: Qt.binding(function) which takes a single function
parameter and returns a function object which will be interpreted as
an assignable binding expression by the QML engine.

Finally, this commit also slightly changes the semantics of var
properties in that the "special" JavaScript values of null and
undefined may be assigned to var properties, rather than being
interpreted as reset requests.

Task-number: QTBUG-21842
Change-Id: Iee99a878b9badf0fb76e983da7ebfa493f55ceb5
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
2012-03-05 09:01:47 +01:00
Matthew Vogt 0284817d6c Merge master <-> api_changes
Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
2012-03-05 11:39:54 +10:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported
by the quick1 module.

Users can apply the bin/rename-qtdeclarative-symbols.sh
script to modify client code using the previous names of the
renamed symbols.

Task-number: QTBUG-23737
Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-24 04:51:31 +01:00