aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcontainer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* MenuBar: ensure the correct delegates are used when created via ComponentMitch Curtis2018-10-021-9/+16
| | | | | | | | | | | | | Don't add items until we're complete, as the delegate could change in the meantime. Instead, add them to contentData and create them when we're complete. A similar fix was already done for Menu in d5cb26bc. Task-number: QTBUG-67559 Change-Id: Idb43b7a69fcf1c1ad6396c73a3c090b92e460ab8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-8/+0
| | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-12-151-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/quickcontrols2/quickcontrols2.pro src/imports/controls/ComboBox.qml src/quicktemplates2/qquickabstractbutton.cpp src/quicktemplates2/qquickabstractbutton_p.h src/quicktemplates2/qquickapplicationwindow_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p.h src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquicklabel_p.h src/quicktemplates2/qquicklabel_p_p.h src/quicktemplates2/qquickslider_p.h src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquicktextarea_p.h src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p.h src/quicktemplates2/qquicktextfield_p_p.h tests/auto/auto.pro tests/auto/controls/data/tst_combobox.qml Change-Id: I34cdd5a9794e34e0f38f70353f2a2d04dfc11074
| * Control: defer the execution of the content itemJ-P Nurmi2017-12-151-0/+2
| | | | | | | | | | | | | | | | | | Tumbler is excluded because test_customContentItemAtConstruction() starts failing if deferred execution is enabled for the content item. Task-number: QTBUG-50992 Change-Id: I11022c3c380311396453cf6229e068e4aae2d82a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-10-221-11/+29
|\| | | | | | | Change-Id: I9188f94e40e2ecb4da1963ce2fcf915ab7a4b4fb
| * QQuickContainer: fix itemSiblingOrderChanged()J-P Nurmi2017-10-171-11/+29
| | | | | | | | | | | | | | | | | | | | | | The problem was that QQuickContainer started already moving items while QQmlObjectModel was creating items and QQuickRepeater was initializing the order. Don't reorder items during the creation, but only after component completion. Task-number: QTBUG-61310 Change-Id: I13380c5ab6b3bddaad3fa03ef6fb028622b4cd11 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickContainer: use get() instead of QQmlListProperty::data for d-ptrJ-P Nurmi2017-07-061-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | MSVC2015 has very strange issues with QQmlListProperty::data in release builds. The pointer is somehow lost between constructing the object and when it reaches a list-property function. It's probably somehow related to the qSwap() calls in QQmlObjectCreator::setupBindings(), but this is tricky to investigate, because adding qDebug() output anywhere near the qSwap() calls also makes the problem disappear. It's easier to use the standard Private::get() pattern instead. :) Change-Id: Iaa361f07023820bfe38191a100cebf64fadb4d62 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-06-151-1/+5
|\| | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/ButtonGroup.qml tests/auto/controls/data/tst_container.qml tests/auto/menu/tst_menu.cpp Change-Id: Ie8ee7e4f83f3fda6a09507b060576ebda929a7cd
| * Fix QQuickContainerPrivate::itemSiblingOrderChanged()J-P Nurmi2017-06-081-1/+5
| | | | | | | | | | | | | | | | | | Repeaters are not part of the content model. Exclude them when calculating the target index when the order of items changes. Task-number: QTBUG-61310 Change-Id: Iaedd59288ed38e985a34ed8e1f515fdfb50d74e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickContainer: removeItem(Item) and takeItem(int)J-P Nurmi2017-06-061-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate removeItem(int) in favor of removeItem(Item) and takeItem(int) with clearer semantics. If one already has access to an item, one can pass it to removeItem() to get rid of it for good, instead of having to call destroy() by hand. If one knows the index instead, we provide a way to take the respective item out of the container, and let the user decide what to do with it. This way we provide convenient ways to remove & destroy items in one go, and to take items out without destroying them. This nice pattern was once upon time planned for the QQC1 containers such as SplitView, and should have been used for the QQC2 containers, but was simply forgotten during the development... [ChangeLog][Controls][Container] Deprecated removeItem(int) in favor of removeItem(Item) and takeItem(int) with clearer semantics. The former destroys the item, whereas the latter transfers ownership to the caller. Change-Id: I4af51157b196c273f923d99b949a9660e6e8df64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-2/+2
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-2/+2
| | | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickContainer::itemMoved()J-P Nurmi2017-05-181-4/+28
|/ | | | | | | | | | | | | This allows the container implementations to easily update their attached properties etc. when items are moved due to being directly moveItem()'d or while being indirectly moved due to insertions or removals. This change will be extensively tested by tst_swipeview.qml and tst_tabbar.qml when they start utilizing itemMoved(). Change-Id: If868d763478541b957b4a3d5da041e6cd095ea0b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Container: document and test current index managementJ-P Nurmi2017-04-271-3/+67
| | | | | Change-Id: I368dd50a4ded743826d6dc4d25dde379c98af20d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-4/+4
| | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Format initializer listsJ-P Nurmi2017-01-191-2/+5
| | | | | | | | Initialize one member per line. Allow empty constructors with one initialized member on a single line. Change-Id: Ie115802561ebd19efd4dacda1fa868b64d279109 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Drawer.qml src/imports/controls/Frame.qml src/imports/controls/GroupBox.qml src/imports/controls/Page.qml src/imports/controls/Pane.qml src/imports/controls/ToolBar.qml src/imports/controls/Tumbler.qml src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickpopup.cpp tests/auto/accessibility/data/busyindicator.qml tests/auto/accessibility/data/button.qml tests/auto/accessibility/data/checkbox.qml tests/auto/accessibility/data/control.qml tests/auto/accessibility/data/dial.qml tests/auto/accessibility/data/label.qml tests/auto/accessibility/data/menu.qml tests/auto/accessibility/data/pageindicator.qml tests/auto/accessibility/data/popup.qml tests/auto/accessibility/data/progressbar.qml tests/auto/accessibility/data/radiobutton.qml tests/auto/accessibility/data/rangeslider.qml tests/auto/accessibility/data/scrollbar.qml tests/auto/accessibility/data/scrollindicator.qml tests/auto/accessibility/data/slider.qml tests/auto/accessibility/data/spinbox.qml tests/auto/accessibility/data/switch.qml tests/auto/accessibility/data/tabbar.qml tests/auto/accessibility/data/tabbutton.qml tests/auto/accessibility/data/textarea.qml tests/auto/accessibility/data/textfield.qml tests/auto/accessibility/data/toolbar.qml tests/auto/accessibility/data/toolbutton.qml tests/auto/accessibility/tst_accessibility.cpp Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
| * Doc: revise brief descriptionsJ-P Nurmi2016-11-021-1/+1
| | | | | | | | | | | | Change-Id: If7bdd4c11aaeb2df87622c769b1a65ac82ac7e73 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-031-4/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quickcontrols2/gallery/gallery.qrc src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/qtquickcontrols2.qdocconf src/imports/controls/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/qtquickcontrols2plugin.cpp src/quicktemplates2/qquicktooltip.cpp src/quicktemplates2/qquicktooltip_p.h src/quicktemplates2/qquicktumbler.cpp tests/auto/controls/data/tst_spinbox.qml tests/auto/controls/data/tst_tumbler.qml tests/auto/qquickmaterialstyle/data/tst_material.qml Change-Id: I25b7473b47739043b6f768603bece30b18021318
| * TabBar: re-layout as appropriate in tab button size changesJ-P Nurmi2016-09-301-4/+5
| | | | | | | | | | | | | | Auto-tested by the next change. Change-Id: I28ff7e82c0255b93d23cff7cbe111406d525f24b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-221-2/+4
|\| | | | | | | Change-Id: I37aab846346692fd4bff08b0dbab66db3a8e2716
| * Container: rephrase paragraph about declaring childrenMitch Curtis2016-09-191-2/+4
| | | | | | | | | | | | | | | | The more common use case is static declaration of children. Change-Id: Ie1c7b44ae9e738e02f89957b27f6111a1e798736 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-201-2/+2
|\| | | | | | | Change-Id: Idf19dd882ba3015be2afda6988cac1e95a4912fa
| * Doc: minor language correctionNico Vertriest2016-07-191-2/+2
| | | | | | | | | | Change-Id: Iec9a8126cf424925fbe74d1f4dfb6a1d55fc2e64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-06-201-5/+115
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickcontainer.cpp Change-Id: I7c41619a81b4fdd0d8ccaa4f0bb489a9b84e3865
| * Doc: write docs for ContainerJ-P Nurmi2016-06-011-4/+116
| | | | | | | | | | | | | | | | Container had extremely brief detailed description and property descriptions, that were added during the development. Change-Id: Ib75a8778487b4dda8d94d20abb08cbe583ef72da Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add QQuickContainer::increment|decrementCurrentIndex()J-P Nurmi2016-06-201-0/+32
|/ | | | | | | | | [ChangeLog][Container] Added incrementCurrentIndex() and decrementCurrentIndex() methods for changing the current index without losing its property binding. Change-Id: Id44e0db5e3d0951eb77b0124a83c5eb3df898012 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QQuickContainer: add missing null checkJ-P Nurmi2016-05-041-5/+7
| | | | | | | | | This fixes 'make qmltypes' for the templates. qmlplugindump creates and instance of each type, and the plain container template does not have a content item. Change-Id: I20c2f5f23ded9745fe0b579c31f5483eae18731e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-05-021-11/+17
| | | | Change-Id: I350192e86f53ac863b288683f832688255f6809e
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-12/+12
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+527
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>