1 | /* |
2 | SPDX-FileCopyrightText: 2007 Peter Penz <peter.penz@gmx.at> |
3 | SPDX-FileCopyrightText: 2019 Méven Car <meven.car@kdemail.net> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only |
6 | */ |
7 | |
8 | #ifndef KDIROPERATORICONVIEW_P_H |
9 | #define KDIROPERATORICONVIEW_P_H |
10 | |
11 | #include <QListView> |
12 | |
13 | /** |
14 | * Default icon view for KDirOperator using |
15 | * custom view options. |
16 | */ |
17 | class KDirOperatorIconView : public QListView |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | KDirOperatorIconView(QWidget *parent = nullptr, QStyleOptionViewItem::Position decorationPosition = QStyleOptionViewItem::Position::Top); |
22 | ~KDirOperatorIconView() override; |
23 | void setDecorationPosition(QStyleOptionViewItem::Position decorationPosition); |
24 | |
25 | protected: |
26 | void initViewItemOption(QStyleOptionViewItem *option) const override; |
27 | void dragEnterEvent(QDragEnterEvent *event) override; |
28 | void mousePressEvent(QMouseEvent *event) override; |
29 | void wheelEvent(QWheelEvent *event) override; |
30 | void resizeEvent(QResizeEvent *event) override; |
31 | |
32 | protected |
33 | Q_SLOT : void updateLayout(); |
34 | |
35 | private: |
36 | QStyleOptionViewItem::Position decorationPosition; |
37 | }; |
38 | |
39 | #endif // KDIROPERATORICONVIEW_P_H |
40 | |