123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef STANDARDMANAGEVIEW_H
- #define STANDARDMANAGEVIEW_H
- #include <QFileSystemModel>
- #include <QStyledItemDelegate>
- #include <QTreeView>
- #include <QWidget>
- class CDelegate : public QStyledItemDelegate
- {
- Q_OBJECT
- public:
- CDelegate(QObject *parent) : QStyledItemDelegate(parent) { }
- protected:
- QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
- {
- QSize size = QStyledItemDelegate::sizeHint(option, index);
- return QSize(size.width(), 35);
- }
- };
- class StandardManageView : public QWidget
- {
- Q_OBJECT
- public:
- explicit StandardManageView(QWidget *parent = nullptr);
- signals:
- private:
- QFileSystemModel *m_fileModel;
- QTreeView *m_treeView;
- QString m_dir;
- // QWidget interface
- protected:
- virtual void resizeEvent(QResizeEvent *event) override;
- private slots:
- void onDoubleClick(const QModelIndex &index);
- };
- #endif // STANDARDMANAGEVIEW_H
|