Commit Graph

609 Commits

Author SHA1 Message Date
Laszlo Agocs dd523fcb00 rendernode example: Prevent gui-render thread data race
By taking things like the item width and height in updatePaintNode()
(while gui is locked).

Change-Id: I840c6c858a0478eb6ceb09653fd1e033cb54372d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:41:49 +02:00
Laszlo Agocs ee702d9436 Make vulkanunderqml work and update docs
What we are doing for now is setting ExternalContentsInPass always.
This way vulkanunderqml works as expected. For applications that do
not integrate external rendering this means that there is now an
additional secondary command buffer per render pass, but we can
live with this for now.

Later (Qt 6) there should be a way to declare this (that the application
will want to issue native rendering stuff) up front in QQuickWindow or
somewhere.

Change-Id: I736741f9b0eee2f8295b046bacdce862e6a546f5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:41:27 +02:00
Laszlo Agocs 76bec768a5 Add vulkanunderqml example
Change-Id: I61e8b50f560d1f4c68731fb19eb13071992040c9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:41:13 +02:00
Shawn Rutledge 5d995ae122 Move currentFrame and frameCount properties up to QQuickImageBase
AnimatedImage already had these properties, but some typically non-animated
image formats such as PDF, TIFF and ICO can also support multiple pages.
In either case, the currentFrame property can be used to select a specific
frame or page.  However an AnimatedImage uses a QMovie to do that, whereas
a plain Image uses QQuickPixmap.  So the accessors need to be virtual in
order to have these different implementations.

[ChangeLog][QtQuick][Image] Image and BorderImage now have currentFrame
and frameCount properties which can be used to step through the frames of
multi-page image formats such as TIFF, WEBP and ICO.

Task-number: QTBUG-77506
Change-Id: Id4d95a99a26a862957e44b1bd8ffe06d7eababef
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-24 12:26:20 +02:00
Laszlo Agocs 7dcdf3b7ae rendernode example: Add support for Metal
Plus clarify QQuickWindow::begin/endExternalCommands() in combination
with QSGRenderNode in the docs. As the example demonstrates, calling
these functions is not necessary within render() of a render node.

Also fix an issue with resetting the scissor in the renderer after
calling render() of a QSGRenderNode.

Change-Id: If8c2dab38d62aa444266d37901f062a51e767f68
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-22 16:10:24 +02:00
Laszlo Agocs ef2715251e Add missing scenegraph example docs
Change-Id: I72e18136a26cdfb52f204ce7d0491d14411956a4
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-22 16:10:19 +02:00
Laszlo Agocs 7b130535cf Implement QSGRenderNode for the rhi path
The documentation is also refined and extended.

Revise the rendernode example as well: make it possible to
test and demonstrate both scissor and stencil based clipping.

An implementation of the triangle for another graphics API
should follow in a separate patch at a later point. For now
only OpenGL is supported in combination with the RHI.

Change-Id: I7ef9f6c6e0b44f1bdf44c9266ea3fa4736367a5d
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-08-22 16:10:07 +02:00
Ulf Hermann 560b5bcd27 examples: Fix a few linter warnings
Unqualified lookup in the root object of a component is bad.

Change-Id: I7772216fb81e68824519408998c73dbb1ca60c4d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-20 08:43:17 +02:00
Simon Hausmann c27554068e Fix docs to explain the new type syntax for QML methods
[ChangeLog][QtQml] It is now possible to specify types for method
parameters and their return value in QML (basic and object types), using
TypeScript-like syntax with a colon separator. The syntax for QML
declared signals supports the same style.

This change also adapts the remaining snippets and docs to the "fresher"
qml signal parameter syntax.

Change-Id: I601781f01f696276951b04785584adab39fedfd9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-07-10 09:24:27 +00:00
Laszlo Agocs 192d4fa0af Make openglunderqml functional with and without the rhi
It has to be written following the new split approach (beforeRendering
for resource setup, beforeRenderPassRecording to issue the actual
underlay draw calls), but it will then work both with and
without QSG_RHI=1.

Change-Id: I9b7b35434aa0caec543cae268064b2684256382d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-04 19:49:08 +02:00
Laszlo Agocs 341ab77080 Add the graphics api independent scenegraph port
Opt in via environment variables:
QSG_RHI=1 -> enable using QRhi instead of GL
QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default
(the default is d3d11 on Windows, metal on Mac, gl elsewhere)

Or force a given rhi backend via the existing
QQuickWindow::setSceneGraphBackend().

Otherwise the default behavior is the same as before, the rhi code path
is never active by default.

-no-opengl builds are supported in the sense that they work and default
to the software backend. However, the rhi code path cannot currently be
used in such builds, even though QRhi from qtbase is fully functional
with Vulkan, D3D, or Metal even when qtbase was configured with
-no-opengl. This cannot be utilized by Quick atm due to OpenGL usage
being all over the place in the sources corresponding to the default
backend, and those host the rhi code path as well. This will be cleaned up
hopefully in Qt 6, with the removal all direct OpenGL usage.

Other env.vars.:
QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer
(assuming the system is set up for this)
QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect
QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too)
QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index
QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index
QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both
merged/unmerged, convert when needed - with some rhi backends this is
implicit)
QSG_RENDER_LOOP -> to override the render loop as usual. The default
with RHI is threaded for Metal, threaded for Vulkan on Windows, basic
for Vulkan on Linux and Android (to be checked later), while the existing
rules apply for OpenGL.

Not supported when running with QRhi:
  - particles
  - compressed atlases (though this is transparent to the apps)
  - QSGRenderNode
  - QQuickRenderControl
  - QQuickFramebufferObject
  - certain QQuickWindow functionality that depends directly on OpenGL
  - anisotropic filtering for textures
  - native text may lack some gamma correction
  - QSGEngine applicability unclear
  - some QML profiler logs may be incorrect or irrelevant

Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-04 10:44:26 +02:00
Fabian Kosmale b1f2385682 Discourage having AsyncImageResponse inherit from QRunnable
As the AsyncImageResponse is owned by the qml engine, it should ideally
live in the same thread. Else, when we call destroyLater() on it in the
qml engine, we can run into various race coditions.

see also commit c8827b444c

Change-Id: I6e21ca4527281445e5f6df082f60b60838bb2eac
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-25 13:50:45 +02:00
Ulf Hermann 046279a2c9 Register QRegularExpressionValidator in QtQuick
This should replace QRegExpValidator. RegExpValidator is deprecated now.

Task-nunber: QTBUG-72588
Change-Id: I072deb382914fd322ce192509782b241824ccd7b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-12 11:46:37 +02:00
Shawn Rutledge ca8f430024 doc: Clarify that DelegateModel is a kind of proxy model
It was not quite clear in the GridView DnD example that the ListModel
doesn't get reordered, so if new ListElements are inserted after reordering
the DelegateModel by DnD, predicting the position where new delegates will
appear becomes a bit of a riddle.

Also:
- the QQmlDelegateModelAttached::model is a model, not an int
- disambiguate the properties that have the same names in
  QQmlDelegateModel and QQmlDelegateModelAttached, using \keyword
  for linking.

Task-number: QTBUG-34891
Change-Id: I485fd632f67d607652428b4e3c9ca528e57f7348
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-02-26 11:18:28 +00:00
Kai Koehne 53240b099c Remove old 'Getting started with Qt Quick' example
The example is actually not very easy to build, and arguably too
complex for a 'getting started' example. qtdoc commit 1df7011858
therefore replaced it by the alarms example in the documentation.

Task-number: QTBUG-66064
Change-Id: I2f2776c649410575aef71948f64b358d60233022
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-10-15 14:29:21 +00:00
Venugopal Shivashankar b6f7fe1f80 Examples: Use XmlHttpRequest to fetch flickr public photos
This change is to facilite moving the XmlListModel code to the
qtxmlpatterns repo, but still keep all the Particles examples
together.

Also fixed:
- the old TODO about darkening images according to depth,
and make it generally look a bit better.

- move the visualdatamodel examples to a directory called
delegatemodel, since that's how they work now.  And add them
to the main "views" example launcher so that they become more
visible to users.

Change-Id: I78f9f19e1e110608580adedcf4cd3be554222515
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-10-11 12:36:36 +00:00
Shawn Rutledge 347a29ff5c Replace more vestiges of VisualDataModel, *Group and VisualItemModel
VisualDataModel, VisualDataGroup, and VisualItemModel
are replaced with DelegateModel, DelegateModelGroup, and ObjectModel
respectively (since 7cad0e52c5), so
shouldn't be mentioned anymore, in preparation for removal.

Task-number: QTBUG-37725
Change-Id: I9a01ec8db748f817efca638383b7a278c7b562cd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-10-03 15:16:37 +00:00
Venugopal Shivashankar f6bb3c220b Example: Update the shared UI controls to use input handlers
Change-Id: I077754d9d9d713d01c7711175eb1b5da5e1f6869
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-10-03 15:16:10 +00:00
Paul Wicking 91bde278ea Doc: Fix QDoc warnings
Change-Id: I19545953bde10d4ccc2f37843dcda2569dc77df4
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-10-01 10:01:00 +00:00
Richard Moe Gustavsen 8e5578d3fc QQuickTableView: override fixup() to preserve contentX/Y at start-up
Flickable::fixup() will be called from Flickable::componentComplete().
fixup() is a virtual function that subclasses can override to e.g
ensure that cells snap to grid etc (which is not yet supported by
TableView). The default implementation will check if the assigned
contentX/Y is within the current content item size, and adjust it
back to 0,0 if not. The problem is that during componentComplete(), the
table has not yet been built. And we don't want Flickable to reset
any assignments to contentX/Y until that has happened. So override the
function and block it from doing any adjustments before the table has
been built.

Change-Id: Id6c5a3b5f053f71bf1854573cd5b9dc3ecc9f246
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-09-11 12:37:36 +00:00
Richard Moe Gustavsen 5b95cc34c1 QQuickTableView: don't rebuild table upon querying content size
Overriding contentWidth/Height was done to be able to force build the
table early if the app needed to know the size of the table already at
Component.onCompleted (to e.g center the viewport on the center of
the table). But now that we have a forceLayout() function, it's better
to require that that function should be called before querying
contentWidth/Height at this stage.

By not building the table on the fly, we allow the application to
bind expressions directly to contentWidth/Height, without being concerned
about potential binding loops that can occur as a result of us
rebuilding the whole table behind his back. The benefit of this overshadows
the need to call forceLayout() explicit for some corner cases.

Note that we still redefine the contentWidth/Height properties in TableView
so that we can catch if the application sets an explicit contentWidth/Height
(which is tested by checkExplicitContentWidthAndHeight()).

Change-Id: Ic4499b3939af1cb3a543e4c006023d0d6f12fd3b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-09-11 12:37:29 +00:00
Qt Forward Merge Bot f3daa8bb97 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ieaf0811cf045af1e6df4db4ab67d7c38ba0d1fbf
2018-09-11 01:00:05 +02:00
Tor Arne Vestbø 38151c0581 examples: Fix LauncherList page components being hidden on window resize
The binding for x to -width will take effect after the enter-transition
finishes animating x from -page.width to 0, but will not update the x
value for some reason, so the item stays at the correct position at
the end of the transition, even if the binding is still active.

Once the window is resized though, and the new window width gets
propagated to the page component, the x-value will be re-evaluated
and the page component ends up on -width again, hiding it.

It doesn't look like the explicit property binding adds anything to
the example, as the transition takes care of starting at -width, so
by removing it we fix the issue.

Change-Id: If0e693ae85fe3e0aa49f59832cbb1ba2804b7b6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-07 08:32:48 +00:00
Richard Moe Gustavsen adbbf08ee2 Example, GameOfLife: bump import to QtQuick 2.12
Otherwise TableView will not be available.

Change-Id: I57fe6ae5dd28064f87dca8cb4c3b957de25713e1
Reviewed-by: Nicolas Ettlin <nicolas.ettlin@me.com>
Reviewed-by: hjk <hjk@qt.io>
2018-08-27 11:48:37 +00:00
Richard Moe Gustavsen 409f302326 QQuickTableView: move TableView from Qt.labs to QtQuick
TableView is now ready for Qt-5.12. The only thing missing
is documentation, which is currently being written, and on the
way. So remove the temporary labs plugin that used to register
TableView, and register it together with the other QtQuick items.

Change-Id: I7f360eac3934d228904a4133363e336afe0c451a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-22 05:46:24 +00:00
Simon Hausmann ec022d0efe Port WorkerScript threading examples to use ES modules
This is the more modern way of doing things, so demonstrate that in our
examples and documentation.

Change-Id: Icd5316fbeeb00c34d470c8d871851945dc831244
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-21 06:33:35 +00:00
Paolo Angelelli 607ced5bfd Allow DelegateModel-based views to support multiple delegate types
This patch adds a specific abstract QQmlComponent subclass,
QQmlAbstractDelegateComponent, and a default implementation,
DelegateChooser, that, together with the type DelegateChoice
allows determining the delegate type by role and/or index.

The patch also adds QQmlAbstractDelegateComponent support
to QQmlTableInstanceModel, that is a simplified version of
the delegate model, currently only used in the new table view.

DelegateChoosers are intended to behave just like Components
in the context of the view. This means that they can be declared
outside of the view, and also in separate files, and the same
delegate component can be used at the same time in multiple views.

[ChangeLog][QtQuick][Item Views] Added a DelegateChooser Component
to host DelegateChoice instances to choose different delegates in
an Item View (e.g. TableView) depending on model roles.

Done-with: Michael Brasser <michael.brasser@live.com>
Task-number: QTBUG-26681
Change-Id: Ibe24a31daf9142c8a9ff45ef6c65da0aec8a14dc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-17 13:17:28 +00:00
Nicolas Ettlin 77b4923c99 TableView Conway's Game of Life example
This new example shows how a Conway's Game of Life implementation can
be created with QML and the new TableView component.

Change-Id: I940210c5e5a0554e6f052ff109070e69e59cab56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-09 08:09:14 +00:00
Shawn Rutledge 0b73efd040 Modify grid example to use DragHandler
It shows that DnD is still possible even though DragHandler doesn't
do anything specifically to enable it.

Change-Id: I600e16c4f0f601d504fcf6b6b32ff865af2a2d67
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-08-06 14:27:23 +00:00
Frederik Gladhorn ee0fed16e3 Remove parallax example
The example was part of the views example, except it was not even listed
in the application, so it would not be discovered by anyone in the first
place. Together with 3rd party assets that would need to be documented,
and it being broken after samegame was moved, there is no reason to keep
this.

Task-number: QTBUG-69660
Change-Id: Ib701bd8987fd1d8473e1073bf4d701dbb087fdba
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-07-31 13:11:31 +00:00
Qt Forward Merge Bot 83a73c8e5a Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/quick/tableview/pixelator/main.cpp
	examples/quick/demos/

Change-Id: Id7eaae6584017a4ab4ec9dd97b56d5c1a417f0e3
2018-07-30 16:35:04 +02:00
Alessandro Portale 90ab10ed2d Examples: Remove the metadata from some docs screen shots
The Welcome/Examples screen in Qt Creator would otherwise emit:
  "libpng warning: iCCP: known incorrect sRGB profile"

The metadata was removed with the command
  optipng -o7 -strip all <file.png>

Change-Id: Ic51155fd4e20193e77e20559f2acdc0319c19b8f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-27 09:34:47 +00:00
Paul Wicking afccf3b465 Doc: Fix broken link targets
* Rename two section titles that caused confusion for the autolinker.
* Add see also link to correct location from SpriteSequence QML type.

Task-number: QTBUG-58640
Change-Id: I62b941d00198ac56d998ca14b926c7bb37f6c91e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-07-25 13:01:53 +00:00
Kai Koehne 785b12a4d1 photoviewer: Use QLocale::uiLanguages() for finding translations
Now that we ship en translations, we can use the
QTranslator::load(QLocale, ...) overload to correctly find translated
files.

Task-number: QTBUG-69196
Change-Id: Ic7f7a2c70763f0c7200782d6e46644f2b3f7f3ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-18 06:40:46 +00:00
Shawn Rutledge 197c22be54 Get rid of Qt.labs.handlers import, merge into QtQuick 2.12
... and clean up imports in examples, snippets and tests accordingly.

Change-Id: I5bbe63afd2614cdc2c1ec7d179c9acd6bc03b167
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-07-17 15:11:51 +00:00
Simon Hausmann e137877eaa Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/quick/demos/photoviewer/i18n/qml_de.ts
	examples/quick/demos/photoviewer/i18n/qml_fr.ts
	examples/quick/demos/photoviewer/photoviewer.pro
	examples/quick/demos/photoviewer/qml.qrc
	src/qml/compiler/qv4instr_moth_p.h
	tests/auto/quick/qquickanimations/tst_qquickanimations.cpp

Change-Id: Ibea76b468577c2a68bd305cee82ae6444d0f8073
2018-07-17 12:39:11 +02:00
Kai Koehne 369998639b i18n examples: Add en translation dummies
We endorse using QTranslator::install(const QLocale&...), because
it tries loading translations from all QLocale::uiLanguages() instead
of the commonly used QLocale::system().name() setup.

Anyhow, the first method requires an English translation - otherwise
a second favorite language might be used.

Pave the way to making the switch by adding (empty) English translations
to our examples.

Task-number: QTBUG-69196
Change-Id: Ie85be875e34e29e80c1693bbf477b962e35a7d87
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-07-17 08:55:11 +00:00
Kai Koehne 33a9fb9f4b i18n examples: Update .ts files
Change-Id: I3c1987bac8251b087fab98d6caaaba267dcc4be8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-17 08:55:06 +00:00
Michael Winkelmann ad0f200df5 Make a subdirectory for TableView examples
This makes more room for more tableview examples.
I also added the tableview directory to the quick.pro subdirs.

Change-Id: Ia136150ded99c2ec627e122aa676e24a519683a9
Reviewed-by: hjk <hjk@qt.io>
2018-07-13 15:25:45 +00:00
Frederik Gladhorn fa3c840ef1 Move demos to qtdoc repository
These demos use several modules and moving them allows to use for
example Qt Quick Controls 2 in them.

Change-Id: I1f352671dec672665e9fdb6a9c2a7c6e25a002b0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-07-12 20:23:24 +00:00
Michael Winkelmann 04e7882fc2 TableView pixelator example
Example of a QML TableView with custom table model.
Inspired from the original pixelator example from the widget world.

Change-Id: Ic33e6d2e9320fe135d56dde92326dd8a606fe109
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-07-10 11:34:02 +00:00
Ulf Hermann fbf6f7400a Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp
	src/quick/handlers/qquickhandlerpoint.cpp
	src/quick/handlers/qquicksinglepointhandler.cpp
	tests/auto/qml/ecmascripttests/test262

Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
2018-06-25 12:15:55 +02:00
Venugopal Shivashankar 9fd90b04a3 Doc: Move the code snippets to a separate snippet file
Change-Id: I17671563f2beebe16ae1d08552854eaf44ae43ee
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-22 11:59:54 +00:00
Paul Wicking ed3a93feee Doc: Add missing dots (qtdeclarative)
Task-number: QTBUG-68933
Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-19 12:44:48 +00:00
Tor Arne Vestbø 6d42c6fd33 window example: close window on 'X' button press, not just hide it
Change-Id: Ice699b3350b223db25e4865c930caf6e3afb647c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-25 17:43:12 +00:00
Shawn Rutledge 6fa746fa61 rename containsMask to containmentMask
It was pointed out that containsMask sounds like it ought to be a
boolean property.

Change-Id: I2b56823b60d64f9903b0d5108c6428e691c09ed0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2018-02-27 14:00:24 +00:00
Shawn Rutledge e17c89f4ce use the override keyword consistently and correctly (clang-tidy)
Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-02-27 08:27:38 +00:00
Mitch Curtis e41d067227 AnimatedSprite: set implicit size based on implicit frame size
By doing so, users no longer need to set an implicit or explicit size
for AnimatedSprite.

[ChangeLog][QtQuick][AnimatedSprite] AnimatedSprite's implicitWidth and
implicitHeight are now based on frameWidth and frameHeight,
respectively. This means it is no longer necessary to explicitly size
AnimatedSprite.

Task-number: QTBUG-36341
Change-Id: I3eb87e9b1c6bb93b3c667123c345341f34e2eee8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-26 22:59:42 +00:00
Shawn Rutledge 06e962f263 init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init'
 -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix

Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-02-26 13:08:30 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00