Commit 6541b89d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto + const'ify

parent af49746a
Pipeline #64607 passed with stage
in 6 minutes and 56 seconds
......@@ -218,7 +218,7 @@ QMenu *RichTextEditor::mousePopupMenu(QPoint pos)
popup->addAction(autoSpellCheckAction);
if (checkSpellingEnabled() && d->activateLanguageMenu) {
QMenu *languagesMenu = new QMenu(i18n("Spell Checking Language"), popup);
auto languagesMenu = new QMenu(i18n("Spell Checking Language"), popup);
auto languagesGroup = new QActionGroup(languagesMenu);
languagesGroup->setExclusive(true);
......@@ -722,9 +722,10 @@ bool RichTextEditor::event(QEvent *ev)
void RichTextEditor::wheelEvent(QWheelEvent *event)
{
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
if (event->angleDelta().y() > 0) {
const int angleDeltaY{event->angleDelta().y()};
if (angleDeltaY > 0) {
zoomIn();
} else if (event->angleDelta().y() < 0) {
} else if (angleDeltaY < 0) {
zoomOut();
}
event->accept();
......@@ -938,7 +939,7 @@ void RichTextEditor::keyPressEvent(QKeyEvent *event)
int RichTextEditor::zoomFactor() const
{
int pourcentage = 100;
QFont f = font();
const QFont f = font();
if (d->mInitialFontSize != f.pointSize()) {
pourcentage = (f.pointSize() * 100) / d->mInitialFontSize;
}
......
......@@ -51,9 +51,9 @@ TextToSpeechWidget::TextToSpeechWidget(QWidget *parent)
hbox->addWidget(close);
hbox->addStretch(0);
QLabel *volume = new QLabel(i18n("Volume:"), this);
auto volume = new QLabel(i18n("Volume:"), this);
hbox->addWidget(volume);
d->mVolume = new QSlider;
d->mVolume = new QSlider(this);
d->mVolume->setMinimumWidth(100);
d->mVolume->setOrientation(Qt::Horizontal);
d->mVolume->setObjectName(QStringLiteral("volumeslider"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment