X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=ed48f0793821ab45a98fb642d75a1be74fe6c693;hb=8582c2ad5708a1972c85bea1cf8d81ad3ece4814;hp=bb9d9344e74f63a26b746047636eacb6cdcbfc03;hpb=6dbccb6a28b1f72347548b31f68031d4cabb594d;p=quassel.git 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(); }