Allow SetFont to be called before Create in wxQT, thanks @seandepagnier
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -274,6 +274,7 @@ void wxWindowQt::PostCreation(bool generic)
|
|||||||
SetBackgroundColour(wxColour(GetHandle()->palette().background().color()));
|
SetBackgroundColour(wxColour(GetHandle()->palette().background().color()));
|
||||||
SetForegroundColour(wxColour(GetHandle()->palette().foreground().color()));
|
SetForegroundColour(wxColour(GetHandle()->palette().foreground().color()));
|
||||||
|
|
||||||
|
GetHandle()->setFont( wxWindowBase::GetFont().GetHandle() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowQt::AddChild( wxWindowBase *child )
|
void wxWindowQt::AddChild( wxWindowBase *child )
|
||||||
@@ -422,9 +423,16 @@ void wxWindowQt::Refresh( bool WXUNUSED( eraseBackground ), const wxRect *rect )
|
|||||||
|
|
||||||
bool wxWindowQt::SetFont( const wxFont &font )
|
bool wxWindowQt::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
GetHandle()->setFont( font.GetHandle() );
|
// SetFont may be called before Create, so the font is stored
|
||||||
|
// by the base class, and set in PostCreation
|
||||||
|
|
||||||
return ( true );
|
if (GetHandle())
|
||||||
|
{
|
||||||
|
GetHandle()->setFont( font.GetHandle() );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxWindowBase::SetFont(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user