Allow overriding the label for stock buttons in wxQt

Stock label should only be used if passed label is empty. Otherwise,
passed label should override the default value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1086
This commit is contained in:
Jay Nabonne 2018-12-19 08:57:04 +00:00 committed by Vadim Zeitlin
parent ae20edb539
commit c47c7de5ea

View File

@ -45,7 +45,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id,
const wxString& name )
{
QtCreate(parent);
SetLabel( wxIsStockID( id ) ? wxGetStockLabel( id ) : label );
SetLabel( label.IsEmpty() && wxIsStockID( id ) ? wxGetStockLabel( id ) : label );
return QtCreateControl( parent, id, pos, size, style, validator, name );
}