Commit Graph

3851 Commits

Author SHA1 Message Date
Liang Qi 04b176d61f Merge remote-tracking branch 'origin/dev' into 5.8
Change-Id: Ib9f44a557bc1d9cf38058252efa0856c61f44c91
2016-08-16 12:39:53 +02:00
Shawn Rutledge 16834ed8cb autotests: remove qWait(1) in touch sequences
After d04982dc84d66bec92b4b3767538676cf925ef17 in qtbase,
QTest::touchEvent() and QTouchEventSequence::commit()
slow down every sequence of touch events, so we don't
need to do it in individual tests.

Change-Id: Id8133b100797d4bd2d7282ee874dbb81ed2cab47
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-08-13 15:07:09 +00:00
Liang Qi d54d28981c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/qml/compiler/qv4isel_moth.cpp
	src/qml/compiler/qv4ssa_p.h
	tests/benchmarks/qml/qqmlimage/qqmlimage.pro
	tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp

Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
2016-08-13 00:41:58 +02:00
Anton Kudryavtsev 6f15de1d2d PathView: fix infinite construction/destruction loop
... when all (or almost all) items are in the cache.

When all items are in cache, check lower bound is equal
to upper_bound.

In rare cases, especially when almost all items are in cache,
the inserting code was used (not only appending and prepending).
In this code there was not bound check before creation of item
and there was such situation:

1. Create item by inserting code (without bound check)
2. At the next call of refill() remove this item by life cycle
because this item does not meet the conditions. And go to step 1.

In other words at the first call we create some item, at the second
remove this item. And again.

So we had infinite construction/destruction loop. To break it we
should check position of new item before creation in inserting code
too (like we do in appending and prepending code).

Task-number: QTBUG-37815
Change-Id: I015cdeb67ca5fcd06c34b3145b49cbd3e38d4078
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-12 18:50:22 +00:00
Simon Hausmann b40d005544 Enable disk cache for files coming from resources
By storing the cached data in QStandardPaths::CacheDir + "/qmlcache/"
+ sha1(filename)

Change-Id: I6a8b4ca701019204fff362504697c3dac9f54bf1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-12 16:54:38 +00:00
Jan Arve Saether 9010dd0e76 Fix test failure: wait between mouse events the proper way
Apparently, QTest::mouseEvent() disregards the wall time for the time
stamps for events, but synthesizes the timestamps instead.
The proper way is to specify the waiting time in the delay argument.
This will adjust both the timestamp and perform a qWait() before the
event handler is called.

Without this patch, the qWait(doubleClickInterval) was disregarded, which
lead to that a doubleclick event was generated, and it failed with the
following message:

Actual   (((window->rootObject()->property("doubleClicks").toInt()))): 2
   Expected (1)                                                      : 1
   tst_qquickmousearea.cpp(1105) : failure location

Change-Id: Ieda3b670d3cda0bd522db2f9677dad5745c88a21
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-12 14:03:14 +00:00
Anton Kudryavtsev 273e5b0bdc PathView: fix item creation
First call of QQuickPathView::refill() did not use currentIndex
for item prepending and there was situation when items were
not created, e.g.:

PathView with current item in center and currentIndex was set
so that item with index 0 was after current item and before path
end. The result of this situation: items from path begin to current
item were not created.

The reason was that idx always equaled (modelCount-1) for item
prepending.

Now first filling uses currentIndex to calculate valid idx.

Task-number: QTBUG-53464
Change-Id: I7e343b0712c9c5c5cd56b1d8e020cf8c0f6e6301
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-12 13:18:51 +00:00
J-P Nurmi 580f2872f0 TextInput: fix horizontal alignment when implicit resizing is disabled
By default, TextInput updates its implicit width to match the content
width. This implies that when TextInput does not have an explicit width
set, there is no need to handle horizontal alignment.

TextField wants to override the default implicit width, so it disables
the "implicit resizing" feature of TextInput. In this scenario, the
implicit width does not match the content width. Therefore the text
layouting code should also treat the item as if it had an explicit width
set to achieve the correct horizontal alignment.

Task-number: QTBUG-55138
Change-Id: I8c04971a6aff44c6f1734df50153a9788849e98a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-08-10 22:24:20 +00:00
Erik Verbruggen 6e687e8571 V4: Handle QTime->DateObject conversion better
By specification, date conversion functions for dates before the epoch
are not DST corrected. We converted QTime to a QDateTime where we set
the date part to Jan. 1, 1970, and then convert that to msecs since the
epoch UTC. For places on Earth where they had DST on that day (e.g.
Hobart in Australia), strange things happen: conversion from a QTime to
DateObject will use DST (because it's after the epoch in local time),
but conversions from DateObject to QTime won't use the DST because it's
before the epoch (in UTC).

Now as everyone knows, a 24-hour clock time has no meaning without a
date, only "elapsed time" has. But users still expect to be able to pass
QTime to QML/JS. So, we do the conversion on day 0 of month 0 of year 0,
and all of it in local time. This gives a stable conversion in both
directions, and the values in both C++ and QML/JS are the same for any
timezone (with or without DST) on this planet.

Task-number: QTBUG-54378
Change-Id: I892e16a93f015e92d311c6cae3ae7768b7373f6a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-10 17:17:15 +00:00
Dominik Holland eea2754976 Added Logging Category support to QML
New Logging Categories can be defined by using the
LoggingCategory type and define a name for the category

When the id of a valid LoggingCategory is provided as
the first argument to console.log and friends the
LoggingCategory is used instead of the default "qml"
LoggingCategory

[ChangeLog][QML Elements] Added a LoggingCategory type and added support
for it to the console object

Change-Id: Ifaeed5f71de6ea6d8172d8c838d6e7789c4d6b9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-10 15:47:52 +00:00
Erik Verbruggen 86a55cdb8c QML: Make all fields in QQmlPropertyRawData private
And add accessors. This makes it easier later on to change the storage
of the fields.

Change-Id: I21163668ac83a7d52f398981baf3c27ef161c177
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-10 14:21:15 +00:00
Arnaud Vrac 7ec1d316f4 Fix import with qualifier of remote directory with qmldir
Do not skip qmldir loading when using an import qualifier and the
resolved uri is remote. This makes the import behavior the same in all
cases.

Task-number: QTBUG-55002
Change-Id: I99d68be02ddd062e387d36946e730df076e80a8d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-10 13:20:56 +00:00
Cavit Sina Dogru 4fbfbf7fe8 Qt object: Add exit(int)
This is similar to the Qt.quit() function but also specifies the return
code that the event loop will return.

[ChangeLog][QtQml] Added exit(int retCode) method to the Qt global object.
An application can call Qt.exit to specify a return code of the engine.

Task-number: QTBUG-54360
Change-Id: Iaa319e6dc4d6b99dc3a5c01845e87b936fd2cab0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-09 17:16:44 +00:00
Frederik Gladhorn 990b750b6b Merge remote-tracking branch 'origin/wip/pointerhandler' into dev
This branch contains changes to the Mouse and Touch event delivery. It
cleans up much of the existing code and adds a new class:
QQuickPointerEvent (and two sub classes for touch and mouse at this
point in time, tablet will be added eventually). The pointer event
contains QQuickEventPoint instances.

Thanks to the new pointer event class, we cache more data, reducing
allocations and making delivery significantly easier.

This lays the basis for a new way of pointer handling in Qt Quick which
will use pointer events directly to have a more powerful abstraction
over the basic events, while being more flexible.

Change-Id: I30a90220f62314d504dd3b5e079b75fc6f4d2c74
2016-08-09 14:32:05 +02:00
Christian Strømme 35597f3014 Fix char conversions in QML
This is a partial revert of 90b06e2773, as it had unwanted side
effects. The original intention was to make assignment from char to
string possible, or more specifically, we wanted a solution where a
QChar could be assigned to a QString, as a character and not a string
representation of its value. While this behavior is desirable for
QChar, we most likely want the opposite for the regular character types.

Task-number: QTBUG-49232
Change-Id: I82d5f72b900fe984c4db1478fd52a9eb69ad2ee6
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-09 11:24:19 +00:00
Liang Qi 5517c63c2e Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/qml/qqmlcomponent.cpp
	tests/auto/quick/scenegraph/tst_scenegraph.cpp

Change-Id: Ibc811b95a57f175ca53337db7bbd1f575a745937
2016-08-09 10:28:48 +02:00
Christian Kandeler 3e5152be41 QJSValue: Adapt to introduction of QMetaType::Nullptr
[ChangeLog][QtQml][Important Behavior Changes] A JS null value converted
to a QVariant now has type QMetaType::Nullptr rather than
QMetaType::VoidStar.

Change-Id: I91a64e444ada0f1884fe807f9973348ba1a878ff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-08 12:45:38 +00:00
Simon Hausmann a3aad1a470 Fix restoring of local aliases from disk cache
Local aliases are always "resolved". We must be careful not to access
the same field in the union otherwise and mistake it as property index.

Change-Id: I6369cdba145a62dcdaa10d8f4ee84bfa3cbfa0e3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-06 06:25:06 +00:00
Simon Hausmann 68bfc9332c Fix crash with Component.onDestruction
A call to a handler of Component.onDestruction may end up causing WeakValues
such as QQmlData::jsWrapper to be set again, even though they've been set to
undefined in an earlier iteration of the loop that walks through the weak
references. That in turn may result in invalid object references to objects
that are scheduled for destruction by the collector.

So after calling all destroy handlers for QObjects, reset all of the weak
values again.

Task-number: QTBUG-54939
Change-Id: I00ebabb76274e296fb1bd90d8d3e21dbbb920b57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-05 18:55:39 +00:00
Simon Hausmann 8d1bae4c0f Enable QML/JS disk cache by default
Except on Windows, where there is still one bug to fix.

Change-Id: I1a22f42859733eedd37596a3e8fc09680720ff10
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-08-05 10:50:57 +00:00
Robin Burchell 7377e8f950 tst_librarymetrics_performance: Use QBENCHMARK macro instead of rolling our own
This means we now respect -callgrind to show instruction counts (for instance).
If benchmarks don't already throw out outliers and perform averaging, we should
roll those features into testlib, not replace it.

Change-Id: I21a3c4b41ec80a49b5b61bfe957f1165ac865010
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-05 10:35:59 +00:00
Robin Burchell fde6e1fe83 benchmarks: Remove odd qqmlimage benchmark
I have no idea what this was theoretically supposed to be testing, but it looks
completely bogus (not representative of a real world scenario), is subject to
massive variance thanks to memory allocation, and generally doesn't seem useful

Change-Id: Ib7adc8a4753e49d2a3bd9515273bca79a88a5749
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-05 09:38:54 +00:00
Robin Burchell e0e591fb80 tst_creation: Remove tst_creation::elements
There is no real sense in testing what boils down to operator new/delete plus a
little PLT overhead. For one thing, the allocator is too variant to test at such
a level. For another, it's not representative of any real-world scenario.

Change-Id: Ib455bb00839ff4e25099977059759a7b328db306
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-05 09:38:50 +00:00
Robin Burchell 3631c77ff0 tst_creation: Remove qobject_alloc benchmark
This is literally just testing operator new and delete, with a little PLT
overhead. It is not useful as a result (not a real-world scenario, and obscenely
variant thanks to allocators not being predictable in behavior).

Change-Id: I42f758c503b37ff880fc4f0e38c220d0638356e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-05 09:38:44 +00:00
Robin Burchell f2d174012b tst_creation: Remove redundant widgets dependency
Absolutely no need for this.

Change-Id: I06ca2dab157fecf2c585b9f863d9893cd4ce7300
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-05 09:38:41 +00:00
Shawn Rutledge ebf07c3f68 Flickable: avoid infinite velocity during release after drag
It sometimes happens on touchscreens that mouse events occur too close
together.  We cannot calculate velocity based on zero elapsed time,
so just ignore the event.

Task-number: QTBUG-45527
Change-Id: I120e73cfa60e2fcc594cb1f3b69f530e746abddd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-08-05 08:59:52 +00:00
Liang Qi 45f79dc7e5 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp
	src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h

Change-Id: I1e6a9424e7f87d9e4ac1ea387ec70e151106f1c7
2016-08-05 09:02:17 +02:00
Simon Hausmann 234e762265 Use on-disk compilation unit if available
If we succeeded in saving the compilation unit to disk, then attempt to use it
right away. This replaces the C++ heap usage for the compilation unit data as
well as the anonymous allocated executable memory with file-backed mmap'ed
memory. That means the memory can be discarded when overall availability is low
and paged in on-demand.

Change-Id: Ide1b1e11752d861eb049a99a26ca12cec5e2502e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-04 14:32:39 +00:00
Simon Hausmann 01575a22ea Fix interaction of files selectors with disk caching
Make sure to save the .qmlc/.jsc files to the location
determined by the file selectors.

Change-Id: If535bb1e4f0d20ac692b3d8e6d563f77cd00446b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-04 14:32:11 +00:00
Simon Hausmann d77e544a56 Safeguard disk cache loading with checksum verification
When loading a QML component from the disk cache, compare the checksum
of the dependent types against the checksum when the cache was created.
Any change in the meta-object of a dependent type should trigger a
re-creation discard of the cache and consequent re-creation (in the
test-case).

Unfortunately this also requires extending the existing hack in the unit
test to deal with the low second precision on HFS+ in order to pass the
tests.

Change-Id: Ib8e899347680f7be676788388e9c23a09b0277e3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-04 14:32:08 +00:00
Erik Verbruggen 1534dd6d97 QML: Introduce QQmlPropertyIndex
This helps in making it clear when an index is a plain old number and
when it consists of an encoded value type index.

Change-Id: Ic50d95caf244ed0ee2d62bdba53910a371cfee04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-04 12:11:05 +00:00
Frederik Gladhorn 175f53860a Merge branch 'dev' into wip/pointerhandler
Conflicts:
src/quick/items/qquickwindow.cpp: we need the fix for QTBUG-31861 but
now using QQuickPointerMouseEvent
src/quick/items/qquickwindow_p.h: hover events need timestamps (e4f7ab42)
tests/auto/quick/qquickwindow/tst_qquickwindow.cpp: added test for QTBUG-31861

Change-Id: Ic120513b69b318df3ba62d8174c276cbf6b7b55e
2016-08-04 13:15:54 +02:00
Olivier Goffart 5e60d281f1 Test that we don't crash when items are sorted and filtered at the same time
This is a test for commit 49c892328223dfa2502b462d8e5e8e181f4f6cd5
in qtbase

Change-Id: Id7be42ddd9136b73af08093117316fe2e86a000a
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-08-04 08:10:44 +00:00
Ulf Hermann 97b2fc9d64 Relax negativeYear EcmaScript test
EcmaScript doesn't in fact require the date to be represented in
english. Thus, only test for the year number to be contained in the
date string.

Change-Id: I5b89c14a833b317f259f4cd2855b3f24310a7d72
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-03 21:17:48 +00:00
David Faure 9baa491a06 autotests: fix finding data files when not in CWD
These tests now can find their data files even when running from
a different directory than the source directory, and they no longer
misuse QUrl::fromLocalFile for a relative URL (resolved with
QUrl::resolved).

Change-Id: If18afd2e29571cca2a4c820eda6b9f6713e08a92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-03 18:44:54 +00:00
Erik Verbruggen fa50403ab3 QML debugger: Fix test
Use delete[] on a new[]-ed pointer.

Change-Id: Ic5721851bdcec284cdd631b81d2cc96b7a1748fc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-03 09:08:41 +00:00
Edward Welbourne 74f0d15e08 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/quick/items/qquickshadereffect.cpp
5.7 had a bug-fix in code dev has replaced wholesale.

	src/quick/items/qquickwindow.cpp
	src/quick/items/qquickwindow_p.h
One side changed a method's signature; the other side renamed a method
declared adjacent to it and changed some code using it, moving some
from the public class to its private partner.

	tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
One side added a blank line before a comment the other re-wrote.
Kept the re-write, killed the stray blank.

	.qmake.conf
Ignore 5.7's change to MODULE_VERSION.

	src/qml/compiler/qqmltypecompiler.cpp
	src/qml/compiler/qqmlpropertyvalidator.cpp
5.7 changed code in the former that dev moved to the latter.
Reflect 5.7's changes there, adapted to dev's form.

	src/qml/qml/qqmlobjectcreator.cpp
One side added new QVariant types; the other changed how it handled
each type of QVariant (without git seeing any conflict); adapted the
new stanzas to work the same as the transformed ones.

	tests/manual/v4/test262
dev had a broken sha1 for it; so used 5.7's 9741ac4655808ac46c127e3d1d8ba3d27ada618e

Change-Id: I1fbe2255b97d6ef405cdd1d0cea7fab8dc351d6f
2016-08-02 18:34:30 +02:00
Frederik Gladhorn e611c00d8c Stop copying mouse events when delivering them
Reduce allocations of events, just refill the local pos.

Change-Id: I2948faf0e302bff315e482f2c1432fe0def19bc5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-02 10:35:47 +00:00
Frederik Gladhorn f059e47a84 Extend tst_qquickwindow::mergeTouchPointLists
Change-Id: I199c57197fafed84ba0065765411d5239804d17f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 21:52:48 +00:00
Frederik Gladhorn 4409160ceb Test touch point delivery order
Change-Id: I9b93eda0378e10bbcc274998d58f5f5ec62bb1b1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 19:17:59 +00:00
Frederik Gladhorn bf2c880b2b Add mergePointerTargets to create pointer delivery list
This code joins lists of "target item" which are joins of where several
touch points should be delivered.

Change-Id: I15ab4b7f70b8930d15368bf4cba0893ab339fa2a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 19:17:20 +00:00
Simon Hausmann 143f22babb Add a checksum to QQmlPropertyCache
By running an md5 hash over the meta-object data and string tables this will
allow us to detect changes to meta-objects and invalidate QML disk caches.

Change-Id: I15b92de4cdf0cb525281b86e1c7b8ba0b11347a0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-01 15:28:04 +00:00
Liang Qi 6839f03051 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
	tests/auto/quick/qquickitem/tst_qquickitem.cpp

Change-Id: If261f8eea84dfa5944bb55de999d1f70aba528fd
2016-08-01 13:14:04 +02:00
Simon Hausmann 897eb7f129 Add a function to QQmlPropertyCache to calculate the meta-object sizes
This will be used later for calculating checksums of the meta-object
data.

Change-Id: Iba925eae298cbfc7b89196f4dd6fb2854ce75e2e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-01 11:13:34 +00:00
Frederik Gladhorn b4f05d7010 Let TestTouchItem::reset reset the event count
Change-Id: I37ddf4d45fd3457decb35a597876008ea9d09d11
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:47:04 +00:00
Frederik Gladhorn 435e3e95c2 Micro optimize tst_qquickwindow::touchEvent_basic
Change-Id: Ifd35eebaa8ba0aadcb15218a494c3e04167182ca
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:47:00 +00:00
Frederik Gladhorn c479032e6e Add minor extra check in tst_qquickwindow
Change-Id: If0343c36c747b419f949cff47a0f6a93bf73250d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:46:56 +00:00
Frederik Gladhorn 30377d13b8 Fix TouchMouse test: accept button
That the EventItem would get an event is a bug in the current event
handling, there is no reason for it to receive anything when it doesn't
accept mouse/touch.

Change-Id: I4079e6cb396cc1913f795015dcc7839ca79edb70
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-31 21:46:52 +00:00
Frederik Gladhorn 80dbc30e97 Touch and mouse handling: don't pre-grab
The touchmouse test needs adjusting since we don't see ungrab events any
more (which makes sense, nobody actively grabbed anything there).

The comment about storing the touchMouseId early enough is invalid - any
item that wants to steal the grab, has to call grab anyway.

The reason to only update the grab when there is no grabber set yet, is
that in the filterChildMouse stuff some other item might steal the
event, setting the grabber there - that must not be overridden when we
come back to the original event handling.

Change-Id: I4f191b16f4d76113d0c88414b5a80eb1baf99be1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-28 20:12:18 +00:00
Frederik Gladhorn 05d7fb5bd2 Prefer QCOMPARE over QVERIFY
Change-Id: Id57e576653cd66d1b36685737ba477c8b3ff6258
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-28 17:49:53 +00:00
Ulf Hermann a7c7b26653 V4: Make ExecutionEngine's debugger and profiler private
This will allow us to #define them away on -no-qml-debug, saving two
pointers per engine.

Change-Id: I400cffd32cd7f55ff0e68565734b6002b9f901d5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 15:09:33 +00:00
Eskil Abrahamsen Blomfeldt 3c9a70eec9 MSVC: Make Lancelot's scenegrabber compile
The extern declaration needs Q_CORE_EXPORT (which resolves to an import
declaration on MSVC). Also, the type of the qt_qhash_seed variable is
a QBasicAtomicInt, not int, so with proper signature mangling it would
not resolve (since memory layout is the same for an int and
a QBasicAtomicInt, it would just work for linkers that did not
detect it.)

Change-Id: I92375afcfc13e045e78a4d6cfdd539bd01b66136
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2016-07-28 12:23:47 +00:00
Frederik Gladhorn 85e60c4591 tst_qquickwindow: Fix touch tests: add release
There is already a comment in the test that points that are pressed
must be released again.

Change-Id: I3190b9f98769f7a3838ff703e5557ee321c71604
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-28 12:21:30 +00:00
Ulf Hermann bd48f0e5ed Tooling: Convert connects to Qt5 style
Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 09:17:49 +00:00
Thiago Macieira d4a1b34e33 tst_qmlproperty: Fix access of dangling pointer
const char *name = propertyName.toLatin1().constData();

big no-no... valgrind was quite angry:

==49215== Invalid read of size 1
==49215==    at 0x4C304F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5E991C5: QMetaObject::indexOfProperty(char const*) const (qmetaobject.cpp:1007)
==49215==    by 0x5ED1273: QObject::property(char const*) const (qobject.cpp:3912)
==49215==    by 0x42AAA5: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2082)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)
==49215==    by 0x403C39C: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:838)
==49215==    by 0x403CE98: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1019)
==49215==    by 0x403DF45: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1321)
==49215==    by 0x403EA9F: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1733)
==49215==    by 0x42B219: main (tst_qqmlproperty.cpp:2104)
==49215==  Address 0x155bb3d0 is 16 bytes inside a block of size 18 free'd
==49215==    at 0x4C2E38B: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5C3F9FC: QArrayData::deallocate(QArrayData*, unsigned long, unsigned long) (qarraydata.cpp:215)
==49215==    by 0x42F2CB: QTypedArrayData<char>::deallocate(QArrayData*) (qarraydata.h:459)
==49215==    by 0x42CC7A: QByteArray::~QByteArray() (in /home/tjmaciei/obj/qt/qt5/qtdeclarative/tests/auto/qml/qqmlproperty/tst_qqmlproperty)
==49215==    by 0x42AA8B: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2081)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)
==49215==    by 0x403C39C: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:838)
==49215==    by 0x403CE98: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1019)
==49215==    by 0x403DF45: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1321)
==49215==    by 0x403EA9F: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1733)
==49215==  Block was alloc'd at
==49215==    at 0x4C2D12F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==49215==    by 0x5C3F4DE: allocateData(unsigned long, unsigned int) (qarraydata.cpp:107)
==49215==    by 0x5C3F6DE: QArrayData::allocate(QArrayData**, unsigned long, unsigned long, unsigned long, QFlags<QArrayData::ArrayOption>) (qarraydata.cpp:155)
==49215==    by 0x5C47BED: QTypedArrayData<char>::allocate(unsigned long, QFlags<QArrayData::ArrayOption>) (qarraydata.h:436)
==49215==    by 0x5C42123: QByteArray::QByteArray(int, Qt::Initialization) (qbytearray.cpp:1627)
==49215==    by 0x5D15F95: QString::toLatin1_helper(QChar const*, int) (qstring.cpp:4635)
==49215==    by 0x5D15F5F: QString::toLatin1_helper(QString const&) (qstring.cpp:4630)
==49215==    by 0x42D076: QString::toLatin1() const & (qstring.h:521)
==49215==    by 0x42AA69: tst_qqmlproperty::floatToStringPrecision() (tst_qqmlproperty.cpp:2081)
==49215==    by 0x42BB37: tst_qqmlproperty::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qqmlproperty.moc:533)
==49215==    by 0x5E9B32D: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2237)
==49215==    by 0x40434FB: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.h:123)

Change-Id: I0031aa609e714ae983c3fffd146543f79048468f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 04:17:21 +00:00
Frederik Gladhorn 2190e37718 MouseArea: press not accepted means not pressed
This changes that items that explicitly do not accept a press
event, will no longer get a cancel event.

[ChangeLog][QtQuick] MouseArea no longer thinks it's pressed when
it does not accept the press event. When a press event is not accepted,
MouseArea also no longer receives a cancel event.

Change-Id: I8419cef60d7cc32aab15e9027fafb73cc08001ba
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-27 14:53:16 +00:00
Frederik Gladhorn eb238e2cf9 Keep track of grabbing inside QQuickEventPoint
With this we can get rid of "itemForTouchPointId" which kept track of
the individual grabbing of touch points. The new approach allows big
cleanups and makes understanding the code easier.

Change-Id: I19f7cda1b430e088ada707b2e75d97ca8dbadcc5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-25 22:04:34 +00:00
Frederik Gladhorn ed054acb9c Fix tst_QQuickPinchArea::cancel
The cancel event must have the device set, otherwise it may not be
delivered properly.

Change-Id: I7f7899fdbfd8fd68e9e19bcd043a46ddb31516cd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-25 22:04:27 +00:00
Thomas McGuire 16b680b734 QQmlPropertyMap: Don't spuriously emit valueChanged() signal
The valueChanged() signal was emitted when the property was written with
the same value. This increased the potential for binding loops in user
code.

Change-Id: Ifeb8f6f23e2022aa35cb6cac7cf1a3dbc0e8ca2f
Task-number: QTBUG-48136
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 16:14:18 +00:00
Frederik Gladhorn 52c66e85f0 Fix usage of QTest::touchEvent
Change-Id: Ib87f7800ffa18f9a4f905ecd0aa0173f46fa2d90
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-25 14:53:50 +00:00
Nikita Krupenko dbb56ab74a Expose HSV and HSL color values to QML
[ChangeLog][QtQuick] Added properties to access color values for the HSV
and HSL color models to the basic QML color type.

Task-number: QTBUG-48723
Change-Id: I45fa52f9f3878553e1b3d0a34b47804ede7794f8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-07-25 09:31:04 +00:00
Erik Verbruggen 007ae316a6 QML: Unify property reads/writes and use accessors
Pass property reads/writes through utility functions in QQmlProperty,
which in turn will try to use accessors when available (and no
interceptors have to be called).

Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 09:26:38 +00:00
Simon Hausmann 4c1a51006e Improve robustness of qml disk caching
Perform various basic checks before proceeding to load an existing cache file,
including the qt version, architecture, data structure version and others.

Change-Id: Ie822b056e944ac120643aad260e97f62616688bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-07-23 05:18:59 +00:00
Dan Cape 0a87552e81 Fix QQuickItem's setAcceptedMouseButtons function
When using setAcceptedMouseButtons to only allow the LeftButton, the
user can click the LeftButton and while still holding it press the
RightButton. There would be a press event sent for both. To resolve this,
a check needed to be added to ensure the acceptedMouseButtons are
checked when a second press comes in.

[ChangeLog][QtQuick][QQuickItem] Fixed issue with mouse button events
being sent even when they were disabled by setAcceptedMouseButtons.

Change-Id: I064f3ff56ede12b1572e172be326eb337e280750
Task-number: QTBUG-31861
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-21 14:42:39 +00:00
Frederik Gladhorn a5e7897dd7 Improve encapsuation of touch/mouse event specific things
This makes it easy to avoid casts when using the classes.

Change-Id: I27bd1244bffb3a7d2cdb4572c229333e4c499d9b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-21 14:14:56 +00:00
Frederik Gladhorn c856d877e7 Hierarchy for touch and mouse pointer events
Change-Id: Ie84e39918d9657b29df697be7b0e5198298c48ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-21 11:13:12 +00:00
Frederik Gladhorn f33b986ee1 Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Change-Id: I76922654efe75b487901d0cdd88a2ed1cc0a03a5
2016-07-21 10:58:22 +02:00
Simon Hausmann c016634478 Fix string property assignments to 2d vectors and quaternions
Just like it's possible to assign "1,2,3" to a QVector3D, the same
should be possible for a QVector2D and a QQuaternion.

Task-number: QTBUG-54858
Change-Id: I8f394279dcdf5c057876efaa316b4bad51a4c126
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-21 05:08:14 +00:00
Simon Hausmann a6b2c5100a Add support for saving/loading the moth interpreter byte code
With the JIT and moth supporting persistence, we can enable the disk
cache tests unconditionally.

Change-Id: I6d6652411237001433a32a2de21d1f78f51b43ef
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-21 04:55:52 +00:00
Erik Verbruggen 06ed1ad17a JS: Check for errors before using sub-expression results
Specifically: don't de-reference a result and assume that it's not-null.

Task-number: QTBUG-54687
Change-Id: If07d3250a95a7815ab7a3262b88e0227965ef8e7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-20 10:36:58 +00:00
Mitch Curtis aa5f09a0d2 Add tryVerify()
This is useful for conditions which can't be tested using tryCompare.
One such situation is that of the currentItem property of ListView.
In Qt Quick Controls 2, the currentItem property of the ListView that
is internally a child of Tumbler can be null for a certain period of
time, so using tryCompare() would result in errors due to trying to
access a property of a null object:

    tryCompare(tumblerView.currentItem, "text", "2")

The current workaround is to use wait(50) in a for loop, which is ugly
and could lead to flaky tests:

    for (var delay = 1000; delay >= 0; delay -= 50) {
        if (tumblerView.currentItem)
            break;
        wait(50);
    }
    verify(tumblerView.currentItem);
    compare(tumblerView.currentItem.text, data.currentIndex.toString());

Using tryVerify(), we can first ensure that currentItem isn't null, and
then use a regular synchronous compare afterwards:

    tryVerify(function(){ return tumblerView.currentItem; });
    compare(tumbler.currentItem.text, data.currentIndex.toString());

[ChangeLog][QtTest][TestCase] Added tryVerify() function to allow
verification of asynchronous conditions that can't be tested using
tryCompare().

Change-Id: Ie93052b650f7fe0bf26853054a8f0f35a483e387
Task-number: QTBUG-19708
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-20 07:55:27 +00:00
Simon Hausmann 6a1667bc4e Improve robustness of qml cache expiry checking
Instead of relying on two time stamps in the file system (source file and cache
file), make the determination on whether the source file is newer than the
cache solely depend on the time stamp of only the source file. This means that
when cache files are stored in archives for example their modification date
does not need to be preserved upon extraction.

Change-Id: I0b4362663868c6fb9bd7e106028161b2d67274d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 18:19:46 +00:00
Frederik Gladhorn b4fc940978 Stabilize tst_QQuickView::resizemodeitem
FAIL!  : tst_QQuickView::resizemodeitem() Compared values are not the same
    Actual   (sizeListener.at(i)): QSize(80x100)
    Expected (view->size())      : QSize(200x300)
    Loc: [tst_qquickview.cpp(172)]

The "SizeChangesListener" can be instantiated too early, catching
signals from the previous resize events. Make sure to flush all events
before.

Change-Id: Ib0933429f5c589f120c263619f00893fa813e361
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-19 09:25:28 +00:00
Frederik Gladhorn 9dc4085e59 Remove redundant compare in test
The same condition is tested in the line above.

Change-Id: I99720e3603b1ae5e2f5161696f1de3dd03f6ff50
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-19 09:24:46 +00:00
Frederik Gladhorn ac79c052af Merge remote-tracking branch 'origin/dev' into HEAD
Change-Id: I931a7b264c68c40e16d9467b48173311aef74bd0
2016-07-18 15:31:45 +02:00
Milian Wolff 9d4b556407 Add benchmark for pathological O(N^2) behavior in QQmlChangeSet.
This patch is just here for documentation of this behavior and does not
come with a fix yet. This hotspot was found while profiling the example
code attached to QTBUG-34391. It is triggered by the repeated calls
to _q_itemsMoved in QQmlDelegateModel::_q_layoutChanged.

Change-Id: I758744b3650c3c47dc86b914b823c3e9f96ce81e
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Daniel Vrátil <daniel.vratil@kdab.com>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
2016-07-18 08:53:51 +00:00
Edward Welbourne f23ad9d576 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	examples/quick/demos/photoviewer/deployment.pri
One side made it redundant; the other removed part of it; remove it all !

	src/quick/scenegraph/util/qsgatlastexture.cpp
One side changed a preprocessor condition, the other a code condition,
on adjacent lines; keep both changes.

	tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
One side changed a condition, the other the content of its block; keep both.

Change-Id: Idb8937f92a7edb28212449dfe0c5cfdb8e6de986
2016-07-15 21:08:50 +02:00
Simon Hausmann bf5f97e6c6 Fix alias resolution algorithm
The resolution of aliases needs to to be solved in iterations as an alias can
refer to another alias, which may not be created yet in the property cache by
the time we try to perform the resolution. Therefore the alias resolution code
works off a list of pending aliases after the initial pass of resolution. This
also requires the ability to detect circular references.

Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 18:51:39 +00:00
Ulf Hermann 20b96e2109 Relax QQmlProfilerService test for scene graph events
The scene graph might decide to do an initial rendering, before the
first SceneGraphContextFrame.

Change-Id: Ie6d96574b5585cfda4dcd258b6031303f9a37715
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-15 09:22:21 +00:00
Simon Hausmann 80a024081a Clean up implicit component registration
When assigning an object to a property that is a QQmlComponent, we implicitly
"wrap" a Component {} around the object declaration. In the QML IR this is only
half-heartedly represented. In order to correctly determine dependencies later
when saving and to support QML files that use implicit components but don't
import QtQml or QtQuick explicitly, we must also extend the file imports
accordingly. This is now done (and tested) by emulating a "import QtQml 2.0 as
QmlInternals" and then using "QmlInternals.Component".

Change-Id: I26f4f53a35675b52d4bd39f23359b0ac8f9678c5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 06:43:39 +00:00
Lars Knoll 91ed06b767 Fix logic bug when deleting properties of JS objects
The code used the size of the internal class in an inconsistent
way. It should simply compute and work with the old internal
class size, as that reflects the old object layout.

[ChangeLog][QtQml] Fix assertion when deleting properties of JS objects

Task-number: QTBUG-54589
Change-Id: Ie3db70437e780215d08a1a96491db75f8b859754
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-14 11:29:34 +00:00
Simon Hausmann be491913c0 Fix endian support in compiled data structures
The goal is to make the compiled data structures persistent on disk. In order
to make it possible to create these data structures on a "host" system that may
have a different endianness than the target system, we now make all the word
sized fields little-endian. The template wrappers from QJson provide
zero-overhead access for little-endian machines (the vast majority) while
maintaining a large degree of source compatibility.

Change-Id: I3d30da1fcf3bffb98dbe9337d3a35482fb7b57c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-14 03:58:57 +00:00
Shawn Rutledge cfe4e8b8dc tst_qquickwindow: make use of new QTest::createTouchDevice function
So gui-private API isn't necessary anymore.
Same as change 94324bd93f

Task-number: QTBUG-44030
Change-Id: I780cc1eedf9285336b96219a1fb1cd4016512701
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-13 19:08:44 +00:00
Shawn Rutledge 73eceacfac add tst_qquickwindow::eventPointCount
Change-Id: I552cf69fa179d8b1260a5502e37553fa57bf32cf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-13 14:56:18 +00:00
J-P Nurmi 35d5005269 Fix itemGeometryChanged() listeners
We must iterate a (cheap) copy of changeListeners, because the
container might be indirectly modified during the loop. For example,
listeners may remove themselves from the list. In such scenario, the
copy gets detached and the loop remains safe.

I've added notes in comments, and extended the tests to prevent the
issue re-surfacing again.

Change-Id: Ib48d6e0765d45370d2fffa119a4c351e0119e40a
Task-number: QTBUG-54732
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-07-13 13:00:13 +00:00
Alexandr Akulich 2418a36d0a Set width and height simultaneously on SizeRootObjectToView
On QQuickView/QQuickWidget size update we used set width (with the notify
signal emission) and then height (with signal emission again). This way code,
relying on width and height would be triggered twice and at the first time
with there would be outdated height value.

The new code takes care on proper value for both width and height.

Change-Id: I6525911c40af0ca6a26ab3e7dac16d32a96d9a27
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-12 11:15:57 +00:00
Daniel d'Andrada e4f7ab42c6 QQuickWindow: Fill out timestamps in QHoverEvents sent to QQuickItems
Task-number: QTBUG-54600
Change-Id: Ie24c44e2f68aae55ff1146c13c3dfc25349b7a29
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-12 10:41:42 +00:00
Frederik Gladhorn 5f4eb78ccb Remove unused variable
Change-Id: I47c00941ef458c8b16c02960a7b37749a222a04e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-12 09:58:43 +00:00
Erik Verbruggen e2c296c46b QML: Pass the kind of geometry change around
This prevents re-calculation of what actually changed, and removes the
now unused parameter newGeometry. Other than this change calculation,
the only place where oldGeometry was used is
QQuickListViewPrivate::itemGeometryChanged. To get rid of oldGeometry
too, QQuickListViewPrivate now stores the current (i.e. last known)
geometry, and updates it in itemGeometryChanged.

Change-Id: I8a5286d08a04132c9a4c81de7ce221f5676946e6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-11 07:50:51 +00:00
Frederik Gladhorn 6349a08f39 Add explanation to tst_QQuickMouseArea::moveAndReleaseWithoutPress
The test makes sure that no events are delivered after the initial press
is released. In this context QTRY_* makes little sense, since we are
confirming that the defaults have not changed.
Thus rather spin the event loop 11 times and hope that if we would
accidentally deliver events that we shouldn't, it will be caught in that
time.

Change-Id: Iadeed07a81978aa6679e5513c1fe0aebcaeeb997
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-08 20:27:25 +00:00
Robin Burchell f640a9b7bb tst_qquicklistview: Style fixes
Change-Id: I18983b06d28bf8f31043070db5aa6c1540062197
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-08 13:37:25 +00:00
Frederik Gladhorn c6d9702bb8 Prefer public API in test
Change-Id: Ib161ffaaea57bdf74e02d0f56c3e02d484a26fcc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-08 12:12:26 +00:00
Shawn Rutledge 733b20af44 MouseArea: add autotest for subtreeHoverEnabled
Verify the fix in f7e462b.

Task-number: QTBUG-54019
Change-Id: Ia9846f9b79473ea4f72e895320cf01d5d85cc1a3
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-07 19:10:30 +00:00
Simon Hausmann 28ed215281 Added two unit tests for alias nesting
The first test covers a use-case currently only otherwise see in
QtQuickControls, and so having it here allows for catching regressions in that
area before hitting the next qt5 build.

Having an alias refer to another alias property within the same file only works
if the second alias is resolved/processed before the first one. This works by
chance when relying on the order of processing reverse to the declaration, but
that's a bug. It should work regardless of the order. That is what the second
test-case demonstrates and that is why it is marked as failure.

Change-Id: Iba386437d21efa868d9814221092df5f7ef6f1f6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-07 14:38:40 +00:00
Ulf Hermann bd8cf4e040 QmlProfiler: Extend test to check for timestamp ordering
Timestamps should always increase monotonically.

Change-Id: Idfd44e160193aab7bce37b58bc42a94ff087d15e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-06 09:19:38 +00:00
Frederik Gladhorn efbeb7d791 Fix tests in tst_QQuickMouseArea for big startDragDistance
Change-Id: I8610887e7d1d3b0c6bd9ab60e55ce1e9209bcae7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-06 05:28:18 +00:00
Albert Astals Cid 506ae2dba8 Fix crash in QQuickShaderEffect::updatePaintNode
When having a ShaderEffect and an Image sharing the texture via supportsAtlasTextures

This used to work fine in 5.4 but 38cab579a0
removed the check for the provider not being null

Change-Id: I18cb969dbf8011ea01543cc079214e8ecbb66623
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-05 11:05:27 +00:00
Frederik Gladhorn ea5b7477a8 Fix tst_QQuickMouseArea::preventStealing for big startDragDistance
Change-Id: I38c3a663409633bd7020c2630bf11c2e46082435
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-05 09:33:28 +00:00
Frederik Gladhorn 18d81de30d Fix tst_QQuickMouseArea::setDragOnPressed for big startDragDistance
Change-Id: I9f2795bcaaec2b126a41c6a6a12a2d5e55d0beee
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-05 09:33:26 +00:00
Frederik Gladhorn 36d23889be Fix tst_QQuickMouseArea::cancelDragging for big startDragDistance
Change-Id: Ia39947f7b6f42c48738af81966deb9c98f708da5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-05 09:33:25 +00:00
Frederik Gladhorn baead14071 Fix tst_QQuickMouseArea::dragging for big startDragDistance
On macOS the mouse move events go through qcursor's setPos. That in turn
uses a native event, so the waits are there for a good reason.

Change-Id: Icb616d303c5280f2a9ba5f78cf07032c298b84a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-05 09:33:24 +00:00
Erik Verbruggen 8c745d8085 QtQuick: clean up shader effect property connections
- Don't use a signal mapper, but handle the mapping using a custom slot
  object and a lambda to do the dispatching ourselves.
- Don't do meta-calls by property name, but by index.
- Cache the meta-object.
- Resolve the property indices by using the QML property cache.

For a shader with 6 property connections, the time spent goes from 320k
instructions to 80k instructions (valgrind on x86_64).

Task-number: QTBUG-53901
Change-Id: I2809198cf62f9716b3683798222203fc3e97fbb3
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-07-05 08:00:21 +00:00
Frederik Gladhorn 5b470b6b6a Improve tst_QQuickMouseArea::pressedCanceledOnWindowDeactivate
Make it more reliable and faster - average run time goes down by ~400 ms
while the test passes reliable for me after this change.
Most QTRY_* will return instantly since the condition will be good in
any case.
On my laptop the test tended to fail roughly every 4th run without this
patch. The failure was the second click on the new window not working
without the QTRY_VERIFY.
Removing the extra 200 ms wait time is what makes it faster - I see no
good reason for the wait here.

Change-Id: I5f45da91ef04a9b807ff0e9362c9d9b3881c227d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-05 05:51:26 +00:00
Frederik Gladhorn 603ff80d3e Fix tst_qquickpincharea::pan with highdpi and document it
The test was expanded slightly and documented, so that it's easier to
understand the strangeness of the center.
On my display the dragThreshold is returned as 16 while the test assued
it's always <= 10.
Explain the math and the coordinate changes due to everything being in
item coordinates.

Change-Id: I4bf72271895ecd9e248154c08bf36eab376c6d79
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-04 21:19:49 +00:00
Frederik Gladhorn 827af02890 Canvas test: make sure canvas is ready
before:
Totals: 80 passed, 653 failed, 0 skipped, 0 blacklisted, 35852ms
after:
Totals: 729 passed, 4 failed, 0 skipped, 0 blacklisted, 29599ms

The last four failures are due to high dpi issues.

Change-Id: Ie937091558395572dc281ee5a5b90848ea9d2081
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-04 15:33:47 +00:00
Frederik Gladhorn a669a2cd49 Stabilize tst_SceneGraph::createTextureFromImage
The test would crash half the time on my laptop due to the scene graph
not being initialized and then returning a nullptr for the texture.
At that point texture->hasAlphaChannel() crashes.

Change-Id: I9220d9bd6abe6381752c26335f2b60fa8d2adccf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-07-04 14:34:21 +00:00
Frederik Gladhorn 123481f94e Fix tst_rendernode to work with hidpi
Change-Id: Id2a7f20933533f69fa43eefc2338205b82a27ccd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-04 14:34:12 +00:00
Andrea Bernabei 240c2ef60e Flickable: fix minXExtent/minYExtent when content is smaller than view
At the moment, defining leftMargin (or topMargin) and contentWidth
(or contentHeight) so that "leftMargin+contentWidth < flickable.width"
(or topMargin+contentHeight < flickable.height) leads to widthRatio
(or heightRatio) having value != 1.
The value should, however, be 1, as the content is completely visible
inside the view, margins included.

As a sideeffect, under the assumptions described above, it will now
not be possible to scroll the leftMargin (or topMargin) out of screen,
something which was possible (and it shouldn't have) before this fix.

Task-number: QTBUG-53726
Change-Id: I22426c8038e90a2cfc7445914206eae0e781a3fb
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-01 06:53:22 +00:00
Liang Qi 42f485231c Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/quick/items/context2d/qquickcanvasitem.cpp
	src/quickwidgets/qquickwidget.cpp
	tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp

Change-Id: Idf279cb88e0df2a383489af5b6afdf04d04ae611
2016-06-30 13:28:35 +02:00
Laszlo Agocs a174ed2a99 Handle AA_ShareOpenGLContexts consistently in QQuickWidget
QOpenGLWidget has offered a lot more fine-grained control over the lifetime
of the OpenGL context it uses for rendering. In practice QQuickWidget also
requires at least a part of this. To unify the behavior when it comes to
reparenting to a different top-level window, add the bail out condition for
AA_ShareOpenGLContexts to QQuickWidget as well.

[ChangeLog][QtQuick][Important Behavior Changes] QQuickWidget now behaves
identically to QOpenGLWidget when it comes to handling window changes when
reparenting the widget into a hierarchy belonging to another top-level
widget. Previously the OpenGL context always got destroyed and recreated
in order to ensure texture resource sharing with the new top-level widget.
From now on this is only true when when AA_ShareOpenGLContexts it not set.

Task-number: QTBUG-54133
Change-Id: Ifda0db76fdf71dae1b9606fb5d59cee6edc2f5a4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-29 08:23:24 +00:00
Liang Qi 5f2249f4dc Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
2016-06-29 10:11:25 +02:00
Allan Sandfeld Jensen 97212616d5 Lazy create QmlEngine on accessing rootContext
A common usecase appears to be to set variables in the rootContext
before loading a url in a QQuickWidget. We there need to ensure there
is a QmlEngine to set variables on when this is attempted.

Change-Id: I07aff2104313eeb3fab902ea3c6043c3c82c50f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-06-27 15:40:17 +00:00
Simon Hausmann 8d139e5e42 Minor optimization
I've seen people write

    property SomeItem myProperty: null

This is an unnecessary initialization that ends up creating a binding
expression. Generally there's handling missing for null and undefined, but in
this very case we should just optimize away the initializer expression,
because QObject style properties are initialized to null by default, as opposed
to undefined.

Change-Id: I7af4cd45461304753c93cef3926f6e92d3b6c95d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-27 07:39:47 +00:00
Erik Verbruggen 3dfd47362f QML: Specialize bindings based on target property type.
When we can determine the type of a target property during type
compilation, we can skip a whole bunch of code that deals with
converting the result of a binding to the correct (target) type.

This removes 65 instructions on x86 for such typed bindings.

Change-Id: Id2c7c57b9ae6dfbeb921121beae9630604ca1d17
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-27 06:20:23 +00:00
Allan Sandfeld Jensen c9d4c8ed97 Create QmlEngine lazy in case one is not needed
QQuickWidget may be used with just a root item, and won't need a
QmlEngine in that case. So if one isn't given to the constructor, only
create one when one is needed for evaluating source.

Change-Id: I96cfe5e2473d5d53fc2d52d4646d36c43f4ccb8a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-06-24 11:59:34 +00:00
Jan Arve Saether fb15206453 ungrab touch points if the MultiPointTouchArea is hidden or disabled
This caused MPTA to not emit onCanceled and caused the touch points
'pressed' property to not become 'false' after the MPTA was hidden or
disabled. We now ungrab the touch points where we already ungrabbed the
mouse.

Change-Id: I90a5d4fa4b3fa470b8b60881c80418e79061f001
Task-number: QTBUG-42928
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-23 08:14:00 +00:00
Laszlo Agocs 65c877f40e Add cross-backend simple rect, texture, and ninepatch nodes
QSGSimpleRectNode is deprecated -> use
QSGRectangleNode via QQuickWindow::createRectangleNode() instead.

QSGSimpleTextureNode is deprecated -> use
QSGImageNode via QQuickWindow::createImageNode() instead.

The OpenGL version of the simple rectangle node is switched over to
the vertex color material instead of flat, to allow for better batching.

Use the same concept for nine patch nodes. The "style" node from Quick Controls 1
is now QSGNinePatchNode in order to provide a proper cross-backend solution which
is already necessary due to the software backend, but now generalize it to apply
to the accelerated backends with proper materials as well. QC can now simply call
createNinePatchNode() without further ado.

Also fixes a bug with the D3D12 texture material not enabling blending
when needed.

When it comes to the internal class names, QSGRectangleNode and
QSGImageNode get the Internal prefix in the adaptation layer in order to
differentiate from the public API. This involves quite a lot of renaming,
but results in a nice and clean public API.

Change-Id: Iddf9f9412377843ea6d652bcf25e68d1d74659ea
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-06-22 13:11:14 +00:00
Erik Verbruggen 702c4247d7 V4: Pass scope around as parameters inside the runtime.
The implementation of many (or all) runtime functions consist of first
creating a QV4::Scope, which saves and restores the JS stack pointer.
It also prevents tail-calls because of that restoring behavior. In many
cases it suffices to do that at the entry-point of the runtime.

The return value of a JS function call is now also stored in the scope.
Previously, all return values were stored in a ScopedValue, got loaded
on return, and immediately stored in another ScopedValue in the caller.
This resulted in a lot of stores, where now there is only one store
needed, and no extra ScopedValue for every function.

Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-22 11:07:05 +00:00
Laszlo Agocs 7de18e6f52 D3D12: Support runtime threaded shader compilation
Let's revise our policy of offline/bytecode only shaders. ShaderEffect
benefits greatly from having runtime compilation support for HLSL
source strings, especially when dynamically constructing shader strings.
There is no reason not to support both approaches since we rely on d3dcompiler
for reflection anyhow.

What's more, we can call D3DCompile on a dedicated thread, keeping the
gui responsive while compilation is on-going.

Change-Id: Ie6c02c2aa0ebd0c8371bbf30b3ce6582128c457b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-22 08:54:40 +00:00
Timur Pocheptsov d2b3a3a4e6 qmltest - fix accidentally broken BLACKLIST
Remove the line that previously was a part of 'linecount' test BLACKLISTed
and now accidentally BLACKLISTed another test instead.

Change-Id: I3618fc0478d7a245c1c5aaaf6f38eb9359f523b0
Reviewed-by: Milla Pohjanheimo <milla.pohjanheimo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-22 07:23:50 +00:00
Liang Qi 43431619d6 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/quick/items/qquickflickable_p_p.h
	src/quick/items/qquickpathview_p_p.h
	tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp

Change-Id: I77664a095d8a203e07a021c9d5953e02b8b99a1e
2016-06-21 21:22:46 +02:00
Daniel d'Andrada b61c774ce5 QQuickSpriteEngine: avoid entering infinite loop in assembledImage()
Do not allow a frame size larger than the image size, otherwise
we would never leave "while (framesLeft > 0) {...}" as framesLeft is
never decremented because "copied/frameWidth" in the expression
"framesLeft -= copied/frameWidth;" always resolves to zero because
copied < frameWidth.

Task-number: QTBUG-53937
Change-Id: Ia777ec65d72562426b13533918efcaca5bcabdd7
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-21 14:31:09 +00:00
Stephen Kelly 5d23470b8d Report changes correctly when inserting into a ListView
Commit v5.6.0-beta1~7 (ListView: Sanitize visibleItems list after model
insertions, 2015-12-07) introduced sanitizing of the container of visibleItems,
but it did not affect the return value of the

 QQuickListViewPrivate::applyInsertionChange

function.  The return value is used in

 QQuickItemViewPrivate::layout()

to determine whether the layouting should proceed, or an early return is
possible instead.  If the layouting does not proceed, then the newly inserted
visible items do not get painted, resulting in the linked bug.

The return value of the

 QQuickListViewPrivate::applyInsertionChange

function was previously determined by whether the new count of visible items is
greater than the previous count.  After the sanitation in commit
v5.6.0-beta1~7, this numeric comparison is no longer a good indicator of
whether a repaint is needed.  Change the return value to indicate whether new
items were inserted which are visible in a more-direct way.

Verify that visible items are initialized correctly in tests.  They should not
be 'culled'.  It is necessary to invoke the layout method first to clear the
forceLayout state.  Two pre-existing tests fail before the fix in this patch.

Change-Id: I625f1e02bf7001834adb147161a1e478a0ce2a0d
Task-number: QTBUG-53263
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-06-21 11:51:46 +00:00
Timur Pocheptsov 4c1dd3efb0 qmltest - remove 'linecount' from BLACKLIST
Must be fixed on OS X now.

Task-number: QTBUG-53778
Change-Id: If94085210115534cf7a467100ec00fc419474c67
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-21 11:32:01 +00:00
Timur Pocheptsov ec77984db9 qmltest::item-grabber - fix image paths
When running qmltest::itemgrabber we save grabbed image into the qmltest dir
but using this name later as 'source' (relative) url we fail to load image.

Task-number: QTBUG-53782
Change-Id: Ibd1f32d8bc13ff155b23491401075638cef16987
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-21 11:31:40 +00:00
Timur Pocheptsov 99e181a543 qmltest:doublevalidator - fix locale
The string "1.0" can fail validation due to locale (requiring ',' for example).

Task-number: QTBUG-53779
Change-Id: I44b2b6886d96a7a32668bea56b5f34bb8d9db8d3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-21 10:34:52 +00:00
Liang Qi cb6c208c77 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/qml/jit/qv4targetplatform_p.h
	src/quick/accessible/qaccessiblequickitem_p.h

Change-Id: Ic95075a5fad81ec997a61561bd65979dfa3b9d4d
2016-06-20 12:26:08 +02:00
Simon Hausmann 7c8441fece Clean up pragma singleton handling in the type loader
Get rid of the m_isSingleton boolean by checking the
CompiledData::Unit::flags after the type compilation. This is more
compact and makes the singleton type checks independent from the IR.

Change-Id: I04189d284e6ea275ac8540918836b641914e7588
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-20 08:02:01 +00:00
Frank Meerkoetter e88500ff25 Increase test coverage for the V4 memory manager
This commit adds a small test that exercises a number of code paths
inside qv4mm.cpp which are normally gated via environment variables.

Change-Id: Ibe959387a9b86ce68df258513446d2165fe06ee2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-20 07:42:08 +00:00
Simon Hausmann 156d10e165 Clean up file/error handling in the type loader
Fold the functionality of reading QFile contents via QQmlFile into
QQmlDataBlob::Data. This reduces the dependency on QQmlFile - which is
scheduled for removal - and it makes it possible in the future to avoid
reading the file altogether if we have a cached compilation unit on
disk.

Change-Id: Ieeaf52b6fb1d25665cd3c3b196819e25aba3dd15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-20 04:08:53 +00:00
Timur Pocheptsov c8241e8551 qmltest::linecount - adjust text width
With text line width 50 'Hello world!' is split into 2 lines on OS X
10.11 and the test expectes 3 lines, let's try something less than 50
(44).

Task-number: QTBUG-53778
Change-Id: Id3254e9d89e7b41498ff8735eff97f0317ae9677
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-18 13:44:15 +00:00
Simon Hausmann 8a33d37006 Added basic support for saving compilation units to disk
Hidden behind a QML_DISK_CACHE=1 environment variable we will now attempt to
save a binary representation of the type compilation for Foo.qml next to it called
Foo.qmlc.

Change-Id: I27e800b50cdb186669256fd277578ea1f1e70513
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-17 09:06:01 +00:00
Shawn Rutledge 547d0bdf09 highdpi manual test: include <QDebug> not qDebug.h
Change-Id: I24b3ccd23fdb42d44978debeeec96bac179edba6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-06-16 09:51:49 +00:00
Liang Qi 34956bc234 Merge remote-tracking branch 'origin/5.7.0' into 5.7
Change-Id: I7b0ad528da17ecdb955c2d0c792c9f113904623e
2016-06-16 07:09:19 +02:00
Shawn Rutledge e042330563 Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-06-14 05:26:37 +00:00
Liang Qi 4d2f743baa Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp

Change-Id: I26d6435a29cac3840bb567ade5149c2562a94bf9
2016-06-13 19:06:06 +02:00
Milla Pohjanheimo 000914cf5d Blacklisting tst_QQuickListView::populateTransitions on OpenSUSE 42.1
To get QtWayland in the CI, we need to blacklist populateTransitions
on OpenSUSE 42.1

Task-number: QTBUG-53863
Change-Id: I7b8b1467757083ea630a0e08e7f27f4b2396e0b1
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-06-13 08:41:01 +00:00
Shawn Rutledge 94324bd93f tst_touchmouse: make use of new QTest::createTouchDevice function
So gui-private API isn't necessary anymore.

Task-number: QTBUG-44030
Change-Id: If4e77fc99e9f6373b8dd0303c9ac52e71ed43cf7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-06-13 06:04:24 +00:00
Ulf Hermann 210617de78 QML: Only release types if they aren't referenced anymore
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.

Task-number: QTBUG-53761
(cherry picked from commit 2ac19881f9)
Change-Id: If254d5bca1f41ec948ec1438df0d37bf8d531bdf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-06-11 12:05:08 +00:00
Ulf Hermann 2ac19881f9 QML: Only release types if they aren't referenced anymore
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.

Task-number: QTBUG-53761
Change-Id: I8567af8e75a078598e4fed31e4717134e1332278
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-10 19:16:45 +00:00
Liang Qi 56d9505e9d Blacklist qmltest::ListView::test_listInteractiveCurrentIndexEnforce()
Task-number: QTBUG-54028
Change-Id: I03390ebfb99927851926c0099fb79581f7b9e7a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-06-10 19:16:43 +00:00
Laszlo Agocs 0c5a9ff987 Merge branch 'wip/scenegraphng' into dev
Change-Id: If8577edb361748535159375c68238845220921a8
2016-06-10 21:12:28 +02:00
Andy Nichols 83dd66ac27 QQuickItemLayer: Don't run tests with GLSL when OpenGL is not used
Change-Id: Ife4a2b1ea691483915c48fd5bb86ff2858df3c34
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-06-10 12:20:07 +00:00
Laszlo Agocs c9d8b85ec9 Merge "Merge remote-tracking branch 'origin/wip/scenegraphng' into dev" into refs/staging/dev 2016-06-10 09:32:24 +00:00
Liang Qi 0932a59971 Merge remote-tracking branch 'origin/5.6' into 5.7
Part of 0e053528 was reverted in the merge, about lastTimestamp. It
will be applied later in separate commit.

qmltest::shadersource-dynamic-sourceobject::test_endresult() was
blacklisted on linux.

Conflicts:
	.qmake.conf
	tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
	tests/auto/qmltest/BLACKLIST
	tests/auto/qmltest/qmltest.pro

Task-number: QTBUG-53590
Task-number: QTBUG-53971
Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
2016-06-10 10:06:39 +02:00
Stephen Kelly aca40a8361 Fix names of tests
The existing names are copy-paste duplication from the test above.

Change-Id: Ie50a0ed6530361c321b619549b3e3896472b7242
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-06-08 14:44:18 +00:00
Andy Nichols ad5b72ab28 Skip mirroring tests with software adaptation
Results are false positives for test failures when run due to small
differences in smoothing and scaling.

Change-Id: I95a75b6dd5d4bc97f0fc24167510477b11ab4b9e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-06-07 09:18:08 +00:00
Andy Nichols 4f501e364e Disable BoomBlock qml compilation benchmark when building without OpenGL
The BoomBlock benchmark imports the Particles module which requires
OpenGL, so it will be skipped for -no-opengl builds.

Change-Id: I1754461f0920e85a51c5b1d5b3f5c8b2c5d26e18
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-07 09:18:05 +00:00
Simon Hausmann 6d54a59bd7 Fix crash when using with statement with an expression that throws
We need to evaluate the expression for the "with" statement that is supposed to
define the new scope _before_ opening up the scope, otherwise - when the
evaluation of the expression throws an exception - we'll try to pop the "with"
scope we couldn't open in the first place.

[ChangeLog][QtQml] Fix crash when using the "with" statement with an expression
that throws an exception.

Task-number: QTBUG-53794
Change-Id: I7733f5a4c5d844916302b9a91c789a0f6b421e8a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-07 07:07:15 +00:00
Corentin Jabot 8c8ec31b7a Add QJSEngine::newQMetaObject
QJSEngine::newQMetaObject let us expose QMetaObject to the QJSEngine,
allowing to construct QObjects instance from javascript.

Additionally, enums values are exposed as property of the QMetaObject
wrapper.

(The engine takes ownership of the created objects)

Change-Id: I5428d4b7061cceacfa89f51e703dce3379b2c329
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-05 15:25:40 +00:00
Simon Hausmann 6d63e3ba09 Fix bug in SQL database integration with null values
Since commit 91d6a63ab3 a null JS value is
mapped to a QVariant(VoidStar) to properly create null JS values when
converting back again. However that broke the binding of values in the SQL
database, where it ended up mapping null to an empty string.

[ChangeLog][QtQml] Fix mapping of null JS values to null SQL values instead
of empty strings.

Task-number: QTBUG-53412
Change-Id: Icf1fea4674e9dd8bb5313e3770ed2d3f99849987
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-06-03 14:37:26 +00:00
Simon Hausmann 4018a91d2f Minor const cleanup
The unit data of QV4::CompiledData::CompilationUnit is read-only, which we
should "enforce" with a const, especially as in the future it may come from a
read-only mmap'ed chunk of memory.

Change-Id: I58dde9fe2494d3cfa52cdc9f612c7fa90b98aa26
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-06-03 13:24:07 +00:00
Valery Kotov a8399c5440 QML Engine: Support for "PATCH" method for XMLHTTPRequest
Support for HTTP PATCH method was added to QQmlXMLHttpRequest. Tests for
PATCH method in XMLHttpRequest were added.

[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports the PATCH method in HTTP requests.

Task-number: QTBUG-38175
Change-Id: Ib3c104b558f626bb63624e234f1362adcf6cbd4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-03 13:23:55 +00:00
Filippo Cucchetto 7039db4885 Revert removal of "Fixed MouseArea threshold with preventStealing"
This reverts commit 9c8dab5378
where commit e1400b5b4d was removed
due to the breakage of QtLocation tests.

After some hours of debugging it seems that the problem in QtLocation
was due to filtering of mouse move events in QDeclarativeGeoMapItemBase.
See QTBUG-52075

Task-number: QTBUG-52534
Change-Id: I00f002c1d6f60f74a148b5a6ac2b9f63e93718a9
Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com>
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
2016-06-03 10:32:33 +00:00
Liang Qi 38b11b7b52 Removed insignificant of qmltest again
Blacklisted or skipped broken and unstable test functions. Some
are moved to tests/auto/qmltest-blacklist folder.

Task-number: QTBUG-33723
Task-number: QTBUG-38290
Task-number: QTBUG-53778
Task-number: QTBUG-53779
Task-number: QTBUG-53780
Task-number: QTBUG-53781
Task-number: QTBUG-53782
Task-number: QTBUG-53785
Task-number: QTBUG-53793
Change-Id: I35594d0d054f4f5719f6549536a1fc5bd7e2518f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-02 15:22:21 +00:00
Simon Hausmann 1f3f6d3e7d Remove QQmlCompiledData in favor of QV4::CompiledData::CompilationUnit
QQmlCompiledData used to contain the binary data for instantiating QML types in
the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler
create a QV4::CompiledData::CompilationUnit.

Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-06-01 17:33:50 +00:00
Laszlo Agocs 272b9a8ad6 Merge remote-tracking branch 'origin/wip/scenegraphng' into dev
Change-Id: Id0f9774dba13ccf10facc7da91b6791a96e0d778
2016-06-01 15:38:07 +02:00
Laszlo Agocs 1c6d4353f7 One GraphicsInfo to rule them all
Rename RendererInfo to GraphicsInfo. Deprecate OpenGLInfo and move
the surface format properties into GraphicsInfo. Move also the
shader info properties from ShaderEffect.

Change-Id: I3b3f01080e059b3a30a132fd67de19a4bfca54ef
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-01 10:32:18 +00:00
Laszlo Agocs b34296671b Change graphicsAPI to graphicsApi
Change-Id: I065f17abd1cb71cd8d6ead76abf7a544eb7a99c0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-01 10:32:12 +00:00
Simon Hausmann 2bb309af8b Moved resolved type references over to QV4::CompiledData::CompilationUnit
Change-Id: I99bb37bf4d4aa4aedd8e02a0fb4afb4a908573a6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-05-31 14:28:29 +00:00
Laszlo Agocs 8cd4c288b5 D3D12 manual test: add an async, uncached image loading test
Change-Id: I8901a67d9e2b3343ba3f57775f1849400f6cdf18
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-31 12:42:06 +00:00
Andy Nichols 91e1a65cdb Merge remote-tracking branch 'origin/dev' into scenegraphng
Change-Id: I35715e07b6f837f21cd8e8898f19d97af92c6b69
2016-05-31 12:24:30 +02:00
Milla Pohjanheimo 7e84a8631c Blacklisting tst_QQuickText::fontSizeMode on OpenSUSE 42.1
To get QtWayland in the CI for OpenSUSE 42.1, we need to blacklist
this test.

Task-number:QTBUG-53512

Change-Id: Ib150088e3843bab87f845d3502e8e2712fb8ff4b
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-05-31 09:24:13 +00:00
Simon Hausmann 7cd4d60c74 Removed the dependency to QQmlCompiledData from QQmlCustomParser
We only need fields from the compilation unit, so let's pass that instead.
This is private, internal QQmlEngine API only used by QtQml and QtQuick.

Change-Id: I1a659654d95585b736384b5b519d05a4df3f9ead
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-30 11:03:36 +00:00
Simon Hausmann e850416fcf Optimize named object handling
By storing the object indices of named objects in the CompiledData::Object of a component,
we can achieve two things:

    (1) We can eliminate the hash of vectors in QQmlCompiledData for the object-to-id mapping
    (2) We can store the mapping from object name to integer object id in the CompilationUnit and
        share it across different QQmlContextData instances (as long as it is not modified).

Also added a new test that verifies the functionality of a .qml file starting
with Component{} itself with object names, something that was previously only
implicitly tested through some of the examples (corkboards.qml for example).

Change-Id: I28c70217222dc0e5252bf5247b7e3fc4def47446
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-26 19:57:55 +00:00
Simon Hausmann 7dcda224fe Fix crash with SignalTransition
Don't crash when using SignalTransition with a signal object instead of the
slot used to emit the signal. A signal object is just as good.

Task-number: QTBUG-53596
Change-Id: I8a419d16ec0c257c9a798a83ee5bad338794cdd2
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2016-05-25 17:09:32 +00:00
Ulf Hermann 0e05352843 QmlProfiler: When flushing data, send it in the right order
Some of the adapters immediately return dataReady() when reportData()
is invoked. This means that there is only one adapter in the start
times list then, which in turn causes all the data from that adapter
to be sent at once, without caring for the other adapters' timestamps.

Change-Id: Ic1e12fdcefb0a691067518fba100368f13c927f7
Task-number: QTBUG-53590
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-05-25 14:36:57 +00:00
Erik Verbruggen 5f3b1e8125 V4: Get more code inlined in the MemoryManager.
Change-Id: I7cf6c5d3458b0c43283e63a7300ee9965ba803fb
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
2016-05-25 08:22:40 +00:00
Eskil Abrahamsen Blomfeldt 441baca74e Fix tst_qquicktext::lineLaidOutRelayout() with > 1 font
When more than one font is needed to display the text in the layout,
then the line height of the layout may not be constant. This rewrites
the test to properly handle this case.

Task-number: QTBUG-51934
Change-Id: I0e0cdfdc06b4a39684b33d10efdd58f98dea06b8
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-05-25 08:07:03 +00:00
Laszlo Agocs 0837453ef9 Merge remote-tracking branch 'origin/dev' into HEAD
Change-Id: If91e0e28d004f1db978dcab393f189743bb69cd5
2016-05-24 21:50:29 +02:00
Simon Hausmann a681465023 Get rid of QQmlVMEMetaData
It is unused now and we can remove it as well as its QByteArray based storage.
The non-emptyness of the meta-data QByteArray was also used to indicate whether
it is necessary to create a VME meta-object when instantiating an object. This
bit is now folded into the flag of the QFlagPointer storing the property
caches.

Change-Id: I3c3604c61ff16a4e76912e68b1c19afdb0f2bd9d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-24 14:08:23 +00:00
Simon Hausmann 70c536b047 Get rid of QQmlVMEMetaData::AliasData
The remaining signal index for the changed signal of the alias target
is something that we need only once (when doing the initial alias endpoint
connection) and then we can retrieve it from the property cache.

Change-Id: Ifbd4625f9af3ca00c9b916eee5c82f58450d54ef
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-24 14:08:18 +00:00
Simon Hausmann 641beae327 Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-05-24 14:08:15 +00:00
Liang Qi 8ae479a8ea Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/jsruntime/qv4engine_p.h
	src/qml/jsruntime/qv4runtime_p.h
	src/qml/qml/qqmldelayedcallqueue.cpp
	src/qml/qml/qqmlvaluetypewrapper.cpp
	src/qml/qml/qqmlvmemetaobject.cpp
	src/qml/qml/v8/qv8engine_p.h
	tests/auto/quick/qquicktext/tst_qquicktext.cpp

Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
2016-05-24 14:00:39 +02:00
Laszlo Agocs 9ff09fb283 Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Conflicts:
	src/quick/items/qquickopenglshadereffectnode.cpp
	src/quick/items/qquickshadereffect.cpp
	src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
	src/quick/scenegraph/qsgdefaultglyphnode_p.h

Change-Id: I3d6874b4e4231a89d2836c04fe8e7f2ef2d698c4
2016-05-24 11:33:42 +02:00
J-P Nurmi 5e651178b2 Fix QQuickItem change listeners
All listeners should get invoked, even if they remove themselves
while iterating the listeners. An index-based loop would skip the
next listener in the list. This change replaces the QPODVector with
a QVector, so we can make a cheap copy before iterating the listeners.

Change-Id: I2430b3763184a40ad1c5c3a68d36fecafcadb3ee
Task-number: QTBUG-53453
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-24 04:35:29 +00:00
J-P Nurmi 15b2e6da74 Use the pre-defined QQmlExtensionInterface_iid macro
The others were changed in 5.6 commit 392c7b9. These are the last
remaining occurrences in 5.7.

Change-Id: I1b17e35b0d1dda6ad598c6c30727c1728b688074
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-05-23 20:34:49 +00:00
Filipe Azevedo 82b0b31fe4 Fix crash for unknown QQmlListModel roles in debug builds
If a role is unknown, trying to access it will crash in getExistingRole.
Fixed that and now return QVariant() for unknown roles.

Change-Id: Iad5c1292a4faee893fbc5a69984cf776aca85d70
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-23 14:01:42 +00:00
Simon Hausmann 7f7e2b0c9c Simplify VME meta object meta-data
For each type of VME meta object we store an array of integers holding the
meta-type ids of the QML declared properties. We can replace that array with
access to the QV4::CompiledData::Property entry for each property, where the
type is also accessible.

This is a fairly straight-forward change, except for the bit in
QV4::CompilationUnit where we delay the release of the CompiledData::Unit and
friends until the destructor instead of releasing it at unlink time. That
should be a safe change and is necessary as there are a few tests around where
the VME meta object still needs access to this meta-data at a very late stage
in the life-cycle right before the deferred deletion is run.

Change-Id: I431de15d12766df837c0e0251192df16a5a76868
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-23 08:59:34 +00:00
Robin Burchell e7da97bf71 QQuickWindow: Only send focus events to items that actually gain focus
Sending focus events may result in further changes to which item actually has
focus, so we cannot blindly send the focus events without first checking that it
hasn't subsequently changed.

To accomplish this, we delay sending events as long as possible, ensuring that
all necessary bookkeeping is done first to ensure internal consistency.

Task-number: QTBUG-40145
Change-Id: I7d93b3f8e3fea2ecce2151c88c29601deda12453
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-23 07:12:40 +00:00
Erik Verbruggen 607320ca9f V4: allow inlining of ExecutionEngine::{qml,js}Engine()
All other changes are just to be able to include qv8engine_p.h in
qv4engine_p.h

Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-20 13:44:13 +00:00
Kari Hautamäki afd01a7341 Don't render when width is zero and elide is not None
Works now similarly as with very small text lengths (smaller than
elide characted length).

Change-Id: I0c4aafbcc50343bb0ec8b5f335045e1048a499fd
Task-number: QTBUG-34990
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-20 08:20:07 +00:00
Liang Qi 63ec33e79c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4engine_p.h

Change-Id: I89ffccd699bee675732758d039e22224b275d60d
2016-05-19 20:41:34 +02:00
Simon Hausmann ef6469a959 VME Method object data cleanup
Get rid of the redundant MethodData meta-data that is stored per-type.

Change-Id: I9faa284bdd0c9f0c9ebb3c66905ab5e34a9ee3a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-19 12:12:35 +00:00
Liang Qi afc84775ef Merge remote-tracking branch 'origin/5.6.1' into 5.6
Change-Id: Ib7f8c60143c1efab279476dba390a3d9837ccc37
2016-05-19 06:34:04 +02:00
Simon Hausmann 5861dc4869 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/qml/v8/qqmlbuiltinfunctions_p.h
	tests/auto/qml/qqmlqt/tst_qqmlqt.cpp

Change-Id: I9dd93732f4b19513576ca1dd89ae18c69de0203b
2016-05-18 15:17:37 +02:00
Simon Hausmann 72515ebe5a Fix crashes when incubating objects asynchronously with initial properties
This is a regression from commit 94e337fa95 where
we accidentally ended up not having a calling QML context set anymore when
initializing the properties on newly incubated objects as provided by the
caller. The QML context is necessary as for example when we set a URL property,
the URL can be relative and it will be resolved to the base url of the context
when written, such as in in QQmlPropertyPrivate::write.

Change-Id: I1d896381fc92f653a7d76f4d82174bca48828f5e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-18 10:08:30 +00:00
Simon Hausmann 6371b208a9 Revert "Remove this piece of code"
This reverts commit bad007360a.

The lookup in the global object is necessary to detect whether we've seen any
unresolved properties. This is used for the optimization of skipping binding
refresh updates when a context property changes.

Task-number: QTBUG-53431
Change-Id: Idb39a32e4b58b915496bbb9d8a098dc17a6f688a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-18 07:44:45 +00:00
Oswald Buddenhagen 87cf6b7ae7 standardize on QT_CONFIG debug_and_release instead of build_all
the two flags are equivalent. use the same one everywhere.

Change-Id: I9ac0caad5a9a8d37813f8de4d81067e20656abc5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-17 15:31:44 +00:00
Robin Burchell 064dc6a29b QQuickTextInput: Remove redundant centerPoint calculations.
The default is to press/release in the center of the window, so we don't need to
DIY.

Change-Id: Id65b2b54c15d45e8d780a008d05275718f519a71
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-17 15:21:17 +00:00
Simon Hausmann 1c51ae2911 Fix visibility of properties in value types
It should be possible to enumerate the properties of value types (gadgets),
in order for things like JSON.stringify(Qt.point(10, 20)) to return something
sensible.

Task-number: QTBUG-43382
Task-number: QTBUG-34878
Change-Id: I3a2c09151ebe97fd97760dfbbf5a4f58e022bc94
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-15 18:35:15 +00:00
Liang Qi ae745746a6 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/jsapi/qjsengine.cpp
	src/qml/qml/qqmlengine_p.h
	src/quick/items/qquickanchors.cpp
	src/quick/items/qquickanimatedimage_p_p.h
	src/quick/items/qquickitem_p.h
	tests/auto/qml/qqmlecmascript/testtypes.h
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
	tests/benchmarks/qml/creation/tst_creation.cpp

Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
2016-05-13 08:28:27 +02:00
Oswald Buddenhagen 61c8539e2a blacklist the qmlextensionplugins example for testing
it requires a special import search path. it would be possible to hack
this into the test launcher, but that doesn't seem worth it (there are
other plugin examples already).

Change-Id: I147b802c690933803cb8f9cf35210618957a6998
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 04:35:45 +00:00
Oswald Buddenhagen 83d3611199 remove blacklisting of tiger and fonts examples
the associated bugs are marked as fixed for a long time.

Change-Id: If8c8710bdf4b7b1962c9749b701cbd335d938fdb
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 04:35:40 +00:00
Oswald Buddenhagen 3cdf72a7b5 adjust example naming convention test to "new" structure
Change-Id: I42ec26bd3c2ffa32ae8c5323f7c0a0343d12ce2f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 04:35:37 +00:00
Oswald Buddenhagen 578d271719 make use of COPIES
Change-Id: I479c9523a89be1d64364e8205daa5860e16882cc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 04:35:22 +00:00
Mitch Curtis f5ae7e4f81 Fix tst_qquicktext::hAlignImplicitWidth() on high DPI displays
The test assumed that the grabbed image of the window was the same
size as what was specified in QML, but QQuickWindow::grabWindow()
returns an image that is scaled by the screen's devicePixelRatio.

Change-Id: I5b361edb28bec562c7f528d06892277dcbe5769f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-12 19:08:51 +00:00
Oswald Buddenhagen 70d30cb2b9 prune unused assignment
Change-Id: Iecb1e9cd4d068660a96ba98480e92d9aa3981671
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-12 14:20:31 +00:00
Erik Verbruggen 28128f2dc6 QML: Fill QtObject lazily.
Only iterate over the enumerations/enumerators in the staticQtMetaObject
when a get() is done, and the key/value is not yet in stored in the
underlying Object. The whole cost of the iteration is now moved to get()
and advanceIterator(). The latter will add all items in one swoop, but
iteration over QtObject isn't used much (if at all). The get() will add
all key/value pairs up until it finds the requested key. Checking a
number of applications shows that none of them use all (or the "last")
key, so it will actually save entries (which equals memory) too.

This change reduces the instruction count for QtObject from 2.7M
instructions down to 95k. As this initialization is done from the
QQmlEngine constructor, it also speeds up that initialization.

Task-number: QTBUG-43770
Change-Id: I71331ff76bdacdd4790f7ff0430c4cbc214fe0ab
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-11 12:23:17 +00:00
Erik Verbruggen 48492b2ee5 QML: add librarymetrics_performance to the builds.
Also make sure that we can easily deploy this test to devices by putting
all data inside a qrc file.

Change-Id: I175830fde51332b13068b163eba3d68c0535b712
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-10 17:29:39 +00:00
Erik Verbruggen c6c0d730b7 QML: Remove internal field padding from QQuickAnchorPrivate.
Don't store QQuickAnchorLine, but store both fields separately in
QQuickAnchorPrivate. This prevents padding of QQuickAnchorLine, saving
48 bytes on x86_64 (or any platform where structs are 8-byte aligned).

On x86_64, this also removes ~180 instructions for each QQuickAnchor
creation/removal, and speeds up the constructor by 25%.

While in the neighborhood, do a drive-by change and merge
QQuickAnchorLine::AnchorLine and QQuickAnchors::Anchor by removing the
former.

Change-Id: I50ab6252b1903f5f1a075174e6185c3048a8f8ec
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-10 08:17:00 +00:00
Ulf Hermann f829f12d3d QmlProfiler: Don't import QtQuick if we don't use it
This enables some of the tests to run in QML-only environments, without
QtQuick.

Change-Id: Icc7250b6ddab43730cb4744ffc4e0bade8574d26
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 15:31:15 +00:00
Simon Hausmann 65e642f13d Make it possible to call some benchmark functions directly
Some benchmarks - such as "elements" - rely on QQmlMetaType::qmlTypeNames(),
which is implicitly populated when other benchmarks import for example QtQuick.
However when calling them directly, the benchmark data set is much smaller.
Therefore let's add QtQuick to the "base" set that is always available.

Change-Id: I4b3696a426854195deb1c31ad24d80427da7b340
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-09 08:14:53 +00:00
Andy Nichols ddbe4ec52b Fix build with QT_NO_OPENGL after rebase
Change-Id: Ia4243de07ec75030bb98f4f6d95f70d88e29fdba
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-08 20:04:37 +00:00
Laszlo Agocs 76c7f7b10f D3D12: Fix a buffer sync issue and fix up tst_scenegraph
the manyWindows test passes now which is excellent.

Complex render / bug fix tests are skipped for now due to them doing
GL specific stuff no reasonable to investigate for now.

createTextureFromImage() gets its scenegraph-valid condition fixed as
well.

Change-Id: Ie72da127e7f219f3c3d024e9f896d1617d06ab85
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-08 20:03:33 +00:00
Laszlo Agocs 3fe2ecccc9 D3D12: Massage tst_qquickwindow and some sg semantics
Change-Id: Ic4cc9ae5c1df2ab7e1da50ac414dc3d7f264e691
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-08 20:03:24 +00:00
Laszlo Agocs e3716cdf88 Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ifb69f73ac805afe5e3c8708fa975b7d3c13a4e48
2016-05-07 13:26:27 +02:00
Andy Nichols 928915cabe Fix some test failures with QT_NO_OPENGL builds
Change-Id: I4154084b4a0e0709ee8cb39a856a37a611e2d537
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 19:17:28 +00:00
Andy Nichols 11e788c9a5 Get tests building when QT_NO_OPENGL is defined
Change-Id: I36f9e5e916b59657990d7613850ba76d2489a21e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 19:17:24 +00:00
Michael Brasser 69b7ba2250 Introduce BorderImageMesh.
BorderImageMesh provides an optimized way to use BorderImage-type
images with ShaderEffect.

[ChangeLog][QtQuick][ShaderEffect] Add new mesh type BorderImageMesh.
BorderImageMesh provides an optimized way to use BorderImage-type
images with ShaderEffect.

Change-Id: I73bdc8318a0facba6edc2634b5f4614996b39c1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-06 18:25:43 +00:00
Laszlo Agocs 2bb63f9e52 D3D12: Implement grabWindow
Change-Id: Icb8151f26bad68795eb2e1f920297267c880b40b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-06 11:27:22 +00:00
Liang Qi 9b6d55ddf3 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I3c6a93917cb46868cdb9dd50566b90c70f67102e
2016-05-06 09:17:24 +02:00
Liang Qi 944b6878df Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I694ac053b53b669ef5578fd0074de5ce109f7a09
2016-05-04 16:14:45 +02:00
Laszlo Agocs 84fb780d83 Introduce RendererInfo
Modeled after OpenGLInfo, RendererInfo.api is an easy to use attached
property that reports the current graphics API as long as the item is
associated with a window that has the scenegraph initialized.

Applications should not worry about this in general since they should
target one given API, however tests, examples and some advanced use cases
will find this handy. RendererInfo is also a great place to expose other
properties in the future.

Change-Id: Ie3411b8820fc4b74efd1b1d0143e936886f62d74
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-03 10:12:40 +00:00
Laszlo Agocs 3551093f42 D3D12: Painter node
Only supports QImage backing.

As a bonus add some notes to the Context2D docs too.

Change-Id: I18457a1f766d2f136c6864ec06fe596668d5e726
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-05-03 10:12:36 +00:00
Kevin Ottens 373c621bf4 Add QVector support to JS sequences
Change-Id: I731355aa1754721236f3711a65af4f96781cebc0
Task-number: QTBUG-51467
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-03 08:00:30 +00:00
Liang Qi 5caa2d03c1 Quick: expose movementDirection of PathView
It is needed by the behavior of TabBar in universal style in QtQC2.

[ChangeLog][QtQuick][PathView] Added movementDirection property

Change-Id: Iedc214a12e7336e52125ec82b9ded45502905978
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-02 13:14:39 +00:00
Simon Hausmann 9530a6a874 Revert "Temporarily blacklist importsPath change on Windows"
This reverts commit 91a96d1de9.

I've been told that the race condition in the networking stack has been
fixed on Windows.

Change-Id: Ica038229e8e164a199332288ed140ca6a1d3104c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-02 11:43:25 +00:00
Tobias Koenig be031102c2 AnimatedImage: Fix value of sourceSize property
Cache the source size of the internal QMovie object during the
change of the 'source' property to ensure that always a valid source
size is returned without emitting more sourceSizeChanged() signals
than necessary.

Change-Id: I637b80efb133197b7345b09fcf8a7bb80c5643c9
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-05-02 06:49:54 +00:00
Simon Hausmann 1650377af7 Fix crash when trying to call a property of the scope or context object
For calls on properties of the scope or context object the thisObject parameter
in the callData is a reference to the QmlContext, not a real object - therefore
the toString conversion fails.

Task-number: QTBUG-52340
Change-Id: I08d01cc5c05920c2fac46ddd40fa41e630bcade3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-01 09:08:52 +00:00
Simon Hausmann 8f7b36f899 Allow the use of uncreatable types for properties
It should be possible to write

    property SomeUncreatableType blah;

It should not be possible to write:

    property SomeUncreatableType blah: SomeUncreatableType {}

Task-number: QTBUG-36752
Change-Id: I2d1aa9f070a368f51844bbc0733d285022aab403
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-29 12:40:46 +00:00
Laszlo Agocs 3169744ab4 D3D12: Fix 'ShaderEffect in a ShaderEffectSource as property value'
Import (and clean up) the dropshadow from the shadereffects example.
This is very useful since it tests a lot more paths and cases than
the wobble.

To overcome the issue of not having some of functionality available before
the item is added to a window, make QQuickGenericShaderEffect smarter and
enhance the documentation.

The handling of vertical mirroring is revised. The GLSL and HLSL version of
the dropshadow shaders produce correct, identical output now.

Change-Id: I94800997bfba781140d80720eb6f340cda480747
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-04-29 09:36:43 +00:00
Laszlo Agocs e88e294059 Adaptable shader effect enablers
The D3D12 node implementation is mostly missing. The rest of the enablers
should be in place now however.

Importing QtQuick 2.8 provides new properties for ShaderEffect:

- shaderType can be used to decide which language should be used

- shaderCompilationType tells if compilation is runtime or offline

- shaderSourceType tells if the vertex/fragmentShader properties refer
  to source strings or source files or pre-compiled bytecode files

The last two are bitmasks. In practice however we will support only
one approach per backend for now (runtime + source string for OpenGL,
offline + bytecode for D3D12).

In addition to QSGShaderEffectNode, introduce the QSGGuiThreadShaderEffectManager
interface. This provides the gui thread bits for the above and performs shader
reflection. Backends that use the new ShaderEffect system must provide both.
For each ShaderEffect item there will be a manager (on the gui thread) and
a node (on the render thread).

Reflection is expected to be done via standard helper libs (d3d12shader
+ D3DReflect from d3dcompiler for the D3D12 backend), or via manually inspecting
SPIR-V, or parsing the source (like the GL path does now), or by using some
3rd party library (not recommended). In any case we require that reflection is
doable on the gui thread without dependencies to the actual graphics API.

The ShaderEffect documentation is greatly extended, covering HLSL and the new
properties.

The test app uses manually compiled shaders on its HLSL path for now. This
is because there is no story yet for build system integration for public
use (the internal HLSL -> bytecode in C header rule is only suitable for
the d3d12 plugin itself, apps need something different).

Change-Id: Id112104906fbcb26b9902a35f19d8d509b340d1b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-04-29 09:36:33 +00:00
Kai Uwe Broulik 7a0f3269b1 Add some ECMAScript 6 Number and Math methods and properties
This adds the Number.EPSILON property, the Number.isFinite, Number.isNaN,
and Math.sign methods introduced in ECMAScript 6.

Change-Id: Ib16408a63c202a4ef30a14334f65ac3a1a13cfaf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-28 08:32:35 +00:00
Liang Qi da374438be Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/quick/items/qquickimagebase.cpp
	src/imports/layouts/plugin.cpp

Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
2016-04-27 08:47:35 +02:00
Andy Nichols e4d56b01b3 Merge remote-tracking branch 'origin/dev' into scenegraphng
Change-Id: Ib990cfbd43d4a8c0ca412b492d507424cd9e58d4
2016-04-26 11:55:12 +02:00
Alberto Mardegan 9cf3895f4d QQuickDragAttached: fix updating of "active" property
The d->active member variable should be changed regardless of the value
of Drag.dragType.

Task-number: QTBUG-52540
Change-Id: I7fa39ccf11b1200e9c2f6fe57cba58657b6cff74
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-04-26 08:27:08 +00:00
Michael Brasser 26ecc82374 Add string search functions from ECMAScript 2015.
Change-Id: I46d5e42186d9f1b2994778de967610725b0e0633
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-25 14:15:48 +00:00
Erik Verbruggen c71e40b2bd QML: Access QQuickItemPrivate data (like x/y/etc) directly.
This saves ~5% in QQuickAnchorsPrivate::itemGeometryChanged on x86_64.

Change-Id: Iccf782521e9c8523c41c6f2e6d87fad401762a9e
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2016-04-21 15:04:36 +00:00
J-P Nurmi 3c5e438890 Allow target path version in a parent module
For example, the QML Engine is now able to locate QtQml.Models 2.x
in both of the following target/installation paths:

- QT_INSTALL_QML/QtQml/Models.2
- QT_INSTALL_QML/QtQml.2/Models

This is required for QtQuick Controls 2. The target path of the module
is QT_INSTALL_QML/QtQuick/Controls.2. The built-in styles are installed
as sub-directories to be able to locate them from the controls module.

Some of the built-in styles provide their own C++ extensions via style-
specific imports (eg. the Material attached property is imported from
QtQuick.Controls.Material 2.0). The problem is that the QML Engine does
not find the module from QT_INSTALL_QML/QtQuick/Controls.2/Material,
but requires it to be installed outside the main controls module ie.
QT_INSTALL_QML/QtQuick/Controls/Material(.2). This makes it a) hard to
locate the styles from the main controls module, and b) conflicts with
the target path of QtQuick Controls 1.

[ChangeLog][QtQml] Made the QML Engine capable of locating QML sub-
modules from within a versioned parent module path. For example,
QtQml.Models 2.x can be either in QT_INSTALL_QML/QtQml/Models.2 or
in QT_INSTALL_QML/QtQml.2/Models.

Change-Id: I2fe4bbdd6d04dd1e80cbe9b3e7e02617658a0756
Task-number: QTBUG-52556
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-21 09:32:25 +00:00
Michael Bruning 0b7c11e7c2 Also match QJSValue conversion types in MatchScore.
This had the effect that overloaded methods were always mapped to the
wrong slot.

[ChangeLog][QtQml][Important Behavior Changes] When matching the method signature
of a invokable method to the slot in the metaobject, the matching function now
assigns the best match to a QJSValue if the parameter actually is a QJSValue. This
corrects the previous behavior, where QJSValue and int were given the same match score
even though QJSValue would have been the best match.

Task-number: QTBUG-51746
Change-Id: I906e7b006ee5af92ea760ed1625e5047aef123bf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-20 13:38:31 +00:00
Laszlo Agocs 9c19298510 Fix up rendernode autotest
Test the new RenderTargetState as well.

Make releaseResources() optional. Code focusing on OpenGL only may not
want to care about providing an implementation for it. It is also more
compatible with the old private API this way.

Change-Id: I0dcec1d48708e71d778a8e5fea1b64d710bee67f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-04-20 13:22:29 +00:00
Michal Klocek 9c8dab5378 Revert "Fixed MouseArea threshold with preventStealing"
This reverts commit e1400b5b4d,
which breaks qtlocation unit tests for drag support.
It is no longer possible to drag markers in mapviewer.

Task-number: QTBUG-52534
Change-Id: If713a8e45f64ea898f38fe3e39561ebc266403b2
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-04-20 11:51:56 +00:00
Filippo Cucchetto e1400b5b4d Fixed MouseArea threshold with preventStealing
When preventStealing is true both keepMouseGrab() and
d->stealMouse are true. This in turn enable the dragging immediately
since the condition "keepMouseGrab() && d->stealMouse && !d->drag->active()"
is true.
Conversely when preventStealing is false the dragging is enabled in the
next move event since keepMouseGrab() and d->stealMouse are set true
inside the last "if" "!keepMouseGrab() && ...check threshold..".
This patch adds a new boolean flag for storing if we detected a drag motion
(so we exceeded the threshold) and enable the dragging iff this flag is true.
With this change:
- if preventStealing is true (and so keepMouseGrab() and d->stealMouse) the
additional d->overThresHold prevent the start of dragging. At the same time
the last if (!keepMouseGrab()) cannot be executed since keepMouseGrab is true
and we still check for the threshold being exceeded.
- if preventStealing is false, we still check for exceeding the threshold and
if this happen we enter in the last "if" since !keepMousegrab() && d->overThreshold
is true taking the mouseGrab as without this patch

Task-number: QTBUG-52534
Change-Id: I2b14d3048b6f8223c90ce5e2fd26e7ca706cb56a
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-04-19 16:12:17 +00:00
Peter Varga d142b2d212 Fix assertion in qt_create_image_data()
Fix rounding of width and height parameters.

Change-Id: Ib7655dafe382684340c32e2d2dc8adb445af65b0
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-04-19 13:39:00 +00:00
Tim Jenssen e195495fea activate QtQuick designer support tests
Change-Id: I5540eda05e6e4d7ab01c85b1da32e8677a9c332d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-19 08:49:22 +00:00
Ulf Hermann 23e0e26ce6 Occasionally trim the type cache
As loaded components are kept in a cache, they are never removed by the
garbage collector. So, if you periodically create new components, they
leak. This change adds a floating threshold for the number of
components. When that threshold is surpassed trimCache() is called and
unneeded components are removed.

Task-number: QTBUG-42055
Change-Id: I30e3e4ee287f6d34376713668009c67614a50e0c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-19 08:09:21 +00:00
Robert Griebl 50a1cd3aac Fix changing QML Window visibility in Component.onCompleted
Creating a transient QML Window with visible set to false and then trying to
show() it in Component.onCompleted led to a race condition where the window
would be shown for a brief moment and then hidden again to enforce the delayed
initialization of the visible property. Fixed by tracking the value of the
visible property regardless of the 'completed' state.
The same problem was fixed for the visibility property.

Task-number: QTBUG-52573
Change-Id: I2a2ed7f359b951cb9189a7a6628d1d0cc1445d73
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-18 19:26:25 +00:00
Edward Welbourne 49ca8921ba tst_qquickanimatedimage::mirror_notRunning(): fix initializer.
Initializing paused to isPlaying() then checking it subsequently
agrees with isPaused() is an obvious copy-and-paste bug in the test,
which was meant to check runtime state wasn't changed by a snapshot.

Task-number: QTBUG-36717
Change-Id: I7a206b07071b862dbe4c0331af6bc32157a415b2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-15 08:48:39 +00:00
Simon Hausmann 490ec1ff4e Fix memory corruption when calling Array.unshift()
The dequeue offset won't wrap around when n > offset.

[ChangeLog][QtQml] Fix crash with Array.unshift()

Task-number: QTBUG-52065
Change-Id: I5e8b89ec964cd6397100442a5239254bca989a3f
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-14 13:49:21 +00:00
Rafael Roquetto 2eb69af40a Fix compilation of qmldevtools/compile test.
C++11 was not automatically enabled, causing the build to fail.
load(qt_common) addresses the issue.

Change-Id: If54c5253942b057677035ed9c8785a2be535c41f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-13 22:00:42 +00:00
Laszlo Agocs b943809c41 Add the skeleton for the new, more generic shader effect impl
which should route and place most of its work into the scenegraph.

And fix a test.

Change-Id: I04f29cba53c2bab62e41b3b524794d3c4d20a472
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-04-13 09:22:22 +00:00
Laszlo Agocs e188a3d864 Prefix GL-specific shader effect code
Rename the C++ sources and classes. The QML type name remains the same.

No changes in functionality.

The shader effect, node, material (and uniform animator and particles and
bits and pieces here and there...) are highly interconnected and do not
follow the usual design practices for Quick and the scenegraph and the
adaptation layer. Therefore while we aim for keeping full compatibility
for GL apps, other backends will likely get a different ShaderEffect item
implementation.

The C++ class QQuickShaderEffect itself is currently a dummy with an
unchanged API. It is not in use for now but forms the basis for the
implementation for other backends. This will be covered in future commits.

Change-Id: Ia39ce4b303f8f33e2f241d11e35fa62423e43127
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-04-13 09:22:16 +00:00
Laszlo Agocs 6e6079031c Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: If33197b616de3476811f0161d4ecd8e7d004756c
2016-04-13 09:19:18 +02:00
Erik Verbruggen f6fee09942 QML: When available, use QQmlAccessors to read properties.
When a property is read from a QObject or the QML scope object, and we
can statically resolve the type to qreal/QObject/int/bool/QString, and
the property has an accessor declared for it, then use that accessor to
do the read.

This collapses the path of e.g.:
  Runtime::getQmlScopeObjectProperty
    -> QObjectWrapper::getProperty
      -> QObjectWrapper::getProperty
        -> LoadProperty
          -> QQmlAccessor::read
(all of which do various checks for all the stuff mentioned above) to:
  Runtime::accessQmlScopeObjectQRealProperty
    -> QQmlAccessor::read
which is a simple 4-line function, and doesn't need to do any check.

According to valgrind, this saves 170 instructions on x86 for the
simple binding:

Item {
    width: height
}

Change-Id: I0761d01e8f1a3c13ecbffe2d8e0317ce9c0a4db0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-12 15:17:04 +00:00
Simon Hausmann 8ca22ca7eb Fix invocations of methods taking a QByteArray
Since commit 3b7e2a69f7 when calling a slot that
takes a QByteArray with a parameter that is not a QByteArray, we would end up
passing an empty QByteArray. This is a regression as previously we supported
the conversion code path, i.e. when passing a QString it would be converted to
utf-8, through QVariant's conversion code path. This code path needs to be
re-activated by removing this "shortcut". The shortcut is not necessary as the
execution engine's toVariant() function also knows how to apply the conversion.

Change-Id: I0600d195c94fa4e1e0b7ab807f045f0da42f595b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-04-12 11:52:49 +00:00
Eskil Abrahamsen Blomfeldt cc5b0f9b05 Add another test for broken selections
This test is for 24914b1acbfc5e45768dd1465b9e3f3e61185829 in qtbase.

Task-number: QTBUG-51759
Change-Id: I59081ec5268359f25c492f0536f985793e08e250
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2016-04-11 15:38:04 +00:00
Sebastian Lösch 392c7b9934 Instantiate static Qml plugins declaring QQmlExtensionInterface only
When instantiating static plugins no check is done whether the
QQmlExtensionInterface is declared. Therefore all user plugins are
instantiated in the Qml thread, which may cause problems.

Task-number: QTBUG-52012
Change-Id: Ia91ec5ec7b2a9721bd11e3648cdc161855b4454e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-11 14:10:54 +00:00
Lars Knoll 3057b8c7e6 Convert the remaining runtime methods to new calling convention
Change-Id: I88ad3ca430508617d527715aa85ae8474ab7c621
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-04-11 12:27:39 +00:00
Laszlo Agocs 7917135a71 D3D12: Add support for layers
Recursive and multisample support is left as a future exercise. Mipmapping
is not supported and is not planned for the time being.

Layers cannot currently be rendered on their own, although they have their
own independent render targets. Starting a layer just starts the next frame early,
putting all commands to the normal command list of that frame. Thus this is
not yet fully suitable for implementing grabs.

Buffer handling is revised to support multiple vertex, index or constant
buffers. This is essential since we are going to have multiple renderer
instances (and may also be needed for a more complex batching renderer
in the future)

QSGBasicImageNode::preprocess is changed not to regenerate the geometry on
every dynamic texture change. In most cases only the material needs to be
dirtied. Rebuilding the geometry is only necessary when the normalized
subrect or similar changes.

Change-Id: Id088c15d1b75022b54c1f8bff1656d2cd68fa7cc
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-04-11 10:12:15 +00:00