 class DeselectableTreeView : public QTreeView { public:     DeselectableTreeView(QWidget *parent) : QTreeView(parent) {}     virtual ~DeselectableTreeView() {}  private:     virtual void mousePressEvent(QMouseEvent *event)     {         QModelIndex item = indexAt(event->pos());         bool selected = selectionModel()->isSelected(i