diff options
-rw-r--r-- | src/libs/utils/headerviewstretcher.cpp | 7 | ||||
-rw-r--r-- | src/libs/utils/headerviewstretcher.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/libs/utils/headerviewstretcher.cpp b/src/libs/utils/headerviewstretcher.cpp index 0af5586ac8..0728dedfa0 100644 --- a/src/libs/utils/headerviewstretcher.cpp +++ b/src/libs/utils/headerviewstretcher.cpp @@ -44,8 +44,13 @@ HeaderViewStretcher::HeaderViewStretcher(QHeaderView *headerView, int columnToSt : QObject(headerView), m_columnToStretch(columnToStretch) { headerView->installEventFilter(this); + stretch(); +} + +void HeaderViewStretcher::stretch() +{ QHideEvent fake; - HeaderViewStretcher::eventFilter(headerView, &fake); + HeaderViewStretcher::eventFilter(parent(), &fake); } bool HeaderViewStretcher::eventFilter(QObject *obj, QEvent *ev) diff --git a/src/libs/utils/headerviewstretcher.h b/src/libs/utils/headerviewstretcher.h index 85739daf44..2e9190ddeb 100644 --- a/src/libs/utils/headerviewstretcher.h +++ b/src/libs/utils/headerviewstretcher.h @@ -41,7 +41,8 @@ class QTCREATOR_UTILS_EXPORT HeaderViewStretcher : public QObject public: explicit HeaderViewStretcher(QHeaderView *headerView, int columnToStretch); - virtual bool eventFilter(QObject *obj, QEvent *ev); + void stretch(); + bool eventFilter(QObject *obj, QEvent *ev) override; }; } // namespace Utils |