diff options
Diffstat (limited to 'src/libs/utils/checkablemessagebox.cpp')
-rw-r--r-- | src/libs/utils/checkablemessagebox.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp index 8813db0bea9..70413886faa 100644 --- a/src/libs/utils/checkablemessagebox.cpp +++ b/src/libs/utils/checkablemessagebox.cpp @@ -52,7 +52,6 @@ class CheckableMessageBoxPrivate { public: CheckableMessageBoxPrivate(QDialog *q) - : clickedButton(0) { QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); @@ -63,7 +62,7 @@ public: pixmapLabel->setSizePolicy(sizePolicy); pixmapLabel->setVisible(false); - QSpacerItem *pixmapSpacer = + auto pixmapSpacer = new QSpacerItem(0, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); messageLabel = new QLabel(q); @@ -72,9 +71,9 @@ public: messageLabel->setOpenExternalLinks(true); messageLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse); - QSpacerItem *checkBoxRightSpacer = + auto checkBoxRightSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum); - QSpacerItem *buttonSpacer = + auto buttonSpacer = new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Minimum); checkBox = new QCheckBox(q); @@ -84,30 +83,30 @@ public: buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - QVBoxLayout *verticalLayout = new QVBoxLayout(); + auto verticalLayout = new QVBoxLayout(); verticalLayout->addWidget(pixmapLabel); verticalLayout->addItem(pixmapSpacer); - QHBoxLayout *horizontalLayout_2 = new QHBoxLayout(); + auto horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->addLayout(verticalLayout); horizontalLayout_2->addWidget(messageLabel); - QHBoxLayout *horizontalLayout = new QHBoxLayout(); + auto horizontalLayout = new QHBoxLayout(); horizontalLayout->addWidget(checkBox); horizontalLayout->addItem(checkBoxRightSpacer); - QVBoxLayout *verticalLayout_2 = new QVBoxLayout(q); + auto verticalLayout_2 = new QVBoxLayout(q); verticalLayout_2->addLayout(horizontalLayout_2); verticalLayout_2->addLayout(horizontalLayout); verticalLayout_2->addItem(buttonSpacer); verticalLayout_2->addWidget(buttonBox); } - QLabel *pixmapLabel; - QLabel *messageLabel; - QCheckBox *checkBox; - QDialogButtonBox *buttonBox; - QAbstractButton *clickedButton; + QLabel *pixmapLabel = nullptr; + QLabel *messageLabel = nullptr; + QCheckBox *checkBox = nullptr; + QDialogButtonBox *buttonBox = nullptr; + QAbstractButton *clickedButton = nullptr; }; CheckableMessageBox::CheckableMessageBox(QWidget *parent) : @@ -215,7 +214,7 @@ QPushButton *CheckableMessageBox::addButton(const QString &text, QDialogButtonBo QDialogButtonBox::StandardButton CheckableMessageBox::defaultButton() const { foreach (QAbstractButton *b, d->buttonBox->buttons()) - if (QPushButton *pb = qobject_cast<QPushButton *>(b)) + if (auto *pb = qobject_cast<QPushButton *>(b)) if (pb->isDefault()) return d->buttonBox->standardButton(pb); return QDialogButtonBox::NoButton; |