TextEditor: Modernize

override, auto, nullptr, member initializers.

Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2018-09-20 01:16:01 +03:00
committed by Orgad Shaneh
parent 439bc225e1
commit 41dee83bec
63 changed files with 261 additions and 342 deletions

View File

@@ -64,8 +64,8 @@ class ModelAdapter : public QAbstractListModel
public:
ModelAdapter(GenericProposalModelPtr completionModel, QWidget *parent);
virtual int rowCount(const QModelIndex &) const;
virtual QVariant data(const QModelIndex &index, int role) const;
int rowCount(const QModelIndex &) const override;
QVariant data(const QModelIndex &index, int role) const override;
private:
GenericProposalModelPtr m_completionModel;
@@ -102,10 +102,10 @@ QVariant ModelAdapter::data(const QModelIndex &index, int role) const
class GenericProposalInfoFrame : public FakeToolTip
{
public:
GenericProposalInfoFrame(QWidget *parent = 0)
GenericProposalInfoFrame(QWidget *parent = nullptr)
: FakeToolTip(parent), m_label(new QLabel(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(m_label);
@@ -297,7 +297,7 @@ GenericProposalWidget::GenericProposalWidget()
connect(d->m_completionListView->verticalScrollBar(), &QAbstractSlider::sliderReleased,
this, &GenericProposalWidget::turnOnAutoWidth);
QVBoxLayout *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->addWidget(d->m_completionListView);
@@ -501,7 +501,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
d->m_infoFrame->close();
return true;
} else if (e->type() == QEvent::ShortcutOverride) {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
auto ke = static_cast<QKeyEvent *>(e);
switch (ke->key()) {
case Qt::Key_N:
case Qt::Key_P:
@@ -511,7 +511,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
}
}
} else if (e->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
auto ke = static_cast<QKeyEvent *>(e);
switch (ke->key()) {
case Qt::Key_Escape:
abort();