annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #ifndef __sidebar_h
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #define __sidebar_h
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <QListWidget>
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
4 #include <QListWidgetItem>
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
5 #include <QItemSelectionModel>
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 class SideBar : public QListWidget {
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
7 Q_OBJECT
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
8
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 SideBar(QWidget *parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 QListWidgetItem* AddItem(QString name, QIcon icon = QIcon());
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 QListWidgetItem* AddSeparator();
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
13 bool IndexIsSeparator(QModelIndex index) const;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
14
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
15 signals:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
16 void CurrentItemChanged(int index);
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
17
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
18 protected:
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
19 virtual void mouseMoveEvent(QMouseEvent* event) override;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
20 QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex & index, const QEvent * event) const override;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
21 int RemoveSeparatorsFromIndex(int index);
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 #endif // __sidebar_h