Exemplo n.º 1
0
FontPickerButton::FontPickerButton(const QIcon &i, const QString &t, QWidget *p,
                                   const QFont &iF)
    : QPushButton(i, t, p), selectedFont(QFont())
{
    setSelectedFont(iF);
    QObject::connect(this, SIGNAL(clicked()), this, SLOT(doClicked()));
}
Exemplo n.º 2
0
void FontPickerButton::doClicked()
{
    bool ok;
    setSelectedFont(QFontDialog::getFont(&ok, getSelectedFont(), this,
                                         tr("Select a Font"), nullptr));

    if(ok)
        Q_EMIT selectedFontChanged(getSelectedFont());
}
Exemplo n.º 3
0
/**
 * This methods tries to set the font
 * @param f The wishes font
 * @return success or failure
 */
bool OFontSelector::setSelectedFont ( const QFont &f )
{
	return setSelectedFont ( f. family ( ), d-> m_fdb. styleString ( f ), f. pointSize ( ), QFont::encodingName ( f. charSet ( )));
}
Exemplo n.º 4
0
FontPickerButton::FontPickerButton(QWidget *p, const QFont &iF)
    : QPushButton(tr("Select a Font"), p), selectedFont(QFont())
{
    setSelectedFont(iF);
    QObject::connect(this, SIGNAL(clicked()), this, SLOT(doClicked()));
}