X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Ffontselector.cpp;h=b6cea4f4d0a525a8f17fece8533d4d5489c05960;hp=df0946d9111b14292d340ffdd006677c63445c18;hb=HEAD;hpb=e50ae7a06fc4e5d3a911c361d30953410deab609 diff --git a/src/uisupport/fontselector.cpp b/src/uisupport/fontselector.cpp index df0946d9..e449d2e8 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-2022 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);