forked from qt-creator/qt-creator
Utils: Add a way to trigger the HeaderViewStretcher
Change-Id: I4fd3179015ba325d8e739357d393aff6ce23072f Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user