FileBrowser: Backup expanded directories and restore that state when the tree is reloaded.

This commit is contained in:
CYBERDEViLNL
2019-04-03 19:54:01 +02:00
committed by Johannes Lorenz
parent 96cc5e0e5e
commit 407444ea1d
2 changed files with 38 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ public:
private slots:
void reloadTree( void );
void expandItems( QTreeWidgetItem * item=NULL );
void expandItems( QTreeWidgetItem * item=NULL, QList<QString> expandedDirs = QList<QString>() );
// call with item=NULL to filter the entire tree
bool filterItems( const QString & filter, QTreeWidgetItem * item=NULL );
void giveFocusToFilter();
@@ -87,6 +87,10 @@ public:
FileBrowserTreeWidget( QWidget * parent );
virtual ~FileBrowserTreeWidget() = default;
//! This method returns a QList with paths (QString's) of all directories
//! that are expanded in the tree.
QList<QString> expandedDirs( QTreeWidgetItem * item = nullptr ) const;
protected:
virtual void contextMenuEvent( QContextMenuEvent * e );