diff --git a/fontdialog.cpp b/fontdialog.cpp index 77b6b3a..27c3582 100644 --- a/fontdialog.cpp +++ b/fontdialog.cpp @@ -39,6 +39,12 @@ void CFont::setCurrentColor(const QColor color) } +QFont CFont::toQFont() +{ + return QFont(family(), pointSize(), weight(), italic()); +} + + CFontDialog::CFontDialog(QWidget *parent, bool needWeight, bool needItalic) : QDialog(parent) { diff --git a/fontdialog.h b/fontdialog.h index 705d377..21f7938 100644 --- a/fontdialog.h +++ b/fontdialog.h @@ -33,6 +33,7 @@ public: QColor color = QColor(QString("#000000"))); QColor color(); void setCurrentColor(const QColor color); + QFont toQFont(); private: QColor currentColor; @@ -48,7 +49,7 @@ public: const bool needWeight = true, const bool needItalic = true); ~CFontDialog(); - static CFont getFont(const QString title = QString("Select font"), + static CFont getFont(const QString title = tr("Select font"), CFont defaultFont = CFont(QString("Arial"), 12, 400, false, QColor(QString("#000000"))),