Double click in file tree open file
This commit is contained in:
@@ -122,3 +122,13 @@ void Filetree::contextMenuEvent(QContextMenuEvent *event)
|
||||
emit indexDirectory(m_fileSystemModel->filePath(index));
|
||||
}
|
||||
}
|
||||
|
||||
void Filetree::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
QModelIndex index = indexAt(event->pos());
|
||||
QFileInfo info = m_fileSystemModel->fileInfo(index);
|
||||
if(info.isFile())
|
||||
emit fileSelected(info.filePath());
|
||||
else
|
||||
QTreeView::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user