Mercurial > minori
comparison src/gui/sidebar.cpp @ 11:fc1bf97c528b
*: use C++11 standard
I've been meaning to do this for a while, but I didn't want to reimplement
the filesystem code. Now we are on C++11 and most compilers from the past 5 centuries should support this now
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 17 Sep 2023 06:14:30 -0400 |
parents | 5c0397762b53 |
children | cde8f67a7c7d |
comparison
equal
deleted
inserted
replaced
10:4b198a111713 | 11:fc1bf97c528b |
---|---|
59 | 59 |
60 bool SideBar::IndexIsSeparator(QModelIndex index) const { | 60 bool SideBar::IndexIsSeparator(QModelIndex index) const { |
61 return !(index.isValid() && index.flags() & Qt::ItemIsEnabled); | 61 return !(index.isValid() && index.flags() & Qt::ItemIsEnabled); |
62 } | 62 } |
63 | 63 |
64 QItemSelectionModel::SelectionFlags SideBar::selectionCommand(const QModelIndex& index, const QEvent* event) const { | 64 QItemSelectionModel::SelectionFlags SideBar::selectionCommand(const QModelIndex& index, const QEvent*) const { |
65 if (IndexIsSeparator(index)) | 65 if (IndexIsSeparator(index)) |
66 return QItemSelectionModel::NoUpdate; | 66 return QItemSelectionModel::NoUpdate; |
67 return QItemSelectionModel::ClearAndSelect; | 67 return QItemSelectionModel::ClearAndSelect; |
68 /* silence unused parameter warnings */ | |
69 (void)event; | |
70 } | 68 } |
71 | 69 |
72 void SideBar::mouseMoveEvent(QMouseEvent* event) { | 70 void SideBar::mouseMoveEvent(QMouseEvent* event) { |
73 if (!IndexIsSeparator(indexAt(event->pos()))) | 71 if (!IndexIsSeparator(indexAt(event->pos()))) |
74 setCursor(Qt::PointingHandCursor); | 72 setCursor(Qt::PointingHandCursor); |