From b91acb19633c59b2f722026fabf35034ff70e4de Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Mon, 18 Aug 2025 09:40:08 -0700 Subject: [PATCH] Compile fix. --- qt/lc_qutils.cpp | 26 ++++++++++++++------------ qt/lc_qutils.h | 8 ++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/qt/lc_qutils.cpp b/qt/lc_qutils.cpp index cd98ff80..3c7a6fbc 100644 --- a/qt/lc_qutils.cpp +++ b/qt/lc_qutils.cpp @@ -140,26 +140,27 @@ bool lcRunElevatedProcess(const LPCWSTR ExeName, const LPCWSTR Arguments, const // Resize all columns to content except for one stretching column. (taken from QT creator) lcQTreeWidgetColumnStretcher::lcQTreeWidgetColumnStretcher(QTreeWidget *treeWidget, int columnToStretch) - : QObject(treeWidget->header()), m_columnToStretch(columnToStretch), m_interactiveResize(false), m_stretchWidth(0) + : QObject(treeWidget->header()), mColumnToStretch(columnToStretch), mInteractiveResize(false), mStretchWidth(0) { parent()->installEventFilter(this); - connect(treeWidget->header(), &QHeaderView::sectionResized, &lcQTreeWidgetColumnStretcher::sectionResized); + connect(treeWidget->header(), &QHeaderView::sectionResized, this, &lcQTreeWidgetColumnStretcher::SectionResized); + QHideEvent fake; lcQTreeWidgetColumnStretcher::eventFilter(parent(), &fake); } -void lcQTreeWidgetColumnStretcher::sectionResized(int LogicalIndex, int OldSize, int NewSize) +void lcQTreeWidgetColumnStretcher::SectionResized(int LogicalIndex, int OldSize, int NewSize) { Q_UNUSED(OldSize) - if (LogicalIndex == m_columnToStretch) + if (LogicalIndex == mColumnToStretch) { QHeaderView* HeaderView = qobject_cast(parent()); if (HeaderView->isVisible()) - m_interactiveResize = true; + mInteractiveResize = true; - m_stretchWidth = NewSize; + mStretchWidth = NewSize; } } @@ -174,25 +175,26 @@ bool lcQTreeWidgetColumnStretcher::eventFilter(QObject* Object, QEvent* Event) for (int i = 0; i < HeaderView->count(); ++i) HeaderView->setSectionResizeMode(i, QHeaderView::Interactive); - m_stretchWidth = HeaderView->sectionSize(m_columnToStretch); + mStretchWidth = HeaderView->sectionSize(mColumnToStretch); } else if (Event->type() == QEvent::Hide) { - if (!m_interactiveResize) + if (!mInteractiveResize) for (int i = 0; i < HeaderView->count(); ++i) - HeaderView->setSectionResizeMode(i, i == m_columnToStretch ? QHeaderView::Stretch : QHeaderView::ResizeToContents); + HeaderView->setSectionResizeMode(i, i == mColumnToStretch ? QHeaderView::Stretch : QHeaderView::ResizeToContents); } else if (Event->type() == QEvent::Resize) { - if (HeaderView->sectionResizeMode(m_columnToStretch) == QHeaderView::Interactive) { + if (HeaderView->sectionResizeMode(mColumnToStretch) == QHeaderView::Interactive) { - const int StretchWidth = HeaderView->isVisible() ? m_stretchWidth : 32; + const int StretchWidth = HeaderView->isVisible() ? mStretchWidth : 32; - HeaderView->resizeSection(m_columnToStretch, StretchWidth); + HeaderView->resizeSection(mColumnToStretch, StretchWidth); } } } + return false; } diff --git a/qt/lc_qutils.h b/qt/lc_qutils.h index 246d99ac..3383e1ee 100644 --- a/qt/lc_qutils.h +++ b/qt/lc_qutils.h @@ -27,12 +27,12 @@ public: bool eventFilter(QObject* Object, QEvent* Event) override; private slots: - void sectionResized(int LogicalIndex, int OldSize, int NewSize); + void SectionResized(int LogicalIndex, int OldSize, int NewSize); private: - const int m_columnToStretch; - bool m_interactiveResize; - int m_stretchWidth; + const int mColumnToStretch; + bool mInteractiveResize; + int mStretchWidth; }; class lcSmallLineEdit : public QLineEdit