MauiKit Controls

GridBrowser.qml
1/*
2 * Copyright 2018 Camilo Higuita <milo.h@aol.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick
21import QtQuick.Controls
22
23import org.mauikit.controls as Maui
24
25/**
26 * @inherit QtQuick.Item
27 * @brief A browser view with a grid layout.
28 *
29 * <a href="https://doc.qt.io/qt-6/qml-qtquick-controls-item.html">This controls inherits from QQC2 Item, to checkout its inherited properties refer to the Qt Docs.</a>
30 *
31 * This component might seem similar to QQC2 GridView - and it does uses it underneath - but this one includes a few more predefined elements, such as auto adaptable uniform cell width, a placeholder element, pinch to zoom gestures, and lasso selection support.
32 *
33 * @section structure Structure
34 * The browser has a dedicated placeholder element handled by MauiKit Holder, where a message can be set when the view is on a determined state the user should be warned about, such as if the view is empty, or not search results were found.
35 * @see Holder
36 *
37 * The lasso selection feature works with a mouse or a track-pad, and allows to select multiple items in the browser-view that are under the lasso rectangle area. A signal is emitted when the selection has been triggered - this is when the lasso rectangle is released - sending as an argument an array of numbers representing the indexes of the selected items.
38 * @see itemsSelected
39 *
40 * @image html Browsers/gridbrowser_resize.gif "The GridBrowser with adaptable content enabled"
41 *
42 * @note Notice the yellow rectangles vs the grey ones. The yellow rectangles will preserve the `itemSize` dimensions, while the cell area, represented by the gray rectangle, will vary. The example below demonstrates this behavior.
43 *
44 * @section notes Notes
45 * Use the `itemSize` property to set an uniform size for the cell item. At first the `cellWidth` will have the same value as the `itemSize`.
46 *
47 * If the `adaptContent` is enabled, the cell width will vary, while the cell height will maintain the same value as the `itemSize`.
48 * @see adaptContent
49 *
50 * When the view is resized and the `adaptContent` is enabled, the cell width - `cellWidth` - values will be updated to a value that can fill the width of the view-port uniformly. The modified values of the `cellWidth` will never be less than the value defined in the `itemSize` property.
51 * @see itemSize
52 *
53 * @warning Keep in mind that the `cellWidth` values will be modified when enabling the `adaptContent` property. So any binding to this property will break.
54 *
55 * @code
56 * Maui.Page
57 * {
58 * id: _page
59 * anchors.fill: parent
60 * Maui.Controls.showCSD: true
61 * headBar.forceCenterMiddleContent: true
62 *
63 * headBar.leftContent: Switch
64 * {
65 * text: "Adapt Content"
66 * checked: _gridBrowser.adaptContent
67 * onToggled: _gridBrowser.adaptContent = !_gridBrowser.adaptContent
68 * }
69 *
70 * Maui.GridBrowser
71 * {
72 * id: _gridBrowser
73 * anchors.fill: parent
74 * model: 30
75 *
76 * itemSize: 200
77 * itemHeight: 300
78 *
79 * adaptContent: true
80 *
81 * delegate: Rectangle
82 * {
83 * width: GridView.view.cellWidth
84 * height: GridView.view.cellHeight
85 * color: "gray"
86 * border.color: "white"
87 *
88 * Rectangle
89 * {
90 * width: _gridBrowser.itemSize
91 * height: _gridBrowser.itemSize
92 *
93 * color: "yellow"
94 *
95 * anchors.centerIn: parent
96 * }
97 * }
98 * }
99 * }
100 * @endcode
101 *
102 * @note You can use the GridView attached properties to refer to the control properties from the delegates. For example, you could use `GridView.view.itemSize` or GridView.view.cellWidth`. *
103 *
104 * @image html Browsers/gridbrowser_alt.png "The GridBrowser with adaptable content disabled"
105 *
106 * @note Notice the yellow rectangles vs the grey ones. The yellow rectangles will preserve the `itemSize` dimensions, and the cell width - as the gray area- will also keep the same dimensions as `itemSize`.
107 *
108 * <a href="https://invent.kde.org/maui/mauikit/-/blob/qt6-2/examples/GridBrowser.qml">You can find a more complete example at this link.</a>
109 */
110Item
111{
112 id: control
113 focus: true
114 clip: false
115
116 implicitHeight: contentHeight + topPadding + bottomPadding
117 implicitWidth: contentWidth + leftPadding + rightPadding
118
119 /**
120 * @brief The uniform size of the element in the cell. This value is used for the width and height. This value will stay the same even when the width of the cell changes.
121 *
122 * The dimensions of the item can be changed manually for its height and its width.
123 * @see itemHeight
124 * @see itemWidth
125 *
126 * @note This is meant to set an initial uniform size, so notice this value will be use for the `cellWidth`, `cellHeight`, `itemHeight` and `itemWidth`.
127 *
128 * @property int GridBrowser::itemSize
129 */
130 property alias itemSize: controlView.itemSize
131
132 /**
133 * @brief The width of the element in the cell. This value will vary even if `adaptContent` is enabled.
134 * This value is used as the `cellWidth` value by default.
135 * @property int GridBrowser::itemWidth
136 */
137 property alias itemWidth : controlView.itemWidth
138
139 /**
140 * @brief The height of the element in the cell. This value will vary even if `adaptContent` is enabled.
141 * This value is used as the `cellHeight` value by default.
142 * @property int GridBrowser::itemHeight
143 */
144 property alias itemHeight : controlView.itemHeight
145
146 /**
147 * @brief The width size of the cell area.
148 *
149 * @warning This value will be modified when the viewport area is resized and the `adaptContent` is enabled. So any binding will be lost. To have a fixed cell width value, set `adaptContent: false`.
150 * @see adaptContent
151 * @property int GridBrowser::cellWidth
152 */
153 property alias cellWidth: controlView.cellWidth
154
155 /**
156 * @brief The height size of the cell area.
157 * This value is set to the `itemHeight` value, or `itemSize` if the formerly one has not been set.
158 * This value will not be modified by the adaptable behaviour.
159 * Notice you can make the cell bigger than the itemHeight, in order to create a sense of vertical padding for each cell element.
160 * @property int GridBrowser::cellHeight
161 */
162 property alias cellHeight: controlView.cellHeight
164 /**
165 * @brief The model to be used to populate the browsing view.
166 * @property var GridBrowser::model
167 */
168 property alias model : controlView.model
169
170 /**
171 * @brief The component to be used as the delegate.
172 * @note Consider using the MauiKit delegate controls, such as GridBrowserDelegate, GalleryRollItem or CollageItem.
173 * @property Component GridBrowser::delegate
174 */
175 property alias delegate : controlView.delegate
176
177 /**
178 * @brief The position of the view contents on the Y axis.
179 * @property double GridBrowser::contentY
180 */
181 property alias contentY: controlView.contentY
182
183 /**
184 * @brief The index number of the current element selected.
185 * @property int GridBrowser::currentIndex
186 */
187 property alias currentIndex : controlView.currentIndex
188
189 /**
190 * @brief The total amount of elements listed in the view.
191 * @property int GridBrowser::count
192 */
193 property alias count : controlView.count
194
195 /**
196 * @brief The cache buffer.
197 * Refer to the QQC2 GridView documentation.
198 * @property int GridBrowser::cacheBuffer
199 */
200 property alias cacheBuffer : controlView.cacheBuffer
201
202 /**
203 * @brief The element controlling the layout fo element, AKA the flickable element.
204 * This is an alias to the QQC2 GridView control.
205 * @property GridView GridBrowser::flickable
206 */
207 property alias flickable : controlView
208
209 /**
210 * @brief The total height of all the elements listed in the view.
211 * @property int GridBrowser::contentHeight
212 */
213 property alias contentHeight : controlView.contentHeight
214
215 /**
216 * @brief The total width of all the elements.
217 * @property int GridBrowser::contentWidth
218 */
219 property alias contentWidth : controlView.contentWidth
220
221 /**
222 * @brief An alias to the QQC2 ScrollView element attached to the view.
223 * @property ScrollView GridBrowser::scrollView
224 */
225 property alias scrollView: _scrollView
226
227 /**
228 * @brief Top padding of the view. This padding is added to the scroll view container.
229 * @see scrollView
230 * @property int GridBrowser::topPadding
231 */
232 property alias topPadding: _scrollView.topPadding
233
234 /**
235 * @brief Bottom padding of the view. This padding is added to the scroll view container.
236 * @see scrollView
237 * @property int GridBrowser::bottomPadding
238 */
239 property alias bottomPadding: _scrollView.bottomPadding
240
241 /**
242 * @brief Right padding of the view. This padding is added to the scroll view container.
243 * @see scrollView
244 * @property int GridBrowser::rightPadding
245 */
246 property alias rightPadding: _scrollView.rightPadding
247
248 /**
249 * @brief Left padding of the view. This padding is added to the scroll view container.
250 * @see scrollView
251 * @property int GridBrowser::leftPadding
252 */
253 property alias leftPadding: _scrollView.leftPadding
254
255 /**
256 * @brief Padding of the view. This padding is added to the scroll view container.
257 * @see scrollView
258 * @property int GridBrowser::padding
259 */
260 property alias padding: _scrollView.padding
261
262 /**
263 * @brief The policy of the vertical scroll bar from the scroll view.
264 * @see scrollView
265 * The default value of this is picked based on the Style property `Style.scrollBarPolicy`, unless the orientation of the view is set to horizontal, in which case this is set to 'ScrollBar.AlwaysOff`.
266 * Possible values are:
267 * - ScrollBar.AlwaysOff
268 * - ScrollBar.AlwaysOn
269 * - ScrollBar.AsNeeded
270 */
271 property int verticalScrollBarPolicy: switch(Maui.Style.scrollBarPolicy)
272 {
273 case Maui.Style.AlwaysOn: return ScrollBar.AlwaysOn;
274 case Maui.Style.AlwaysOff: return ScrollBar.AlwaysOff;
275 case Maui.Style.AsNeeded: return ScrollBar.AsNeeded;
276 case Maui.Style.AutoHide: return ScrollBar.AsNeeded;
277 }
278
279 /**
280 * @brief The policy of the horizontal scroll bar from the scroll view.
281 * @see scrollView
282 * The default value of this is picked based on the Style property `Style.scrollBarPolicy`, unless the orientation of the view is set to vertical, in which case this is set to 'ScrollBar.AlwaysOff`.
283 * Possible values are:
284 * - ScrollBar.AlwaysOff
285 * - ScrollBar.AlwaysOn
286 * - ScrollBar.AsNeeded
287 */
288 property int horizontalScrollBarPolicy:
289 {
290 if(control.orientation === GridView.Vertical)
291 return ScrollBar.AlwaysOff
293 switch(Maui.Style.scrollBarPolicy)
294 {
295 case Maui.Style.AlwaysOn: return ScrollBar.AlwaysOn;
296 case Maui.Style.AlwaysOff: return ScrollBar.AlwaysOff;
297 case Maui.Style.AsNeeded: return ScrollBar.AsNeeded;
298 case Maui.Style.AutoHide: return ScrollBar.AsNeeded;
299 }
300 }
301
302 /**
303 * @brief An alias to access the placeholder properties. This is handled by a MauiKit Holder.
304 * @see Holder::title
305 * @see Holder::body
306 *
307 * @property Holder GridBrowser::holder
308 */
309 property alias holder : _holder
310
311 /**
312 * @brief Whether the width value of the cells should be recalculated when the view-port is resized. This will result in a uniform set of cells. The minimum width of the cells is constrained by the `itemSize` property.
313 * By default this is set to `true`.
314 */
315 property bool adaptContent: true
316 onAdaptContentChanged:
317 {
318 if(adaptContent)
319 control.adaptGrid()
320 else
321 control.resetCellWidth()
322 }
323
324 /**
325 * @brief Whether to enable the lasso selection, to select multiple items.
326 * By default this is set to `false`.
327 * @see itemsSelected
328 */
329 property bool enableLassoSelection : false
330
331 /**
332 * @brief
333 */
334 property bool selectionMode: false
335
336 /**
337 * @brief An alias to the lasso rectangle.
338 * @property Rectangle GridBrowser::lassoRec
339 */
340 readonly property alias lassoRec : selectLayer
341
342 /**
343 * @brief Whether the pinch-to-zoom gesture is enabled.
344 * By default this is set to `false`.
345 */
346 property bool pinchEnabled : false
347
348 /**
349 * @brief The current item selected.
350 * @property Item GridBrowser::currentItem
351 */
352 property alias currentItem : controlView.currentItem
353
354 /**
355 * @brief The header section of the GridView element.
356 * @see flickable
357 * @property Component GridBrowser::header
358 */
359 property alias header : controlView.header
360
361 /**
362 * @brief The footer section of the GridView element
363 * @see flickable
364 * @property Component GridBrowser::footer
365 */
366 property alias footer : controlView.footer
367
368 /**
369 * @brief The actual width of the view-port. This is the actual width without any padding.
370 * @property int GridBrowser::availableWidth
371 */
372 readonly property alias availableWidth: controlView.width
373
374 /**
375 * @brief The actual height of the view-port. This is the actual height without any padding.
376 * @property int GridBrowser::availableHeight
377 */
378 readonly property alias availableHeight: controlView.height
379
380 /**
381 * @brief Whether the view is moving horizontally or vertically. This reacts to changes in the content Y and/or X axis.
382 * @see contentY
383 * @see contentX
384 * @property bool GridBrowser::moving
385 */
386 readonly property alias moving: updateContentDelay.running
387
388 /**
389 * @brief Emitted when the lasso selection has been released.
390 * @param indexes A array of index numbers is sent as the argument, representing the index value of the items under the lasso rectangle area.
391 */
392 signal itemsSelected(var indexes)
393
394 /**
395 * @brief Emitted when an empty space of the background area has been clicked.
396 * @param mouse Object with information about the click event.
397 */
398 signal areaClicked(var mouse)
399
400 /**
401 * @brief Emitted when an empty space of the area area background has been right clicked.
402 */
403 signal areaRightClicked()
404
405 /**
406 * @brief Emitted when a physical key from the device has been pressed.
407 * @param event The object with information about the event.
408 */
409 signal keyPress(var event)
410
411 Keys.enabled : true
412 Keys.forwardTo : controlView
413
414 onItemSizeChanged :
415 {
416 controlView.size_ = itemSize
417 control.itemWidth = itemSize
418 control.cellWidth = itemWidth
419 if(adaptContent)
420 control.adaptGrid()
421 }
422
424 {
425 id: _scrollView
426 anchors.fill: parent
427 focus: true
428 padding: Maui.Style.contentMargins
429
430 clip: control.clip
431
432 ScrollBar.horizontal.policy: control.horizontalScrollBarPolicy
433 ScrollBar.vertical.policy: control.verticalScrollBarPolicy
434
435 contentHeight: controlView.contentHeight
436 contentWidth: availableWidth
437
438 Maui.Controls.orientation: control.Maui.Controls.orientation
439
441 {
442 id: controlView
443 focus: true
444
445 /**
446 * itemSize : int
447 */
448 property int itemSize: 0
449
450 /**
451 * itemWidth : int
452 */
453 property int itemWidth : itemSize
454
455 /**
456 * itemHeight : int
457 */
458 property int itemHeight : itemSize
459
460
461 property bool firstSelectionPress
462 property var selectedIndexes : []
463
464 //nasty trick
465 property int size_
466 Component.onCompleted:
467 {
468 controlView.size_ = control.itemWidth
469 }
470
471 flow: GridView.FlowLeftToRight
472 clip: control.clip
473
474 displayMarginBeginning: Maui.Style.effectsEnabled ? Maui.Style.toolBarHeight * 4 : 0
475 displayMarginEnd: displayMarginBeginning
476 cacheBuffer: control.itemHeight * 4
477
478 cellWidth: control.itemWidth
479 cellHeight: control.itemHeight
480
481 boundsBehavior: Flickable.StopAtBounds
482
483 flickableDirection: Flickable.AutoFlickDirection
484 snapMode: GridView.NoSnap
485 highlightMoveDuration: 0
486
487 interactive: Maui.Handy.hasTransientTouchInput
488
489 onWidthChanged: if(adaptContent) control.adaptGrid()
490 onCountChanged: if(adaptContent) control.adaptGrid()
491
492 keyNavigationEnabled : true
493 keyNavigationWraps : true
494
495 Keys.onPressed: (event) =>
496 {
497 control.keyPress(event)
498 }
499
500 Maui.Holder
501 {
502 id: _holder
503 visible: false
504 Keys.forwardTo: controlView
505 anchors.fill : parent
506 anchors.topMargin: controlView.headerItem ? controlView.headerItem.height : 0
507 anchors.bottomMargin: controlView.footerItem ? controlView.footerItem.height : 0
508 }
509
510 onContentXChanged:
511 {
512 updateContentDelay.restart()
513 }
514
515 onContentYChanged:
516 {
517 updateContentDelay.restart()
518 }
519
520 Timer
521 {
522 id: updateContentDelay
523 interval: 500
524 repeat: false
525 }
526
527 Loader
528 {
529 asynchronous: true
530 active: control.pinchEnabled
531
532 anchors.fill: parent
533 z: -1
534
535 sourceComponent: PinchArea
536 {
537 onPinchFinished: (pinch) =>
538 {
539 resizeContent(pinch.scale)
540 }
541 }
542 }
543
544 Loader
545 {
546 asynchronous: true
547 // active: !Maui.Handy.hasTransientTouchInput && !Maui.Handy.isMobile
548 anchors.fill: parent
549 z: parent.z-1
550 clip: false
551
552 sourceComponent: MouseArea
553 {
554 id: _mouseArea
555
556 propagateComposedEvents: true
557 preventStealing: true
558 acceptedButtons: Qt.RightButton | Qt.LeftButton
559 scrollGestureEnabled: false
560
561 onClicked: (mouse) =>
562 {
563 console.log("Area clicked")
564 control.areaClicked(mouse)
565 control.forceActiveFocus()
566
567 if(mouse.button === Qt.RightButton)
568 {
569 control.areaRightClicked()
570 return
571 }
572 }
573
574 onWheel: (wheel) =>
575 {
576 if (wheel.modifiers & Qt.ControlModifier)
577 {
578 if (wheel.angleDelta.y != 0)
579 {
580 var factor = 1 + wheel.angleDelta.y / 600;
581 control.resizeContent(factor)
582 }
583 }else
584 wheel.accepted = false
585 }
586
587 onPositionChanged: (mouse) =>
588 {
589 console.log("Area clicked >>> Moving")
590
591 if(_mouseArea.pressed && control.enableLassoSelection && selectLayer.visible)
592 {
593 if(mouseX >= selectLayer.newX)
594 {
595 selectLayer.width = (mouseX + 10) < (control.x + control.width) ? (mouseX - selectLayer.x) : selectLayer.width;
596 } else {
597 selectLayer.x = mouseX < control.x ? control.x : mouseX;
598 selectLayer.width = selectLayer.newX - selectLayer.x;
599 }
600
601 if(mouseY >= selectLayer.newY) {
602 selectLayer.height = (mouseY + 10) < (control.y + control.height) ? (mouseY - selectLayer.y) : selectLayer.height;
603 if(!controlView.atYEnd && mouseY > (control.y + control.height))
604 controlView.contentY += 10
605 } else {
606 selectLayer.y = mouseY < control.y ? control.y : mouseY;
607 selectLayer.height = selectLayer.newY - selectLayer.y;
608
609 if(!controlView.atYBeginning && selectLayer.y === 0)
610 controlView.contentY -= 10
611 }
612 }
613 }
614
615 onPressed: (mouse) =>
616 {
617 if (mouse.source === Qt.MouseEventNotSynthesized)
618 {
619 if(control.enableLassoSelection && mouse.button === Qt.LeftButton && control.count > 0)
620 {
621 selectLayer.visible = true;
622 selectLayer.x = mouseX;
623 selectLayer.y = mouseY;
624 selectLayer.newX = mouseX;
625 selectLayer.newY = mouseY;
626 selectLayer.width = 0
627 selectLayer.height = 0;
628 }
629 }
630 }
631
632 onPressAndHold: (mouse) =>
633 {
634 if ( mouse.source !== Qt.MouseEventNotSynthesized && control.enableLassoSelection && !selectLayer.visible )
635 {
636 selectLayer.visible = true;
637 selectLayer.x = mouseX;
638 selectLayer.y = mouseY;
639 selectLayer.newX = mouseX;
640 selectLayer.newY = mouseY;
641 selectLayer.width = 0
642 selectLayer.height = 0;
643
644 mouse.accepted = true
645 }else
646 {
647 mouse.accepted = false
648 }
649 }
650
651 onReleased: (mouse) =>
652 {
653 if(mouse.button !== Qt.LeftButton || !control.enableLassoSelection || !selectLayer.visible)
654 {
655 mouse.accepted = false
656 return;
657 }
658
659 if(selectLayer.y > controlView.contentHeight)
660 {
661 return selectLayer.reset();
662 }
663
664 var lassoIndexes = []
665 const limitX = mouse.x === lassoRec.x ? lassoRec.x+lassoRec.width : mouse.x
666 const limitY = mouse.y === lassoRec.y ? lassoRec.y+lassoRec.height : mouse.y
667
668 for(var i =lassoRec.x; i < limitX; i+=(lassoRec.width/(controlView.cellWidth* 0.5)))
669 {
670 for(var y = lassoRec.y; y < limitY; y+=(lassoRec.height/(controlView.cellHeight * 0.5)))
671 {
672 const index = controlView.indexAt(i,y+controlView.contentY)
673 if(!lassoIndexes.includes(index) && index>-1 && index< controlView.count)
674 lassoIndexes.push(index)
675 }
676 }
677
678 if(lassoIndexes.length > 0)
679 {
680 control.itemsSelected(lassoIndexes)
681 }
682
683 selectLayer.reset()
684 }
685 }
686 }
687
688 Maui.Rectangle
689 {
690 id: selectLayer
691 property int newX: 0
692 property int newY: 0
693 height: 0
694 width: 0
695 x: 0
696 y: 0
697 visible: false
698 color: Qt.rgba(control.Maui.Theme.highlightColor.r,control.Maui.Theme.highlightColor.g, control.Maui.Theme.highlightColor.b, 0.2)
699 opacity: 0.7
700
701 borderColor: control.Maui.Theme.highlightColor
702 borderWidth: 2
703 solidBorder: false
704
705 function reset()
706 {
707 selectLayer.x = 0;
708 selectLayer.y = 0;
709 selectLayer.newX = 0;
710 selectLayer.newY = 0;
711 selectLayer.visible = false;
712 selectLayer.width = 0;
713 selectLayer.height = 0;
714 }
715 }
716 }
717
718
719 }
720
721 /**
722 * @brief Request to resize the view elements. This will result in the `itemSize` property being modified.
723 * @param factor a factor for resizing.
724 * The minimum size is `Style.iconSizes.small`.
725 */
726 function resizeContent(factor)
727 {
728 const newSize = control.itemSize * factor
729
730 if(newSize > control.itemSize)
731 {
732 control.itemSize = newSize
733 }
734 else
735 {
736 if(newSize >= Maui.Style.iconSizes.small)
737 control.itemSize = newSize
738 }
739 }
740
741 /**
742 * @brief Forces to adapt the width of the grid cells. This will result on the `cellWidth` property being modified.
743 */
744 function adaptGrid()
745 {
746 var fullWidth = controlView.width
747 var realAmount = parseInt(fullWidth / controlView.size_, 0)
748 var amount = parseInt(fullWidth / control.cellWidth, 0)
749
750 var leftSpace = parseInt(fullWidth - ( realAmount * controlView.size_ ), 0)
751 var size = Math.min(amount, realAmount) >= control.count ? Math.max(control.cellWidth, control.itemSize) : parseInt((controlView.size_) + (parseInt(leftSpace/realAmount, 0)), 0)
752
753 control.cellWidth = size
754 }
755
756 /**
757 * @brief Resets the value of the `cellWidth` back to the initial size set with `itemSize`.
758 */
759 function resetCellWidth()
760 {
761 control.cellWidth = control.itemSize
762 }
763}
alias moving
Whether the view is moving horizontally or vertically.
void keyPress(var event)
Emitted when a physical key from the device has been pressed.
bool pinchEnabled
Whether the pinch-to-zoom gesture is enabled.
void areaClicked(var mouse)
Emitted when an empty space of the background area has been clicked.
alias itemSize
The uniform size of the element in the cell.
int horizontalScrollBarPolicy
The policy of the horizontal scroll bar from the scroll view.
alias holder
An alias to access the placeholder properties.
bool adaptContent
Whether the width value of the cells should be recalculated when the view-port is resized.
alias availableWidth
The actual width of the view-port.
bool enableLassoSelection
Whether to enable the lasso selection, to select multiple items.
alias lassoRec
An alias to the lasso rectangle.
alias itemWidth
The width of the element in the cell.
alias header
The header section of the GridView element.
void itemsSelected(var indexes)
Emitted when the lasso selection has been released.
void areaRightClicked()
Emitted when an empty space of the area area background has been right clicked.
alias footer
The footer section of the GridView element.
alias currentItem
The current item selected.
alias availableHeight
The actual height of the view-port.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
QAction * repeat(const QObject *recvr, const char *slot, QObject *parent)
KGuiItem reset()
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:57:11 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.