Group View: Use painting code from the previous group headers, small optimizations

This commit is contained in:
Petr Mrázek
2014-02-08 21:46:29 +01:00
parent 573d4c8050
commit aa41b891f0
3 changed files with 117 additions and 19 deletions

View File

@ -16,18 +16,19 @@ struct Group
Group(const Group *other);
/* data */
GroupView *view;
GroupView *view = nullptr;
QString text;
bool collapsed;
bool collapsed = false;
QVector<int> rowHeights;
int firstItemIndex;
int firstItemIndex = 0;
int m_verticalPosition = 0;
/* logic */
/// do stuff. and things. TODO: redo.
void update();
/// draw the header at y-position.
void drawHeader(QPainter *painter, const QStyleOptionViewItem &option, const int y);
void drawHeader(QPainter *painter, const QStyleOptionViewItem &option);
/// height of the group, in total. includes a small bit of padding.
int totalHeight() const;