From 4a9402a48765076329f75d18fcfe2a68f81d6954 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Thu, 4 Sep 2014 20:20:26 +0400 Subject: [PATCH] add new function --- fontdialog.cpp | 6 ++++++ fontdialog.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) 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"))),