ListBrowser

Search for usage in LXR

ListBrowser Class Reference
Inheritance diagram for ListBrowser:

Properties

alias atYBeginning
 
alias atYEnd
 
alias availableHeight
 
alias availableWidth
 
alias bottomPadding
 
alias cacheBuffer
 
alias contentHeight
 
alias contentWidth
 
alias contentX
 
alias contentY
 
alias count
 
alias currentIndex
 
alias currentItem
 
alias delegate
 
bool enableLassoSelection
 
alias flickable
 
alias footer
 
alias header
 
alias holder
 
int horizontalScrollBarPolicy
 
alias lassoRec
 
alias leftPadding
 
alias model
 
alias orientation
 
alias padding
 
alias rightPadding
 
alias scrollView
 
alias section
 
bool selectionMode
 
alias snapMode
 
alias spacing
 
alias topPadding
 
int verticalScrollBarPolicy
 

Signals

void areaClicked (var mouse)
 
void areaRightClicked ()
 
void itemsSelected (var indexes)
 
void keyPress (var event)
 

Additional Inherited Members

- Public Member Functions inherited from QtQuick.Item
 childAt (real x, real y)
 
bool contains (point point)
 
 dumpItemTree ()
 
 forceActiveFocus ()
 
 forceActiveFocus (Qt::FocusReason reason)
 
bool grabToImage (callback, targetSize)
 
point mapFromGlobal (real x, real y)
 
point mapFromItem (Item item, point p)
 
point mapFromItem (Item item, real x, real y)
 
rect mapFromItem (Item item, real x, real y, real width, real height)
 
rect mapFromItem (Item item, rect r)
 
point mapToGlobal (real x, real y)
 
point mapToItem (Item item, point p)
 
point mapToItem (Item item, real x, real y)
 
rect mapToItem (Item item, real x, real y, real width, real height)
 
rect mapToItem (Item item, rect r)
 
 nextItemInFocusChain (bool forward)
 

Detailed Description

A browser view with a list layout.

This controls inherits from QQC2 Item, to checkout its inherited properties refer to the Qt Docs.

This component might seem similar to QQC2 ListView - and it does uses it underneath - but this one includes a few more predefined elements, such as a placeholder element, pinch to zoom gestures, lasso selection support, and some predefined behaviour.

Structure

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.

See also
Holder

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.

See also
itemsSelected
Note
Consider using as the delegate elements the MauiKit ListBrowserDelegate.

To position the delegates you can use the ListView attached properties, such as ListView.view.width to set the width of the delegate correctly.

Maui.ListBrowser
{
anchors.fill: parent
model: 60
onItemsSelected: (indexes) => console.log(indexes)
delegate: Maui.ListBrowserDelegate
{
width: ListView.view.width
label1.text: "An example delegate."
label2.text: "Using the MauiKit ListBrowser."
iconSource: "folder"
}
}
alias model
The model to be used to populate the browsing view.
bool enableLassoSelection
Whether to enable the lasso selection, to select multiple items.
alias delegate
The component to be used as the delegate.

You can find a more complete example at this link.

Definition at line 64 of file ListBrowser.qml.

Property Documentation

◆ atYBeginning

bool ListBrowser::atYBeginning
read

Whether the view is positioned at the beginning on the Y axis.

Remarks
This property is read-only

Meant to be used if the view orientation has been set to vertical.

Definition at line 172 of file ListBrowser.qml.

◆ atYEnd

bool ListBrowser::atYEnd
read

Whether the view is positioned at the end on the Y axis.

Remarks
This property is read-only

Meant to be used if the view orientation has been set to vertical.

Definition at line 165 of file ListBrowser.qml.

◆ availableHeight

int ListBrowser::availableHeight
read

The actual height of the view-port.

Remarks
This property is read-only

This is the actual height without any padding.

Definition at line 270 of file ListBrowser.qml.

◆ availableWidth

int ListBrowser::availableWidth
read

The actual width of the view-port.

Remarks
This property is read-only

This is the actual width without any padding.

Definition at line 264 of file ListBrowser.qml.

◆ bottomPadding

int ListBrowser::bottomPadding
read

The bottom padding.

See also
padding

Definition at line 184 of file ListBrowser.qml.

◆ cacheBuffer

int ListBrowser::cacheBuffer
read

The cache buffer.

Refer to the QQC2 ListView for proper documentation.

Definition at line 118 of file ListBrowser.qml.

◆ contentHeight

int ListBrowser::contentHeight
read

The total height of all the elements listed in the view.

Definition at line 153 of file ListBrowser.qml.

◆ contentWidth

int ListBrowser::contentWidth
read

The total width of all the elements.

Definition at line 158 of file ListBrowser.qml.

◆ contentX

alias ListBrowser::contentX
read

Definition at line 96 of file ListBrowser.qml.

◆ contentY

double ListBrowser::contentY
read

The position of the view contents on the Y axis.

The position of the view contents on the X axis.

Definition at line 91 of file ListBrowser.qml.

◆ count

int ListBrowser::count
read

The total amount of elements listed in the view.

Definition at line 112 of file ListBrowser.qml.

◆ currentIndex

int ListBrowser::currentIndex
read

The index number of the current element selected.

Note
To no break any binding, use the setCurrentIndex function.

Definition at line 102 of file ListBrowser.qml.

◆ currentItem

Item ListBrowser::currentItem
read

The current item selected.

Definition at line 107 of file ListBrowser.qml.

◆ delegate

Component ListBrowser::delegate
read

The component to be used as the delegate.

Note
Consider using the MauiKit delegate controls, such as ListBrowserDelegate, ListDelegate or LabelDelegate.

Definition at line 80 of file ListBrowser.qml.

◆ enableLassoSelection

bool ListBrowser::enableLassoSelection
read

Whether to enable the lasso selection, to select multiple items.

By default this is set to false.

See also
itemsSelected

Definition at line 236 of file ListBrowser.qml.

◆ flickable

ListView ListBrowser::flickable
read

An alias to access the QQC2 ListView.

Remarks
This property is read-only

Definition at line 142 of file ListBrowser.qml.

◆ footer

Component ListBrowser::footer
read

The footer section of the ListView element.

See also
flickable

Definition at line 258 of file ListBrowser.qml.

◆ header

Component ListBrowser::header
read

The header section of the ListView element.

See also
flickable

Definition at line 252 of file ListBrowser.qml.

◆ holder

Holder ListBrowser::holder
read

An alias to access the placeholder properties.

This is handled by a MauiKit Holder.

See also
Holder::title
Holder::body

Definition at line 230 of file ListBrowser.qml.

◆ horizontalScrollBarPolicy

int ListBrowser::horizontalScrollBarPolicy
read

The policy of the horizontal scroll bar from the scroll view.

See also
scrollView 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`. Possible values are:
  • ScrollBar.AlwaysOff
  • ScrollBar.AlwaysOn
  • ScrollBar.AsNeeded

Definition at line 222 of file ListBrowser.qml.

◆ lassoRec

Rectangle ListBrowser::lassoRec
read

An alias to the lasso rectangle.

Remarks
This property is read-only

Definition at line 246 of file ListBrowser.qml.

◆ leftPadding

int ListBrowser::leftPadding
read

The left padding.

See also
padding

Definition at line 196 of file ListBrowser.qml.

◆ model

var ListBrowser::model
read

The model to be used to populate the browsing view.

Definition at line 74 of file ListBrowser.qml.

◆ orientation

enum ListBrowser::orientation
read

The orientation of the list view.

By default this is set to ListView.Vertical.

Definition at line 124 of file ListBrowser.qml.

◆ padding

int ListBrowser::padding
read

The total padding all around the list view.

The padding is added to the ScrollView. This is the same as setting scrollView.padding.

Definition at line 202 of file ListBrowser.qml.

◆ rightPadding

int ListBrowser::rightPadding
read

The right padding.

See also
padding

Definition at line 190 of file ListBrowser.qml.

◆ scrollView

ScrollView ListBrowser::scrollView
read

An alias to access the QQC2 ScrollView.

Remarks
This property is read-only

Definition at line 148 of file ListBrowser.qml.

◆ section

section ListBrowser::section
read

The section group property to set the ListView sections.

Refer to the Qt documentation on the ListView section.

Definition at line 86 of file ListBrowser.qml.

◆ selectionMode

bool ListBrowser::selectionMode
read

Definition at line 240 of file ListBrowser.qml.

◆ snapMode

enum ListBrowser::snapMode
read

How to snap the elements of the list view while scrolling.

Note
See Qt documentation.

Definition at line 130 of file ListBrowser.qml.

◆ spacing

int ListBrowser::spacing
read

The spacing between the elements in the list view.

By default this is set to Style.defaultSpacing

Definition at line 136 of file ListBrowser.qml.

◆ topPadding

int ListBrowser::topPadding
read

The top padding.

See also
padding

Definition at line 178 of file ListBrowser.qml.

◆ verticalScrollBarPolicy

int ListBrowser::verticalScrollBarPolicy
read

The policy of the vertical scroll bar from the scroll view.

See also
scrollView 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`. Possible values are:
  • ScrollBar.AlwaysOff
  • ScrollBar.AlwaysOn
  • ScrollBar.AsNeeded

Definition at line 212 of file ListBrowser.qml.

Member Function Documentation

◆ areaClicked

void ListBrowser::areaClicked ( var mouse)
signal

Emitted when an empty space of the background area has been clicked.

Parameters
mouseObject with information about the click event.

◆ areaRightClicked

void ListBrowser::areaRightClicked ( )
signal

Emitted when an empty space of the area area background has been right clicked.

◆ itemsSelected

void ListBrowser::itemsSelected ( var indexes)
signal

Emitted when the lasso selection has been released.

Parameters
indexesA array of index numbers is sent as the argument, representing the index value of the items under the lasso rectangle area.

◆ keyPress

void ListBrowser::keyPress ( var event)
signal

Emitted when a physical key from the device has been pressed.

Parameters
eventThe object with information about the event.

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.