aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicksplitview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove qtquickcontrols2 sources and explain where they wentHEADdevMitch Curtis2021-08-161-2089/+0
| | | | | | | | | | | | Now that qtquickcontrols2 has been merged into qtdeclarative, we should make it obvious that this repo should no longer be used, by preventing it from being built. Task-number: QTBUG-95173 Pick-to: 6.2 Change-Id: I95bd6a214f3d75a865ab163ee0a1f9ffbeb7a051 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SplitView: document how to change handle touch area sizeMitch Curtis2021-07-191-0/+5
| | | | | | | | | | Task-number: QTBUG-82678 Pick-to: 6.2 Change-Id: Icf0f43454086a059e8e14a03db985e570233e0a9 Reviewed-by: Igor Bugaev <freedbrt@gmail.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* AbstractButton: emit doubleClicked() for touch eventsMitch Curtis2021-06-091-6/+6
| | | | | | | | | [ChangeLog][Controls][AbstractButton] doubleClicked() is now also emitted for touch events. Fixes: QTBUG-82146 Change-Id: Ie1e24d291bd4b592edd91fc762da8636e08698df Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adjust to bindable QQuickItem propertiesFabian Kosmale2021-06-031-2/+2
| | | | | | | | | | This prepares for QQuickItem's properties becoming bindable, changing the type of QQuickItemPrivate::{x, y, width, height}. It adds explicit casts/types where implicit conversion or type deduction would fail after the conversion. Change-Id: I9e25b45d1c7de162c3e72e8ec337b198bfd29c57 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Remove version numbers for import statement in snippetsJerome Pasion2020-11-261-6/+6
| | | | | | | | | | | -recommend using the import statement without versions for Qt 6.0 -update use of \qml snippet without \QtMinorVersion Task-number: QTBUG-87155 Pick-to: 6.0 6.0.0 Change-Id: I338d4fb81b9709f2f342f250c07ddf66f116b1dd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Fix qdoc warningsVenugopal Shivashankar2020-11-061-1/+1
| | | | | | | | | | | Mostly broken links to types and properties that are either dropped or renamed. Task-number: QTBUG-88141 Fixes: QTBUG-88141 Change-Id: I44789cdd1b8560a967b0b3868fd637deef488d88 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: fix SplitView's inheritanceMitch Curtis2020-11-051-1/+1
| | | | | | | | | It inherits Container. Fixes: QTBUG-88184 Pick-to: 5.15 Change-Id: Ic4878c2b240dad2294569a48c4f39e82d377133a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickSplitHandleAttached: pass correct d ptr to QObject constructorMitch Curtis2020-06-251-1/+1
| | | | | | | | Not sure how this ever worked, but the tests have been passing, so... Pick-to: 5.15 Change-Id: I6afecc692d56e5e58687cf5b60e87510275ec2b1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtquickcontrols2 $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I7fb9b0603341ea1a0c3a00f79ebd642a6354702d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Adapt to geometryChanged => geometryChange renamingMitch Curtis2020-04-241-2/+2
| | | | | | Task-number: QTBUG-82994 Change-Id: Iaf530d2a6f4dc92641d0c10e16e7b931f90646ac Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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>