diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2018-11-11 12:24:06 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2018-11-12 17:10:11 +0000 |
commit | 7d56d89f255335511fb22ec43e047a0d2bb38a91 (patch) | |
tree | fcd9e84a4bd2372fbe1f6950524bf254daa26b9c /src/plugins/imageviewer/exportdialog.cpp | |
parent | 901b2be036618f562ecfc3bf48be58830609bfe7 (diff) |
ImageView: Modernize
modernize-*
Change-Id: I7fcffa4b455355cbcdc91f7e671e0a88f1091042
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/imageviewer/exportdialog.cpp')
-rw-r--r-- | src/plugins/imageviewer/exportdialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/imageviewer/exportdialog.cpp b/src/plugins/imageviewer/exportdialog.cpp index 1b641591315..f0c52aeebe4 100644 --- a/src/plugins/imageviewer/exportdialog.cpp +++ b/src/plugins/imageviewer/exportdialog.cpp @@ -88,18 +88,18 @@ ExportDialog::ExportDialog(QWidget *parent) , m_heightSpinBox(new QSpinBox(this)) , m_aspectRatio(1) { - typedef void (QSpinBox::*QSpinBoxIntSignal)(int); + using QSpinBoxIntSignal = void (QSpinBox::*)(int); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - QFormLayout *formLayout = new QFormLayout(this); + auto formLayout = new QFormLayout(this); m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5); m_pathChooser->setExpectedKind(Utils::PathChooser::SaveFile); m_pathChooser->setPromptDialogFilter(imageNameFilterString()); formLayout->addRow(tr("File:"), m_pathChooser); - QHBoxLayout *sizeLayout = new QHBoxLayout; + auto sizeLayout = new QHBoxLayout; m_widthSpinBox->setMinimum(exportMinimumSize); m_widthSpinBox->setMaximum(exportMaximumSize); connect(m_widthSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged), @@ -112,14 +112,14 @@ ExportDialog::ExportDialog(QWidget *parent) connect(m_heightSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged), this, &ExportDialog::exportHeightChanged); sizeLayout->addWidget(m_heightSpinBox); - QToolButton *resetButton = new QToolButton(this); + auto resetButton = new QToolButton(this); resetButton->setIcon(QIcon(QStringLiteral(":/qt-project.org/styles/commonstyle/images/refresh-32.png"))); sizeLayout->addWidget(resetButton); sizeLayout->addStretch(); connect(resetButton, &QAbstractButton::clicked, this, &ExportDialog::resetExportSize); formLayout->addRow(tr("Size:"), sizeLayout); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); + auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); formLayout->addRow(buttonBox); @@ -143,7 +143,7 @@ void ExportDialog::accept() QSize ExportDialog::exportSize() const { - return QSize(m_widthSpinBox->value(), m_heightSpinBox->value()); + return {m_widthSpinBox->value(), m_heightSpinBox->value()}; } void ExportDialog::setExportSize(const QSize &size) |