This commit is contained in:
DavidXanatos 2023-02-04 14:42:45 +01:00
parent f231da3cef
commit 5cbdf1ef11
3 changed files with 8 additions and 5 deletions

View File

@ -124,8 +124,7 @@ CFinder::~CFinder()
void CFinder::SetTree(QTreeView* pTree)
{
m_pTree = pTree;
if(m_pModel)
QObject::connect(this, SIGNAL(SelectNext()), this, SLOT(OnSelectNext()));
QObject::connect(this, SIGNAL(SelectNext()), this, SLOT(OnSelectNext()));
}
bool CFinder::eventFilter(QObject* source, QEvent* event)
@ -142,7 +141,7 @@ bool CFinder::eventFilter(QObject* source, QEvent* event)
void CFinder::Open()
{
if (m_pModel && m_pColumn->count() == 0)
if (m_pColumn && m_pColumn->count() == 0)
{
m_pColumn->addItem(tr("All columns"), -1);
for (int i = 0; i < m_pModel->columnCount(); i++)
@ -300,6 +299,9 @@ QModelIndex CFinder::FindPrev(QModelIndex idx, bool next, int depth)
void CFinder::OnSelectNext()
{
if (!m_pModel)
return;
bool next = true;
QModelIndex idx = m_pTree->currentIndex();
if (!(next = idx.isValid()))

View File

@ -11,6 +11,7 @@ public:
~CFinder();
void SetTree(QTreeView* pTree);
void SetModel(QAbstractItemModel* pModel) { m_pModel = pModel; }
static void SetDarkMode(bool bDarkMode) { m_DarkMode = bDarkMode; }
static bool GetDarkMode() { return m_DarkMode; }

View File

@ -87,9 +87,9 @@ CTraceTree::CTraceTree(QWidget* parent)
//m_pMainLayout->addWidget(CFinder::AddFinder(m_pTreeList, m_pSortProxy));
CFinder* pFinder;
m_pMainLayout->addWidget(CFinder::AddFinder(m_pTreeList, m_pTraceModel, CFinder::eHighLightDefault, &pFinder));
m_pMainLayout->addWidget(CFinder::AddFinder(m_pTreeList, this, CFinder::eHighLightDefault, &pFinder));
pFinder->SetModel(m_pTraceModel);
//QObject::connect(pFinder, SIGNAL(SelectNext()), this, SLOT(SelectNext()));
QObject::connect(pFinder, SIGNAL(SetFilter(const QString&, int, int)), this, SLOT(SetFilter(const QString&, int, int)));
QByteArray Columns = theConf->GetBlob("MainWindow/TraceLog_Columns");