-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathapplicationsview.h
42 lines (37 loc) · 1.25 KB
/
applicationsview.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <QApplication>
#include <QDrag>
#include <QListView>
#include <QMimeData>
#include <QMouseEvent>
#include "common.h"
#include "itemdescriptiondelegate.h"
class ApplicationsView : public QListView
{
Q_OBJECT
public:
ApplicationsView(int iconSize, AppLayout::Layout layout = AppLayout::ListNameAndDescription, QWidget* parent = nullptr);
~ApplicationsView() = default;
void setDelegateDefault(bool isDefault);
void setAppLayout(int layout) { setAppLayout((AppLayout::Layout)layout); };
void setAppLayout(AppLayout::Layout layout);
// QSize sizeHint() const override;
private:
int mIconSize;
bool mFavorites;
AppLayout::Layout mAppLayout;
ItemDescriptionDelegate* mDelegate;
QPoint mDragStartPosition;
bool mDidDrag;
signals:
void indexClicked(const QModelIndex& index);
protected:
void keyPressEvent(QKeyEvent* e) override;
void mouseMoveEvent(QMouseEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* e) override;
void dragEnterEvent(QDragEnterEvent* e) override;
void dragMoveEvent(QDragMoveEvent* e) override;
void dragLeaveEvent(QDragLeaveEvent* e) override;
void dropEvent(QDropEvent* e) override;
};