We cannot use dynamic_cast in Qt.
Change-Id: Ia6aeeb2439ca8c24239dce7cff55a0c18860e43e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The screen property can be used for both setting the initital screen, and
for reading out the current screen, so 'targetScreen' was not an ideal
name for this property.
Change-Id: I1b617085b1e8e0e437355740be5d3cee9379c47f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
With the ANGLE update in 5.7 the root cause may have been fixed.
Task-number: QTBUG-42967
Change-Id: Iec2faf5b7f5ed2c5f116a9c10ce35ed704c46d31
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Furthermore, some of the ES6 tests do check for this behavior (this
fixes at least 9 of the tests in /test/built-ins/Object/, maybe more
elsewhere).
createMutableBinding used hasProperty(String*) to determine whether or
not it needs to actually define a property, which checks the prototype
chain.
This would be fine, but when writing values to properties, we used find() on
the InternalClass (which is equivilent to Object::hasOwnProperty), which
would fail as the property doesn't "really" exist on the object, it's somewhere
in the prototype chain. Thus, we'd incorrectly throw an exception in strict mode.
I see no regressions in ES5 from this change.
Change-Id: I3b097306f220a891955ec11eea860264746bc0ee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* getPrototypeOf: Per 19.1.2.9, we should ToObject(O), and ReturnIfAbrupt
* getOwnPropertyDescriptor: Per 19.1.2.6, we should ToObject(O), and ReturnIfAbrupt
* getOwnPropertyNames: Per 19.1.2.8.1, we should ToObject(O) and ReturnIfAbrupt
* seal: Per 1.9.2.17, if Type(O) is not Object, return O
* freeze: Per 1.9.2.5, if Type(O) is not Object, return O
* preventExtensions: Per 19.1.2.15, if Type(O) is not Object, return O
* isSealed: Per 19.1.2.13, if Type(O) is not Object, return true
* isFrozen: Per 19.1.2.12, if Type(O) is not Object, return true
* isExtensible: Per 19.1.2.11, if Type(O) is not Object, return false
* keys: Per 19.1.2.14, we should ToObject(O), and ReturnIfAbrupt
This improves the ES6 passrate for test/built-ins/Object/ quite a bit, before:
=== Summary ===
- Ran 6144 tests
- Passed 5719 tests (93.1%)
- Failed 425 tests (6.9%)
After:
=== Summary ===
- Ran 6144 tests
- Passed 5769 tests (93.9%)
- Failed 375 tests (6.1%)
... and also fixes numerous tests in other areas. Most of the missing
failures seem to be down to missing Object.assign & Symbol. It does regress on
some ES5 tests that specifically check for the ES5 spec behavior.
Change-Id: I039a223060c79c5bf4f5b041ad1ec4dc1afd5932
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Quoting 20.3.4:
The Date prototype object is the intrinsic object %DatePrototype%. The Date
prototype object is itself an ordinary object. It is not a Date instance
and does not have a [[DateValue]] internal slot.
Aside from Symbol failures (which we expect, because we don't have a
Symbol implementation at this time), Date.prototype only has these two
failures left in ES6:
setFullYear/new-value-time-clip in strict mode
setFullYear/new-value-time-clip in non-strict mode
setMonth/new-value-time-clip in strict mode
setMonth/new-value-time-clip in non-strict mode
These seem to be related to handling of overflow conditions.
Change-Id: I0b7f65fbef3f709ff56ecfc8e5a5d5cf974b7515
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't return -0 from TimeClip (20.3.1.15, 1)
* Mark length configurable (19.2.4.1)
* toUTCString and toGMTString must be the the same object (B.2.4.3)
Brings us a bit closer to passing tests. Still some failures in other
areas.
Change-Id: I905216b8653ac0b33cb27e6b773616521fbb5daa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In ES5, these were not configurable, but ES6 changed the behavior.
For length, refer to:
9.2.4 (FunctionInitialize)
17 (ECMAScript Standard Built-in Objects):
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
19.2.2.1 Function.length
19.2.3.2 (Function.prototype.bind)
19.2.4.1 (Function instances, length)
For name, refer to:
9.2.11 (SetFunctionName)
This does regress test262 for ES5 for me a little, but improves our es6 test
coverage a bit (~682 more tests pass, +1.5%).
Change-Id: Icda7c9068dc3e6e4e4aebbb0d359868a30343013
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We also tie this up to the existing skeletal "const" support so that they
are also checked for duplicate declarations.
While we do that, change from using a boolean to an enum so we make the scope of
a declaration a little more easily comprehensible.
Change-Id: I6a6e08aed4e16a53690d6f6bafb55632807b6024
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Spec 13.3.1.1 (Static Semantics: Early Errors) says:
It is a Syntax Error if the BoundNames of BindingList contains any
duplicate entries.
Only let/const are supposed to be treated in this way, so we ensure that
one of them has been marked read-only (since we don't support "let"
yet).
There's still no runtime check on assigning to a constant-declared variable.
[ChangeLog][QtQml] "const" variable declarations now throw a SyntaxError if
multiple attempts to declare the same variable name are found. Note that
"const" is still not fully spec-compliant (i.e. reassignment at runtime is
not disallowed).
Task-number: QTBUG-58493
Change-Id: I31fd5f2bf3e79d48734e8ecb714c4e7f47e31d2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This seems to match up with the spec behavior. 13.3.1.1 (Static Semantics:
Early Errors) says:
It is a Syntax Error if Initializer is not present and IsConstantDeclaration
of the LexicalDeclaration containing this production is true.
In addition, we also allow "const" to be used in JS mode too. We don't
yet fully support the semantics, but as it's there, why not let it work.
[ChangeLog][QtQml] "const" variable declarations are now available in JS
as well as QML mode.
[ChangeLog][QtQml] "const" variable declarations now require an
initializer, bringing them closer to the required spec behavior.
Task-number: QTBUG-58493
Change-Id: Ife5d5979b3e7a5d7340bf04f43605f847ee25ee2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is C++ API to get the actual storage path for a particular database.
[ChangeLog][QtQml] Added QQmlEngine::offlineStorageDatabaseFilePath(dbName)
to allow getting the actual storage path for a particular database.
Task-number: QTBUG-52013
Change-Id: I1cbd9454c537f08c97f4dafc06fd6b14e81c51af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
mouseDrag(item, x, y, dx, dy, button, modifiers, delay)
in TestCase.qml adds intermediate mouseMove events if dx or dy
is too large (specifically if Math.round(dx/3) > dragThreshold)
and that is affecting the outcome of this test. So we need to
stay under that threshold. The original point of this test is from
f52227f66a / QTBUG-30188 :
when you drag past the dragThreshold, and the dragged Item "breaks loose"
and starts dragging, the initial distance that it jumps should be
equal to the dragThreshold, not greater. To test it, we need
to move a distance which is greater than the dragThreshold in
one move event, not break it up into smaller movements.
This reverts commit 432eb3344b.
Task-number: QTBUG-58025
Change-Id: Ib6da69fb465b58fde1bf8ba56c4c3a1cb584f698
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This provides a way to determine which font will actually be
used to presenting the text, which can be especially useful when
not using a fixed size font (the font info will then expose the
actual font size used by the Text element.)
[ChangeLog][QtQuick][Text] Added fontInfo property to Text type,
providing a way to query properties of the actual font used
for presenting the text.
Task-number: QTBUG-51133
Change-Id: I5860fb1bd25ac5734713f49c8482428f2d531d22
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
This fixes a regression caused by 9c50216c7b
when the Image specified fillMode: aspectRatioCrop/Fit.
[ChangeLog][QtQuick][Image] Item::grabToImage on an Image element will now work
regardless of the Image's sourceSize or cache properties.
Change-Id: I225854c48f0c35a3cb2ef0dd56bf51bd88c31779
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
We didn't have resolution of composite types previously, which is a
prerequisite to do more exciting things with QML types in JavaScript
(such as instanceof).
By deferring the resolution to QQmlImports, we can avoid the need to
fill the cache with types that may not be needed, while still finding
types which are requested.
In the future, we could consider removing the "special" handling for composite
singletons as they should be found through QQmlImports now. If we do
that, we may still want to cache the QUrl for the types, to avoid using
QQmlImports too often directly, as it is a little slow itself.
This change doesn't regress tst_compilation.
Task-number: QTBUG-24799
Change-Id: I9ba2e4829ca49008fd180fb488c586475cf90674
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
As I'll be touching QQmlImport, it would be good to ensure it doesn't
regress. This may also be useful for future such changes (e.g. I want to
try play around with how the implicit import is handled).
Results for me on a recent dev snapshot, 2013 rmbp:
********* Start testing of tst_compilation *********
Config: Using QtTest library 5.9.0, Qt 5.9.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 8.0.0 (clang-800.0.42.1) (Apple))
PASS : tst_compilation::initTestCase()
PASS : tst_compilation::bigimport(10, qmldir)
RESULT : tst_compilation::bigimport():"10, qmldir":
3.6 msecs per iteration (total: 59, iterations: 16)
PASS : tst_compilation::bigimport(100, qmldir)
RESULT : tst_compilation::bigimport():"100, qmldir":
54 msecs per iteration (total: 54, iterations: 1)
PASS : tst_compilation::bigimport(1000, qmldir)
RESULT : tst_compilation::bigimport():"1000, qmldir":
558 msecs per iteration (total: 558, iterations: 1)
PASS : tst_compilation::bigimport(10, noqmldir)
RESULT : tst_compilation::bigimport():"10, noqmldir":
5.0 msecs per iteration (total: 80, iterations: 16)
PASS : tst_compilation::bigimport(100, noqmldir)
RESULT : tst_compilation::bigimport():"100, noqmldir":
58 msecs per iteration (total: 58, iterations: 1)
PASS : tst_compilation::bigimport(1000, noqmldir)
RESULT : tst_compilation::bigimport():"1000, noqmldir":
558 msecs per iteration (total: 558, iterations: 1)
PASS : tst_compilation::cleanupTestCase()
Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 22400ms
********* Finished testing of tst_compilation *********
Change-Id: I7159e561fb13a3c48e966d5b963dc0ef1ca783e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This saves QQmlImport from some unnecessary bad lookups when finding
types (due to classname being misinterpreted as belonging as a
component).
Change-Id: I36e622e357e55e98a5af46911709640c5d8fa291
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Obviously, if the animation still hasn't stopped, we cannot expect it to
fail on the next QTRY_COMPARE, since that might wait until it then passes,
thus CI will log that as an XPASS.
This failed during CI run for MSVC 2015:
XPASS : tst_QPauseAnimationJob::multipleSequentialGroups() QCOMPARE(((group.state())), QAbstractAnimationJob::Stopped) returned TRUE unexpectedly.
tst_qpauseanimationjob.cpp(396) : failure location
Change-Id: I25151123b8fc2617f2a4d3690215e6a1ed2856ff
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Since I'm working on this, it is nice to have some simple verification
that things are working. I don't expect this to provide full coverage,
but it should at least make sure that the basics are ok, and nicely
provides a place to put further tests if it ever somehow breaks.
Change-Id: If91154dee836cc514515bde122e48b271de22676
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
They are moved from qtquickcontrols:tests/auto/controls in 3437fd56.
Task-number: QTBUG-58294
Change-Id: I281d4e505b2f699154dd4efb7a4601bdf3856295
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Both QQuickPathLine and QQuickPathSvg inherit QQuickCurve class which
has “x” and “y” properties that return qreal type, but internally they
are stored as QQmlNullableValue<qreal>. At the same time, if any of them
is not specified explicitly, its getter returns 0.
QQuickPath processes QQuickPath%Type% objects and produces a
QPainterPath which later used by QQuickPathAnimation.
QQuickPathAnimation only created a QAbstractAnimationJob if
QQuickPath::hasEnd returned true, and hasEnd returned true only if both
“x” and “y” were specified explicitly.
All that in conjunction led to the situation when if you had either
- a PathLine with unspecified “x” or “y”; or
- a PathSvg
which was the last (or the only) path element in your Path,
PathAnimation would not start.
This patch removes hasEnd check, it should be safe to do because
QPainterPath is always valid anyway due to the fact QQuickCurve::x()
and QQuickCurve::y() return 0 if they have not been not explicitly set.
Task-number: QTBUG-57666
Change-Id: Id320aaeb5aff0964d6493b7b80d5d9a7d36acce8
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Useful for running a test tree against different qmljs or if qmljs is
outside PATH.
Change-Id: Ibaa24a15d32b21f9293db2c042fe3f1de3bb75eb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We don't exactly know when the animation speed is actually set and the
system clock may play tricks on us. Consider the test failed when the
wrong animation speed is witnessed 3 times in a row and successful if
the correct one is witnessed 3 times in a row. Also, make sure we don't
confuse lines from different hits of the timer.
Task-number: QTBUG-58186
Change-Id: Iaa2c35f723a92f32131e36084399b3d32accb7d0
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
After commit 0e3380f9c6 we wouldn't crash
anymore, if QJSValue::UndefinedValue was provided as value for a
QJSValue C++ signal parameter. However that was not a complete fix for
the regression of commit aa869cbb06, as
other primitive values stored in QJSValue as QVariant were not
converted, so for example QJSValue(42). So let's fix this once and for
all by using QJSValuePrivate::valueForData, that handles all types of
QJSValuePrivate encodings.
Task-number: QTBUG-58133
Change-Id: Ib7c0461b18df6260ccd4bce729ae2348281eb7f3
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
qmlInfo predated info-level messages in QtCore, and as such previously sent
warning-level messages despite the unfortunate naming. Now that we have
an actual qmlWarning function, and we have switched our code to use it,
we can change qmlInfo's behavior to better match the function naming.
This does have the impact that existing qmlInfo callers will
basically need a s/qmlInfo/qmlWarning/g to retain the same QDebug level in
user code, but I feel that this behavior change makes sense given the better
consistency with C++-side QDebug we attain.
[ChangeLog][QtQml][Important Behavior Changes] qmlInfo now reports messages with
a QtMsgType of QtInfoMsg instead of QtWarningMsg. To continue to send warnings,
callers should migrate to the newly-introduced qmlWarning function.
Change-Id: I16c88d94377b5956eb6921b64af7c84d1ca024f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The last remnants were removed from qtbase in 5.7 making this all dead code,
so match here too.
Change-Id: I10f3f1c614562f2a97ade7cdf5002065d6f79e07
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Previously flicking was restricted to the orientation of the ListView.
[ChangeLog][QtQuick][ListView] Made it possible to enable horizontal
flicking in a vertical ListView, and vice versa. The only thing apps
must do is to specify the desired flick direction and the content
width (vertical ListView) or content height (horizontal ListView),
which is not calculated by ListView.
Change-Id: Ic370e57f5d18679940d48e7a2c20c200b2ef36d1
Task-number: QTBUG-52553
Task-number: QTBUG-56501
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
qtdeclarative hasn't relied on qtwebkit for a long time (since
fbfb27a44a &
56d34a653a as early as 2011!).
Change-Id: If02572617034bf2c3eecbf081b96b1ed0ad65b45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Picture the following application:
QQmlApplication qAppEngine("main.qml");
With main.qml:
...
AComponentInTheSameDirectory {
}
...
This was failing, with the error:
file:main.qml:13 AComponentInTheSameDirectory is not a type
Which is wrong, but also reveals the root cause in that the
original filename was not a fully resolved path.
Change-Id: Ifc5557cc43f4bb92fd121ea9f7a37f09b3b38a9b
Reviewed-by: David Faure <david.faure@kdab.com>
These tests were blacklisted after QtSvg/4bd5d6ced07d2d0e643a13e7cebb228c521d2046.
in order to integrate qt5.git. Now, fix the tests to match the new
behavior, and remove the blacklisting.
Task-number: QTBUG-58082
Change-Id: I77abe995095ee52978c5957e49e1547b3af7708b
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Item views and positioners all have now forceLayout(), so make the
Text element API consistent with them. The old doLayout(), which
sounds more like an internal helper method, is deprecated and marked
for removal in Qt 6.
[ChangeLog][QtQuick][Text] Deprecated doLayout() in favor of
forceLayout().
Change-Id: I051988fca13c4cd84904f7b268d51f6a96f28af3
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
QtSvg changed how the dimensions of an SVG are determined in
4bd5d6ced07d2d0e643a13e7cebb228c521d2046. These tests assume the old
behavior at present, so blacklist the tests so qt5 integration can
proceed.
Task-number: QTBUG-58082
Change-Id: Ia579fbe6736932c081f9873d84bea4c01a975bad
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When converting the parameters of a C++ signal to JS values to provide
to a signal handler written in JS, the conversion of a QJSValue to a
QV4::Value* may yield a null pointer in case of a default constructed
QJSValue for example. This is a regression from commit
aa869cbb06 and we must check for this.
Task-number: QTBUG-58133
Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add a forceLayout function, similar to the views, as well
as a signal that indicates when positioning has completed.
Change-Id: Ice01ea0840c707e403fdd4ea59d92a89e2ed8e4b
Task-number: QTBUG-44762
Task-number: QTBUG-32114
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>