mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Preserve event browser expansion across filtering
This commit is contained in:
@@ -2166,8 +2166,17 @@ void EventBrowser::filter_apply()
|
||||
ui->events->clearSelection();
|
||||
ui->events->setCurrentIndex(QModelIndex());
|
||||
|
||||
ExpansionKeyGen keygen = [](QModelIndex idx, uint) { return idx.data(ROLE_SELECTED_EID).toUInt(); };
|
||||
|
||||
// update the expansion with the current state. Any rows that were hidden won't have their
|
||||
// collapsed/expanded state lost by this. We use the EID as a key because it will be the same even
|
||||
// if the model index changes (e.g. if some events are shown or hidden)
|
||||
ui->events->updateExpansion(m_EventsExpansion, keygen);
|
||||
|
||||
QString parseError = m_FilterModel->ParseExpression(ui->filterExpression->text());
|
||||
|
||||
ui->events->applyExpansion(m_EventsExpansion, keygen);
|
||||
|
||||
ui->events->setCurrentIndex(m_FilterModel->mapFromSource(m_Model->GetIndexForEID(curSelEvent)));
|
||||
|
||||
if(!parseError.isEmpty())
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <QFrame>
|
||||
#include <QIcon>
|
||||
#include <QSet>
|
||||
#include "Code/Interface/QRDInterface.h"
|
||||
|
||||
namespace Ui
|
||||
@@ -40,6 +41,8 @@ class QTextStream;
|
||||
class FlowLayout;
|
||||
struct EventItemTag;
|
||||
|
||||
typedef QSet<uint> RDTreeViewExpansionState;
|
||||
|
||||
class RichTextViewDelegate;
|
||||
struct EventItemModel;
|
||||
struct EventFilterModel;
|
||||
@@ -137,6 +140,8 @@ private:
|
||||
|
||||
TimeUnit m_TimeUnit = TimeUnit::Count;
|
||||
|
||||
RDTreeViewExpansionState m_EventsExpansion;
|
||||
|
||||
QTimer *m_FindHighlight, *m_FilterTimeout;
|
||||
|
||||
FlowLayout *m_BookmarkStripLayout;
|
||||
|
||||
Reference in New Issue
Block a user