Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kdiroperatoriconview_p.h
- This file was added.
1 | /***************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at> * | ||||
3 | * Copyright (C) 2019 by Méven Car <meven.car@kdemail.net> * | ||||
4 | * This library is free software; you can redistribute it and/or * | ||||
5 | * modify it under the terms of the GNU Library General Public * | ||||
6 | * License version 2 as published by the Free Software Foundation. * | ||||
7 | * * | ||||
8 | * This library is distributed in the hope that it will be useful, * | ||||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||||
11 | * Library General Public License for more details. * | ||||
12 | * * | ||||
13 | * You should have received a copy of the GNU Library General Public License * | ||||
14 | * along with this library; see the file COPYING.LIB. If not, write to * | ||||
15 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||||
16 | * Boston, MA 02110-1301, USA. * | ||||
17 | *****************************************************************************/ | ||||
18 | | ||||
19 | #ifndef KDIROPERATORICONVIEW_P_H | ||||
20 | #define KDIROPERATORICONVIEW_P_H | ||||
21 | | ||||
22 | #include <QListView> | ||||
23 | | ||||
24 | /** | ||||
25 | * Default icon view for KDirOperator using | ||||
26 | * custom view options. | ||||
27 | */ | ||||
28 | class KDirOperatorIconView : public QListView | ||||
29 | { | ||||
30 | Q_OBJECT | ||||
31 | public: | ||||
32 | KDirOperatorIconView(QWidget *parent = nullptr, QStyleOptionViewItem::Position decorationPosition = QStyleOptionViewItem::Position::Top); | ||||
33 | virtual ~KDirOperatorIconView(); | ||||
34 | void setDecorationPosition(QStyleOptionViewItem::Position decorationPosition); | ||||
35 | | ||||
36 | protected: | ||||
37 | QStyleOptionViewItem viewOptions() const override; | ||||
38 | void dragEnterEvent(QDragEnterEvent *event) override; | ||||
39 | void mousePressEvent(QMouseEvent *event) override; | ||||
40 | void wheelEvent(QWheelEvent *event) override; | ||||
41 | void resizeEvent(QResizeEvent *event) override; | ||||
42 | | ||||
43 | protected Q_SLOT: | ||||
44 | void updateLayout(); | ||||
45 | private: | ||||
46 | QStyleOptionViewItem::Position decorationPosition; | ||||
47 | }; | ||||
48 | | ||||
49 | | ||||
50 | #endif // KDIROPERATORICONVIEW_P_H |