X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ffontselector.cpp;h=ddece710ae798f74b29324ccedf9f30656ad0eb4;hp=df0946d9111b14292d340ffdd006677c63445c18;hb=03ee70025a98912c163155955fe3cc3045f629b9;hpb=1cb02004ee5973b89368bd84f234d4652794690d diff --git a/src/uisupport/fontselector.cpp b/src/uisupport/fontselector.cpp index df0946d9..ddece710 100644 --- a/src/uisupport/fontselector.cpp +++ b/src/uisupport/fontselector.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,19 +18,20 @@ * 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);