X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ffontselector.cpp;h=b6cea4f4d0a525a8f17fece8533d4d5489c05960;hp=27627296d1f91321b2deac44b5f0b7ef8b418e40;hb=52209badc8e769e50aa3019b63689dda0e79e9d0;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/uisupport/fontselector.cpp b/src/uisupport/fontselector.cpp index 27627296..b6cea4f4 100644 --- a/src/uisupport/fontselector.cpp +++ b/src/uisupport/fontselector.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,22 +15,23 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include "fontselector.h" + #include #include #include #include #include -#include "fontselector.h" - -FontSelector::FontSelector(QWidget *parent) : QWidget(parent) +FontSelector::FontSelector(QWidget* parent) + : QWidget(parent) { - QHBoxLayout *layout = new QHBoxLayout(this); - QPushButton *chooseButton = new QPushButton(tr("Choose..."), this); - connect(chooseButton, SIGNAL(clicked()), SLOT(chooseFont())); + auto* layout = new QHBoxLayout(this); + QPushButton* chooseButton = new QPushButton(tr("Choose..."), this); + connect(chooseButton, &QAbstractButton::clicked, this, &FontSelector::chooseFont); layout->addWidget(_demo = new QLabel("Font")); layout->addWidget(chooseButton); @@ -42,8 +43,7 @@ FontSelector::FontSelector(QWidget *parent) : QWidget(parent) _font = font(); } - -void FontSelector::setSelectedFont(const QFont &font) +void FontSelector::setSelectedFont(const QFont& font) { _font = font; _demo->setText(QString("%1 %2pt").arg(font.family()).arg(font.pointSize())); @@ -51,18 +51,16 @@ void FontSelector::setSelectedFont(const QFont &font) emit fontChanged(font); } - void FontSelector::chooseFont() { bool ok; - QFont font = QFontDialog::getFont(&ok, _demo->font()); + QFont font = QFontDialog::getFont(&ok, _demo->font(), nullptr, QString(), QFontDialog::DontUseNativeDialog); if (ok) { setSelectedFont(font); } } - -void FontSelector::changeEvent(QEvent *e) +void FontSelector::changeEvent(QEvent* e) { if (e->type() == QEvent::StyleChange) { _demo->setFont(_font);