From e5193fe2099de71d7d55e7d6cdac78fcbc183e9d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 21 Sep 2015 16:32:18 +0200 Subject: [PATCH] JsonFieldPage: Sprinkle the code with auto Change-Id: Ic8e65d352897bf5b47c8362936830266f55a233c Reviewed-by: Orgad Shaneh Reviewed-by: Benjamin Zeller --- .../projectexplorer/jsonwizard/jsonfieldpage.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index a3277a29381..7059531d37d 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -333,7 +333,7 @@ QWidget *LabelField::createWidget(const QString &displayName, JsonFieldPage *pag { Q_UNUSED(displayName); Q_UNUSED(page); - QLabel *w = new QLabel(); + auto w = new QLabel; w->setWordWrap(m_wordWrap); w->setText(m_text); return w; @@ -426,10 +426,10 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage) QWidget *LineEditField::createWidget(const QString &displayName, JsonFieldPage *page) { Q_UNUSED(displayName); - QLineEdit *w = new QLineEdit; + auto w = new QLineEdit; if (m_validatorRegExp.isValid()) { - LineEditValidator *lv = new LineEditValidator(page->expander(), m_validatorRegExp, w); + auto lv = new LineEditValidator(page->expander(), m_validatorRegExp, w); lv->setFixupExpando(m_fixupExpando); w->setValidator(lv); } @@ -522,7 +522,7 @@ QWidget *TextEditField::createWidget(const QString &displayName, JsonFieldPage * // TODO: Set up modification monitoring... Q_UNUSED(displayName); Q_UNUSED(page); - QTextEdit *w = new QTextEdit; + auto w = new QTextEdit; w->setAcceptRichText(m_acceptRichText); return w; } @@ -900,7 +900,7 @@ JsonFieldPage::JsonFieldPage(MacroExpander *expander, QWidget *parent) : { QTC_CHECK(m_expander); - QVBoxLayout *vLayout = new QVBoxLayout; + auto vLayout = new QVBoxLayout; m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); vLayout->addLayout(m_formLayout); m_errorLabel->setVisible(false);