Commit Graph

11123 Commits

Author SHA1 Message Date
Shawn Rutledge 1929fee8e1 Flickable: ensure movementEnded after wheel/trackpad flick
In qtdeclarative/tests/manual/touch/flicktext.qml it was already clear
that the moving/movingVertically/Horizontally properties did not revert
to false after a trackpad flick on OS X. It turns out that the failure
to emit the movementEnded signal also caused a scrolling bug in ListView.

QQuickFlickable::wheelEvent() looks at event->phase(), but ScrollEnd is not
absolute: on OS X with a bluetooth trackpad, it happens once when the user's
fingers are lifted, then the "momentum" events occur with ScrollUpdate, and
then ScrollEnd happens again at the end of the momentum phase.  But if the
user's fingers come to rest before being lifted, to stop the momentum, then
the ScrollEnd phase happens only once, and that's actually the end of
scrolling, flicking and movement, all at once.  The events don't seem to
provide enough information to disambiguate these two cases; but if ScrollEnd
phase occurs, and then we don't receive any more events within some short
time interval, we can be pretty sure the scrolling really ended.  So, use
a timer to check whether any more events have been received, a little later
after the ScrollEnd phase.

The movementEnded signal can now be emitted for several reasons: the
regular timeline ended movement, the velocityTimeline ended movement,
or the movementEndingTimer sent an event.

Also, when flicking with a physical mouse wheel, flickStarted was emitted
multiple times; now it will be emitted only once.

Task-number: QTBUG-47151
Change-Id: I534e99befbd9bf6af24c4ebdca73dd21964f1063
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-02 14:57:25 +00:00
Friedemann Kleint 666bc731a0 photosurface demo: Improve handling of image directories.
Make it possible to pass URLs on the command line. If no argument is
given and the pictures location as returned by QStandardPaths exists
and has contents, show it, Otherwise, show the file dialog as was before.

Set context properties containing  pictures location, image name filters
and initial URL.

Derive the image filter string from QImageReader/QMimeDatabase.

Change-Id: I89bdff27416bf8ef725aa4e17853b2f634cf059b
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-29 08:23:56 +00:00
J-P Nurmi c14c3a1054 PathView: don't leak item references
Every getItem() call increases the reference count. If getItem() was
called on an item that was already managed, we must pair it with a call
to releaseItem() in order to keep the reference count in sync.

Change-Id: I897d19c77bc0c58717065cbe925c45a14153ad0b
Task-number: QTBUG-50655
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-01-28 18:45:14 +00:00
Sebastian Sauer 570c848e6d Fix rejecting drag enter events in QML DropArea
Don't initiate a drag and drop if the event was rejected.

What happens is:
QQuickDropArea::dragEnterEvent() sets d->containsDrag = true
QQuickDropArea::dragLeaveEvent() sets d->containsDrag = false
HOWEVER, when the enter event is rejected, the leave event is
never delivered, and the drop area remains blocked because it
thinks the first drag action is not done yet.

Change-Id: I74c53fbe778c954e4aa2f22f393318c4938a5afe
Task-number: QTBUG-39453
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-28 14:38:08 +00:00
Nico Vertriest c2ef3674a3 Doc: corrected minor link issue to id attribute
Change-Id: I0143e212b2236cef5bfad42fb9b0f9837b825649
Task-number: QTBUG-43810
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-01-28 14:11:49 +00:00
Marco Benelli 187a5b0c6e qmlimportscanner: do not use local predicates.
Some (?) pre C++11 compilers are not able to resolve template arguments
for std::find_if when the predicates are local to the function.

Change-Id: I1e5c4adc3409bd32081ddedff158ab9dcc2eaa9a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-28 10:19:23 +00:00
Friedemann Kleint 67c4017054 stocqt example: Choose font depending on platform.
The example used the font "Open Sans" which is only available
on UNIX platforms and causes it to look baroque on WinRT.

Add a settings file specifying the font and override via file
selector.

Change-Id: I1a9284d928ac57289d75b5fb9477849ac518787b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-27 14:18:04 +00:00
Erik Verbruggen afbfdcff3b QML: do not wrap property values of type QVariant.
When reading a propety from a QGadget or a QObject, the values are
stored in a QVariant and later unwrapped/converted to the correct
JavaScript type. However, if the property value is a QVariant, it does
not need to wrap it (again) in a QVariant.

Change-Id: I633d3194f82b6032fc15d9994c4dee5e5609fd21
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-27 12:17:53 +00:00
Lars Knoll e9a6c1d4e3 Don't check for revisions when assigning to grouped properties
This leads to wrong behavior in some cases, where we reject
valid revisions, and there is probably no case, where this could
lead to a conflict for the user of the API.

Change-Id: I1614332cf4c07c6a227551612331dd69b2ae71f3
Task-number: QTBUG-40043
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-27 12:15:53 +00:00
Jan Arve Saether b13412f4db Animated sprite would stop after running for 24 hours.
Fix is to use QElapsedTimer instead of QTime.

Change-Id: I03d0a2428c7f0d82c4c54ab844023b09baf15175
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-27 09:03:03 +00:00
Andreas Hartmetz a6875f4409 Preparations for re-rendering native text on DPI scaling changes.
This makes only non-functional changes so the next patch can make
mostly functional changes.

QQuickText: rename q_imageLoaded() to q_updateLayout().
Says what it does, not when it is called.

QQuickWindow: split QQuickWindow::forcePolish() into
QQuickWindow::handleScreenChanged() and
QQuickWindowPrivate::forcePolish().

Change-Id: Ief2ae30cd9f27ee8083b2c75765fb5278bde5ea8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-26 13:07:40 +00:00
Nico Vertriest 16eaec15e8 Doc: Corrected display qml code in photosurface.qdoc
Change-Id: Ic4e0dcc6bd91921cfea68e0cfe805e8369f58618
Task-number: QTBUG-49810
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-01-26 11:39:15 +00:00
Robin Burchell 9d58412049 QQuickTextNode: Nuke some dead code.
This has been commented out since the initial introduction in 2011. I doubt it's
actually useful anymore, and if it is, it's in git history regardless.

Change-Id: Ife36f423a21d4b12ebca154b4ad14848844e4eef
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-26 09:43:55 +00:00
BogDan Vatra b83b358634 Fix don't delete singletons objects owned by C++
Don't delete singletons objects that are created only from C++ and
have explicitSetObjectOwnership flag set, explicitSetObjectOwnership
flag is set only by QQmlEngine::setObjectOwnership.

Task-number: QTBUG-49865
Change-Id: I0ef658c2094e67b5cd9a1585e273144dfcee736a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-25 12:37:19 +00:00
Kevin Krammer d6c5c3b529 Pass Qt.include() URLs through the URL interceptor if present
JavaScript files loaded by the Qt.include() function did not get
passed through the QQmlEngine's URL interceptor, while those loaded
by import statements did.

Now both include variants have the resolved URL passed through
the interceptor, e.g. an installed QQmlFileSelector

Task-number: QTBUG-50483
Change-Id: Ife75e6b644687f3fb04048a311e570cdcbab8c6d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-23 13:09:48 +00:00
Jian Liang 3cc589c983 Make sure we destroy all QV4::QObjectWrapper objects
Delay freeing QObjectWrapper Value to MemoryManager::sweep() to make sure
we can destroy all QObjectWrapper objects.
We also keep track of QObjectWrapper in QV4::Heap::ModelObject to make
sure we destory them in QV4::MemoryManager::sweep()

Change-Id: I3a8a3b07faab1f88c2eb746f68aa8d9584b40026
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 14:07:19 +00:00
Nico Vertriest 2d7921184e Doc: corrected some minor link issues
Change-Id: I6bdd485eafe2c2a0c925690dab451664af1223dc
Task-number: QTBUG-43810
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-22 12:12:29 +00:00
Robin Burchell 978993b3a3 tst_qquicklistview: Move a number of window instances to use scoped pointers.
These are exception safe (not that that matters greatly here) but more
importantly idiot-proof. A number of tests weren't cleaning up windows properly
before.

Change-Id: Ieca676c8eea54d3c2a1d9e4738133acdb2b370fe
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-22 10:43:20 +00:00
Ulf Hermann b60a5dc940 Clean up QV4DataCollector
We don't need to pass debuggers and engines around as the data
collector already has all the necessary information. Also, the
exception collect job is only used in the test case, so we don't
need to define it in the collector.

Change-Id: I3197dd5c2d99e95465aa787097c6f8bf8aee794e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 09:51:40 +00:00
Ulf Hermann 5537027094 V4 Debugger: Avoid looking up values in debugger thread
To avoid interaction with the engine from the debugger thread we
move the value lookup functionality into the data collector, and
drop the RefHolder. Also, we define some more debugger jobs to
move the work the request handlers do into the GUI thread.

Task-number: QTBUG-50481
Change-Id: Ia73ebd01e715f13110ef010a766e9b0a1e202df9
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-22 09:51:37 +00:00
Simon Hausmann 872a054757 Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6 2016-01-21 08:08:30 +00:00
Liang Qi d68a7e04f2 QQuickItem: fix an infinite loop nextItemInFocusChain()
When isTabFence is set to true and no children.

Task-number: QTBUG-50516
Change-Id: I8430336fde7ab041797f8f9d9dfe5b9d56fecddd
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-20 12:44:46 +00:00
Marco Benelli a28bf00a6c qmlplugindump: avoid generating conflicting types.
qmlplugindump used to import QtQuick, therefore skipping all QtQuick
types when dumping.  Now that it imports only Qt, it is no longer the
case, and all QtQuick types would be dumped in the module's qmltypes
file.  It can be avoided by specifyng 'QtQuick' as dependency in qmldir
file or in a json file passed as -dependencies option.  It seems however
that people are not used to that, so in order to restore the old
behavior, the QtQuick dependency is automatically added when the
dependency list is empty.

Change-Id: I5fb2e57893607a877d284767b3fd09159b45ff42
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-01-20 09:01:17 +00:00
Michael Brasser 63652419b6 Provide access to signal parameters in SignalTransition::onTriggered.
Change-Id: Ib74d3f5e9a357a86b818e27dd7249e2ecdf1e513
Task-number: QTBUG-46897
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-19 14:54:12 +00:00
Liang Qi 81b3d791b5 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ieb48911638b5c1acdfd4dee8aa19dca9be99a1f6
2016-01-19 10:32:37 +01:00
Anton Kudryavtsev 7c9e51e7e7 QmlPluginDump: use QFileInfo::exist(f) instead of
... QFileInfo(f).exists(). It's faster.

Change-Id: Id9dd30f5532ed73c487caffcaad3860a6475e832
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-19 08:04:45 +00:00
Pär-Olof Håkansson 9000c04650 QSGDefaultImageNode: Only set DirtyGeometry if new texture
QSGDefaultImageNode::preprocess() always sets the
geometry to dirty even if no new texture was grabbed.

Change-Id: Ifb6ce160854aa0a5b9e0f87fbf517b21e86e0ade
Task-number: QTBUG-49904
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-01-19 00:31:23 +00:00
Marco Benelli c1bdf81549 qmlplugindump test: added check.
Added a check on meta object revisions, in order to verify regressions
on QTBUG-49284.

Change-Id: I616875157d2b36db0a984338ba9d6a7c5a83a240
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-01-18 12:31:37 +00:00
Simon Hausmann d3311375a1 Fix up commit 9d7b27f5bf
That commit changed qqmljsgrammar.cpp, which turns out to be a generated file.
Therefore it's important to also make the modification to the original grammar
file, to ensure that future re-generations of the file contain the new code.

Change-Id: Id913b29e4a70bfa0c2786073c46dcc206c28b6ee
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-16 10:32:23 +00:00
Robin Burchell fd1cd93708 tst_qquicklistview: Share window in stickyPositioning test.
Since it has a lot of table driven tests, if we reuse the window like the other
table driven tests do, the total time is a lot lower (~2 seconds lower for just
this test for me).

Change-Id: I01ce38442f70d592d70ba584df3e0783956ebeaf
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-15 11:05:55 +00:00
Robin Burchell 96f1bb07eb QQuickItemView: Take sticky header/footer into account for positionViewAtIndex().
When using an overlaid header or footer, we must adjust the position we come up
with by the appropriate size in order to end up at the correct place.

Change-Id: I218b9aef7fdf37f56ffb63dc395f97045b55a186
Task-number: QTBUG-50097
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-01-15 11:04:22 +00:00
Joerg Bornemann f4fb1ff188 Doc: typo fix
Change-Id: Ida2e39f2eb1744173cd40b4a29f3304c2a2bfd6c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-12 16:38:09 +00:00
Nico Vertriest 8b468ee661 Doc: Added brief statements for examples overview page
Task-number: QTBUG-50261
Change-Id: Ie7e7ce2fdb872f1628eeb6dbcb415cecbbe92216
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-11 16:30:29 +00:00
Thiago Macieira 74580d0092 Fix inconsistent use of override keyword
Change-Id: I408dcb81ba654c929f25ffff1427560b6e7962ad
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2016-01-08 18:17:04 +00:00
Stephen Kelly 9e5cdcdd4b Set CMP0056 to NEW only if it exists for the running cmake version
Change-Id: Id3dfaba678f1891adbc31fcd379481ad9271198e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-08 13:16:50 +00:00
J-P Nurmi 5c0b7f73aa QQuickAnimatorController: fix dangling QQuickAnimatorProxyJob pointer
We're hitting crash problems in controls2 auto tests where
QQuickAnimatorController::stopProxyJobs() contains dangling pointers
in m_proxiesToStop. The window for these proxy jobs had been already
reset, so the destructor of QQuickAnimatorProxyJob was not removing
it from QQuickAnimatorController's m_proxiesToStop.

Change-Id: I89e3b174c86dfb217a555f07ee1ce4c42cbcf204
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-01-08 13:14:58 +00:00
Thiago Macieira 65fa1b4c08 Remove prohibited uses of underscore + capital letter
All identifiers starting with an underscore and a capital letter are
reserved to the compiler and must never be used by the user code. Try to
find a better name or, in the worst case, move the underscore to the
last position in these identifiers.

See commit cf63c63d558227fdbef09699c261560e7474f5ea in qtbase for a case
of such an identifier causing a build breakage when the compiler began
treating it specially (it was _Nullable).

Change-Id: I1d0f78915b5942aab07cffff140f9f39c29f0fdf
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2016-01-08 00:09:50 +00:00
Joerg Bornemann ac47b1520c Check for python executable.
When building QtQml without having python in PATH the build system will
generate an empty RegExpJitTables.h. The linking will then fail because
of unresolved external symbols.

Task-number: QTBUG-47193
Change-Id: I39abf44bf30abfb4a3209713a1fb07faff7ead63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-07 10:23:10 +00:00
Edward Welbourne 893067a474 Correct declaration in doc to match const in code.
QSGTextureProvider::texture() was getting a warning from qdoc because
it didn't find an exact match for its signature: the doc lacked const.
Ditch some spurious semicolons while we're about it.

Change-Id: I785ae8b8d46c839a1e29339284834a8b8e44bffe
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-06 13:06:41 +00:00
Erik Verbruggen 7ffb275c57 V4: Replace QVector with (Q)VarLengthArray in BasicBlock.
This prevents extra mallocs in nearly all cases, because the number of
incoming edges is not that big. The outgoing edge count has a maximum of
two.

Change-Id: I89195809952ce6087c5af51d717a4c2d8ac6b853
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-06 09:25:34 +00:00
Sérgio Martins 49f9797d2a Fix a couple of container detachments
Change-Id: I0def20d858de7721771702907b7a431b5fb90a1f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-05 16:36:02 +00:00
Nico Vertriest 8b9ab5e06e Doc: Added brief statements for Qt examples overview page
Task-number: QTBUG-50101
Change-Id: I0a7a8d7c3312923d956082fed7fcdf6567b44a7d
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-05 12:23:28 +00:00
Oswald Buddenhagen 58ce11c6c9 don't rely on transitive dependencies
Change-Id: Ide872b452e02ebefb3eeb51464c8d59e8bf58bc4
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-01-05 11:32:13 +00:00
Robin Burchell 71f6752c62 QQmlXmlHttpRequest: Fix a memory leak on use of XMLHttpRequest's responseXML.
DocumentImpl (the root of all evil) inherits QQmlRefCount, thus, it has an
initial refcount of 1. We correctly released the initial ref in the case of
error, but if there is no error, we don't: we pass it over to v4 using class
Node which (in Node::Node) increments the refcount again.

When Node is later on collected by the GC, the document's refcount is never
decreased past the initial ref, thus, not deleted.

Task-number: QTBUG-50231
Change-Id: Icefe4391a785c95cb8900219be8ba71f9c53785f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-05 09:39:22 +00:00
Robin Burchell 5588eec637 QQuickRepeater: Use qmlobject_(dis)connect instead of regular (dis)connect.
A bit faster, not that this is the most important case for it.

Change-Id: I3e50bd4a45d2b60c105a9315ccf0b2c34502cb8d
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2016-01-05 09:38:44 +00:00
Frank Meerkoetter a4b2fa94d2 Fix value changed logic for ValueTypeProvider types
Fix broken value changed logic for types implemented
through the ValueTypeProvider interface (QtQuick and Qt3d).
It affects vector2d, vector3d, ...

The signal was not emitted for the cases where the new value
was equal to the default value of a given type.

Also add a unit test to cover this area.

Change-Id: I9491b0462c78fecc4c704ea36921611c1bd6b2ee
Task-number: QTBUG-50204
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-04 09:56:17 +00:00
Gunnar Sletta 3b76257409 Make QQuickPaintedItem support Item::layer
Change-Id: I4baf8416704fdb65b96b7e0b8620c651f9199159
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-04 09:18:28 +00:00
Mitch Curtis 2aacd08720 Fix typos in ParticleSystem documentation
Change-Id: I417250992dbba3b67e891b0e929c09f2c95da299
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-01-04 08:54:13 +00:00
Robin Burchell a4a8ee48b0 QQuickFlipable: Set enabled property on whichever side is considered active.
This fixes a regression in behavior whereby input is not blocked when the side
changes. In QtQuick1, input was tied to opacity: items with a 0 opacity would
not receive input. In QtQuick2, this is not the case.

[ChangeLog][QtQuick][Flipable] Flipable now toggles the 'enabled' property on
whichever side is active. This restores broken behavior compatibility with
QtQuick1, and blocks input to whichever side is not active.

Change-Id: I36e29089cd7ffd05bf1f415490e0e0816a86bf30
Task-number: QTBUG-37072
Reviewed-by: Michael Brasser <michael.brasser@live.com>
2015-12-31 18:01:51 +00:00
Thiago Macieira a34a6de0b9 Fix crash in a non-debug build with assertions enabled
QV4::Heap::Base::setVtable has a Q_ASSERT on the state of Base::mm_data,
but that member is never initialized anywhere (that is, the Base class
does not properly protect its invariant). There were workarounds in some
places for initializing the member, but only in debug mode.

That was wrong for a number of reasons:
 1) Q_ASSERT is still enabled if QT_FORCE_ASSERTS is defined
 2) in release mode, the compiler will remove the double initialization
    anyway

Another solution would be to give QV4::Heap::Base a constructor that
initializes the member, but I am not sure whether adding a constructor
to this class is permitted.

Task-number: QTBUG-49681
Change-Id: Ic90fe6b1cbe84978a02fffff141beacbe73c0b9c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-29 13:59:13 +00:00