Kirigami2
columnview.cpp
106 m_leadingSeparatorComponent = m_instance->property("leadingSeparator").value<QQmlComponent *>();
109 m_trailingSeparatorComponent = m_instance->property("trailingSeparator").value<QQmlComponent *>();
112 m_units = engine->singletonInstance<Kirigami::Units *>(qmlTypeId("org.kde.kirigami", 2, 0, "Units"));
116 connect(m_units, &Kirigami::Units::longDurationChanged, this, &QmlComponentsPool::longDurationChanged);
327 QRectF mapped = m_view->currentItem()->mapRectToItem(m_view, QRectF(QPointF(0, 0), m_view->currentItem()->size()));
410 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(child, true));
416 return qRound(qBound(m_columnWidth, (parentItem()->width() - attached->reservedSpace()), std::max(m_columnWidth, parentItem()->width())));
454 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(child, true));
467 child->setPosition(QPointF(qMin(qMax(-x(), partialWidth), -x() + m_view->width() - child->width() + sepWidth), 0.0));
533 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(child, true));
544 child->setPosition(QPointF(qMin(qMax(-x(), partialWidth), -x() + m_view->width() - child->width() + sepWidth), 0.0));
563 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
565 if (item->isVisible() && item->x() + x() < m_view->width() && item->x() + item->width() + x() > 0) {
579 const QQuickItem *oldFirstVisibleItem = m_visibleItems.isEmpty() ? nullptr : qobject_cast<QQuickItem *>(m_visibleItems.first());
580 const QQuickItem *oldLastVisibleItem = m_visibleItems.isEmpty() ? nullptr : qobject_cast<QQuickItem *>(m_visibleItems.last());
600 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
636 QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_leadingSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item)));
642 QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_leadingSeparatorComponent->completeCreate();
656 QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_trailingSeparatorComponent->beginCreate(QQmlEngine::contextForObject(item)));
662 QmlComponentsPoolSingleton::instance(qmlEngine(item))->m_trailingSeparatorComponent->completeCreate();
670 void ContentItem::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)
674 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(value.item, true));
795 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(this, true));
797 attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(m_contentItem, true));
833 disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, nullptr);
867 QRectF mappedCurrent = m_currentItem->mapRectToItem(this, QRectF(QPointF(0, 0), m_currentItem->size()));
870 mappedCurrent.moveLeft(mappedCurrent.left() + m_contentItem->x() + m_contentItem->m_slideAnim->endValue().toInt());
971 disconnect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, nullptr);
1001 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
1115 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
1117 attached->setShouldDeleteOnRemove(item->parentItem() == nullptr && QQmlEngine::objectOwnership(item) == QQmlEngine::JavaScriptOwnership);
1128 // NOTE: just updating m_currentIndex does *not* update currentItem (which is what we need atm) while setCurrentIndex will update also currentItem
1140 qCWarning(KirigamiLog) << "Position" << pos << "passed to ColumnView::replaceItem is out of range.";
1159 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(oldItem, false));
1175 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
1177 attached->setShouldDeleteOnRemove(item->parentItem() == nullptr && QQmlEngine::objectOwnership(item) == QQmlEngine::JavaScriptOwnership);
1246 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, false));
1390 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(candidateItem, true));
1397 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(candidateItem, true));
1410 if ((!keepMouseGrab() && item->keepMouseGrab()) || item->property("preventStealing").toBool()) {
1418 // If a drag happened, start to steal all events, use startDragDistance * 2 to give time to widgets to take the mouse grab by themselves
1419 m_dragging = keepMouseGrab() || qAbs(mapFromItem(item, me->localPos()).x() - m_startMouseX) > qApp->styleHints()->startDragDistance() * 3;
1526 m_dragging = keepMouseGrab() || qAbs(event->localPos().x() - m_startMouseX) > qApp->styleHints()->startDragDistance() * 2;
1594 m_contentItem->m_columnWidth = privateQmlComponentsPoolSelf->instance(qmlEngine(this))->m_units->gridUnit() * 20;
1598 connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::gridUnitChanged, this, syncColumnWidth);
1602 m_contentItem->m_slideAnim->setDuration(QmlComponentsPoolSingleton::instance(qmlEngine(this))->m_units->longDuration());
1606 connect(QmlComponentsPoolSingleton::instance(qmlEngine(this)), &QmlComponentsPool::longDurationChanged, this, syncDuration);
1623 void ColumnView::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)
1650 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
1652 attached->setShouldDeleteOnRemove(item->parentItem() == nullptr && QQmlEngine::objectOwnership(item) == QQmlEngine::JavaScriptOwnership);
1674 QQuickItem *ColumnView::contentChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index)
1729 ColumnViewAttached *attached = qobject_cast<ColumnViewAttached *>(qmlAttachedPropertiesObject<ColumnView>(item, true));
1731 attached->setShouldDeleteOnRemove(view->m_complete && !item->parentItem() && QQmlEngine::objectOwnership(item) == QQmlEngine::JavaScriptOwnership);
void append(const T &value)
QList< QObject * > visibleItems
The list of all visible column items that are at least partially in the viewport at any given moment.
Definition: columnview.h:217
qreal left() const const
QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const const
virtual bool event(QEvent *ev) override
void setZ(qreal)
MouseButtonPress
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QVariant fromValue(const T &value)
Q_EMITQ_EMIT
Qt::MouseButton button() const const
int count(const T &value) const const
bool moving
True both when the user is dragging around with touch gestures the view contents or the view is anima...
Definition: columnview.h:238
JavaScriptOwnership
T value() const const
void itemRemoved(QQuickItem *item)
An item has just been removed from the view.
bool inherits(const char *className) const const
void activeFocusChanged(bool)
virtual QObject * create(QQmlContext *context)
T singletonInstance(int qmlTypeId)
bool pinned
If true the page will never go out of view, but will stay either at the right or left side of the Col...
Definition: columnview.h:68
KCRASH_EXPORT void setFlags(KCrash::CrashFlags flags)
virtual void componentComplete() override
LeftButton
void polish()
implicitHeight
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
ItemChange
void setSize(const QSizeF &size)
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
ColumnView is a container that lays out items horizontally in a row, when not all items fit in the Co...
Definition: columnview.h:147
void destroyed(QObject *obj)
void rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
QQmlContext * contextForObject(const QObject *object)
void deleteLater()
void setParentItem(QQuickItem *parent)
void forceActiveFocus()
const QPointF & localPos() const const
virtual void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)
bool acceptsMouse
True if the contents can be dragged also with mouse besides touch.
Definition: columnview.h:248
void setKeepMouseGrab(bool keep)
void setData(const QByteArray &data, const QUrl &url)
qreal reservedSpace
When a column is fillWidth, it will keep reservedSpace amount of pixels from going to fill the full v...
Definition: columnview.h:55
void setAccepted(bool accepted)
QQuickItem lastVisibleItem
The last of visibleItems provided from convenience.
Definition: columnview.h:227
bool dragging
True when the user is dragging around with touch gestures the view contents.
Definition: columnview.h:233
Qt::MouseButtons buttons() const const
Definition: units.h:71
void finished()
Qt::MouseEventSource source() const const
QQmlListProperty< QObject > contentData
every item declared inside the view, both visual and non-visual items
Definition: columnview.h:258
int toInt(bool *ok) const const
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
void replaceItem(int pos, QQuickItem *item)
Replaces an item in the view at a given position with a new item.
Definition: columnview.cpp:1137
height
qreal columnWidth
The width of all columns when columnResizeMode is FixedColumns.
Definition: columnview.h:163
bool toBool() const const
QQuickItem firstVisibleItem
The first of visibleItems provided from convenience.
Definition: columnview.h:222
bool canConvert(int targetTypeId) const const
KGuiItem del()
bool setProperty(const char *name, const QVariant &value)
ColumnResizeMode columnResizeMode
The strategy to follow while automatically resizing the columns, the enum can have the following valu...
Definition: columnview.h:158
qreal contentX
The value of the horizontal scroll of the view, in pixels.
Definition: columnview.h:187
QQmlEngine::ObjectOwnership objectOwnership(QObject *object)
qreal x() const const
qreal y() const const
QQuickItem contentItem
The main content item of this view: it's the parent of the column items.
Definition: columnview.h:182
bool separatorVisible
True if columns should be visually separated by a separator line.
Definition: columnview.h:212
QQmlListProperty< QQuickItem > contentChildren
Every column item the view contains.
Definition: columnview.h:254
void setParent(QObject *parent)
void itemInserted(int position, QQuickItem *item)
A new item has been inserted.
implicitWidth
void xChanged()
RightToLeft
void clear()
bool inViewport
True if this column is at least partly visible in the ColumnView's viewport.
Definition: columnview.h:79
Running
InOutQuad
void clear()
bool isVisible() const const
T * data() const const
void moveLeft(qreal x)
void addItem(QQuickItem *item)
Pushes a new item at the end of the view.
Definition: columnview.cpp:1099
MouseEventNotSynthesized
bool keepMouseGrab() const const
void insertItem(int pos, QQuickItem *item)
Inserts a new item in the view at a given position.
Definition: columnview.cpp:1104
QObject * parent() const const
T value(int i) const const
width
virtual bool childMouseEventFilter(QQuickItem *item, QEvent *event)
bool preventStealing
Like the same property of MouseArea, when this is true, the column view won't try to manage events by...
Definition: columnview.h:62
This is an attached property to every item that is inserted in the ColumnView, used to access the vie...
Definition: columnview.h:38
void accept()
QQuickItem * itemAt(qreal x, qreal y)
Returns the visible item containing the point x, y in content coordinates.
Definition: columnview.cpp:1298
QVariant property(const char *name) const const
virtual void classBegin() override
qreal height() const const
bool fillWidth
If true, the column will expand to take the whole viewport space minus reservedSpace.
Definition: columnview.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:14:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:14:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.