Make wxListBox::SetString() actually work in wxQt

Do set the string on QListWidgetItem.

Closes https://github.com/wxWidgets/wxWidgets/pull/1047
This commit is contained in:
chris2oph
2018-12-06 09:52:08 +00:00
committed by Vadim Zeitlin
parent aee926f2d5
commit 3e79f903b4

View File

@@ -160,7 +160,7 @@ wxString wxListBox::GetString(unsigned int n) const
return wxQtConvertString( item->text() );
}
void wxListBox::SetString(unsigned int n, const wxString& WXUNUSED(s))
void wxListBox::SetString(unsigned int n, const wxString& s)
{
QListWidgetItem* item = m_qtListWidget->item(n);
wxCHECK_RET(item != NULL, wxT("wrong listbox index") );
@@ -169,6 +169,7 @@ void wxListBox::SetString(unsigned int n, const wxString& WXUNUSED(s))
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
item->setCheckState(Qt::Unchecked);
}
item->setText(wxQtConvertString(s));
}
int wxListBox::GetSelection() const