Skip to content
Snippets Groups Projects
Commit 6b06501a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

override vs virtual or final [cppcoreguidelines-explicit-virtual-functions]

parent 51de7f86
No related branches found
No related tags found
1 merge request!453further corrections suggested by clang-tidy
......@@ -38,7 +38,7 @@ public:
protected:
void paint(QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const
const QModelIndex& index) const override
{
ItemDelegateForHTML::paint(painter, option, index);
......@@ -53,7 +53,7 @@ protected:
painter->restore();
}
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override
{
auto s = ItemDelegateForHTML::sizeHint(option, index);
s.setHeight(std::max(s.height(), 32));
......
......@@ -35,14 +35,14 @@ public:
explicit FilterEdit(QWidget* parent = 0) : QLineEdit(parent) { setFocusPolicy(Qt::NoFocus); }
protected:
virtual void mousePressEvent(QMouseEvent* event)
void mousePressEvent(QMouseEvent* event) override
{
if (!hasFocus()) // Explicitly focus on click.
setFocus(Qt::OtherFocusReason);
QLineEdit::mousePressEvent(event);
}
virtual void focusInEvent(QFocusEvent* e)
virtual void focusInEvent(QFocusEvent* e) override
{
// Refuse the focus if the mouse it outside. In addition to the mouse
// press logic, this prevents a re-focussing which occurs once
......
......@@ -43,9 +43,9 @@ public:
};
// QAbstractListModel
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override;
virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
// The model returns no text in icon mode, so, it also needs to know the view mode
void setViewMode(QListView::ViewMode viewMode);
......
......@@ -34,8 +34,8 @@ class GroupTitleDelegate : public QItemDelegate {
public:
GroupTitleDelegate(QTreeView* view, QWidget* parent) : QItemDelegate(parent), m_view(view) {}
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const override
void paint(QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const override
{
const QAbstractItemModel* model = index.model();
const bool isGroupTitleItem = !model->parent(index).isValid();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment