mirror of
https://github.com/arcan1s/qtadds-fontdialog.git
synced 2025-04-24 16:47:17 +00:00
add new function
This commit is contained in:
parent
2b7760c656
commit
4a9402a487
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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"))),
|
||||||
|
Loading…
Reference in New Issue
Block a user