add new function

This commit is contained in:
arcan1s 2014-09-04 20:20:26 +04:00
parent 2b7760c656
commit 4a9402a487
2 changed files with 8 additions and 1 deletions

View File

@ -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) CFontDialog::CFontDialog(QWidget *parent, bool needWeight, bool needItalic)
: QDialog(parent) : QDialog(parent)
{ {

View File

@ -33,6 +33,7 @@ public:
QColor color = QColor(QString("#000000"))); QColor color = QColor(QString("#000000")));
QColor color(); QColor color();
void setCurrentColor(const QColor color); void setCurrentColor(const QColor color);
QFont toQFont();
private: private:
QColor currentColor; QColor currentColor;
@ -48,7 +49,7 @@ public:
const bool needWeight = true, const bool needWeight = true,
const bool needItalic = true); const bool needItalic = true);
~CFontDialog(); ~CFontDialog();
static CFont getFont(const QString title = QString("Select font"), static CFont getFont(const QString title = tr("Select font"),
CFont defaultFont = CFont(QString("Arial"), CFont defaultFont = CFont(QString("Arial"),
12, 400, false, 12, 400, false,
QColor(QString("#000000"))), QColor(QString("#000000"))),