diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp
index 10074936e928f7234d4da1426e6ab036bbf8bfae..094f9ecb749f5eae30740078eaaff4edc75fe313 100644
--- a/src/plugins/projectexplorer/environmentwidget.cpp
+++ b/src/plugins/projectexplorer/environmentwidget.cpp
@@ -128,13 +128,12 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
     d->m_unsetButton->setText(tr("&Unset"));
     buttonLayout->addWidget(d->m_unsetButton);
 
-    QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
-    buttonLayout->addItem(verticalSpacer);
-
     d->m_batchEditButton = new QPushButton(this);
     d->m_batchEditButton->setText(tr("&Batch Edit..."));
     buttonLayout->addWidget(d->m_batchEditButton);
 
+    buttonLayout->addStretch();
+
     horizontalLayout->addLayout(buttonLayout);
     vbox2->addLayout(horizontalLayout);