From f5cd9a79349d5a009f6a11ec2e1957b4dc3a7050 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Sep 2018 00:11:28 +0200 Subject: [PATCH] Update wxFont in wxQt after recent base class interface changes Trivially implement the new wxFont::{Set,Get}{FractionalPointSize, NumericWeight}() methods in terms of the corresponding wxNativeFontInfo methods. --- include/wx/qt/font.h | 8 ++++---- src/qt/font.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/wx/qt/font.h b/include/wx/qt/font.h index 9d674bc614..dd06d24356 100644 --- a/include/wx/qt/font.h +++ b/include/wx/qt/font.h @@ -50,20 +50,20 @@ public: wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // accessors: get the font characteristics - virtual int GetPointSize() const; + virtual float GetFractionalPointSize() const wxOVERRIDE; virtual wxFontStyle GetStyle() const; - virtual wxFontWeight GetWeight() const; + virtual int GetNumericWeight() const wxOVERRIDE; virtual bool GetUnderlined() const; virtual wxString GetFaceName() const; virtual wxFontEncoding GetEncoding() const; virtual const wxNativeFontInfo *GetNativeFontInfo() const; // change the font characteristics - virtual void SetPointSize( int pointSize ); + virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE; virtual void SetFamily( wxFontFamily family ); virtual void SetStyle( wxFontStyle style ); + virtual void SetNumericWeight(int weight) wxOVERRIDE; virtual bool SetFaceName(const wxString& facename); - virtual void SetWeight( wxFontWeight weight ); virtual void SetUnderlined( bool underlined ); virtual void SetEncoding(wxFontEncoding encoding); diff --git a/src/qt/font.cpp b/src/qt/font.cpp index d468d0f902..63a26f6a9a 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -203,9 +203,9 @@ bool wxFont::Create(wxSize size, wxFontFamily family, wxFontStyle style, return true; } -int wxFont::GetPointSize() const +float wxFont::GetFractionalPointSize() const { - return M_FONTDATA.GetPointSize(); + return M_FONTDATA.GetFractionalPointSize(); } wxFontStyle wxFont::GetStyle() const @@ -213,9 +213,9 @@ wxFontStyle wxFont::GetStyle() const return M_FONTDATA.GetStyle(); } -wxFontWeight wxFont::GetWeight() const +int wxFont::GetNumericWeight() const { - return M_FONTDATA.GetWeight(); + return M_FONTDATA.GetNumericWeight(); } bool wxFont::GetUnderlined() const @@ -238,11 +238,11 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const return &M_FONTDATA; } -void wxFont::SetPointSize( int pointSize ) +void wxFont::SetFractionalPointSize(float pointSize) { AllocExclusive(); - M_FONTDATA.SetPointSize(pointSize); + M_FONTDATA.SetFractionalPointSize(pointSize); } bool wxFont::SetFaceName(const wxString& facename) @@ -266,11 +266,11 @@ void wxFont::SetStyle( wxFontStyle style ) M_FONTDATA.SetStyle(style); } -void wxFont::SetWeight( wxFontWeight weight ) +void wxFont::SetNumericWeight(int weight) { AllocExclusive(); - M_FONTDATA.SetWeight(weight); + M_FONTDATA.SetNumericWeight(weight); } void wxFont::SetUnderlined( bool underlined )