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)
|
||||
: QDialog(parent)
|
||||
{
|
||||
|
@ -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"))),
|
||||
|
Loading…
Reference in New Issue
Block a user