changed to 80 max column
This commit is contained in:
@@ -25,8 +25,8 @@ void SettingsPage::cancel()
|
||||
this->onCancel_.invoke();
|
||||
}
|
||||
|
||||
QCheckBox *SettingsPage::createCheckBox(const QString &text,
|
||||
pajlada::Settings::Setting<bool> &setting)
|
||||
QCheckBox *SettingsPage::createCheckBox(
|
||||
const QString &text, pajlada::Settings::Setting<bool> &setting)
|
||||
{
|
||||
QCheckBox *checkbox = new QCheckBox(text);
|
||||
|
||||
@@ -38,16 +38,17 @@ QCheckBox *SettingsPage::createCheckBox(const QString &text,
|
||||
this->managedConnections_);
|
||||
|
||||
// update setting on toggle
|
||||
QObject::connect(checkbox, &QCheckBox::toggled, this, [&setting](bool state) {
|
||||
qDebug() << "update checkbox value";
|
||||
setting = state; //
|
||||
});
|
||||
QObject::connect(checkbox, &QCheckBox::toggled, this,
|
||||
[&setting](bool state) {
|
||||
qDebug() << "update checkbox value";
|
||||
setting = state; //
|
||||
});
|
||||
|
||||
return checkbox;
|
||||
}
|
||||
|
||||
QComboBox *SettingsPage::createComboBox(const QStringList &items,
|
||||
pajlada::Settings::Setting<QString> &setting)
|
||||
QComboBox *SettingsPage::createComboBox(
|
||||
const QStringList &items, pajlada::Settings::Setting<QString> &setting)
|
||||
{
|
||||
QComboBox *combo = new QComboBox();
|
||||
|
||||
@@ -55,29 +56,34 @@ QComboBox *SettingsPage::createComboBox(const QStringList &items,
|
||||
combo->addItems(items);
|
||||
|
||||
// update when setting changes
|
||||
setting.connect([combo](const QString &value, auto) { combo->setCurrentText(value); },
|
||||
this->managedConnections_);
|
||||
setting.connect(
|
||||
[combo](const QString &value, auto) { combo->setCurrentText(value); },
|
||||
this->managedConnections_);
|
||||
|
||||
QObject::connect(combo, &QComboBox::currentTextChanged,
|
||||
[&setting](const QString &newValue) { setting = newValue; });
|
||||
QObject::connect(
|
||||
combo, &QComboBox::currentTextChanged,
|
||||
[&setting](const QString &newValue) { setting = newValue; });
|
||||
|
||||
return combo;
|
||||
}
|
||||
|
||||
QLineEdit *SettingsPage::createLineEdit(pajlada::Settings::Setting<QString> &setting)
|
||||
QLineEdit *SettingsPage::createLineEdit(
|
||||
pajlada::Settings::Setting<QString> &setting)
|
||||
{
|
||||
QLineEdit *edit = new QLineEdit();
|
||||
|
||||
edit->setText(setting);
|
||||
|
||||
// update when setting changes
|
||||
QObject::connect(edit, &QLineEdit::textChanged,
|
||||
[&setting](const QString &newValue) { setting = newValue; });
|
||||
QObject::connect(
|
||||
edit, &QLineEdit::textChanged,
|
||||
[&setting](const QString &newValue) { setting = newValue; });
|
||||
|
||||
return edit;
|
||||
}
|
||||
|
||||
QSpinBox *SettingsPage::createSpinBox(pajlada::Settings::Setting<int> &setting, int min, int max)
|
||||
QSpinBox *SettingsPage::createSpinBox(pajlada::Settings::Setting<int> &setting,
|
||||
int min, int max)
|
||||
{
|
||||
QSpinBox *w = new QSpinBox;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user