Fix groupview issues

* indexAt was using the wrong coordinate system
* model events now trigger a delayed layout update instead of immediate.
This commit is contained in:
Petr Mrázek
2014-02-10 00:51:52 +01:00
parent 2f0275c194
commit 5a0e7877b0
2 changed files with 26 additions and 27 deletions

View File

@ -24,9 +24,12 @@ public:
GroupView(QWidget *parent = 0);
~GroupView();
/// return geometry rectangle occupied by the specified model item
QRect geometryRect(const QModelIndex &index) const;
/// return visual rectangle occupied by the specified model item
virtual QRect visualRect(const QModelIndex &index) const override;
QModelIndex indexAt(const QPoint &point) const;
/// get the model index at the specified visual point
virtual QModelIndex indexAt(const QPoint &point) const override;
void setSelection(const QRect &rect,
const QItemSelectionModel::SelectionFlags commands) override;
@ -114,6 +117,7 @@ private slots:
void endCategoryEditor();*/
private: /* variables */
/// point where the currently active mouse action started in geometry coordinates
QPoint m_pressedPosition;
QPersistentModelIndex m_pressedIndex;
bool m_pressedAlreadySelected;