Commit 256ec29c authored by Ludovic Fauvet's avatar Ludovic Fauvet Committed by Jean-Baptiste Kempf

A mouse click in an empty position clear the selection (see #1956)

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 39ef9e13
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
}; };
virtual ~QVLCTreeView() {}; virtual ~QVLCTreeView() {};
void mouseReleaseEvent(QMouseEvent* e ) void mouseReleaseEvent( QMouseEvent* e )
{ {
if( e->button() & Qt::RightButton ) if( e->button() & Qt::RightButton )
{ {
...@@ -84,6 +84,16 @@ public: ...@@ -84,6 +84,16 @@ public:
} }
QTreeView::mouseReleaseEvent( e ); QTreeView::mouseReleaseEvent( e );
} }
void mousePressEvent( QMouseEvent* e )
{
if( e->button() & Qt::LeftButton )
{
if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )
clearSelection();
}
QTreeView::mousePressEvent( e );
}
signals: signals:
void rightClicked( QModelIndex, QPoint ); void rightClicked( QModelIndex, QPoint );
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment