delete m_autoScrollTimer;
m_autoScrollTimer = 0;
}
-
}
bool KItemListView::autoScroll() const
return QHash<QByteArray, QSizeF>();
}
+void KItemListView::setSupportsItemExpanding(bool supportsExpanding)
+{
+ if (m_supportsItemExpanding != supportsExpanding) {
+ m_supportsItemExpanding = supportsExpanding;
+ updateSiblingsInformation();
+ onSupportsItemExpandingChanged(supportsExpanding);
+ }
+}
+
bool KItemListView::supportsItemExpanding() const
{
return m_supportsItemExpanding;
connect(m_header, SIGNAL(visibleRoleWidthChanged(QByteArray,qreal,qreal)),
this, SLOT(slotVisibleRoleWidthChanged(QByteArray,qreal,qreal)));
+ connect(m_header, SIGNAL(visibleRoleMoved(QByteArray,int,int)),
+ this, SLOT(slotVisibleRoleMoved(QByteArray,int,int)));
connect(m_header, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
this, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
connect(m_header, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
Q_UNUSED(previous);
}
+void KItemListView::onSupportsItemExpandingChanged(bool supportsExpanding)
+{
+ Q_UNUSED(supportsExpanding);
+}
+
void KItemListView::onTransactionBegin()
{
}
return m_visibleItems.values();
}
-void KItemListView::setSupportsItemExpanding(bool supportsExpanding)
-{
- if (m_supportsItemExpanding != supportsExpanding) {
- m_supportsItemExpanding = supportsExpanding;
- updateSiblingsInformation();
- }
-}
-
void KItemListView::slotItemsInserted(const KItemRangeList& itemRanges)
{
updateVisibleRolesSizes(itemRanges);
}
}
+void KItemListView::slotVisibleRoleMoved(const QByteArray& role,
+ int currentIndex,
+ int previousIndex)
+{
+ Q_ASSERT(m_visibleRoles[previousIndex] == role);
+
+ const QList<QByteArray> previous = m_visibleRoles;
+
+ QList<QByteArray> current = m_visibleRoles;
+ current.removeAt(previousIndex);
+ current.insert(currentIndex, role);
+
+ setVisibleRoles(current);
+
+ emit visibleRolesChanged(current, previous);
+}
+
void KItemListView::triggerAutoScrolling()
{
if (!m_autoScrollTimer) {