Commit 74251c3c authored by Daniel Teske's avatar Daniel Teske
Browse files

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: default avatarTobias Hunger <>
parent c0cc6ce5
......@@ -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->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
new Utils::HeaderViewStretcher(d->m_environmentView->horizontalHeader(), 1);
QFontMetrics fm(font());
d->m_environmentView->verticalHeader()->setDefaultSectionSize(qMax(static_cast<int>(fm.height() * 1.2), fm.height() + 4));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment