Utils: Better resizing behavior for environment widget

The automatic resizing to contents should happen immediately, not when
coming back to the widget the next time.

Fixes: QTCREATORBUG-26510
Change-Id: I76cafa493b2eadc5115d42badbabe3d4e0a050f6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2021-12-08 11:18:22 +01:00
parent b8d5482e9c
commit 8dcab74586
3 changed files with 13 additions and 1 deletions

View File

@@ -53,6 +53,13 @@ void HeaderViewStretcher::stretch()
HeaderViewStretcher::eventFilter(parent(), &fake);
}
void HeaderViewStretcher::softStretch()
{
const auto hv = qobject_cast<QHeaderView*>(parent());
for (int i = 0; i < hv->count(); ++i)
hv->resizeSections(QHeaderView::ResizeToContents);
}
bool HeaderViewStretcher::eventFilter(QObject *obj, QEvent *ev)
{
if (obj == parent()) {