-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfolderIconSelector.h
More file actions
48 lines (36 loc) · 1.04 KB
/
Copy pathfolderIconSelector.h
File metadata and controls
48 lines (36 loc) · 1.04 KB
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
43
44
45
46
47
48
#ifndef FOLDERICONSELECTOR_H
#define FOLDERICONSELECTOR_H
#include <QWidget>
#include <QFileIconProvider>
namespace Ui {
class FolderIconSelector;
}
class FolderIconSelector : public QWidget
{
Q_OBJECT
public:
explicit FolderIconSelector(const QString& dirPath, QWidget *parent = nullptr);
~FolderIconSelector();
void applySelectedIcon();
private:
// set Icon to Label
void setIcon(const QIcon& icon);
void openFolder();
void addIconCandidate(const QString& path);
void showActionFailed();
int findMatchedComboTextIndex(const QString& labelText);
signals:
void removeItems(QList<int> idxs);
private:
Ui::FolderIconSelector *ui;
const QString dirPath;
static QFileIconProvider iconPro;
// QObject interface
public:
virtual bool eventFilter(QObject* watched, QEvent* event) override;
// QWidget interface
protected:
virtual void contextMenuEvent(QContextMenuEvent* event) override;
virtual void mouseDoubleClickEvent(QMouseEvent* event) override;
};
#endif // FOLDERICONSELECTOR_H