This removes the limitation that hover only changes when the mouse moves, and
(in my opinion) is required to make hover functionality even remotely useful.
QtQuick scenes are a dynamic medium, items can move (or change) frequently, so
only changing this in response to a user action means it will frequently end up
out of date.
A very simple example of this is a ListView of delegates that each have a
background set on hover: when flicking the list, it won't reset the hover to
actually match the item under the mouse.
This is now not a (very) expensive operation to do, as deliverHoverEvent
does nothing if the item tree in question doesn't have hover enabled.
[ChangeLog][QtQuick][MouseArea] Hover state is now updated once per frame.
This means that MouseArea::containsMouse property will now be correct even
if the mouse is not moving, but items move under the cursor. Likewise
the mouse position properties and positionChanged signal will act as if
the mouse had moved.
Task-number: QTBUG-40475
Task-number: QTBUG-42194
Task-number: QTBUG-33982
Task-number: QTBUG-42578
Task-number: QTBUG-52537
Change-Id: Ic2dcbb45339e11c07f5c6a9c95eb7f64957968eb
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This change creates a single key/mouse/wheel event for use in signals,
and re-uses that event across emissions. This prevents allocating a new
event (and it's QObjectPrivate data) for every key press / mouse move /
wheel spin.
Change-Id: I395f6ce3ed8588157e4175c8481351b330793fac
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
By storing the calculated integer id for an id-named object in
CompiledData::Object we can simplify the code and replace a hash table with a
plain vector.
Change-Id: I4a84cdd00e98766d603d152e5a6574b232771a02
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This allows simplifying some code and reducing the usage of the objectIndexToId
hash maps.
Change-Id: I1f08d4b224c4f9fa498d90471fa545ae4e4f2af4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
We store the CompiledData::Function indices for a give QML object in a fixed sized
array in the memory pool in the IR. That array can be stored as pointer/len pair
directly, there is no need for another pointer indirection.
Change-Id: Iccad465ab873e0e7203dc563abb67cf6354a8bfd
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
When handling wheel events, it's useful to know whether or not
"natural" scrolling was enabled on platforms like OSX where
the scrolling direction can be reversed. It's especially useful
when implementing components like Slider (see QTBUG-35972).
This will soon be needed in QtQuick.Controls because we plan
to remove the WheelArea.
Change-Id: I2770e0aa39e7e54511d7f9f7cc12760580a55e5c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: I7cf6c5d3458b0c43283e63a7300ee9965ba803fb
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
This would not seem like a member variable that is hot enough to keep there and
it is two loads away.
Change-Id: Id7088771bd33545a2846cc3497e5904dd8ac4f5d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
Add missing qdebug.h include after some header file changes in qtbase.
Change-Id: Ie3bc9469650c954596a03fb471765767149b8f05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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>
We only need one bit, so this is easy to merge.
Change-Id: I98bf882b8c1bf10f2172a9e22331d621985d3ed4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
We can retrieve the alias property index from the QV4::CompiledData::Alias and the
property type from the property cache (only needed for aliases to value types).
Change-Id: Ibf0cb909a4cd1ce1c2d67b57e1be1de491d4d598
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
We can store the id (in QQmlContextData::idValues) for the alias target in the QV4::CompiledData::Alias.
Change-Id: I3f32648aef28d96ddedff6b3d2cde75969a46fa1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
The count of properties, aliases, signals and methods is also accessible through
CompiledData::Object.
Change-Id: I4693ea672b643cdaabf752c3f0d71abdcc032395
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The constructor will use "fake" VME meta data if the provided QObject has a VME
meta object - that is the behavior of the vMEMetaDataForObject(object) call.
The QQmlVMEMetaObject constructor will set hasVMEMetaObject to true
unconditionally. By detecting the use of the fake meta data we can restore the
hasVMEMetaObject flag to what it was before. As I would like to remove the VME
meta-data, this patch removes the dependency to the meta data as a way of
detecting the situation where we have to restore the hasVMEMetaObject flag.
Instead this is done explicitly in the factor method that calls the constructor.
Change-Id: I9c5cbfbd8fb41ca65c597669ee04c1c5694dee2a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
We used to store property declarations and alias declarations in the same
properties array in CompiledData::Object. However at run-time the
QQmlVMEMetaObject implements them separately, using separate data structures
(in the meta-data) and (most importantly) using separate property id segments:
First the properties, then the aliases. By reflecting the same separation in
CompiledData::Object with property arrays and alias arrays, we can pave the way
for getting rid of the meta-data in QQmlVMEMetaObject.
Change-Id: Ia84813fe3da6f3fdbd4d2b16136a8bf11fa175a6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
We only need one bit for the flags, to save four bytes.
Change-Id: I73cbf8c2ef8b532dfe494b1b31ab242cccc38686
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
The typical case is that there's already a QQmlData for a QObject, so
fast-path this, and fall back to the general case if there is none (or
it is deleted, etc.)
Change-Id: I00c890e5fe7abdd743c4e99316a7ce93eb3db9df
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Change to remove the Q_OS_ANDROID define for using ::copysign there
instead of std::copysign as other systems are affected as well
(FreeBSD 9.3 with gcc 4.8 in particular). The distinction does cause
more problems than simply using ::copysign everywhere.
Change-Id: I1fe42fdee9c1c1bbb3e5930573ff29c600dfb5e0
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Instead of storing the methods of a qml object in an array of persistents,
let's just store them in the same member data array we also use for properties.
That reduces the amount of persistents and saves one pointer per instance.
Change-Id: I1ad1d9ec76b78fce01bc6ded7eaf536cb99dd245
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
WebEngineView requires a shared opengl context. The plugin checks for
this when initializing.
Change-Id: I686b9c22be95f7ef16ea68ea49b8f9aee47789ae
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
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>
Fixed a whole bunch of the following warnings:
warning: 'interface_cast' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
Change-Id: I6cd6c16a6465d23e5e7c61d04ba87652df727bc1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
With commit ad8d760dec the precision of the
location (row/column) fields was reduced. The same fields are used to preserve
the insertion orer of bindings as they appear in the .qml file, which meant
that for large qml files without any line feeds we may end up with an overrun
in the column range (2048). This happened in the
Tests_TabView::test_mousePressOnTabBar test in qtquickcontrols.
The reduced precision is fine because those column/row fields should only be
used for error reporting. In this case where we need the precision we can just
as well use the file offset in the temporary QML-IR Binding data structure.
Task-number: QTBUG-53115
Change-Id: Ifb6f76b4f83a06fa228211134d12cc67c071bbec
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Get rid of the redundant MethodData meta-data that is stored per-type.
Change-Id: I9faa284bdd0c9f0c9ebb3c66905ab5e34a9ee3a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
There is no need to go through the public QQmlContext in order to retrieve
the QQmlContextData the QQmlVMEMetaObject is associated with.
Change-Id: I648454c217fa594d4017c3af67848eacab55edfc
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Resolving locations is fairly expensive and we only need to do it once
per location.
Change-Id: I8716858f45da9c085e50527ada0611531641dafe
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
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>
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>
the two flags are equivalent. use the same one everywhere.
Change-Id: I9ac0caad5a9a8d37813f8de4d81067e20656abc5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
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>
We reverted this in 6f59c91c51 to avoid further
breakage in a patch release. Now let's do the right thing in the next minor
release and replace the qobject_cast on the instance with the IID check that
won't require instantiating the plugin in the qml loader thread.
[ChangeLog][QtQml][Important Behavior Changes] When the engine looks for QML
modules / extension plugins in statically linked applications, the plugins are
not instantiated in the qml loader thread anymore. For this to work however
it is necessary for plugins to use Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
in their class declaration instead of hardcoding the interface id as a string
literal.
Task-number: QTBUG-52012
Change-Id: I45fe8b9fec23b3d0408b7ee79ce297c7d47ce36d
Reviewed-by: Sebastian Lösch <Sebastian.Loesch@governikus.com>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
If updatePending is set, that means we want to call update()
eventually. If we just reset updatePending without calling
update(), we produce UI glitches.
Change-Id: Ie7353b2f5da567e196dbee8c113920e0e4702304
Task-number: QTCREATORBUG-16022
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This signals the compiler the actual intent (i.e. it doesn't rely on
unsigned int overflow behavior) and even allows for slightly better
code generation.
Change-Id: I915ebbeab2e60decb6adf816e9cf010ab41d172a
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
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>