summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2013-03-20 15:51:56 +0100
committerDaniel Teske <daniel.teske@digia.com>2013-03-26 16:19:54 +0100
commit74251c3cd017cd0c93247d0c1c8ab531f25e9cb9 (patch)
treea21862ab017f079861e0ba04d113e91db98f173e /src/plugins/projectexplorer
parentc0cc6ce5af6a1396a490f858e53ba1ff7c24717f (diff)
downloadqt-creator-74251c3cd017cd0c93247d0c1c8ab531f25e9cb9.tar.gz
EnvironmentWidget: Use HeaderViewStrecher
Essentially we use ResizeToContents until the widget is shown to the user. That is not optimal, since this still can lead to a absurd size for the keys column, but since the user can then resize it, it is far better than before. Note: Each hide() + show() will resize the columns again to their contents. Task-number: QTCREATORBUG-8982 Change-Id: Iaccd32d4a2ce618a98f9b9d48141fd753c6f8b97 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/environmentwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp
index ef5f9360da..b4772d6749 100644
--- a/src/plugins/projectexplorer/environmentwidget.cpp
+++ b/src/plugins/projectexplorer/environmentwidget.cpp
@@ -40,6 +40,7 @@
#include <QTableView>
#include <QTextDocument> // for Qt::escape
#include <QVBoxLayout>
+#include <headerviewstretcher.h>
namespace ProjectExplorer {
@@ -96,8 +97,8 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
d->m_environmentView->setMinimumHeight(400);
d->m_environmentView->setGridStyle(Qt::NoPen);
d->m_environmentView->horizontalHeader()->setStretchLastSection(true);
- d->m_environmentView->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
d->m_environmentView->horizontalHeader()->setHighlightSections(false);
+ new Utils::HeaderViewStretcher(d->m_environmentView->horizontalHeader(), 1);
d->m_environmentView->verticalHeader()->hide();
QFontMetrics fm(font());
d->m_environmentView->verticalHeader()->setDefaultSectionSize(qMax(static_cast<int>(fm.height() * 1.2), fm.height() + 4));