Files
wxWidgets/src/qt/fontdlg.cpp
Sean D'Epagnier 35bc8f449b Improve build and widget storage
There are no longer any qt headers included in wx/qt headers.
Applications do not need to link with qt librarys anymore, only wxqt libraries.
wxWindow and derived widgets only contain one pointer to their qtwidget, no longer
  carrying both base and derived pointers in parallel as was before.
2017-11-06 02:05:40 +01:00

41 lines
1.2 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/qt/filedlg.cpp
// Author: Sean D'Epagnier
// Copyright: (c) 2014 Sean D'Epagnier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/qt/private/winevent.h"
#include "wx/fontdlg.h"
#include <QtWidgets/QFontDialog>
class wxQtFontDialog : public wxQtEventSignalHandler< QFontDialog, wxFontDialog >
{
public:
wxQtFontDialog( wxWindow *parent, wxFontDialog *handler)
: wxQtEventSignalHandler<QFontDialog,wxFontDialog>(parent, handler)
{
connect(this, &QFontDialog::currentFontChanged, this, &wxQtFontDialog::updateFont);
}
void updateFont(const QFont &font)
{
GetHandler()->GetFontData().SetChosenFont(wxFont(font));
}
};
wxIMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog);
bool wxFontDialog::DoCreate(wxWindow *parent)
{
m_qtWindow = new wxQtFontDialog( parent, this );
static_cast<QFontDialog*>(m_qtWindow)->setCurrentFont(m_fontData.GetInitialFont().GetHandle());
return wxFontDialogBase::DoCreate(parent);
}