aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicksplitview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-221-20/+20
| | | | | | | | | | | This reverts commit 950f8bff7cbbdbd472234fd32ef659c9d0e8ba7c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I69e514934864bea3ccd68de9a65fb08e262325a1 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-221-20/+20
| | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtquickcontrols2. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4209 Change-Id: I4175d7a58cb1b04172132a3bc09aea1b065d1778 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: fix SplitView's inheritanceMitch Curtis2020-11-051-1/+1
| | | | | | | | | | It inherits Container. Fixes: QTBUG-88184 Change-Id: Ic4878c2b240dad2294569a48c4f39e82d377133a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c357974b4e1a3400d8036039c15dddac3b863046) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SplitView: fix hidden items causing visible items to not be resizableMitch Curtis2020-03-131-14/+38
| | | | | | | | | | | | | | | | When a handle is dragged, the items on either side of it are resized. Until this patch, we were assuming that the item after the one at the handle index was visible, which was wrong. Now we iterate through each item after the one at the pressed index until we find one that's visible. Since we need this in a few other places during a handle drag, we cache it as a member variable. This patch also fixes an issue where the visibility of handles were not updated after setting a new handle delegate. Change-Id: Icd246abae2ed4dc6c3b81217b9a241b7e4debf7d Fixes: QTBUG-81867 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* SplitView: fix hoverable child items breaking handle hover stateMitch Curtis2019-12-041-0/+19
| | | | | | | | | Detect HoverEnter events by filtering the mouse events of child items, and respond by clearing any hovered handle. Change-Id: Ice7e7fe3cc4c9224064c2384cd832e4a7d91c4da Fixes: QTBUG-79846 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2019-11-261-22/+22
| | | | | | | | | | | The warnings were about: - Undocumented function parameters - Instances of \instantiates that us an internal class - A few link issues Task-number: QTBUG-79827 Change-Id: I60094279c7da6bc446b5c63b7b4924b71cee4672 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* SplitView: refactor hover handling codeMitch Curtis2019-11-151-42/+35
| | | | | | | | | | | - Don't unset the hovered flag only to potentially set it again. - Generally simplify the code. - Move it into a new updateHoveredHandle() function so that follow up patches can call it from other places. - Add more logging to debug hover issues. Change-Id: Iaf06cfe1f556a3f30bd0e883ef504b3df2dbc8e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickContainer: stop creating duplicate content itemsMitch Curtis2019-10-241-1/+0
| | | | | | | | | | | | In most cases, getContentItem() will create a new content item when called. In addition, its only responsibility is to return the content item, not set it as the control's new contentItem; QQuickControl::contentItem() does that. Instead, QQuickContainer should simply call contentItem(). Change-Id: I1b8cb57f9f7b9e56074e99bed20ce5bcac70e1a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* SplitView: fix cursor shape staying as Split*Cursor in some casesMitch Curtis2019-10-241-15/+11
| | | | | | | | | | | Don't return early before restoring the ArrowCursor shape. This is not testable in QML due to QWindow's cursor API not being available there. Task-number: QTBUG-79302 Change-Id: Idb59d9cfbf04fc12ebe0adfbb7285ae7155e195d Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix assertion failure when hiding a SplitView with only one itemMitch Curtis2019-10-231-4/+8
| | | | | | | | Check for -1 when calling handleIndexForSplitIndex(). Change-Id: I81021b64265ace0c47269ea54e538a2725c84b79 Fixes: QTBUG-79270 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.13.0' into 5.13Qt Forward Merge Bot2019-06-201-6/+6
|\ | | | | | | Change-Id: I76cc3f99ecaca3eebe49fd129e3b3562ebd6ea09
| * Doc: fix import versions in SplitView documentationv5.13.0-rc3v5.13.0-rc2v5.13.0Mitch Curtis2019-06-041-6/+6
| | | | | | | | | | | | Change-Id: Ib491000bf2751f24e3dc635958bdf997193c225e Fixes: QTBUG-76077 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | SplitView: fix preferredHeight not being restored in restoreState()Mitch Curtis2019-06-101-4/+4
|/ | | | | Change-Id: Icc236494f5df382d6bc49092d23a460822c835a1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix building with qreal floatJeremy Powell2019-04-231-2/+2
| | | | | Change-Id: I02ebf4277142ef426194da0992b3348bd3c83998 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove incorrect statement in SplitView's documentationMitch Curtis2019-03-151-2/+0
| | | | | | | State is saved into a byte array, not a string. Change-Id: Id5a62a281a43349d0fa5d6a8c69a25cba900f9c7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix SplitView crash when using certain attached propertiesv5.13.0-beta1Mitch Curtis2019-03-111-7/+14
| | | | | | | | | | | | | | | | | | If the attached property object was created on an item that SplitView doesn't manage, then its m_splitView member will be null, so check for that. Sometimes, an attached SplitView object will be created on an item that SplitView _does_ manage, but SplitView's own contentItem hasn't been created yet (see the comment in the QQuickSplitViewAttached constructor). In that case the SplitView will see the item added as a child of its contentItem eventually, and we just have to wait. While we are waiting, check access to our members in case they are null. Fixes: QTBUG-74276 Change-Id: I70b7f017e621e0d15c239b962f0407743eb70b15 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* SplitView: fix revisions, imports and \since versionsMitch Curtis2019-03-071-2/+2
| | | | | | | | Work was probably started before 5.12 but the patch ended up getting merged in time for 5.13. It seems that I forgot to update the versions. Change-Id: I19edf08158cca0967a7a536b3aee326e3b393d4c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: fix SplitView exampleMitch Curtis2019-01-231-2/+2
| | | | | | | | Don't use explicit size properties like width; use implicitWidth instead. Change-Id: If983bc5a38289bd860652f063eca93b12aace881 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* SplitView: schedule another layout if requested sizes changed during layoutMitch Curtis2019-01-081-4/+45
| | | | | | | | | | | | | | | | | | | | | As mentioned in the review of ed87e837, there could be a scenario where the user sets the preferred size of an item inside the onWidthChanged handler of another item: onWidthChanged: if (width < 10) secondItem.SplitView.preferredWidth = 100 Before this patch, this would result in the preferredWidth assignment being ignored since it happened during a layout. This patch adds some auto tests to ensure that this works, as the previous patch (that converted layouts to be done in polish/updatePolish cycles) already fixed the issue. It also adds a check to avoid doing too many layouts in the case of one of the split handles being dragged. Change-Id: Ide519b33a2fa3bf746ae3793e0671fd1750c70d8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* SplitView: batch layout requests via polish()/updatePolish()Mitch Curtis2019-01-081-28/+42
| | | | | | | | This results in less layouts, especially when a bunch of properties change one after the other. Change-Id: I8dd76d147bcc20f2ccddb587e59ac3e59f580f21 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* SplitView: react to changes in implicit size of split itemsMitch Curtis2018-12-051-0/+19
| | | | | Change-Id: Id81aac71f26ec9cbf643fdc480d76841d1e3be47 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: remove duplicate "(default)" in SplitView::orientation docsMitch Curtis2018-12-031-1/+1
| | | | | | | Qt::Horizontal is the default value, as seen in qquicksplitview_p_p.h. Change-Id: Ic0d1abbe32fade0d45978382fb5188e696d944cc Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Add SplitViewMitch Curtis2018-11-131-0/+1970
SplitView is an important tool for desktop applications that do not want to use a dock widget-style approach for their user interface. It allows users to have some degree of control over the sizing of elements in the UI, as well as the ability to conveniently serialize those sizes so that they're remembered across sessions. The main differences between this and the SplitView in Qt Quick Controls 1 are: - Has its own SplitView attached properties, rather than relying on the Layout attached properties (which required an additional import). - Uses the attached preferredWidth and preferredHeight properties as well as Item's implicitWidth/implicitHeight properties for the preferred size of items, rather than using the width and height properties. - Inherits from Container, so supports most of its API (though some parts of the API, like the currentIndex-related stuff, make no sense for SplitView). - Uses attached SplitHandle properties for the handle delegate to visualize hovered/pressed effects. - Offers convenience API for serializing the user's preferred sizes. [ChangeLog][Controls][SplitView] Introduced SplitView, a control that lays out items horizontally or vertically with a draggable splitter between each item. Task-number: QTBUG-56318 Change-Id: I3da91643ab312eb9ef5b0567da4e758f17747192 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>