Mercurial > minori
view 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 |
line wrap: on
line source
#ifndef __sidebar_h #define __sidebar_h #include <QListWidget> #include <QListWidgetItem> #include <QItemSelectionModel> class SideBar : public QListWidget { Q_OBJECT public: SideBar(QWidget *parent = nullptr); QListWidgetItem* AddItem(QString name, QIcon icon = QIcon()); QListWidgetItem* AddSeparator(); bool IndexIsSeparator(QModelIndex index) const; signals: void CurrentItemChanged(int index); protected: virtual void mouseMoveEvent(QMouseEvent* event) override; QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex & index, const QEvent * event) const override; int RemoveSeparatorsFromIndex(int index); }; #endif // __sidebar_h