File indexing completed on 2024-04-21 15:00:14

0001 /*
0002     SPDX-FileCopyrightText: 2007 Peter Penz <peter.penz@gmx.at>
0003     SPDX-FileCopyrightText: 2019 Méven Car <meven.car@kdemail.net>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KDIROPERATORICONVIEW_P_H
0009 #define KDIROPERATORICONVIEW_P_H
0010 
0011 #include <QListView>
0012 
0013 /**
0014  * Default icon view for KDirOperator using
0015  * custom view options.
0016  */
0017 class KDirOperatorIconView : public QListView
0018 {
0019     Q_OBJECT
0020 public:
0021     KDirOperatorIconView(QWidget *parent = nullptr, QStyleOptionViewItem::Position decorationPosition = QStyleOptionViewItem::Position::Top);
0022     ~KDirOperatorIconView() override;
0023     void setDecorationPosition(QStyleOptionViewItem::Position decorationPosition);
0024 
0025 protected:
0026 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
0027     void initViewItemOption(QStyleOptionViewItem *option) const override;
0028 #else
0029     QStyleOptionViewItem viewOptions() const override;
0030 #endif
0031     void dragEnterEvent(QDragEnterEvent *event) override;
0032     void mousePressEvent(QMouseEvent *event) override;
0033     void wheelEvent(QWheelEvent *event) override;
0034     void resizeEvent(QResizeEvent *event) override;
0035 
0036 protected
0037     Q_SLOT : void updateLayout();
0038 
0039 private:
0040     QStyleOptionViewItem::Position decorationPosition;
0041 };
0042 
0043 #endif // KDIROPERATORICONVIEW_P_H