aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/layouts
Commit message (Collapse)AuthorAgeFilesLines
* Doc: place more importance on not binding to x/y/width/heightMitch Curtis2018-10-171-4/+8
| | | | | | | | | | It's common for users to bind to these properties and think that it's a bug that it doesn't work, so we should make the note in the docs more strongly worded and elaborate a bit. Change-Id: I82c8d5644ed81cc616a3035f489344a491ea5a66 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix items in layouts not being rendered when layers are usedMitch Curtis2018-07-091-0/+3
| | | | | | | | | | | | | | | | A layer effect is apparently considered a child item of the layout that manages the item, and this causes issues when layouting. As was done for positioners in 865b4ec8, exclude any items for which QQuickItemPrivate::isTransparentForPositioner() returns true from layouting. As that commit made QQuickItemLayer set it to true when the layer is enabled, QQuickShaderEffectSource will be excluded from layouting. Task-number: QTBUG-63269 Change-Id: I463ff8d0cea0dfd6c4273f376de347971040d3d0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Document latest QtQuick.Layouts import to be 2.11Kai Koehne2018-04-201-1/+1
| | | | | | | | | Since commit 214fbaa57b73296a0 the latest minor version of the import is automatically the Qt minor version, so let's also document this. Change-Id: I4131a399cca7c66b0e9df549f14be43eeaa94af3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* add qmlRegisterModule to all QML plugins (QUIP 99)Shawn Rutledge2018-03-211-0/+3
| | | | | | | | | | | | | | | | | Now it should always be possible to do import QtQuick.Module x.m where x is the module's major version and m is Qt's minor version. [ChangeLog][QtQuick][Important Behavior Changes] In Qt 5.11 and newer versions, QML plugin modules are available with the same minor version as the Qt release minor version number. For example it's possible to import QtQuick.Window 2.11 or import QtQuick.Layouts 1.11 even though there haven't been any API changes in these modules for Qt 5.11, and the maximum possible import version will automatically increment in future Qt versions. This is intended to reduce confusion. Change-Id: I0d28ed04d186bcdd5acde95b8ed0b66c1c4697e3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-265-10/+10
| | | | | | | | | | | | | 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>
* Layout: improve warning message when anchors are detectedMitch Curtis2018-02-201-1/+1
| | | | | | | | | | - Use the more explicit term "manage" to make it clear that the warning only applies to items that are direct children of a layout type. - Instruct users towards the proper way to position items within a layout: Layout.alignment. Change-Id: Id13af95457a689e41aeaead1f9a0f958f095fca9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Only warn about actual *anchors* in layout childrenJan Arve Sæther2018-02-191-1/+2
| | | | | | | | | | | Do not warn if they don't actually pose a problem, such as having just anchors.margins: 42 in a layout child item (as demonstrated by the test) Change-Id: I01e4515e91d7d0df3ae6bf9061cebe5c51802998 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Warn if a layout has children with anchorsJan Arve Sæther2017-11-284-2/+14
| | | | | | | | | We get several bug reports due to this mistake. Print a warning about it and that it *might* eat your cats. Task-number: QTBUG-63303 Change-Id: I0b1ae21dc4419efee88623765a8d6dd302fbc1f4 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix positioning and placement of initially invisible items in layoutsSascha Siebert2017-11-222-30/+28
| | | | | | | | | | | Instead of misusing implicitWidth/Height as a storage mechanism in scenarios where width/height is used for preferred size evaluation, new members are created to hold this information to prevent incorrect sizing in mentioned scenario and get rid of blocking signals. Task-number: QTBUG-57455 Change-Id: I102c45805c4106e5829b17b65c2e247b2381573f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-255-32/+32
| | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-262-0/+4
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQuickLayout: ensure that all change listeners are removedMitch Curtis2017-02-221-4/+11
| | | | | | | | | | | | | | | | | | The first fix for QTBUG-51927 (59c6c0e0) went to 5.6.2, where only the SiblingOrder ChangeType was listened to by QQuickLayout. It was then cherry-picked to 5.7 (5149aa68), where SiblingOrder was still the only ChangeType in use. 3b4f00ec then optimized QQuickLayout by swapping connections for item change listeners, but didn't check for usages of change types elsewhere in the file. This patch moves the change types into a variable that ensures there is one place for future changes. 5.6 is not affected. Task-number: QTBUG-51927 Change-Id: Ifd6e0545ce543ab79d6415e007b35c457cacc83a Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-261-1/+5
|\ | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickutilmodule.cpp tools/qmllint/main.cpp Change-Id: Ic2283f88c293ca7fc776de3e83eb4c7812309d8a
| * StackLayout: propagate rearrange() call to child layoutsOleg Yadrov2017-01-191-1/+5
| | | | | | | | | | | | Task-number: QTBUG-57867 Change-Id: I0190b892e2bc2966b82a0dbd99e53fd9d6848957 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAGAlbert Astals Cid2017-01-191-1/+1
| | | | | | | | | | Change-Id: Ibedd0d0c23cf194ea02a229ab643450dbefd40aa Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove remnants of blackberry platform supportRobin Burchell2017-01-161-1/+1
| | | | | | | | | | | | | | | | The last remnants were removed from qtbase in 5.7 making this all dead code, so match here too. Change-Id: I10f3f1c614562f2a97ade7cdf5002065d6f79e07 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQuickGridLayout: Use qmlWarning to give extra context to warningsRobin Burchell2017-01-161-4/+7
| | | | | | | | | | | | | | | | | | | | We now have file & line number information pointing us to the location of the faulty child. Also take the effort to split the message into two, so it's clear which property is faulty (and which the value is representing). Change-Id: I8e515feeaf8fa1decf8aaf7adf0a02cce7aec0ea Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickGridLayout: Remove dead code in layoutRobin Burchell2017-01-161-15/+4
| | | | | | | | | | | | | | | | | | | | | | The attached isRowSet and isColumnSet check for values >= 0, and row/column getters also enforce a minimum return value of 0, so it is impossible for us to get a negative value for row/column if either of these is set -- and we can simply call the getter and rely on it to return 0 in the unset case. Change-Id: Iec80e7d7cf3738cf0a81e90b027ffe41e0f57369 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickLayout: Use qmlWarning instead of qWarning to give context informationRobin Burchell2017-01-161-1/+2
| | | | | | | | | | Change-Id: Ie16508d22554c9b6dcd66adf6a59f32117edf1e3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-143-5/+29
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
| * Avoid needless notifications when destroying layoutsJan Arve Saether2017-01-123-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deleting a layout with children, it ends up in ~QQuickItem(), which in turn will call setParentItem(0). setParentItem(0) will in turn call setEffectiveVisibleRecur(), which will recurse down all its descendants. Therefore, deleting a top level layout might trigger item change listeners for *all* its descendants, not only its direct children. This behavior might even cause crashes: The visibility changes will then trigger an invalidation of the layout, which will propagate up the parent hierarchy, and potentially call invalidate() on a partially-destroyed layout, which then might crash. Change-Id: I48e11d57f69e9011ced6c3a0b51e3d89b24ad5c1 Task-number: QTBUG-55103 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-144-48/+51
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Layouts: Use QQuickItemChangeListener for more thingsRobin Burchell2016-11-304-48/+51
| | | | | | | | | | | | | | | | | | | | | | | | Signal connections are expensive: even with qmlobject_connect, there's a bunch of memory allocation. By avoiding the signal connections, we can do the same thing essentially, a little faster. This gives me another 15-20 RowLayout instances per frame when testing with RowLayout containing 5 Rectangles on qmlbench (from ~139 to ~155 ops/frame). Change-Id: I4448a28128dc251e40b6b06d642bae716af212f4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-221-27/+3
|\| | | | | | | Change-Id: I171c7dbb6a74fe743c2eec63e86e9c0bef7c7dfd
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-201-27/+3
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemsmodule.cpp tests/auto/quick/rendernode/tst_rendernode.cpp Change-Id: I90582df69feb95a4e4aafb0b9793c23714654f19
| | * Row/Column/GridLayout: add missing margins properties to documentationMitch Curtis2016-10-141-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | 52e1044a1a22525b960d9e1d336ac06c4f39e6d5 in qtquickcontrols missed this. Change-Id: Ie104c421e34d4d2a13a88864a279eb65738bd5a8 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Imports: add missing 'override'Anton Kudryavtsev2016-10-062-5/+5
|/ / | | | | | | | | | | | | ... and drop redundant 'virtual' Change-Id: I13246ff07a219d41c9e0fd11fbc6a0b00109912a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-211-0/+4
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmltypeloader.cpp Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
| * Fix crash on exit when using default property aliases with layoutsMitch Curtis2016-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The layout was being destroyed before the text, which meant that the removeItemChangeListener() call never got hit. To ensure that the listener is always removed, loop through each child in QQuickLayout's destructor. This is a manual cherry-pick of 59c6c0e0b1b5b46747595a58e11311b7393d7e70. Task-number: QTBUG-51927 Change-Id: I669f42beb8c3dd6b4b741cae0b16e017bb3409df Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Update .qmltypesMarco Benelli2016-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | Update qmltypes for 5.8. For some files the -noforceqtquick option is used; in this way there are no redundand definitions of QtQuick component and no unneded dependencies from QtQuick. Change-Id: Id29683fcd6d15056923867ea65b091f998297fc4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQuickLayout: Remove unused QQuickItemPublic structRobin Burchell2016-07-081-5/+0
| | | | | | | | | | Change-Id: I4e0e929118d708a4157c07df93ce5eb4083263ee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Layouts: Use qmlobject_{dis}connectRobin Burchell2016-07-072-14/+14
| | | | | | | | | | | | | | | | | | This is significantly faster, especially with a large number of items and signals. For a RowLayout with 5 child items, I go from being able to create ~95 per frame to ~145 per frame on a 2011 mbp. Change-Id: I2c09078573a745b6d275931785de548364604a85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsapi/qjsengine.cpp src/qml/qml/qqmlengine_p.h src/quick/items/qquickanchors.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/items/qquickitem_p.h tests/auto/qml/qqmlecmascript/testtypes.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tests/benchmarks/qml/creation/tst_creation.cpp Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-1/+1
| | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
* | Mark overrides of QQmlExtensionPluginFrank Meerkoetter2016-04-191-1/+1
|/ | | | | | | | Clearly state that we want to override registerTypes of QQmlExtensionPlugin. Change-Id: I0acf76115d47d7166ccb813a811dd757d514e6e2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Ensure the resources are initialized when used staticallyAndy Shaw2016-04-071-0/+11
| | | | | Change-Id: Ifbcd16402189c4621596fc38c3bd8931b3b6a66e Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Replace qQNaN() and friends with qt_qnan().Erik Verbruggen2016-04-052-11/+11
| | | | | | | | These constexpr functions can be inlined, and the compiler can be a bit smarter with code generation. Change-Id: I4ea87c794dd8e375749e18d273d01bb848231113 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Move QtQuick.Layouts to qtdeclarative from qtquickcontrolsJan Arve Saether2016-02-2614-0/+3579
This is in order for it to be available without having to install Qt Quick Controls Change-Id: I3f0d0dc108829947cd189b7861944e556e00cef3 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>