Commit Graph

70 Commits

Author SHA1 Message Date
Tomasz Siekierda (sierdzio) 55867c2f00 Document parenting behaviour of delegates in QML ListView and Component.
ListView:
As delegates are instantiated in ListView, they are parented to views
contentItem. This is now explicitly stated in the documentation.

Component:
Components are not derived from Items, so they cannot hook to anchors.

Task-number: QTBUG-24822
Change-Id: I09e04fbcc01b2858c039d22f9600ef201a9a91ab
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-08-10 10:46:53 +02:00
J-P Nurmi 53371a557f QQuickListViewPrivate::updateStickySections(): add missing null check
Task-number: QTBUG-32711
Change-Id: I45ed6829f2c240e8352dac33beeee803cb88a18d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-07-29 22:50:26 +02:00
Albert Astals Cid 3f01f6ff03 Resizing items out of the list viewport should not change the viewport
Consider the old geometry, not the new one to check if an item
was outside the viewport or not

Change-Id: I108412d560faf86130044f3d091254c07af0c004
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-07-24 11:30:40 +02:00
Albert Astals Cid b924cbe711 Update snap when snapMode changes
Task-number: QTBUG-32258

Change-Id: Id2120acad06d7cfce988400df0067e2c0f16eb24
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-07-08 15:17:04 +02:00
J-P Nurmi feaf7ca8f5 Item views: do not track the geometry of items being removed
Task-number: QTBUG-31873
Change-Id: I4230893ccb2925ed9c2429d26b411264bf7c1c65
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2013-07-04 08:26:59 +02:00
Tasuku Suzuki cbc86ae4d4 Doc: fix since QtQuick 5.1
Change-Id: I87a108e817caa06c73620dde0ba68b3c66a134c9
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-06-10 05:48:57 +02:00
David Fries 3b5173b826 Doc: corrections, spelling, and ListView requirements comments
From the ListView comment I thought the model had to be derived from
QAbstractListModel, but that's not the case, QAbstractListModel will
work just fine, it just doesn't support specific cases such as trees.

Change-Id: I59305006540ddc049e276cf412571373cbfa6c67
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-05-15 09:32:58 +02:00
Sze Howe Koh 0d4512c8bd Doc: Fix some broken snippet paths
Change-Id: Ib79bfbea402b86e26a503de47383522317ca906b
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-05-06 16:35:28 +02:00
Alan Alpert 53e3174686 No longer apply pending changes when accessing ItemView properties
Applying changes in the getters can lead to binding loops, and is
currently inconsistently applied. Removing the applyPendingChanges calls
from remaining getters, and adding a forceLayout() function for cases
where the immediate-apply behavior is needed.

Task-number:  QTBUG-30555
Parts-of-patch-by: Albert Astals Cid
Change-Id: I64632601e02f2a53060296ab7739577a749d916f
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
2013-04-26 21:17:42 +02:00
Frederik Gladhorn 15dc45ce10 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ia02971527a2d1a80c5624d69330428818aab3a41
2013-02-25 11:57:50 +01:00
Michael Brasser 523bf6c3d0 ListView's highlightMoveDuration should default to -1.
Change-Id: Ibb53cc21b4f1f301569cd7724c60cb8df978921a
Reviewed-by: Bea Lam <bea.lam@jollamobile.com>
2013-02-22 14:35:10 +01:00
Alan Alpert 7cad0e52c5 Move the model classes from QtQuick to QtQml
This is needed for proper support of non-GUI instantiators in QtQml.
Only private C++ classes are affected. Aside from name changes, model
classes now operate on QObjects instead of QQuickItems, leading to minor
changes in the implementation of QtQuick classes using them.

The old QML type names will still be registered in the QtQuick import
for the forseeable future, but pointing to the new classes. The new QML
types will be added in a second commit.

Classes Affected:
QQuickVisualDataGroup -> QQmlDataGroup
QQuickVisualDataModel -> QQmlDelegateModel
QQuickVisualItemModel -> QQmlObjectModel
QQuickVisualModel -> QQmlInstanceModel
QQuickChangeSet -> QQmlChangeSet
QQuickListAccessor -> QQmlListAccessor
QQuickListCompositor -> QQmlListCompositor
QQuickPackage -> QQuickPackage (just moved for now)

Change-Id: Ia19e630e53bfa9e5d459e289596cd11df1ea3930
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2013-01-24 17:14:23 +01:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Xingtao Zhang 888a02ec4a Doc: Updated docs for examples and etc
- Corrected several \snippet paths and \example paths.
- Added missing example images.
- Marked several commands as code.
- Updated the exampledirs variable for qtqml.

Done-with: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Task-number: QTBUG-28898
Change-Id: I24aac17821f54de4bd5129c45b5bf96dc0f114b2
Reviewed-by: Liang Qi <liang.qi@digia.com>
2013-01-09 18:42:42 +01:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Bea Lam 545608ee97 Document that add transitions should not animate item height
Change-Id: I4941e96e9ea96dfe364b9b95a00372d94695c7a3
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-08-03 09:47:47 +02:00
Bea Lam 21f6b4d381 Fix various broken links in documentation
Change-Id: I9e2dac37d18e3ca62e4a92be25e5c2e60ffeba00
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-08-03 09:47:47 +02:00
Bea Lam 76c5bbd375 Use \b instead of \bold
Change-Id: Ica77b78b113321f962066f1edabd34bf21d38910
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-08-02 05:44:53 +02:00
Jerome Pasion 2d3584ff21 Doc: Changed \qmlclass to \qmltype and added \instantiates.
-To simplify QDoc, \qmlclass is now \qmltype.
-'\instantiates <C+++ class>' is for the types that are defined in C++.

Change-Id: I29242d33daf7b972d8b86a356b9689638866b950
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-07-30 11:11:56 +02:00
Martin Jones 3a045419ba Add SnapPosition mode to positionViewAtIndex() in List/GridView.
This allows the view to be positioned on a snap boundary, which is
generally what is wanted when strict highlight mode s set or snapping
is enabled.

Task-number: QTBUG-26605
Change-Id: I6288dc8be4ff16c412b56ab449b6a9fb7b7ea889
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-27 03:08:24 +02:00
Andrew den Exter 7daab8039a Remove QListModelInterface.
Implement ListModel and XmlListModel using QAbstractListModel
instead.

Task-number: QTBUG-15728

Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
2012-07-25 02:15:15 +02:00
Martin Jones 50ec85e368 Change Quick docs to refer to "types" rather than "elements"
Task-number: QTBUG-24785
Change-Id: I223479b879514abaacb123852323c1cfada7a5e1
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-16 04:50:48 +02:00
Martin Jones baee77ef47 Section headers ignore list delegate size changes when "colliding"
Make section header updates part of the layout process.

Task-number: QTBUG-23298
Change-Id: I4586bc58bc195fcc47f6db79346727eb6e3d3845
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-04 03:02:49 +02:00
Bea Lam a5186a2333 Rename ListView *speed properties to *velocity
Change-Id: I63c02d186b1832e7bf890a00caad150d5bf136cb
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-26 08:08:37 +02:00
Andrew den Exter 3bb4880d63 Fix section delegates not updating when changed.
Delete all allocated section items before doing an update when the
section delegate is changed.

Task-number: QTBUG-24899
Change-Id: I09dc7a1c602a49ad7bb37512a7e5116392259457
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-26 08:08:33 +02:00
Andrew den Exter 4089c2bbc5 Position section headers correctly when section property changes.
Schedule a new layout after the section property is changed to correct
item positions if section headers are added or removed.

Task-number: QTBUG-24900

Change-Id: I7e46ec6dc00e5a810029396a4c5ca4e87ee1d94d
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-26 08:08:32 +02:00
Bea Lam d8dcb8ea98 Revert "Remove properties related to highlight speed"
This reverts commit 18fb5506d5.

Without these properties there's no way to set a constant
movement speed.

Change-Id: I49cd648846f801eb479ecce8cde09ff49ea11736
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-25 08:57:36 +02:00
Andrew den Exter 530b773dfc Fix crash when dragging items outside visible area.
If asynchronous item creation finishes while the content area of a
ListView has been dragged full outside the visible area a full refill
is triggered which can overwrite the requested index and potentially
result in a single delegate item being assigned to multiple view items
and later being doubly released.  Only create the view item object in
the createItem function to prevent this from happening.

Secondly only reset the visible items if jumping outside the buffer
range rather than just the fill range to prevent churn when the list
only contains buffered items.

Task-number: QTBUG-26232

Change-Id: I5bce845898ef5f699f34afc268594ef38e01d6a3
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-22 12:47:31 +02:00
Bea Lam 18fb5506d5 Remove properties related to highlight speed
ListView should only have duration-type properties (i.e.
highlightMoveDuration and highlightResizeDuration) as it's unnecessary
to have both duration and speed properties for the highlight animation.
(PathView and GridView only have the duration-related properties.)

Change-Id: I1b94599e3e89afe6488ce2a882c2802354a859fe
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-22 08:18:15 +02:00
Chris Adams 5e33b0f580 Create new documentation structure
The documentation currently has no clear separation between Qt QML
and Qt Quick.  With recent commits like:
6c8378eaf1
and
ab1e510121
the separation between the language definition and implementation,
provided by Qt QML, and the standard library for the QML language,
provided by Qt Quick, is clear.

This commit creates a new documentation structure that is more
navigable and separates concepts into logical categories, with
clear separation between QtQML and QtQuick.  It also provides a more
generic QML Application Developer Resources page which contains links
to information for QML application developers.

Change-Id: Ia807ccfbfd24ffa0e1c7f0a51ed9d2ed3aa6a733
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-21 09:58:56 +02:00
Martin Jones 6a1f3c1b35 Update Flickable velocity/overbound for each axis independently
We were attempting to update velocities/overbound correction for both
axes even if only one of them had changed, leading to inaccurate values
for one of the axes.  Also removes a bunch of code duplication.

Change-Id: I6a50b908992c976889373f541bdd1abad462e247
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-06-13 09:07:03 +02:00
Martin Jones 86cbb55522 Set a non-zero default cacheBuffer.
The likelihood of constant framerate when flicking is considerably
improved by having a cacheBuffer.  Since there is only a minimal cost
in having a modest cacheBuffer, it is better to have a more optimal
default value - 320 seems a good starting point.

Change-Id: Id3c8a153821573b5b08c6fbd80d34152908d358d
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-06-13 01:41:58 +02:00
Martin Jones 762b4d9011 Performance should always be better with cacheBuffer
Setting a cacheBuffer introduced more work for the scenegraph due to
cached delegates' visibility being toggled.  Changing visibility is
expensive as it is proagated to all children.  Introduce a cheap
method of hiding a branch instead.

Also avoid initiating incubation in the same frame as a completed
creation.

Change-Id: I573bcf37f441f96a7502d445be50ef4301f217d5
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-06-08 06:17:54 +02:00
Bea Lam c37c4215b0 Don't emit moving and flicking signals unnecessarily
The moving and flicking signals should only be emitted once when
the view has been moved/flicked both vertically and horizontally. (This
was already done correctly for the dragging signals.)

Also changes QQuickFlickable::flick() to return bool instead of void.
Subclasses no longer emit the flicking signals but call
flickingStarted() instead.

Also splits the tst_qquickflickable::movingAndDragging() test up into
several tests.

Change-Id: Ie527568a9702049dd0bcda18c2eb3e43d8938a18
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-06 10:14:01 +02:00
Jerome Pasion ca6d49e6b4 Doc: Grouped Qt Quick types into several groups
-created new groups and converted some overviews into group pages
-edited type documentation and added \ingroup
-articles still need title fixes and link fixes

Groups:
qtquick-visual-types
qtquick-item-graphics
qtquick-shaders
qtquick-canvas
qtquick-text
qtquick-text-validator
qtquick-interaction
qtquick-positioners
qtquick-transformations
qtquick-states
qtquick-animation-define
qtquick-animation-properties
qtquick-animation-control
qtquick-animation-modifiers
qtquick-images-sprites
qtquick-images
qtquick-models
qtquick-containers
qtquick-views
qtquick-paths
qtquick-utility

Task: QTBUG-25685

Change-Id: I81d4df3320bf5daad5cabb5e42408013fb24f464
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-06-06 06:27:41 +02:00
Bea Lam 4c671c046e Fix doc snippets paths and parsing errors
qtqml.qdocconf and qtquick.qdocconf now refer to the correct
snippets and source directories.

Snippet paths in .qdoc and .cpp files have been updated to refer to
the new shortened path references, e.g. \snippet qml/file.cpp instead of
\snippet doc/src/snippets/qml/file.cpp.

This also deletes snippets from src/qml/doc/snippets that belonged under
src/quick/doc/snippets (and were already duplicated there anyway) and
restores some snippet files that shouldn't have been deleted.

Also fixes some inline snippets to use \code .. \endcode instead of
\qml .. \endqml as they contained javascript or partial QML
snippets that were causing parsing errors from qdoc.

There are still snippet errors arising from qmlintro.qdoc as the
qmlintro snippets directory that it refers to cannot be located.

There are also two references to a removed snippet identifier in
examples/qml/cppextensions/plugins/plugin.cpp that need to be fixed
in conjunction with the related docs in a later commit as the relevant
code has changed and the docs are now invalid.

Task-number: QTBUG-25721

Change-Id: I50c665245a74c140470c58a32546591d187dfe4b
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-05-31 10:40:41 +02:00
Bea Lam 1deba22774 Don't override "z" bindings for header and footer
Headers and footers are given a default z value. This value
should be set between Component beginCreate() and completeCreate()
to avoid overwriting any binding in the header or footer item
that has already set the 'z' value.

Change-Id: I8e3ee97232d99500a32f2d77d2b663016eb404f7
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-05-28 02:39:10 +02:00
Nico Vertriest 6112c0f571 Doc: Sanitized QML types
-modified \brief
-checked QML modules
-added qml directory to the qdocconf file
-added particles directory to the qdocconf file

Change-Id: I589e32d3106cda37c7fa4d55a941afd9876fc2b2
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-05-24 15:41:16 +02:00
Geir Vattekar 727180c984 Doc: Moving Qt Quick docs for new doc structure
-moved documentation from
   doc/src/qtquick2
   doc/src/localstorage
   doc/src/particles
 to src/quick/doc/
-fixed qdocconf file
-fixed snippets, images, and other qdoc errors related to the new
 directories
-fixed links in the main Qt Quick page

Change-Id: Ie3408c2624f623c17de07e5635d5c7284d02b973
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-05-09 00:56:16 +02:00
Bea Lam 6fce244a22 Fix compile warning
Change-Id: Iccbb17c929f7966bb1cfa21437434d9a9a6a04ee
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-05-01 09:51:56 +02:00
Bea Lam 9a107f47ea Fix content pos adjustment when resizing first item
If visibleItems.first() changes size in a ListView, the size change
should be made in the direction of the content flow. This was not
working correctly for layouts other than the default vertical+LTR
layout. This patch fixes the issue for other layouts and also fixes
resizing of implicitly sized delegates (e.g. positioners) within the
default layout.

Change-Id: Ib1d84ce000a3a341fe617cf644420dc5d589d577
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-05-01 07:34:12 +02:00
Bea Lam 0d52c081a1 Vertical layout direction for ListView and GridView
Provide verticalLayoutDirection property with TopToBottom
and BottomToTop values.

Change-Id: If6f0da5dd4735036162868d391852a661854de5b
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-04-17 06:09:56 +02:00
Andrew den Exter 96c0e7e576 Don't ignore model changes when the ListView scroll position changes.
If there are pending changes when the ListView viewport changes then
do a full layout instead of a refill.  Likewise for GridView and when
animations finish or the cacheBuffer size changes.

Change-Id: I57a2b01fee5729381558af366dad24ba26c223ef
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-04-13 08:07:16 +02:00
Martin Jones 4f08f48017 Section comparison should be case insensitive.
Allows use of mixed case model data without having to add a
special role just for sectioning.

Change-Id: I0a747e51542b5bf0f9db8fc2732882928a6cc676
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-28 03:10:14 +02:00
Martin Jones 6deb3ceffa Resetting a model can cause a crash in views with header/footer.
Geometry listeners were called for deleted header/footer.

Change-Id: I47854178232f8a4ab5e19a931901b49741fec388
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-19 10:49:21 +01:00
Martin Jones f079f789c5 Ensure section header/footer are cleaned up.
If the model is cleared or replaced with an empty one,
the section headers should be released.

Change-Id: Ia2f070c312593743b2c5332a6c69facaf222ee6d
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-19 10:49:05 +01:00
Casper van Donderen c291efff26 Remove the usage of deprecated qdoc macros.
QDoc now has support for Doxygen style commands for italics, bold
and list items. This change applies that change in QDoc to the
actual documentation.

Task-number: QTBUG-24578
Change-Id: I62d203f21df63a95ee236e578b10418fd9680707
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-03-13 16:34:49 +01:00
Bea Lam ed74ec4c40 refilled items should be moved immediately
refill() functionality should reposition items immediately, else
removeNonVisibleItems() sees different positions from those added in
addVisibleItems() if an item is animating.

Change-Id: Ib9904e08bf92b18fd4b712270c0ab69e9a113e04
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-10 05:47:00 +01:00
Bea Lam 78356f6038 Avoid using QQuickViewItem as base class
This patch renames it to QQuickItemViewTransitionableItem, and
FxViewItem and PositionedItem now create instances of this instead of
subclassing it, to reduce the memory used when transitions are not
required.

Change-Id: Ie050cda5a121bff9542c7ba7356f6eacf37d241a
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-03-10 00:58:12 +01:00
Martin Jones b1a301884b ListView can freeze if flicked beyond its bounds.
If the delegate's size changes in componentComplete and all
items are flicked out of view, an incorrect jump calculation
in addVisibleItems() resulted in a new delegate being created
in the wrong position, and retriggering the jump calculation,
which resulted in a new delegate being created in the wrong
position, and retriggering the jump...

Also fixed currentItem visibility.

Change-Id: Iad5f211c4fc5eed9c009d51a0ce3b58181a7b36e
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-07 08:42:21 +01:00