test filtering behavior

This commit is contained in:
Martin Rotter 2022-01-08 17:35:41 +01:00
parent 70d915fc5c
commit 6cbcef3ee5

View File

@ -495,6 +495,12 @@ void FeedsView::focusInEvent(QFocusEvent* event) {
}
void FeedsView::filterItems(const QString& pattern) {
if (!pattern.isEmpty()) {
m_dontSaveExpandState = true;
expandAll();
m_dontSaveExpandState = false;
}
#if QT_VERSION < 0x050C00 // Qt < 5.12.0
m_proxyModel->setFilterRegExp(pattern.toLower());
#else
@ -504,14 +510,6 @@ void FeedsView::filterItems(const QString& pattern) {
if (pattern.isEmpty()) {
loadAllExpandStates();
}
/*
else {
m_isDontSaveExpandState = true;
expandAll();
m_isDontSaveExpandState = false;
}
*/
}
void FeedsView::onIndexExpanded(const QModelIndex& idx) {
@ -603,7 +601,7 @@ void FeedsView::loadAllExpandStates() {
}
void FeedsView::expandItemDelayed(const QModelIndex& source_idx) {
QTimer::singleShot(100, this, [=] {
//QTimer::singleShot(100, this, [=] {
// Model requests to expand some items as they are visible and there is
// a filter active, so they maybe were not visible before.
QModelIndex pidx = m_proxyModel->mapFromSource(source_idx);
@ -613,7 +611,8 @@ void FeedsView::expandItemDelayed(const QModelIndex& source_idx) {
m_dontSaveExpandState = true;
expandRecursively(pidx);
m_dontSaveExpandState = false;
});
//});
}
QMenu* FeedsView::initializeContextMenuCategories(RootItem* clicked_item) {