From 163cd4668c4e9b5c1ed5d403bfb6a79e3bd1aafc Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 25 Feb 2021 15:58:03 +0000 Subject: [PATCH] Searching for an EID should return it first before any text results --- qrenderdoc/Windows/EventBrowser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index eef620695..1f3d7137e 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -184,6 +184,13 @@ struct EventItemModel : public QAbstractItemModel m_FindString = text; m_FindResults.clear(); + bool eidOK = false; + uint32_t eid = text.toUInt(&eidOK); + + // include EID in results first if the text parses as an integer + if(eidOK && eid > 0 && eid < m_Draws.size()) + m_FindResults.push_back(GetIndexForEID(eid)); + if(!m_FindString.isEmpty()) { // do a depth-first search to find results