summaryrefslogtreecommitdiff
path: root/src/layouts
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash when invalidating a layout while rearrangingDaiwei Li2015-02-052-0/+26
| | | | | | | | | | Queue the invalidations and upates while rearranging and apply them after. If we do them during, we can delete the items being arranged, leading to a crash. Change-Id: Ic3fe25c52afd1c8d36644f3cf7e3377ba3bec9c1 Task-number: QTBUG-44139 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Layouts: increase the default spacing on mobile platformsJ-P Nurmi2014-10-301-2/+9
| | | | | | Change-Id: I7aff0236a08465c05559bd8a2e8a60b556fbc4ba Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Adding designersupported to pluginsThomas Hartmann2014-09-181-0/+1
| | | | | | | | This patch adds designersupported to the plugins supported by QtQuick Designer. Change-Id: I021bdeab6ef1e29d5ffd7e1e95b296217aaf10eb Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Fix Layout.minimumWidth documentationGatis Paeglis2014-09-171-1/+1
| | | | | Change-Id: I5472ee9b906a46bd665002a0e468f22762957ee1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Do not crash when removing children from hidden layoutsJan Arve Saether2014-09-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the proxy items (QQuickGridLayoutItem) that was added to the layout was not removed when a child item got deleted from a hidden layout. The proxy item therefore ended up having a dangling pointer to the deleted item. The solution is to also update the layout with a new list of items even when the layout is hidden. This will also fix a problem with that size hints was not correct when layouts were hidden. Note that the test included has an expected failure. This is because the case it tests is not very common and the problem is shared with positioners. The problem stems from the fact that a layouts implicit size should change when a child item is changed from implicitly hidden to explicitly hidden. Unfortuntately, QQuickItem does not notify about such changes. This is a problem independent of this crash patch fix, and I would like to address that in a separate commit. Change-Id: I67ac28b9d08208432559622c9cd412e24b197b32 Task-number: QTBUG-39045 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Update license headers and add new license filesAntti Kokko2014-08-259-171/+99
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I470909ba0980db33ab551790d619c59a35978590 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Doc: Removing url variable from qdocconf file.Jerome Pasion2014-07-071-1/+0
| | | | | | | -url inherited from the url variable set in qtbase/doc/global Change-Id: Iaf9a7530c163a6a334c80c9e8ef2b1fbbb2b1981 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devJ-P Nurmi2014-06-255-11/+79
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Styles/Desktop/SpinBoxStyle.qml Change-Id: Ia501c1388a2af9f273ec2742abbfc766717ad9e6
| * Fix grammar in Layout::fillWidth and Layout::fillHeight documentation.Mitch Curtis2014-06-201-2/+2
| | | | | | | | | | | | Change-Id: If6ef7eb6fe3f5f6f70b70dc4bc19678e0db18321 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Updated layouts docs with images and snippetsstableVenu2014-06-134-9/+77
| | | | | | | | | | | | | | | | | | | | | | | | The images and the corresponding snippets should help the reader understand the Quick Layouts better. Task-number: QTBUG-33799 Change-Id: I0a4831f33d99de87fcd7cb68a36844885509bb06 Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Doc: Fix qmlclass selector used in documentation configTopi Reinio2014-06-111-1/+1
|/ | | | | | | | | | A recent change (46959875) in qdoc raised QML types from subnodes to top-level nodes. This change modifies the documentation configuration file(s) accordingly. Change-Id: I42fe45b82e8342ddbd535c79754c1eea29521391 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix typo and add missing period to GridLayout documentation.Mitch Curtis2014-05-071-2/+2
| | | | | Change-Id: I200601a11935c3054c4b876fb9bf2e29ecf48c2d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Bump QtQuick.Controls import version to 1.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Idc0b93cbfc2fe23e8be3bcaece672d06555a81f6 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Import QtQuick 2.2J-P Nurmi2014-04-071-1/+1
| | | | | Change-Id: Ifc9719ec6fbbd80b866c01eebc471d0ed121bd16 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Do not reduce items size when snapping to pixel grid.Jan Arve Saether2014-03-192-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the required snapping to pixel grid, there was a high risk of reducing the size of an item to become smaller than its minimum size. With the original way of snapping (simply doing qRound) it didn't happen very often, but with the last change the problem became more evident: If an item that covered the full extent of a cell was snapped it would *always* shrink. Sometimes it could then shrink to become smaller than its minimum size. This was easy to see if the item snapped was a Text element with eliding enabled, since that meant that the text was elided as soon as the Text element got resized to smaller than its minimum. The current solution now is to always snap the x,y coordinates (with qCeil), but keep the width and height that was calculated by the layout. This means that snapped items will be shifted slightly to the right. Due to this they might extend almost a pixel outside their calculated cell (on the right or bottom sides). Due to this we also have to adjust the size hint result calculation so that it will also ceil up to the nearest integer. The only downside now is that row/column spacings might be less than specified, but they should not reduce by more than 1 pixel. Task-number: QTBUG-36235 Change-Id: Idca909f2102a1f7c5cb50d2490c7af39d722ff4f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-171-2/+3
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-121-2/+3
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/layouts/qquicklinearlayout.cpp Change-Id: Ib24dab43c37fc0f3f6a85398766f102a1ac833c3
| | * Allow size hint changes during a rearrange.Jan Arve Saether2014-01-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we marked the layout as not dirty straight after a rearrange was done. However, in the case of when a size hint changed during a rearrange that would block the pending rearrange (since it only perform the actual rearrange if its dirty). Instead, mark the layout as not dirty *before* the rearrange. This will allow bindings such as implicitWidth: height to execute the pending rearrange. (Although such bindings are not encouraged) Task-number: QTBUG-36169 Change-Id: I75bd821a0ca4302026bd5dac01287ca3359d471b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | Don't register LayoutBase as a type.Jan Arve Saether2014-02-174-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use qmlRegisterRevision() instead of qmlRegisterUncreatableType() This avoids that qmlplugindump generate an entry for LayoutBase and consequently doesn't show up in the code completion in Qt Creator. Change-Id: I8688b5d05382c3fbc3fc526cfbf34eda05b35d77 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | Update plugins.qmltypes for QtQuick.LayoutsJan Arve Saether2014-02-171-1/+5
|/ / | | | | | | | | Change-Id: I9b717b9986ce27102ab4a1bd8f6d6cc9aae006f1 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Make sure that items don't exceed the layout-computed boundaryJan Arve Saether2014-01-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When geometries were rounded to their nearest pixel grid geometry they sometimes exceeded the area the layout calculated them to cover. This could often be observed by that the visual spacing got shrunk to a smaller size than was specified. For small spacings values the visual spacing could even disappear. With this fix the visual spacing should never be smaller than the specified spacings value (but might be bigger due to rounding). Task-number: QTBUG-36235 Change-Id: I5142c793460e50fd2de397abfd2ea6730f1bd042 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Make sure that layout is invalidated if LayoutMirroring is changed.Jan Arve Saether2014-01-231-0/+7
| | | | | | | | | | | | | | | | | | The old autotest never tested to see if the layout got rearranged if _only_ LayoutMirroring got changed. (It was always tested together with layoutDirection changes). Change-Id: Ie541ccb101884b8d47770f32b4312bccd2329d47 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-171-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/controls/Styles/Base/ComboBoxStyle.qml src/controls/Styles/Desktop/ComboBoxStyle.qml src/layouts/qgridlayoutengine.cpp Change-Id: I14298b9b3521fe220248e4b27e7057d538af5c49
| * Support negative layout spacings (do not assert)Jan Arve Saether2014-01-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests * default spacing * explicit positive spacing * negative spacings Negative spacings that causes the layout to shrink down to 0 or a negative spacing are not supported. (But make sure they don't crash the whole engine) Task-number: QTBUG-35741 Change-Id: I69521dffb03c35a63db37ab51a2e99152d88272b Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
| * Don't lie in the docs.Jan Arve Saether2014-01-161-4/+4
| | | | | | | | | | | | | | | | It seems we forgot to update the documentation when the default spacing got changed to 5. Change-Id: Id76ebd3d75ec5c0d5806aab65723d046c0f49864 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-1/+4
|\ \ | |/ | | | | Change-Id: I2491c91285196583e784033e78757743bfa2a423
| * Do not loop infinitely if a span is larger than the layout extentJan Arve Saether2014-01-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no point in searching through all cells to see if an item of columnSpan 3 fits into a layout with 2 columns, since it won't ever fit. So instead we detect this case early and ignore the item for inclusion. Task-number: QTBUG-35778 Change-Id: I3f7963df17b05b3eb14ba0bae49e5a885d15b33b Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Remove our forked version of QGridLayoutEngineJan Arve Saether2014-01-0211-2628/+162
| | | | | | | | | | | | | | ...and use the one we recently added to QtGui Change-Id: I25965d98a7e4a45907f54dae94ba76465dd6ff0f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Prepare to move the gridlayout engine so it can be shared.Jan Arve Saether2013-11-296-0/+20
|/ | | | | | | | | | | | | Currently, the gridlayout engine is duplicated in QtQuick.Layouts module and in QtWidgets module. The plan is to move the gridlayout engine from QtWidgets to QtGui and export it privately from there. However, that would produce linkage errors when linking the QtQuick.Layouts module. As a temporary solution we put the gridlayout engine in a namespace until the move has been completed. Change-Id: I8b43583cadff8846b5ed275f7fb5614737d903ad Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-1/+1
| | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: Ifb9ba5c4a0e78b6170c448ec97f0bec8fa80bdfe Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Add classnames for QML plugins.Morten Johan Sørvig2013-10-281-0/+1
| | | | | | | | Needed for static builds on iOS Change-Id: I77a0f9b9dc0531a321227b6f618558f31d0dd2da Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Qt Quick Layouts: Some small documentation refinements.Jan Arve Saether2013-10-163-11/+43
| | | | | | | | | | | | | | | Document the unreliability of width and height. Move the docs on how preferred size is determined to the overview document instead of keeping it in the documentation for the Layout.* attached property documentation, because its scope extends beyond this class. Task-number: QTBUG-34045 (inspired by) Change-Id: Ie16f7d151b867aa45caf8e8e589f92ffd82e3220 Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Moved \inqmlmodule version to \qmlmodule for QtQuick.LayoutsJerome Pasion2013-10-024-7/+7
| | | | | | | | | | -QDoc uses \qmlmodule as the import statement and the version in \inqmlmodule is not needed. -used QtQuick.Layouts 1.1 for Qt 5.2 Task-number: QTBUG-32172 Change-Id: I5f9b1ba252e86d30b10a70878c4800d28e92b42a Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Update the internal alignment when an item *changes* its alignmentJan Arve Saether2013-10-016-1/+32
| | | | | | | | Previously it only respected the initial alignment. Task-number: QTBUG-33773 Change-Id: I1d24209b866babd4bacabaec569f2f7dcc913c02 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Don't apply baseline calculations if Qt.AlignBaseline is not setJan Arve Saether2013-10-011-5/+7
| | | | | | | | | | | | | | | | | Parts of the code assumed that if q_minimumDescent or q_minimumAscent was valid, it would reserve enough space in each case for the combined ascents and descents of all items in a row. The extreme case was when one item had a baseline at its bottom edge, and the next item had the baseline at its top edge, the layouts minimum height tried to reserve space for such a case even though baseline alignment was not desired. The last case in the test demonstrates such a (valid) case. The problem was that the same logic was applied to the first case. Change-Id: Ie24503b1a5f7333f16ed84ebe01ab8d48becb4e2 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Respect items maximumwidth also when layouting baseline itemsJan Arve Saether2013-09-281-0/+1
| | | | | Change-Id: Ie36dcf158f5901ef84ce8b3c06ea9e6069f9c294 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Show list of valid flags for the alignment propertyJan Arve Saether2013-09-271-0/+12
| | | | | Change-Id: I9671e4f545454ac08436a622010d2a38061dd72b Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Add baseline support for Qt Quick LayoutsJan Arve Saether2013-09-204-14/+21
| | | | | Change-Id: Ieb5f1a2c9fa81bdb6ff587ef84e97b2233f2e289 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Reduce chaos during deconstructionJan Arve Saether2013-09-113-0/+32
| | | | | | | | | | | | | | When a layout is destroyed, it will during its destruction unparent its children and possibly change their visibility. The visibility change will recurse down to all descendants. Because of these slots, this information will again be communicated up to the layout, which again might cause the layout to adjust to this new change _while_it_is_deconstructing_. This makes it chaotic, is a waste of resources and makes it harder to maintain, and could in worst case cause crashes. Change-Id: I6b3111b8ecc4ec4312dd36068b4b4b4e6529b9ef Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Use the m_isXXXSet flags and friends instead of checking for < 0Jan Arve Saether2013-09-111-4/+4
| | | | | Change-Id: I6f796f25ed9f460689f0ede7c7d0cc7489cf15ab Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Make sure rowSpan, columnSpan and alignment changes are emittedJan Arve Saether2013-09-102-6/+33
| | | | | | | ...and reacted upon properly. Change-Id: I54f23f0edd41abeb6403eb754a23561b3814a509 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Prepare for QtQuick.Layouts 1.1J-P Nurmi2013-09-106-9/+21
| | | | | Change-Id: Idf6a9a51389d4f979d19d5232a93754fd468cd41 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Update imports to 1.1 and remove version from qmlmodule definitionJens Bache-Wiig2013-09-101-1/+1
| | | | | Change-Id: Icb4c6d78225c072da787e4646a55d8cf71a5db7a Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Add missing NOTIFY specifiers for fill{Width,Height} propertiesJan Arve Saether2013-09-101-2/+2
| | | | | | | Code is fine. These signals are already emitted when needed. Change-Id: I814cdaca08bd9bb2c8824d6a0ba8405d4639b32a Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2013-08-201-1/+1
|\ | | | | | | Change-Id: I97e6044a5d28ab875628e61ea67474f3c0a4ef4b
| * Fix 'make qmltypes' by setting correct IMPORT_VERSIONJ-P Nurmi2013-08-161-1/+1
| | | | | | | | | | | | Change-Id: I9b86a47cf37e04fc3ad6219f27ea1c0b26762c10 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | GridLayout did not evaluate Layout.{row,column} changes on its itemsJan Arve Saether2013-08-143-5/+21
| | | | | | | | | | | | | | | | | | | | Only the initial Layout.row and Layout.column values were respected - any further changes were ignored. Task-number: QTBUG-32767 Change-Id: I018800665e64158e8b38762fc29a5d3025776ff0 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Fix build without qtjsbackendSimon Hausmann2013-08-121-1/+1
| | | | | | | | | | | | | | QT += v8-private is not necessary anymore Change-Id: I1faf7627388373a8e05432a88fa1f013e12ef57a Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Enable dynamically changes to rows and columns propertiesJan Arve Saether2013-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | This was left out on purpose, but I did not realize that Qt Creator needs this to work. Task-number: QTBUG-32676 Change-Id: I8291ee95c8f9383629597c5cfa27b8668fe63124 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Add support for RTLJan Arve Saether2013-07-112-4/+90
| | | | | | | | | | | | | | | | Introduce the property layoutDirection. This matches the API of Grid, Row, and Column. Change-Id: I7282e3bc8ac1e1643f278b9069a319b2e5b1c323 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>