configure_system: Implement with for loop
This commit is contained in:
@@ -9,6 +9,7 @@ class QComboBox;
|
||||
class QLineEdit;
|
||||
class QSlider;
|
||||
class QCheckBox;
|
||||
class QDateTimeEdit;
|
||||
|
||||
namespace Settings {
|
||||
class BasicSetting;
|
||||
@@ -23,6 +24,8 @@ enum class RequestType {
|
||||
Slider,
|
||||
ReverseSlider,
|
||||
LineEdit,
|
||||
HexEdit,
|
||||
DateTimeEdit,
|
||||
MaxEnum,
|
||||
};
|
||||
|
||||
@@ -33,8 +36,7 @@ public:
|
||||
Widget(Settings::BasicSetting* setting, const TranslationMap& translations, QWidget* parent,
|
||||
bool runtime_lock, std::forward_list<std::function<void(bool)>>& apply_funcs,
|
||||
RequestType request = RequestType::Default, bool managed = true, float multiplier = 1.0f,
|
||||
Settings::BasicSetting* other_setting = nullptr,
|
||||
const QString& format = QStringLiteral(""));
|
||||
Settings::BasicSetting* other_setting = nullptr, const std::string& format = "");
|
||||
virtual ~Widget();
|
||||
|
||||
bool Valid();
|
||||
@@ -48,13 +50,18 @@ public:
|
||||
QCheckBox* checkbox{};
|
||||
QSlider* slider{};
|
||||
QComboBox* combobox{};
|
||||
QDateTimeEdit* date_time_edit{};
|
||||
|
||||
private:
|
||||
void CreateCheckBox(const QString& label, std::function<void()>& load_func);
|
||||
void CreateCheckBoxWithLineEdit(const QString& label, Settings::BasicSetting* other_setting,
|
||||
std::function<void()>& load_func);
|
||||
void CreateCheckBoxWithHexEdit(const QString& label, Settings::BasicSetting* other_setting,
|
||||
std::function<void()>& load_func);
|
||||
void CreateCheckBoxWithSpinBox(const QString& label, Settings::BasicSetting* other_setting,
|
||||
std::function<void()>& load_func, const QString& suffix);
|
||||
std::function<void()>& load_func, const std::string& suffix);
|
||||
void CreateCheckBoxWithDateTimeEdit(const QString& label, Settings::BasicSetting* other_setting,
|
||||
std::function<void()>& load_func);
|
||||
void CreateCombobox(const QString& label, bool managed, std::function<void()>& load_func);
|
||||
void CreateLineEdit(const QString& label, bool managed, std::function<void()>& load_func);
|
||||
void CreateSlider(const QString& label, bool reversed, float multiplier,
|
||||
|
||||
Reference in New Issue
Block a user