When enabling a group where the sort-role is retrieved
asynchronously (e.g. group by "type") the group-headers have
stayed invisible.
}
if (!changedRoles.isEmpty()) {
}
if (!changedRoles.isEmpty()) {
+ if (groupedSorting() && changedRoles.contains(sortRole())) {
+ m_groups.clear();
+ }
m_data[index] = currentValue;
emit itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
}
m_data[index] = currentValue;
emit itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
}
+ doLayout(Animation, 0, 0);
onScrollOrientationChanged(orientation, previousOrientation);
emit scrollOrientationChanged(orientation, previousOrientation);
onScrollOrientationChanged(orientation, previousOrientation);
emit scrollOrientationChanged(orientation, previousOrientation);
}
m_sizeHintResolver->clearCache();
}
m_sizeHintResolver->clearCache();
+ doLayout(Animation, 0, 0);
onItemSizeChanged(itemSize, previousSize);
}
onItemSizeChanged(itemSize, previousSize);
}
m_animation->setScrollOffset(offset);
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
m_animation->setScrollOffset(offset);
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
}
onScrollOffsetChanged(offset, previousOffset);
}
}
onScrollOffsetChanged(offset, previousOffset);
}
}
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
}
if (!m_layoutTimer->isActive()) {
doLayout(NoAnimation, 0, 0);
}
updateVisibleRolesSizes();
}
updateVisibleRolesSizes();
+ doLayout(Animation, 0, 0);
onVisibleRolesChanged(roles, previousRoles);
}
onVisibleRolesChanged(roles, previousRoles);
}
}
m_sizeHintResolver->clearCache();
}
m_sizeHintResolver->clearCache();
+ doLayout(Animation, 0, 0);
onStyleOptionChanged(option, previousOption);
}
onStyleOptionChanged(option, previousOption);
}
if (m_activeTransactions == 0) {
onTransactionEnd();
if (m_activeTransactions == 0) {
onTransactionEnd();
+ doLayout(Animation, 0, 0);
if (updateSizeHints) {
m_sizeHintResolver->itemsChanged(index, count, roles);
m_layouter->markAsDirty();
if (updateSizeHints) {
m_sizeHintResolver->itemsChanged(index, count, roles);
m_layouter->markAsDirty();
if (!m_layoutTimer->isActive()) {
m_layoutTimer->start();
}
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;
}
}
void KItemListView::slotGroupedSortingChanged(bool current)
{
m_grouped = current;
+ m_layouter->markAsDirty();
if (m_grouped) {
// Apply the height of the header to the layouter
if (m_grouped) {
// Apply the height of the header to the layouter
m_styleOption.margin * 2;
m_layouter->setGroupHeaderHeight(groupHeaderHeight);
m_styleOption.margin * 2;
m_layouter->setGroupHeaderHeight(groupHeaderHeight);
- updateVisibleGroupHeaders(); // Triggers updateLayout()
+ updateVisibleGroupHeaders();
- m_layouter->markAsDirty();
-
// Clear all visible headers
QMutableHashIterator<KItemListWidget*, KItemListGroupHeader*> it (m_visibleGroups);
while (it.hasNext()) {
// Clear all visible headers
QMutableHashIterator<KItemListWidget*, KItemListGroupHeader*> it (m_visibleGroups);
while (it.hasNext()) {
recycleGroupHeaderForWidget(it.key());
}
Q_ASSERT(m_visibleGroups.isEmpty());
recycleGroupHeaderForWidget(it.key());
}
Q_ASSERT(m_visibleGroups.isEmpty());
+
+ doLayout(Animation, 0, 0);
}
void KItemListView::slotSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous)
}
void KItemListView::slotSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous)
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
+ doLayout(Animation, 0, 0);
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
Q_UNUSED(previous);
if (m_grouped) {
updateVisibleGroupHeaders();
+ doLayout(Animation, 0, 0);
widget->setVisibleRolesSizes(m_stretchedVisibleRolesSizes);
}
widget->setVisibleRolesSizes(m_stretchedVisibleRolesSizes);
}
+ doLayout(Animation, 0, 0);
-void KItemListView::updateLayout()
-{
- doLayout(Animation, 0, 0);
- update();
-}
-
void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int changedCount)
{
if (m_layoutTimer->isActive()) {
void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int changedCount)
{
if (m_layoutTimer->isActive()) {
it.next();
updateGroupHeaderForWidget(it.value());
}
it.next();
updateGroupHeaderForWidget(it.value());
}
}
QHash<QByteArray, qreal> KItemListView::headerRolesWidths() const
}
QHash<QByteArray, qreal> KItemListView::headerRolesWidths() const
KItemListRubberBand* rubberBand() const;
KItemListRubberBand* rubberBand() const;
void doLayout(LayoutAnimationHint hint, int changedIndex, int changedCount);
void doGroupHeadersLayout(LayoutAnimationHint hint, int changedIndex, int changedCount);
void emitOffsetChanges();
void doLayout(LayoutAnimationHint hint, int changedIndex, int changedCount);
void doGroupHeadersLayout(LayoutAnimationHint hint, int changedIndex, int changedCount);
void emitOffsetChanges();