}
}
- updateLayout();
+ doLayout(Animation, 0, 0);
onScrollOrientationChanged(orientation, previousOrientation);
emit scrollOrientationChanged(orientation, previousOrientation);
}
m_sizeHintResolver->clearCache();
- updateLayout();
+ doLayout(Animation, 0, 0);
onItemSizeChanged(itemSize, previousSize);
}
m_animation->setScrollOffset(offset);
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
- update();
}
onScrollOffsetChanged(offset, previousOffset);
}
}
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
- update();
}
}
}
updateVisibleRolesSizes();
- updateLayout();
+ doLayout(Animation, 0, 0);
onVisibleRolesChanged(roles, previousRoles);
}
}
m_sizeHintResolver->clearCache();
- updateLayout();
+ doLayout(Animation, 0, 0);
onStyleOptionChanged(option, previousOption);
}
if (m_activeTransactions == 0) {
onTransactionEnd();
- updateLayout();
+ doLayout(Animation, 0, 0);
}
}
if (updateSizeHints) {
m_sizeHintResolver->itemsChanged(index, count, roles);
m_layouter->markAsDirty();
+
if (!m_layoutTimer->isActive()) {
m_layoutTimer->start();
}
}
}
+ if (m_grouped && roles.contains(m_model->sortRole())) {
+ // The sort-role has been changed which might result
+ // in modified group headers
+ updateVisibleGroupHeaders();
+ doLayout(NoAnimation, 0, 0);
+ if (!m_layoutTimer->isActive()) {
+ m_layoutTimer->start();
+ }
+ }
}
}
void KItemListView::slotGroupedSortingChanged(bool current)
{
m_grouped = current;
+ m_layouter->markAsDirty();
if (m_grouped) {
// Apply the height of the header to the layouter
m_styleOption.margin * 2;
m_layouter->setGroupHeaderHeight(groupHeaderHeight);
- updateVisibleGroupHeaders(); // Triggers updateLayout()
+ updateVisibleGroupHeaders();
} else {
- m_layouter->markAsDirty();
-
// Clear all visible headers
QMutableHashIterator<KItemListWidget*, KItemListGroupHeader*> it (m_visibleGroups);
while (it.hasNext()) {
recycleGroupHeaderForWidget(it.key());
}
Q_ASSERT(m_visibleGroups.isEmpty());
-
- updateLayout();
}
+
+ doLayout(Animation, 0, 0);
}
void KItemListView::slotSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous)
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
+ doLayout(Animation, 0, 0);
}
}
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
+ doLayout(Animation, 0, 0);
}
}
widget->setVisibleRolesSizes(m_stretchedVisibleRolesSizes);
}
- updateLayout();
+ doLayout(Animation, 0, 0);
}
}
return m_rubberBand;
}
-void KItemListView::updateLayout()
-{
- doLayout(Animation, 0, 0);
- update();
-}
-
void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int changedCount)
{
if (m_layoutTimer->isActive()) {
it.next();
updateGroupHeaderForWidget(it.value());
}
-
- updateLayout();
}
QHash<QByteArray, qreal> KItemListView::headerRolesWidths() const