ColumnView QML Type

Import Statement: import org.kde.kirigami.layouts
Since: 2.7

Properties

Attached Properties

Signals

Methods

Detailed Description

ColumnView is a container that lays out items horizontally in a row, when not all items fit in the ColumnView, it will behave like a Flickable and will be a scrollable view which shows only a determined number of columns. The columns can either all have the same fixed size (recommended), size themselves with implicitWidth, or automatically expand to take all the available width: by default the last column will always be the expanding one. Items inside the ColumnView can access info of the view and set layouting hints via the ColumnView attached property.

This is the base for the implementation of PageRow.

Property Documentation

acceptsMouse : bool

True if the contents can be dragged also with mouse besides touch


bottomPadding : qreal

The padding this will have at the bottom


columnResizeMode : enumeration

The strategy to follow while automatically resizing the columns, the enum can have the following values:

  • FixedColumns: every column is fixed at the same width of the columnWidth property
  • DynamicColumns: columns take their width from their implicitWidth
  • SingleColumn: only one column at a time is shown, as wide as the viewport, eventual reservedSpace on the column's attached property is ignored

The default is FixedColumns.


columnWidth : qreal

The width of all columns when columnResizeMode is FixedColumns


contentChildren : list<Item>

Every column item the view contains


contentData : list<QtObject> [default]

every item declared inside the view, both visual and non-visual items


contentItem : Item [read-only]

The main content item of this view: it's the parent of the column items


contentWidth : qreal [read-only]

The compound width of all columns in the view


contentX : qreal

The value of the horizontal scroll of the view, in pixels


count : int [read-only]

How many columns this view contains


currentIndex : int

The position of the currently active column. The current column will also have keyboard focus


currentItem : Item [read-only]

The currently active column. The current column will also have keyboard focus


dragging : bool [read-only]

True when the user is dragging around with touch gestures the view contents


interactive : bool

True if it supports moving the contents by dragging


leadingVisibleItem : Item [read-only]

The first of visibleItems provided from convenience


moving : bool [read-only]

True both when the user is dragging around with touch gestures the view contents or the view is animating


scrollDuration : int

The duration for scrolling animations


separatorVisible : bool

True if columns should be visually separated by a separator line


topPadding : qreal

The padding this will have at the top


trailingVisibleItem : Item [read-only]

The last of visibleItems provided from convenience


visibleItems : list<QtObject> [read-only]

The list of all visible column items that are at least partially in the viewport at any given moment


Attached Property Documentation

ColumnView.fillWidth : bool

If true, the column will expand to take the whole viewport space minus reservedSpace


ColumnView.inViewport : int [read-only, since 5.77]

True if this column is at least partly visible in the ColumnView's viewport.

This property was introduced in 5.77.


ColumnView.index : int

The index position of the column in the view, starting from 0


ColumnView.pinned : int

If true the page will never go out of view, but will stay either at the right or left side of the ColumnView


ColumnView.preventStealing : int

Like the same property of MouseArea, when this is true, the column view won't try to manage events by itself when filtering from a child, not disturbing user interaction


ColumnView.reservedSpace : qreal

When a column is fillWidth, it will keep reservedSpace amount of pixels from going to fill the full viewport width


ColumnView.view : ColumnView [read-only]

The view this column belongs to


Signal Documentation

itemInserted(int position, Item item)

A new item has been inserted

position where the page has been inserted

item a pointer to the new item

Note: The corresponding handler is onItemInserted.


itemRemoved(Item item)

An item has just been removed from the view

item a pointer to the item that has just been removed

Note: The corresponding handler is onItemRemoved.


Method Documentation

Item pop()

This method removes the last item from the view and returns it.

This method calls removeItem() on the last item.

Returns the removed item

See also ::removeItem().


Item pop(var item)

This method removes all the items after the specified item or index from the view and returns the last item that was removed.

Note that if the passed value is neither of the values said below, it will return a nullptr.

item the item to remove. It can be an item, index or not defined in which case it will pop the last item.


Item removeItem(var item)

This method removes an item from the view.

If the argument is a number, this method dispatches to removeItem(int index) to remove an item by its index. Otherwise the argument should be the item itself to be removed itself, and this method will dispatch to removeItem(QQuickItem *item).

index the index of the item which should be removed, or the item itself

Returns the removed item

See also ::removeItem(QQuickItem *item).