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 <tobias.hunger@digia.com>
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->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));
......
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