From 83f23cec89a2b0e1c00bd45d0e81f559d1f12221 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:31:17 +0000 Subject: [PATCH 1/3] Added virtual and override specifiers to derived method in ListCtrl --- include/wx/qt/listctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/qt/listctrl.h b/include/wx/qt/listctrl.h index 17637de752..4cee40bb52 100644 --- a/include/wx/qt/listctrl.h +++ b/include/wx/qt/listctrl.h @@ -292,7 +292,7 @@ protected: void Init(); // Implement base class pure virtual methods. - long DoInsertColumn(long col, const wxListItem& info); + virtual long DoInsertColumn(long col, const wxListItem& info) wxOVERRIDE; QTreeWidgetItem *QtGetItem(int id) const; From ca0025145443be705133d6c9fbb55943ae74acbb Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:35:47 +0000 Subject: [PATCH 2/3] Fix in wxListCtrl::FindItem. Every item is now iterated through, rather than only the first --- src/qt/listctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 556021c003..58be4de5ed 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -762,7 +762,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial) !partial ? Qt::MatchExactly : Qt::MatchContains ); for (int i=0; iindexOfTopLevelItem(qitems.at(0)); + ret = m_qtTreeWidget->indexOfTopLevelItem(qitems.at(i)); if ( ret >= start ) return ret; } From f9280c8529326d3e90fe158bb4f28bba950812cc Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:38:38 +0000 Subject: [PATCH 3/3] Now use the column index to retrieve the correct text in GetItemText --- src/qt/listctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 58be4de5ed..65acc4f937 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -413,11 +413,11 @@ bool wxListCtrl::SetItemColumnImage(long item, long column, int image) return SetItem(info); } -wxString wxListCtrl::GetItemText(long item, int WXUNUSED(col)) const +wxString wxListCtrl::GetItemText(long item, int col) const { QTreeWidgetItem *qitem = QtGetItem(item); if ( qitem ) - return wxQtConvertString( qitem->text(0) ); + return wxQtConvertString( qitem->text(col) ); else return wxString(); }