mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 23:44:52 -04:00
added clear selection to YACReaderTreeView if a mouse click is received in a place without a valid model index
This commit is contained in:
@ -91,6 +91,18 @@ YACReaderTreeView::YACReaderTreeView(QWidget *parent) :
|
||||
|
||||
}
|
||||
|
||||
void YACReaderTreeView::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QTreeView::mousePressEvent(event);
|
||||
|
||||
QModelIndex destinationIndex = indexAt(event->pos());
|
||||
|
||||
if(!destinationIndex.isValid() && event->button() == Qt::LeftButton)
|
||||
{
|
||||
clearSelection();
|
||||
}
|
||||
}
|
||||
|
||||
void YACReaderTreeView::expandCurrent()
|
||||
{
|
||||
QModelIndex index = indexAt(expandPos);
|
||||
|
Reference in New Issue
Block a user