Commit Graph

65 Commits

Author SHA1 Message Date
Friedemann Kleint adaa3fc546 Fix invocations of static methods of QGuiApplication/QCoreApplication.
Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-03-05 10:03:30 +00:00
Allan Sandfeld Jensen 373ce88783 Cleanup math function includes and usage
Use std::math on floats and doubles, and qMath on qreals, and only
include the math headers actually needed.

Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-19 10:49:03 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Holger Hans Peter Freyther 2a2fb6a9b4 Check for "c" being a nullptr in all places
So either c is never a nullptr or there is a potential crash in
the grab code. Replicate the check from above.

Change-Id: I2c93502c026cdd92dc5d20e3d6d59e6f6f92a6ce
Fixes: Coverity CID 10628
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-14 09:23:46 +01:00
J-P Nurmi cf959b4b4e Repeater & itemviews: fix setModel() JS array handling
QVariant comparison in setModel() started failing because
JS arrays are now passed as a QJSValue. Re-assigning the
same array content should not trigger a model change.

This change restores the old behavior it had before, when
JS arrays were passed as QVariantLists.

Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-29 21:50:12 +01:00
Sérgio Martins 2b5e953445 PathView: Fix QML engine thinking currentItem is null when it's not
QML didn't re-evaluate any bindings using currentItem because a
notification was missing.

Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-10-10 11:30:06 +02:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Simon Hausmann 61f72d32b4 Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
	src/qml/jsruntime/qv4include.cpp
	src/quick/items/qquickrendercontrol.cpp
	src/quick/items/qquickrendercontrol_p.h
	src/quickwidgets/qquickwidget.cpp

Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
2014-08-12 10:04:33 +02:00
Martin Jones c85bfba382 Synchronize PathView gesture grabbing with other items.
PathView didn't attempt to grab the gesture at the same event as other
items. This prevented PathView from rightfully claiming the gesture
before lower items in the stack. Use the same threshold test for
PathView as used elsewhere.

Task-number: QTBUG-37859
Change-Id: Ic57cb805ac979e41c3e35d86b2e7db781e61d69d
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2014-08-06 01:35:56 +02:00
Simon Hausmann 75d8ebb3e6 Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/qml/jsruntime/qv4arrayobject.cpp
	src/qml/jsruntime/qv4engine.cpp

Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
2014-07-26 13:21:16 +02:00
Mitch Curtis 1416e6bd3e Schedule layout changes to avoid refill() recursion.
Otherwise we add duplicate item delegates.

Task-number: QTBUG-40298
Change-Id: I8a2221d72f458c892720a71d87513808a5d725a6
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2014-07-24 10:17:13 +02:00
Lars Knoll 2338bb1faa Fix QQmlDelegateModelChangeArray
The class had a vtable, clashing with assumptions about Managed
objects. The derived classes where actually only cosmetic sugar
on top of the basic change class. Clean this up and unify the
functionality in the base class.

In addition adjust the class to the new data layout.

Change-Id: I8677f6c71465381f7ebdf82eb6025fda6d137ec3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:49:09 +02:00
Albert Astals Cid 5772da7e91 QQuickItemView/QQuickPathView: Fix creation of delegates
When the delegate is set before the model and
after the ItemView/PathView has been created

Task-number: QTBUG-38368
Change-Id: I6963abe28087699cf4e8921153dc7641bae3b220
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-04-18 07:39:32 +02:00
Sze Howe Koh 303db2e8a1 Doc: Document signals (not handlers) under \qmlsignal
Append the handler names to the end of the corresponding signal doc.

Task-number: QTBUG-35846
Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-03-18 13:17:42 +01:00
Oleg Shparber 059ffd2d37 Flickable: Use increased default flick parameters on BB10
Due to the high resolution the display default flicking speed
is rather slow. This change introduces increased values of
QML_FLICK_DEFAULTMAXVELOCITY and QML_FLICK_DEFAULTDECELERATION
which feel closer to the native experience.

Also cleans up the flick variables a little by moving them to
their own header, so that QQuickPathView can also benefit from
the improved behavior on BB10.

Change-Id: I80878d4cc2a53a8f530b1dc8674f729f70a83119
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-12-11 01:22:58 +01:00
Marco Bubke 1738e4ee11 moveOffset in QQuickPathView::modelUpdated uninitialized
Get a error for compiling with gcc 2.8.1.

Change-Id: If93ed69695fb523eff05cae2960e3743dc496310
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-11-09 22:46:47 +01:00
Sze Howe Koh 22c138abfc Doc: Fix broken links
Change-Id: Ie7408409ddbaa354370267f2dd74326ec56a4186
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-11-05 15:37:29 +01:00
Gunnar Sletta 7dd2deb44b Remove ancient and unused leftovers
Change-Id: Ia3a2aa2244748c2f3f2df8853f5bddfbbc4bc19f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-10-22 12:34:05 +02:00
Martin Smith 4706b1ceff qdoc: no longer recognizes the version nr in QML refs
All QML references of the form
<QML-module-name><QML-module-version>::<QML-type>::<member-name> have
had the <QML-module-version> removed i.

Task-number: QTBUG-33776
Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-10-02 14:40:01 +02:00
Andrew den Exter a8b27d974a Fix PathView stealing mouse grab from its child items.
Apply the improvements that have been applied to Flickables handling of
child items over time to PathView to bring its behavior back in line.

Task-number: QTBUG-33699
Change-Id: I76a412d75c48f9cf2f12f5f6f1aa01ff62d06364
Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2013-10-01 01:50:49 +02:00
Gunnar Sletta 424052000a Fix license headers of QtQuick sources.
Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-30 08:06:57 +02:00
Jerome Pasion 0e62896fdc Doc: Fixed and updated Qt Quick's \qmlmodule page
-incremented version to Qt Quick 2.2 (in \qmlmodule page)
-import changed to QtQuick 2.2
-\inqmlmodule no longer needs the version. QDoc will ignore the version
but it is better to remove it now to avoid confusion

Task-number: QTBUG-32172
Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-25 13:51:51 +02:00
David Faure 80b65ff537 Doc: PathView::currentItem is an Item, not an int.
Change-Id: If06c747b424ac8dd6b880aa296af5e5957bb9b51
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-17 16:17:03 +02:00
Topi Reinio 78c325b7c5 Doc: Clean up docs for PathView.highlightRangeMode enum values
Fix PathView.NoHighlightRange description, move the enum values
into a list, and do some minor editing.

Task-number: QTBUG-16160
Change-Id: I5356c21ea3244ce43defa346da11696a8706c71f
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-08-01 14:15:52 +02:00
Friedemann Kleint ae50eaa410 Fix lupdate-warning "Cannot invoke tr() like this".
Change-Id: I3ded3d9ab9fa202a3133c53fd6e17a8354481d0c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-04-23 07:34:46 +02: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
Tasuku Suzuki 9e604dcd07 Fix crash in PathView
Change-Id: I259e7af1755ff9615782bbce03fc41ea1957cab3
Task-number: QTBUG-29176
Reviewed-by: Alan Alpert <aalpert@rim.com>
2013-01-18 18:19:16 +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
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
Martin Jones 4a4a08d61a Add cacheItemCount property to PathView
cacheItemCount specifies the number of items to cache off the path when
pathItemCount is specified.  This allows up to cacheItemCount items to be
kept alive when they move off the path, and also to asynchronously
create items off path in preparation for display when the path offset
changes.  This is the equivalent of cacheBuffer for other views.

Task-number: QTBUG-23931
Change-Id: I03497537d3f929e5e3579536850dd43eb2724c38
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-08-28 04:32:48 +02:00
Bea Lam 49882aea5a Various small doc fixes and improvements
Adds some missing docs and fixes some incorrect doc references.

Also removes AnimatedImage docs that were exactly the same
as those in base Image type docs.

Change-Id: I1357d3c00e63f1b08683bb78246de93dcc0dac7f
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-08-09 02:28:00 +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
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
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 2a4bb96084 Add methods to PathView: positionViewAtIndex(), indexAt(), itemAt()
These methods are already present in ListView and GridView.

Change-Id: I3777fccdecd77c8ab756a0062c71c6e1bfb749ef
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-23 06:38:18 +02:00
Martin Jones 0fc361f96b Changing PathView model after componentComplete should reset position
If the model is changed after the component is completed, the offset
and currentIndex should be reset to 0.

Change-Id: Ie36eb0c17ce6602c6ae15b5ee7aeb8b1a6e7854b
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-07-23 03:30:23 +02:00
Alan Alpert feb996e3ab QQuickCanvas renames
QQuickCanvas is now called QQuickWindow
QQuickCanvas::rootItem is now QQuickWindow::contentItem
QQuickItem::canvas is now QQuickItem::window
QQuickItem::ItemChangeData::canvas is also renamed window
QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow
The functions related to the color property have dropped the clear from
their names.

The first three changes have interim compatibility measures in place to
ease the transition.

Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-17 07:26: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 6a013bf73b PathView needs drag events similar to Flickable
Added dragging property and dragStarted() and dragEnded() signals.

Task-number: QTBUG-21740
Change-Id: I718835ff7e46af615951ec5f248eba41bac31071
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-07-04 10:12:10 +02:00
Martin Jones 589d39ec6c PathView element with 1 item moves in wrong direction when dragged right
The shortest direction calculation used integer math to determine
which direction to move.  For an odd modelCount, the wrong direction
could be chosen.  For a modelCount of 1 it was particularly obvious.

Task-number: QTBUG-21337
Change-Id: I5e75c74153a5b4c62d1536226cd0703dcae04178
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-06-27 08:49:46 +02:00
Martin Jones 7722786a13 Changing PathView offset doesn't set currentIndex appropriately
If the highlightRangeMode is StrictlyEnforceRange then the
currentIndex should always be updated when the path offset changes.

Task-number: QTBUG-19835
Change-Id: I2371e5abd430e770bbb8f9f9d5f4e1d17e0d8ff5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-06-27 08:49:46 +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
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
Andrew den Exter 447e5acb88 Reset the PathView currentIndex to 0 when all items are removed.
The default currentIndex for an empty PathView is 0, and except when
there is no model or an empty model setCurrentIndex won't allow a
currentIndex outside the valid index range for the model. This changes
the wrapping for negative numbers in setCurrentIndex so that it is
consistent with decrementCurrentIndex and forces the currentIndex to
0 if there are no model items.

Task-number: QTBUG-21316
Change-Id: Id4d4d78e9832d05baf8a9d148e7f81ee89c9bc61
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-05-31 02:23:00 +02:00
Andrew den Exter 2533a40cf2 Fix PathView not updating after all items are removed from the model.
Always clear the layoutScheduled flag on a refill even if there are no
items to create, otherwise future layouts won't be scheduled because
it appears one is already pending.

Fixes an issue in the dragselection example where items that should
have moved to the PathView instead disappeared.

Change-Id: I4302b5b43184c697a78f5c09dc3811326e2271ca
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-05-28 05:30:34 +02:00
Andrew den Exter d4dad3a0b8 Don't parent (QObject) delegate items to views.
This keeps object ownership within the context the items were created
in and simplifies lifetime management as the VisualDataModel has sole
license to delete objects and doesn't have to keep guards against a
view and all it's children being deleted.

Delegates are still reparented in the item heirarchy.

Change-Id: Ife5afdfe294a5a8ca1ca3638a086f72452e4915c
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-05-28 05:30:34 +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
Aaron Kennedy d2e557c2c2 Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is
just wasteful.  Additionally, as the property caches were always
created from the intermediate QMetaObject, it was difficult to pass
information directly from the compiler to the property cache.

Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-05-24 12:52:43 +02:00
Martin Jones 9575a325c2 PathView was moving view too soon on drag
In order to allow gesture grabbing to work correctly, the view shouldn't
react to a drag until the event after the one that triggered it.

Change-Id: I3b84e501aa0f82da821498fa26abe8bbf66a6252
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-05-14 05:37:29 +02:00