X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=ed48f0793821ab45a98fb642d75a1be74fe6c693;hp=bb9d9344e74f63a26b746047636eacb6cdcbfc03;hb=3a3e844f9fcfd12235a0086af75ecd503b621ef4;hpb=6dbccb6a28b1f72347548b31f68031d4cabb594d diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index bb9d9344..ed48f079 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -24,13 +24,16 @@ #include #include #include +#include + +#include "fontselector.h" #include "uisettings.h" -SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) +SettingsPage::SettingsPage(QString category, QString title, QWidget *parent) : QWidget(parent), - _category(category), - _title(title), + _category(std::move(category)), + _title(std::move(title)), _changed(false), _autoWidgetsChanged(false) { @@ -85,6 +88,18 @@ bool SettingsPage::hasChanged(QSpinBox *box) { return box->property("storedValue").toInt() != box->value(); } + + +void SettingsPage::load(FontSelector *box, QFont value) +{ + box->setProperty("storedValue", value); + box->setSelectedFont(value); +} + + +bool SettingsPage::hasChanged(FontSelector *box) +{ + return box->property("storedValue").value() != box->selectedFont(); }