6 #include "fontbutton.h"
9 FontButton::FontButton(QWidget* parent)
12 connect(
this, SIGNAL( clicked() ), SLOT( thisClicked() ) );
14 this->updateAppearance();
17 void FontButton::setSelectedFont(
const QFont& font)
19 this->currentFont = font;
20 this->updateAppearance();
23 void FontButton::thisClicked()
26 QFont fontTmp = QFontDialog::getFont(&bOk, this->currentFont, this->parentWidget());
34 void FontButton::updateAppearance()
36 QString text = QString(
"%1, %2").arg(this->currentFont.family()).arg(this->currentFont.pointSize());
37 QFont textFont = this->currentFont;
39 this->setFont(textFont);
45 QFont oldFont = this->currentFont;
46 this->currentFont = newFont;
49 emit fontUpdated(oldFont, this->currentFont);