-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
99 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <QLoggingCategory> | ||
#include <QFileSystemModel> | ||
#include "FileBroserTreeView.h" | ||
|
||
static Q_LOGGING_CATEGORY(log, "RabbitCommon.Browser.File.TreeView") | ||
CFileBroserTreeView::CFileBroserTreeView(QWidget *parent) : QTreeView(parent) | ||
{} | ||
|
||
CFileBroserTreeView::~CFileBroserTreeView() | ||
{ | ||
qDebug(log) << "CFileBroserTreeView::~CFileBroserTreeView()"; | ||
} | ||
|
||
void CFileBroserTreeView::selectionChanged( | ||
const QItemSelection &selected, const QItemSelection &deselected) | ||
{ | ||
} | ||
|
||
void CFileBroserTreeView::currentChanged( | ||
const QModelIndex ¤t, const QModelIndex &previous) | ||
{ | ||
QFileSystemModel* pModel = qobject_cast<QFileSystemModel*>(model()); | ||
if(!pModel) return; | ||
emit sigChanged(pModel->filePath(current), pModel->isDir(current)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef FILEBROSERTREEVIEW_H | ||
#define FILEBROSERTREEVIEW_H | ||
|
||
#include <QObject> | ||
#include <QTreeView> | ||
|
||
class CFileBroserTreeView : public QTreeView | ||
{ | ||
Q_OBJECT | ||
public: | ||
CFileBroserTreeView(QWidget *parent = nullptr); | ||
virtual ~CFileBroserTreeView(); | ||
|
||
Q_SIGNALS: | ||
void sigChanged(const QString &szItem, bool bDir); | ||
|
||
// QAbstractItemView interface | ||
protected slots: | ||
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; | ||
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; | ||
}; | ||
|
||
#endif // FILEBROSERTREEVIEW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters