From 740e9569327c0026257dfcea38ab2efac4a29d67 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 24 Sep 2011 00:18:09 +0200 Subject: Fix size-hint calculation in KFileItemListView The current approach works fine but should be replaced in the longterm by a helper class shared by KFileItemListWidget and KFileItemListView to share information that is required to calculate the size hints in KFileItemListView and to represent the actual data in KFileItemListWidget. --- src/kitemviews/kfileitemlistwidget.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/kitemviews/kfileitemlistwidget.h') diff --git a/src/kitemviews/kfileitemlistwidget.h b/src/kitemviews/kfileitemlistwidget.h index 4f1cf1133..71c57ea73 100644 --- a/src/kitemviews/kfileitemlistwidget.h +++ b/src/kitemviews/kfileitemlistwidget.h @@ -52,6 +52,14 @@ public: virtual QRectF textBoundingRect() const; virtual QRectF expansionToggleRect() const; + /** + * @return Shown string for the role \p role of the item with the values \p values. + */ + // TODO: Move this method to a helper class shared by KFileItemListWidget and + // KFileItemListView to share information that is required to calculate the size hints + // in KFileItemListView and to represent the actual data in KFileItemListWidget. + static QString roleText(const QByteArray& role, const QHash& values); + protected: /** * Invalidates the cache which results in calling KFileItemListWidget::refreshCache() as @@ -103,8 +111,6 @@ private: void updateAdditionalInfoTextColor(); - QString roleText(TextId textId, const QVariant& roleValue) const; - void drawPixmap(QPainter* painter, const QPixmap& pixmap); static QPixmap pixmapForIcon(const QString& name, int size); -- cgit v1.3.1