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>
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>
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>
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>
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>
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>
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>
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>
Remove the QQmlBinding *binding argument as it is always the this
pointer.
Change-Id: I76ccf64a1d37ce32089c81f60466dce79b9fa5bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
Replace it with QL1S or with QL1C in QStringBuilder expressions
Change-Id: I894c546d2d010a713cc476d60b7966e77df996af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>
These methods have real arguments.
Change-Id: I61f42076d36265b58dcc598394c6b3576b02dd60
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
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>
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>
CompilationUnitMapper::open is supposed to return a pointer, not bool.
Change-Id: I798be4038b8df047d380201b746f8d97cc1db526
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>
The platform is not supported since Qt 5.7
Task-number: QTBUG-55331
Change-Id: I5a38940bd8ebf7dd62d04015e1738ee23ac65bb2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>