Really add items to the listbox in wxQt wxListBox::Create()
The initial choices were just ignored, do add them to the Qt listbox now. Closes https://github.com/wxWidgets/wxWidgets/pull/1094
This commit is contained in:
parent
e9cbbede00
commit
a6dc3c78ab
@ -111,7 +111,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& WXUNUSED(choices),
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
@ -119,6 +119,13 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
Init();
|
||||
m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this );
|
||||
|
||||
QStringList items;
|
||||
|
||||
for (size_t i = 0; i < choices.size(); ++i)
|
||||
items.push_back(wxQtConvertString(choices[i]));
|
||||
|
||||
m_qtListWidget->addItems(items);
|
||||
|
||||
return wxListBoxBase::Create( parent, id, pos, size, style, validator, name );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user