File indexing completed on 2024-04-28 15:26:39

0001 /*
0002     SPDX-FileCopyrightText: 2007 Peter Penz <peter.penz@gmx.at>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KDIROPERATORDETAILVIEW_P_H
0008 #define KDIROPERATORDETAILVIEW_P_H
0009 
0010 #include <QTreeView>
0011 
0012 #include <kfile.h>
0013 
0014 class QAbstractItemModel;
0015 
0016 /**
0017  * Default detail view for KDirOperator using
0018  * custom resizing options and columns.
0019  */
0020 class KDirOperatorDetailView : public QTreeView
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit KDirOperatorDetailView(QWidget *parent = nullptr);
0026     ~KDirOperatorDetailView() override;
0027 
0028     /**
0029      * Displays either Detail, Tree or DetailTree modes.
0030      */
0031     virtual bool setViewMode(KFile::FileView viewMode);
0032 
0033 protected:
0034 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
0035     void initViewItemOption(QStyleOptionViewItem *option) const override;
0036 #else
0037     QStyleOptionViewItem viewOptions() const override;
0038 #endif
0039 
0040     bool event(QEvent *event) override;
0041     void dragEnterEvent(QDragEnterEvent *event) override;
0042     void mousePressEvent(QMouseEvent *event) override;
0043     void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
0044 
0045 private:
0046     bool m_hideDetailColumns;
0047 };
0048 
0049 #endif