comparison src/include/sidebar.h @ 7:07a9095eaeed

Update Refactored some code, moved some around
author Paper <mrpapersonic@gmail.com>
date Thu, 24 Aug 2023 23:11:38 -0400
parents 1d82f6e04d7d
children
comparison
equal deleted inserted replaced
6:1d82f6e04d7d 7:07a9095eaeed
1 #ifndef __sidebar_h 1 #ifndef __sidebar_h
2 #define __sidebar_h 2 #define __sidebar_h
3 #include <QListWidget> 3 #include <QListWidget>
4 #include <QListWidgetItem>
5 #include <QItemSelectionModel>
4 class SideBar : public QListWidget { 6 class SideBar : public QListWidget {
7 Q_OBJECT
8
5 public: 9 public:
6 SideBar(QWidget *parent = nullptr); 10 SideBar(QWidget *parent = nullptr);
7 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon()); 11 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon());
8 QListWidgetItem* AddSeparator(); 12 QListWidgetItem* AddSeparator();
13 bool IndexIsSeparator(QModelIndex index) const;
14
15 signals:
16 void CurrentItemChanged(int index);
17
18 protected:
19 virtual void mouseMoveEvent(QMouseEvent* event) override;
20 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex & index, const QEvent * event) const override;
21 int RemoveSeparatorsFromIndex(int index);
9 }; 22 };
10 #endif // __sidebar_h 23 #endif // __sidebar_h