mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-11 14:44:15 +02:00
Cable: use begin/endFilterChange() on Qt >= 6.9, invalidateFilter() on older Qt
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m51s
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m51s
This commit is contained in:
@@ -62,8 +62,14 @@ CableFilterProxy::CableFilterProxy(QObject *parent) :
|
||||
void CableFilterProxy::setTokens(const QStringList &tokens)
|
||||
{
|
||||
if (m_tokens == tokens) return;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||
beginFilterChange();
|
||||
m_tokens = tokens;
|
||||
endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||
#else
|
||||
m_tokens = tokens;
|
||||
invalidateFilter();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,8 +82,14 @@ void CableFilterProxy::setTokens(const QStringList &tokens)
|
||||
void CableFilterProxy::setHideUnsuitable(bool hide)
|
||||
{
|
||||
if (m_hide_unsuitable == hide) return;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||
beginFilterChange();
|
||||
m_hide_unsuitable = hide;
|
||||
endFilterChange(QSortFilterProxyModel::Direction::Rows);
|
||||
#else
|
||||
m_hide_unsuitable = hide;
|
||||
invalidateFilter();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user