Fix group mouse interaction issues

This commit is contained in:
Petr Mrázek
2014-02-02 14:27:43 +01:00
parent b2bf50a6d7
commit eb0ed082d8
4 changed files with 109 additions and 33 deletions

16
Group.h
View File

@@ -15,8 +15,6 @@ struct Group
GroupView *view;
QString text;
bool collapsed;
QRect iconRect;
QRect textRect;
QVector<int> rowHeights;
int firstRow;
@@ -29,8 +27,22 @@ struct Group
int numRows() const;
int top() const;
enum HitResult
{
NoHit = 0x0,
TextHit = 0x1,
CheckboxHit = 0x2,
HeaderHit = 0x4,
BodyHit = 0x8
};
Q_DECLARE_FLAGS(HitResults, HitResult)
HitResults pointIntersect (const QPoint &pos) const;
QList<QModelIndex> items() const;
int numItems() const;
QModelIndex firstItem() const;
QModelIndex lastItem() const;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Group::HitResults)