aboutsummaryrefslogtreecommitdiff
path: root/CategorizedView.h
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-12-30 18:45:40 +0100
committerJan Dalheimer <jan@dalheimer.de>2013-12-30 18:45:40 +0100
commit4662fbd29891ccb9120df82d17a34a7619242827 (patch)
tree91332b6388f547a0c641edab163e216a58cc79b7 /CategorizedView.h
parent01092206783f74ce14f31d328cdac025fd90fe16 (diff)
downloadPrismLauncher-4662fbd29891ccb9120df82d17a34a7619242827.tar.gz
PrismLauncher-4662fbd29891ccb9120df82d17a34a7619242827.tar.bz2
PrismLauncher-4662fbd29891ccb9120df82d17a34a7619242827.zip
Make the MultiMC delegate fully usable. Dynamic row heights.
Diffstat (limited to 'CategorizedView.h')
-rw-r--r--CategorizedView.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/CategorizedView.h b/CategorizedView.h
index 0756629a..e98e7c5e 100644
--- a/CategorizedView.h
+++ b/CategorizedView.h
@@ -91,9 +91,10 @@ private:
QList<Category *> sortedCategories() const;
private:
- mutable QSize m_cachedItemSize;
- QSize itemSize(const QStyleOptionViewItem &option) const;
- QSize itemSize() const { return itemSize(viewOptions()); }
+ mutable int m_cachedItemWidth;
+ mutable QCache<QModelIndex, QSize> m_cachedItemSizes;
+ int itemWidth() const;
+ QSize itemSize(const QModelIndex &index) const;
/*QLineEdit *m_categoryEditor;
Category *m_editedCategory;
@@ -110,6 +111,8 @@ private:
QItemSelectionModel::SelectionFlag m_ctrlDragSelectionFlag;
QPoint m_lastDragPosition;
+ QPair<int, int> categoryInternalPosition(const QModelIndex &index) const;
+
QPixmap renderToPixmap(const QModelIndexList &indices, QRect *r) const;
QList<QPair<QRect, QModelIndex> > draggablePaintPairs(const QModelIndexList &indices, QRect *r) const;