ColumnView

Search for usage in LXR

#include <columnview.h>

Inheritance diagram for ColumnView:

Public Types

enum  ColumnResizeMode { FixedColumns = 0, DynamicColumns, SingleColumn }
 
- Public Types inherited from QQuickItem
enum  Flag
 
enum  ItemChange
 
enum  TransformOrigin
 

Properties

bool acceptsMouse
 
qreal bottomPadding
 
ColumnResizeMode columnResizeMode
 
qreal columnWidth
 
QQmlListProperty< QQuickItemcontentChildren
 
QQmlListProperty< QObjectcontentData
 
QQuickItem contentItem
 
qreal contentWidth
 
qreal contentX
 
int count
 
int currentIndex
 
QQuickItem currentItem
 
bool dragging
 
QQuickItem firstVisibleItem
 
bool interactive
 
QQuickItem lastVisibleItem
 
bool moving
 
int scrollDuration
 
bool separatorVisible
 
qreal topPadding
 
QList< QObject * > visibleItems
 
- Properties inherited from QQuickItem
 activeFocus
 
 activeFocusOnTab
 
 antialiasing
 
 baselineOffset
 
 childrenRect
 
 clip
 
 enabled
 
 focus
 
 height
 
 implicitHeight
 
 implicitWidth
 
 opacity
 
 parent
 
 rotation
 
 scale
 
 smooth
 
 state
 
 transformOrigin
 
 visible
 
 width
 
 x
 
 y
 
 z
 
- Properties inherited from QObject
 objectName
 

Signals

void acceptsMouseChanged ()
 
void bottomPaddingChanged ()
 
void columnResizeModeChanged ()
 
void columnWidthChanged ()
 
void contentChildrenChanged ()
 
void contentWidthChanged ()
 
void contentXChanged ()
 
void countChanged ()
 
void currentIndexChanged ()
 
void currentItemChanged ()
 
void draggingChanged ()
 
void firstVisibleItemChanged ()
 
void interactiveChanged ()
 
void itemInserted (int position, QQuickItem *item)
 
void itemRemoved (QQuickItem *item)
 
void lastVisibleItemChanged ()
 
void movingChanged ()
 
void scrollDurationChanged ()
 
void separatorVisibleChanged ()
 
void topPaddingChanged ()
 
void visibleItemsChanged ()
 

Public Slots

void addItem (QQuickItem *item)
 
void clear ()
 
bool containsItem (QQuickItem *item)
 
void insertItem (int pos, QQuickItem *item)
 
QQuickItemitemAt (qreal x, qreal y)
 
void moveItem (int from, int to)
 
QQuickItempop (QQuickItem *item)
 
QQuickItemremoveItem (const QVariant &item)
 
void replaceItem (int pos, QQuickItem *item)
 

Public Member Functions

 ColumnView (QQuickItem *parent=nullptr)
 
bool acceptsMouse () const
 
qreal bottomPadding () const
 
ColumnResizeMode columnResizeMode () const
 
qreal columnWidth () const
 
QQmlListProperty< QQuickItemcontentChildren ()
 
QQmlListProperty< QObjectcontentData ()
 
QQuickItemcontentItem () const
 
qreal contentWidth () const
 
qreal contentX () const
 
int count () const
 
int currentIndex () const
 
QQuickItemcurrentItem ()
 
bool dragging () const
 
QQuickItemfirstVisibleItem () const
 
bool interactive () const
 
QQuickItemlastVisibleItem () const
 
bool moving () const
 
QQuickItemremoveItem (QQuickItem *item)
 
QQuickItemremoveItem (int item)
 
int scrollDuration () const
 
bool separatorVisible () const
 
void setAcceptsMouse (bool accepts)
 
void setBottomPadding (qreal padding)
 
void setColumnResizeMode (ColumnResizeMode mode)
 
void setColumnWidth (qreal width)
 
void setContentX (qreal x) const
 
void setCurrentIndex (int index)
 
void setInteractive (bool interactive)
 
void setScrollDuration (int duration)
 
void setSeparatorVisible (bool visible)
 
void setTopPadding (qreal padding)
 
qreal topPadding () const
 
QList< QObject * > visibleItems () const
 
- Public Member Functions inherited from QQuickItem
 QQuickItem (QQuickItem *parent)
 
Qt::MouseButtons acceptedMouseButtons () const const
 
bool acceptHoverEvents () const const
 
bool acceptTouchEvents () const const
 
void activeFocusChanged (bool)
 
bool activeFocusOnTab () const const
 
void activeFocusOnTabChanged (bool)
 
bool antialiasing () const const
 
void antialiasingChanged (bool)
 
qreal baselineOffset () const const
 
void baselineOffsetChanged (qreal)
 
QQuickItemchildAt (qreal x, qreal y) const const
 
QList< QQuickItem * > childItems () const const
 
QRectF childrenRect ()
 
void childrenRectChanged (const QRectF &)
 
bool clip () const const
 
void clipChanged (bool)
 
QObjectcontainmentMask () const const
 
void containmentMaskChanged ()
 
virtual bool contains (const QPointF &point) const const
 
QCursor cursor () const const
 
void enabledChanged ()
 
bool filtersChildMouseEvents () const const
 
QQuickItem::Flags flags () const const
 
void focusChanged (bool)
 
void forceActiveFocus ()
 
void forceActiveFocus (Qt::FocusReason reason)
 
void grabMouse ()
 
QSharedPointer< QQuickItemGrabResultgrabToImage (const QSize &targetSize)
 
void grabTouchPoints (const QVector< int > &ids)
 
bool hasActiveFocus () const const
 
bool hasFocus () const const
 
qreal height () const const
 
void heightChanged ()
 
qreal implicitHeight () const const
 
void implicitHeightChanged ()
 
qreal implicitWidth () const const
 
void implicitWidthChanged ()
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const const
 
bool isAncestorOf (const QQuickItem *child) const const
 
bool isEnabled () const const
 
bool isFocusScope () const const
 
virtual bool isTextureProvider () const const
 
bool isVisible () const const
 
bool keepMouseGrab () const const
 
bool keepTouchGrab () const const
 
QPointF mapFromGlobal (const QPointF &point) const const
 
QPointF mapFromItem (const QQuickItem *item, const QPointF &point) const const
 
QPointF mapFromScene (const QPointF &point) const const
 
QRectF mapRectFromItem (const QQuickItem *item, const QRectF &rect) const const
 
QRectF mapRectFromScene (const QRectF &rect) const const
 
QRectF mapRectToItem (const QQuickItem *item, const QRectF &rect) const const
 
QRectF mapRectToScene (const QRectF &rect) const const
 
QPointF mapToGlobal (const QPointF &point) const const
 
QPointF mapToItem (const QQuickItem *item, const QPointF &point) const const
 
QPointF mapToScene (const QPointF &point) const const
 
QQuickItemnextItemInFocusChain (bool forward)
 
qreal opacity () const const
 
void opacityChanged ()
 
void parentChanged (QQuickItem *)
 
QQuickItemparentItem () const const
 
void polish ()
 
void resetAntialiasing ()
 
void resetHeight ()
 
void resetWidth ()
 
qreal rotation () const const
 
void rotationChanged ()
 
qreal scale () const const
 
void scaleChanged ()
 
QQuickItemscopedFocusItem () const const
 
void setAcceptedMouseButtons (Qt::MouseButtons buttons)
 
void setAcceptHoverEvents (bool enabled)
 
void setAcceptTouchEvents (bool enabled)
 
void setActiveFocusOnTab (bool)
 
void setAntialiasing (bool)
 
void setBaselineOffset (qreal)
 
void setClip (bool)
 
void setContainmentMask (QObject *mask)
 
void setCursor (const QCursor &cursor)
 
void setEnabled (bool)
 
void setFiltersChildMouseEvents (bool filter)
 
void setFlag (QQuickItem::Flag flag, bool enabled)
 
void setFlags (QQuickItem::Flags flags)
 
void setFocus (bool)
 
void setFocus (bool focus, Qt::FocusReason reason)
 
void setHeight (qreal)
 
void setImplicitHeight (qreal)
 
void setImplicitWidth (qreal)
 
void setKeepMouseGrab (bool keep)
 
void setKeepTouchGrab (bool keep)
 
void setOpacity (qreal)
 
void setParentItem (QQuickItem *parent)
 
void setRotation (qreal)
 
void setScale (qreal)
 
void setSize (const QSizeF &size)
 
void setSmooth (bool)
 
void setState (const QString &)
 
void setTransformOrigin (QQuickItem::TransformOrigin)
 
void setVisible (bool)
 
void setWidth (qreal)
 
void setX (qreal)
 
void setY (qreal)
 
void setZ (qreal)
 
QSizeF size () const const
 
bool smooth () const const
 
void smoothChanged (bool)
 
void stackAfter (const QQuickItem *sibling)
 
void stackBefore (const QQuickItem *sibling)
 
QString state () const const
 
void stateChanged (const QString &)
 
virtual QSGTextureProvidertextureProvider () const const
 
QQuickItem::TransformOrigin transformOrigin () const const
 
void transformOriginChanged (QQuickItem::TransformOrigin)
 
void ungrabMouse ()
 
void ungrabTouchPoints ()
 
void unsetCursor ()
 
void update ()
 
void visibleChanged ()
 
qreal width () const const
 
void widthChanged ()
 
QQuickWindowwindow () const const
 
void windowChanged (QQuickWindow *window)
 
qreal x () const const
 
void xChanged ()
 
qreal y () const const
 
void yChanged ()
 
qreal z () const const
 
void zChanged ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static ColumnViewAttachedqmlAttachedProperties (QObject *object)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

bool childMouseEventFilter (QQuickItem *item, QEvent *event) override
 
void classBegin () override
 
void componentComplete () override
 
void geometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry) override
 
void itemChange (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseUngrabEvent () override
 
void updatePolish () override
 
- Protected Member Functions inherited from QQuickItem
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual bool event (QEvent *ev) override
 
virtual void focusInEvent (QFocusEvent *)
 
virtual void focusOutEvent (QFocusEvent *)
 
bool heightValid () const const
 
virtual void hoverEnterEvent (QHoverEvent *event)
 
virtual void hoverLeaveEvent (QHoverEvent *event)
 
virtual void hoverMoveEvent (QHoverEvent *event)
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
bool isComponentComplete () const const
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void releaseResources ()
 
virtual void touchEvent (QTouchEvent *event)
 
virtual void touchUngrabEvent ()
 
void updateInputMethod (Qt::InputMethodQueries queries)
 
virtual QSGNodeupdatePaintNode (QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *updatePaintNodeData)
 
virtual void wheelEvent (QWheelEvent *event)
 
bool widthValid () const const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Attributes inherited from QQuickItem
 Bottom
 
 BottomLeft
 
 BottomRight
 
 Center
 
typedef Flags
 
 ItemAcceptsDrops
 
 ItemAcceptsInputMethod
 
 ItemActiveFocusHasChanged
 
 ItemAntialiasingHasChanged
 
 ItemChildAddedChange
 
 ItemChildRemovedChange
 
 ItemClipsChildrenToShape
 
 ItemDevicePixelRatioHasChanged
 
 ItemEnabledHasChanged
 
 ItemHasContents
 
 ItemIsFocusScope
 
 ItemOpacityHasChanged
 
 ItemParentHasChanged
 
 ItemRotationHasChanged
 
 ItemSceneChange
 
 ItemVisibleHasChanged
 
 Left
 
 Right
 
 Top
 
 TopLeft
 
 TopRight
 
- Public Attributes inherited from QObject
typedef QObjectList
 

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

Since
2.7

Definition at line 147 of file columnview.h.

Property Documentation

bool ColumnView::acceptsMouse
readwrite

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

Definition at line 248 of file columnview.h.

qreal ColumnView::bottomPadding
readwrite

The padding this will have at the bottom.

Definition at line 202 of file columnview.h.

ColumnView::ColumnResizeMode ColumnView::columnResizeMode
readwrite

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

Definition at line 158 of file columnview.h.

qreal ColumnView::columnWidth
readwrite

The width of all columns when columnResizeMode is FixedColumns.

Definition at line 163 of file columnview.h.

QQmlListProperty< QQuickItem > ColumnView::contentChildren
read

Every column item the view contains.

Definition at line 254 of file columnview.h.

QQmlListProperty< QObject > ColumnView::contentData
read

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

Definition at line 258 of file columnview.h.

QQuickItem * ColumnView::contentItem
read

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

Definition at line 182 of file columnview.h.

qreal ColumnView::contentWidth
read

The compound width of all columns in the view.

Definition at line 192 of file columnview.h.

qreal ColumnView::contentX
readwrite

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

Definition at line 187 of file columnview.h.

int ColumnView::count
read

How many columns this view containsItem.

Definition at line 167 of file columnview.h.

int ColumnView::currentIndex
readwrite

The position of the currently active column.

The current column will also have keyboard focus

Definition at line 172 of file columnview.h.

QQuickItem * ColumnView::currentItem
read

The currently active column.

The current column will also have keyboard focus

Definition at line 177 of file columnview.h.

bool ColumnView::dragging
read

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

Definition at line 233 of file columnview.h.

QQuickItem * ColumnView::firstVisibleItem
read

The first of visibleItems provided from convenience.

Definition at line 222 of file columnview.h.

bool ColumnView::interactive
readwrite

True if it supports moving the contents by dragging.

Definition at line 243 of file columnview.h.

QQuickItem * ColumnView::lastVisibleItem
read

The last of visibleItems provided from convenience.

Definition at line 227 of file columnview.h.

bool ColumnView::moving
read

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

Definition at line 238 of file columnview.h.

int ColumnView::scrollDuration
readwrite

The duration for scrolling animations.

Definition at line 207 of file columnview.h.

bool ColumnView::separatorVisible
readwrite

True if columns should be visually separated by a separator line.

Definition at line 212 of file columnview.h.

qreal ColumnView::topPadding
readwrite

The padding this will have at the top.

Definition at line 197 of file columnview.h.

QList< QObject * > ColumnView::visibleItems
read

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

Definition at line 217 of file columnview.h.

Member Function Documentation

void ColumnView::addItem ( QQuickItem item)
slot

Pushes a new item at the end of the view.

Parameters
itemthe new item which will be reparented and managed

Definition at line 1081 of file columnview.cpp.

void ColumnView::clear ( )
slot

Removes every item in the view.

Items will be reparented to their old parent. If they have JavaScript ownership and they didn't have an old parent, they will be destroyed

Definition at line 1265 of file columnview.cpp.

bool ColumnView::containsItem ( QQuickItem item)
slot
Returns
true if the view contains the given item

Definition at line 1274 of file columnview.cpp.

void ColumnView::insertItem ( int  pos,
QQuickItem item 
)
slot

Inserts a new item in the view at a given position.

The current Item will not be changed, currentIndex will be adjusted accordingly if needed to keep the same current item.

Parameters
posthe position we want the new item to be inserted in
itemthe new item which will be reparented and managed

Definition at line 1086 of file columnview.cpp.

QQuickItem * ColumnView::itemAt ( qreal  x,
qreal  y 
)
slot

Returns the visible item containing the point x, y in content coordinates.

If there is no item at the point specified, or the item is not visible null is returned.

Definition at line 1279 of file columnview.cpp.

void ColumnView::itemInserted ( int  position,
QQuickItem item 
)
signal

A new item has been inserted.

Parameters
positionwhere the page has been inserted
itema pointer to the new item
void ColumnView::itemRemoved ( QQuickItem item)
signal

An item has just been removed from the view.

Parameters
itema pointer to the item that has just been removed
void ColumnView::moveItem ( int  from,
int  to 
)
slot

Move an item inside the view.

The currentIndex property may be changed in order to keep currentItem the same.

Parameters
fromthe old position
tothe new position

Definition at line 1176 of file columnview.cpp.

QQuickItem * ColumnView::pop ( QQuickItem item)
slot

Removes all the items after item.

Starting from the last column, every column will be removed until item is found, which will be left in place. Items will be reparented to their old parent. If they have JavaScript ownership and they didn't have an old parent, they will be destroyed

Parameters
itemthe item which will be the new last one of the row.
Returns
the last item that has been removed

Definition at line 1251 of file columnview.cpp.

QQuickItem * ColumnView::removeItem ( const QVariant item)
slot

Removes an item from the view.

Items will be reparented to their old parent. If they have JavaScript ownership and they didn't have an old parent, they will be destroyed. CurrentIndex may be changed in order to keep the same currentItem

Parameters
itemit can either be a pointer of an item or an integer specifying the position to remove
Returns
the item that has just been removed

Definition at line 1201 of file columnview.cpp.

void ColumnView::replaceItem ( int  pos,
QQuickItem item 
)
slot

Replaces an item in the view at a given position with a new item.

The current Item and currentIndex will not be changed.

Parameters
posthe position we want the new item to be placed in
itemthe new item which will be reparented and managed

Definition at line 1119 of file columnview.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Nov 28 2021 22:34:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.