Third attempt for fixing the layout issue, this time without side effects and only with very minor performance overhead...

svn path=/trunk/KDE/kdebase/apps/; revision=791824
This commit is contained in:
Peter Penz 2008-03-30 13:19:01 +00:00
parent b6f970d355
commit e8cb5a292d
2 changed files with 15 additions and 0 deletions

View file

@ -133,6 +133,18 @@ DolphinIconsView::~DolphinIconsView()
m_categoryDrawer = 0;
}
void DolphinIconsView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
{
KCategorizedView::dataChanged(topLeft, bottomRight);
KCategorizedSortFilterProxyModel* proxyModel = dynamic_cast<KCategorizedSortFilterProxyModel*>(model());
if ((flow() == QListView::LeftToRight) && !proxyModel->isCategorizedModel()) {
// bypass a QListView issue that items are not layout correctly if the decoration size of
// an index changes
scheduleDelayedItemsLayout();
}
}
QStyleOptionViewItem DolphinIconsView::viewOptions() const
{
QStyleOptionViewItem viewOptions = KCategorizedView::viewOptions();

View file

@ -48,6 +48,9 @@ public:
explicit DolphinIconsView(QWidget* parent, DolphinController* controller);
virtual ~DolphinIconsView();
protected slots:
virtual void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
protected:
virtual QStyleOptionViewItem viewOptions() const;
virtual void contextMenuEvent(QContextMenuEvent* event);