From a6dc3c78ab652fd3f43fb20f7d913db45fc5f354 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Thu, 20 Dec 2018 15:49:51 +0000 Subject: [PATCH] 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 --- src/qt/listbox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index be40ae320f..acae97e7d8 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -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 ); }