MCPcopy Create free account
hub / github.com/comaps/comaps / OnSearchPanelItemClicked

Method OnSearchPanelItemClicked

qt/search_panel.cpp:305–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305void SearchPanel::OnSearchPanelItemClicked(int row, int)
306{
307 ASSERT_EQUAL(m_results.GetCount(), static_cast<size_t>(m_pTable->rowCount()), ());
308
309 if (m_results[row].IsSuggest())
310 {
311 // insert suggestion into the search bar
312 std::string const suggestion = m_results[row].GetSuggestionString();
313 m_pEditor->setText(QString::fromUtf8(suggestion.c_str()));
314 }
315 else
316 {
317 // center viewport on clicked item
318 GetFramework().ShowSearchResult(m_results[row]);
319 }
320}
321
322void SearchPanel::hideEvent(QHideEvent *)
323{

Callers

nothing calls this directly

Calls 4

rowCountMethod · 0.80
IsSuggestMethod · 0.80
ShowSearchResultMethod · 0.80
GetCountMethod · 0.45

Tested by

no test coverage detected