|
|
|
@ -28,23 +28,29 @@ class TabListView : public QListView |
|
|
|
public: |
|
|
|
public: |
|
|
|
explicit TabListView(QWidget *parent = nullptr); |
|
|
|
explicit TabListView(QWidget *parent = nullptr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isHidingWhenEmpty() const; |
|
|
|
|
|
|
|
void setHideWhenEmpty(bool enable); |
|
|
|
|
|
|
|
|
|
|
|
void updateIndex(const QModelIndex &index); |
|
|
|
void updateIndex(const QModelIndex &index); |
|
|
|
void adjustStyleOption(QStyleOptionViewItem *option); |
|
|
|
void adjustStyleOption(QStyleOptionViewItem *option); |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; |
|
|
|
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; |
|
|
|
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override; |
|
|
|
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override; |
|
|
|
|
|
|
|
void rowsInserted(const QModelIndex &parent, int start, int end) override; |
|
|
|
|
|
|
|
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; |
|
|
|
bool viewportEvent(QEvent *event) override; |
|
|
|
bool viewportEvent(QEvent *event) override; |
|
|
|
|
|
|
|
|
|
|
|
TabListDelegate *m_delegate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum DelegateButton { |
|
|
|
enum DelegateButton { |
|
|
|
NoButton, |
|
|
|
NoButton, |
|
|
|
AudioButton |
|
|
|
AudioButton |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
DelegateButton buttonAt(const QPoint &pos, const QModelIndex &index) const; |
|
|
|
DelegateButton buttonAt(const QPoint &pos, const QModelIndex &index) const; |
|
|
|
|
|
|
|
void updateVisibility(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TabListDelegate *m_delegate; |
|
|
|
DelegateButton m_pressedButton = NoButton; |
|
|
|
DelegateButton m_pressedButton = NoButton; |
|
|
|
QModelIndex m_pressedIndex; |
|
|
|
QModelIndex m_pressedIndex; |
|
|
|
|
|
|
|
bool m_hideWhenEmpty = false; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|