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:
@@ -111,7 +111,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
const wxArrayString& WXUNUSED(choices),
|
const wxArrayString& choices,
|
||||||
long style,
|
long style,
|
||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
@@ -119,6 +119,13 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
Init();
|
Init();
|
||||||
m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this );
|
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 );
|
return wxListBoxBase::Create( parent, id, pos, size, style, validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user