Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
FavoriteView.h
1#ifndef CFAVORITEVIEW_H
2#define CFAVORITEVIEW_H
3
4#include <QTreeView>
5#include <QStandardItem>
6#include "TitleBar.h"
7
8class CFavoriteView : public QTreeView
9{
10 Q_OBJECT
11public:
12 explicit CFavoriteView(QWidget *parent = nullptr);
13 virtual ~CFavoriteView();
14
15 RabbitCommon::CTitleBar* m_pDockTitleBar;
16 int AddFavorite(const QString& szName, const QString &szFile);
17
18Q_SIGNALS:
19 void sigConnect(const QString &szFile, bool bOpenSettings);
20 void sigFavorite();
21
22 // QWidget interface
23protected:
24 virtual void dragEnterEvent(QDragEnterEvent *event) override;
25 virtual void dragMoveEvent(QDragMoveEvent *event) override;
26 virtual void dropEvent(QDropEvent *event) override;
27
28 virtual void mousePressEvent(QMouseEvent *event) override;
29 virtual void mouseMoveEvent(QMouseEvent *event) override;
30
31private slots:
32 void slotFavrtieClicked(const QModelIndex &index);
33 void slotFavortiedoubleClicked(const QModelIndex &index);
34 void slotCustomContextMenu(const QPoint &pos);
35 void slotConnect();
36 void slotOpenConnect();
37 void slotDelete();
38 void slotNewGroup();
39 void slotDoubleEditNode(bool bEdit);
40 void slotMenu();
41
42private:
43 QStandardItemModel* m_pModel;
44 QString m_szSaveFile;
45
46 QPoint m_DragStartPosition;
47
48 QMenu* m_pMenu;
49
50 QStandardItem* NewItem(const QModelIndex &index);
51 int Save();
52};
53
54#endif // CFAVORITEVIEW_H