Commit Graph

12573 Commits

Author SHA1 Message Date
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Anton Kudryavtsev c754b71eb4 manual tests: replace 'foreach' with 'range for'
Change-Id: I21d17b7770246888b1de71d54a6a1babd0726b8a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:51:06 +00:00
Anton Kudryavtsev c5218430ed auto tests: Particles: replace 'foreach' with 'range for'
Change-Id: I69c5e0d076fcb68261ea2b0fb5bee485751f6ddd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:46:54 +00:00
Anton Kudryavtsev e9667491d8 Quick: fix incorrect usage of 'range for' with Qt containers
Also port remaining foreach to 'range for'.

Change-Id: I20296bb3bb6d63f144ebddaba02cabeb16b7d734
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:46:41 +00:00
Anton Kudryavtsev cd3380862b QQuickWidget: fix incorrect usage of 'range for' with Qt containers
Change-Id: Ifd95a2076c6f5330820dc0eb4890636f83b93794
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:46:25 +00:00
Anton Kudryavtsev e923ac48a5 Particles: fix incorrect usage of 'range for' with Qt containers
Change-Id: Ibe750b068bc8d4c33272a65dafcc398239d7d591
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:46:13 +00:00
Anton Kudryavtsev 19baf625b9 Imports: replace 'foreach' with 'range for'
Change-Id: I283ce40b52de2371550dab7a54cdce89c78cdc68
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:45:59 +00:00
Anton Kudryavtsev 6ade9e9ed9 benchmarks: replace 'foreach' with 'range for'
Change-Id: Ibdb6daf0e09e01186478602287e2a6a143e09951
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 05:45:33 +00:00
Jake Petroules 25c2cfc143 Exclude tests that require features not present on UIKit platforms
Change-Id: I0398bf60fa150e9e03822938a2a6bedf280d7750
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-08-19 21:04:31 +00:00
Liang Qi f36f3d0b4b Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-08-19 20:28:21 +00:00
Liang Qi 79349119c6 Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
2016-08-19 21:22:10 +02:00
Simon Hausmann 23527754d6 Fix crash in tst_qqmlextensionplugin on shutdown
On shutdown the test will unload all the plugins it loaded. In the case
of the QtQuick2 plugin we only loaded it but never called registerTypes,
as the test merely sees if the plugin can be instantiated. Consequently
the attempt at unregistering the value type providers will fail because
it was previously never defined.

Note: We can't just let the QQmlValueTypeProvider destructor take care
of the deregistration, as we do not truly unload plugins anymore
(thankfully). However the plugin object will be destroyed and along with
it we should correctly de-register the things we registered earlier,
otherwise when initializing the plugin again, we'll register handers
multiple times.

Change-Id: Id778890bcd3f1fab16eb312a01de7d423ea3aa22
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-19 16:55:19 +00:00
Anton Kudryavtsev bf3b596066 QQuickItemView: use reverse iterators more
Since qt5.6 we can use reverse iterators.

Change-Id: Ibf78b937e793c868ecc40710ef74c25308cc39bf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-19 16:24:50 +00:00
Liang Qi 4f0988c390 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I7bd70996e3372d154c6b0e47336baa22146667b0
2016-08-19 16:32:09 +02:00
Shawn Rutledge 01a9c006b0 TestCase::mouseDrag: set mouse move delay >= 1 ms
Infinite-speed drags do not work well with velocity-sensitive
components like Flickable.  As with change d04982dc on qtbase,
adding a short delay helps to stabilize tests.

To keep it flexible, we make QTest::defaultMouseDelay()
available via the qtest_events.defaultMouseDelay property.
So the delay can be increased by passing a larger delay
value to mouseDrag, or by changing the QTEST_MOUSEEVENT_DELAY
environment variable (as before).

Task-number: QTBUG-55382
Change-Id: I8f8088758a206be104a439ee0d1832eeca574e8c
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-08-19 12:50:28 +00:00
Lars Knoll be846890f3 Adjust decarative after qtConfig changes in qtbase
Most of the changes are optional, but cleanup our QT_CONFIG
usage.

Change-Id: I5253d53f72f6fb03c2cfedae1e17d94f424a6bbb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-19 11:16:18 +00:00
Simon Hausmann 79cdb4bd45 Remove unused delete watcher class
Change-Id: I8ccb3ae9029d17dcb4d60239d225393b1da88993
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-08-18 14:21:16 +00:00
Frederik Schwarzer 4a9635b0bf Remove some double-meaning text from documentation
Change-Id: I9b69dbe929947795bdfbff4e0e3a16a47fa94197
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-18 14:02:04 +00:00
Riku Palomäki 96bd2337a9 Flickable: Fixed rounding errors with contentX/Y
contentX/Y are qreals, but they are rounded using qRound/qFloor/qCeil
which will limit the values to 2^31 needlessly. This fix will use
(std::)round, std::floor and std::ceil instead to allow bigger values for
contentX and contentY.

Change-Id: I35ad4bcfa3b8bbc21e90768d348d3002ca400081
Task-number: QTBUG-48018
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 13:36:44 +00:00
Erik Verbruggen b5f9c1e6e7 QML: Remove hasAccessors flag from QQmlPropertyRawData
We can now always check if the pointer is null (no accessors) or not.

Change-Id: Ie9abf2f8930ea1f75a6d637a47f7f9c4fbab1151
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-18 12:29:00 +00:00
Shawn Rutledge 32a980a862 Revert "localstorage: disable warning about tautological comparison"
After 12c7f22, the comparison should now be done at compile time.
This reverts commit a858ce0039.

Task-number: QTBUG-53373
Change-Id: I79d2c8aaabba8a2676df6da64206fefc9cdef3b2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-18 11:59:15 +00:00
Erik Verbruggen 2a4f543ca2 QML: Do not register dependencies of deleted binding
Because it can lead to a use-after-free.

Change-Id: I6701b370c0ecee4967e5f749f673a6f9ee3d504c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-18 09:21:12 +00:00
Anton Kudryavtsev 696e12d137 qmlimportscanner: fix MSVC build
MSVC does not like QStringLiteral in operator[].
And the follow-up patch, which replaces 'foreach'
with 'range for' triggers this MSVC bug.
So this prequel patch resolves 2 issues:
1. fix MSVC build - the main issue.
2. de-duplicate QStringLiteral data (.rodata)
   - as drive-by issue.

Change-Id: Ic6607edf324e9330d2b8dccd34561abb90f79cf1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-08-18 08:43:24 +00:00
Anton Kudryavtsev b35858d4b8 Quick: replace 'foreach' with 'range for'
Change-Id: I3493b16a184fc811289db9e98eff37bb987113a3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:42:37 +00:00
Simon Hausmann 31650bc49b Minor binding code cleanup
Remove the QQmlBinding *binding argument as it is always the this
pointer.

Change-Id: I76ccf64a1d37ce32089c81f60466dce79b9fa5bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-18 08:27:46 +00:00
Erik Verbruggen 707b9be53c QML: Change storage types of QQmlPropertyRawData fields
By getting rid of the unions, all "features" (like accessors and notify
indices) can now be used for all properties or functions. Other fields
are trimmed to the size as used in other parts of QML.

Now the size of QQmlPropertyRawData is 24 bytes on 32bit platforms, and
32 bytes on 64bit platforms.

Change-Id: Ie2f22eb60e6119c93e3d3ea32a2974a718d45e91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-18 08:14:14 +00:00
Anton Kudryavtsev a61dafa2f5 qmlimportscanner: use QStringLiteral more judiciously
Replace it with QL1S or with QL1C in QStringBuilder expressions

Change-Id: I894c546d2d010a713cc476d60b7966e77df996af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:05:33 +00:00
Anton Kudryavtsev 7b2d2d7735 QQuickPathView: optimize releasing of cache items
Release all cache items, and then clean container.
Avoid quadratic complexity.

Change-Id: I61f3e43aa070c0be074c3804a83f2ff1de9a398d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:03:53 +00:00
Anton Kudryavtsev 24e6df252d QQuickGridView: fix doc for itemAt() and indexAt()
These methods have real arguments.

Change-Id: I5362a407b8417b62bb27bb313dccce8611b5e316
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:03:05 +00:00
Anton Kudryavtsev e330198669 QQuickListView: fix doc for itemAt() and indexAt()
These methods have real arguments.

Change-Id: Ieb4ea8396876f237adedf5df8ab5aeec1055229f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:02:36 +00:00
Liang Qi 5df9fb29e1 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
2016-08-18 09:47:21 +02:00
Anton Kudryavtsev b095e0a85b QQuickPathView: de-duplicate calls and cache results
Change-Id: I4b49b912c068fd5c76a2c2c8580f616cb42e9bdb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 06:13:20 +00:00
Anton Kudryavtsev 4354588f55 QQuickPathView: de-duplicate code of indexAt()
Re-use itemAt() method.

Change-Id: Ic3673fe4d9fd3f27abc90c9436e99e0da9821cdb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-17 20:20:02 +00:00
Shawn Rutledge 286dbc48bd softwarerenderer example: fix ambiguous reference to QQuickItem
GCC 6 says (with paths trimmed)
In file included from customrenderitem.cpp:47:0:
softwarerenderer.h:51:35: error: expected ')' before '*' token
softwarerenderer.h:61:5: error: reference to 'QQuickItem' is ambiguous

Change-Id: I70b328426ac48f5f6140d1ad4f015858979b99a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-08-17 20:11:38 +00:00
Anton Kudryavtsev f2ba71dd55 QQuickPathView: port some loops to 'range for'
The 'range for' works with pointer increments and
the generated code is less, so we save some text size.

Change-Id: I66a2827c9a342d9453a52028d3ec76a91a19a606
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-17 19:45:38 +00:00
Liang Qi 370707cfbd Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-08-17 18:32:35 +00:00
Anton Kudryavtsev 4840bc0c20 QQuickPathView: fix doc for itemAt() and indexAt()
These methods have real arguments.

Change-Id: I61f42076d36265b58dcc598394c6b3576b02dd60
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-08-17 16:38:48 +00:00
Erik Verbruggen 82e551b5fa QML: Get rid of propTypeName in QQmlPropertyRawData
This information can be recreated when needed: the property/method index
is known, just like the meta-object, so we can query that for the
type name.

Change-Id: I9d4f557eda4e4a946a80b68d3787823767b0b1d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-17 14:05:31 +00:00
Simon Hausmann a86e6e1821 Prospective fix for invalidating caches for qml files from resources
The Qt resource system does not store any time stamps, so to validation
purposes fall back to the time stamp of the application binary.

Change-Id: Ia1c4d06a634ffdb2d4d281aae55e5ed34f044a3c
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-17 14:05:26 +00:00
Maurice Kalinowski 39179d41f0 Fix return value
CompilationUnitMapper::open is supposed to return a pointer, not bool.

Change-Id: I798be4038b8df047d380201b746f8d97cc1db526
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-17 14:05:23 +00:00
Simon Hausmann 7101ca92fe Enable QML disk cache on WinRT 10
Change-Id: I6a61d015c93bf507c0b68f3a975d8574334a05e5
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-08-17 14:05:21 +00:00
Simon Hausmann 9fcca80bc4 Make the unit mapping on Windows configurable with regards to executable mapping
If we generate byte code, then we can mmap without the executable flags,
otherwise we need them. This should make things work out of the box on
platforms where special rights are needed before executable mappings are
allowed.

Change-Id: I24e663f85d661bc51cd3bf2463547b1d1590ea32
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-08-17 14:05:18 +00:00
Shawn Rutledge 9132b7731c stabilize tst_TouchMouse::hoverEnabled
The autotest does not generate the mouse movement that will occur
if you touch an actual touchscreen on X11.
QQuickWindowPrivate::flushFrameSynchronousEvents() will hover the
MouseArea as if the mouse had moved, but that doesn't update
QGuiApplicationPrivate::lastCursorPosition.  The test checks that
the synth mouse move in QQuickWindowPrivate::deliverTouchAsMouse()
occurred in response to the touch release, but if
flushFrameSynchronousEvents occurs before these lines
QVERIFY(mouseArea1->hovered());
QVERIFY(!mouseArea2->hovered());
then it will fail because the touchpoint left mouseArea2 hovered.

Also replace QVERIFY with QCOMPARE where we are comparing a value,
so that when it fails we can see why.

Task-number: QTBUG-55350
Change-Id: I6c9c9ff1aa57c199cdc4be59156bd36e487cbd2b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-08-17 13:37:36 +00:00
Laszlo Agocs 0bf89f3ce6 D3D12: Convert 8-bit glyphs to 32-bit to prevent using R8 formats
Until we figure out why DXGI_FORMAT_R8_UNORM sampling produces weird
results with AMD cards, disable it and convert to RGBA.

The check could be done at runtime based on the device's VendorId
(0x1002), however the shader needs changes too so it would make
things more convoluted. Hence only a compile-time define for now.

Task-number: QTBUG-55330
Change-Id: I73f038cf0aeba742e8ea6669359c8a6e8e400a06
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-08-17 13:09:09 +00:00
Venugopal Shivashankar b03c85de2a Doc: Remove references to Windows CE
The platform is not supported since Qt 5.7

Task-number: QTBUG-55331
Change-Id: I5a38940bd8ebf7dd62d04015e1738ee23ac65bb2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-17 10:22:24 +00:00
Liang Qi 7e609f6d10 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	src/qml/compiler/qqmltypecompiler.cpp
	src/qml/compiler/qv4isel_moth.cpp
	src/qml/compiler/qv4ssa_p.h
	src/qml/qml/qqmlobjectcreator.cpp

Change-Id: I8bb7fe773d657f908f20ee5e72c2b9bd643f6260
2016-08-17 10:57:38 +02:00
Marc Mutz 12c7f225e6 QV4Object: fix GCC 6.1 tautologial compare warning
GCC warned:

  qtdeclarative/src/imports/localstorage/plugin.cpp:152:126: error: self-comparison always evaluates to true [-Werror=tautological-compare]

Fix by comparing the types for equality instead of the addresses of
their static_vtbls.

Task-number: QTBUG-53373
Change-Id: Idd1598610ad6381c03c3a46abe56a332726bd6a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-17 05:35:52 +00:00
Andreas Cord-Landwehr 78f5b9e7f7 Do not override QT_QPA_PLATFORM env variables
The QGuiApplication documentation explicitly says that QT_QPA_PLATFORM
can be used to specify the QPA for every QGuiApplication. Unconditionally
overriding this value within the application is a unexpected behavior.

Task-number: QTBUG-54789
Change-Id: Ia7a61a0f2921ef8ec27fe630e8d307d20ba1eb37
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-16 11:24:49 +00:00
Simon Hausmann 8b8492d3ff Fix throwing an exception inside a finally block with a return in catch
When exiting a catch block with a return statement, we'll unwind the
exception handling manually and emit finally statements right before
jumping to the exit block. If we throw an exception in the final block,
we'll end up using the exception handler of the catch block that
contains the return statement, which means we'll end up popping the
exception scope one too many times, once through
ScopeAndFinally::CatchScope in unwindException() and then when executing
the exception handler block. The latter we should not be executing,
instead we should jump straight to the exit block. Therefore any
statements emitted as part of the manual exception unwinding (finally
block here) need to be part of a new basic block with no exception
handler.

This bug became visible in debug builds where the Scope destructor
compares the scope mark against the engine stack top to ensure correct
cleanup order (which was wrong). However that in turn was hidden in
debug builds again due to an accidental = instead of == in a Q_ASSERT.

With the Q_ASSERT fixed this use-case is covered by
ch12/12.14/S12.14_A13_T3

Change-Id: Id74a1b2bb3e063871b89cc05353b601dd60df08e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-16 09:18:10 +00:00
Simon Hausmann 852e60e67b Ignore generated QML/JS code cache files
Change-Id: Ic6fd156a1f9088c35d217a6f450610ac4b7d3284
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-15 07:59:53 +00:00