shared_widget: Forward-port Citra changes

Seemed like a good time to move these over.
Also remove usage of std::sto{l,ll,ul,f,d}
This commit is contained in:
lat9nq
2023-09-13 13:50:25 -04:00
parent 2d2c176f03
commit 3ae3706c84
2 changed files with 134 additions and 31 deletions

View File

@ -22,6 +22,7 @@ class QObject;
class QPushButton;
class QSlider;
class QSpinBox;
class QDoubleSpinBox;
class QRadioButton;
namespace Settings {
@ -43,6 +44,9 @@ enum class RequestType {
MaxEnum,
};
constexpr const float default_multiplier{1.f};
constexpr const float default_float_multiplier{100.f};
class Widget : public QWidget {
Q_OBJECT
@ -89,6 +93,7 @@ public:
QPushButton* restore_button{}; ///< Restore button for custom configurations
QLineEdit* line_edit{}; ///< QLineEdit, used for LineEdit and HexEdit
QSpinBox* spinbox{};
QDoubleSpinBox* double_spinbox{};
QCheckBox* checkbox{};
QSlider* slider{};
QComboBox* combobox{};
@ -126,6 +131,9 @@ private:
const std::function<void()>& touch);
QWidget* CreateSpinBox(const QString& suffix, std::function<std::string()>& serializer,
std::function<void()>& restore_func, const std::function<void()>& touch);
QWidget* CreateDoubleSpinBox(const QString& suffix, std::function<std::string()>& serializer,
std::function<void()>& restore_func,
const std::function<void()>& touch);
QWidget* parent;
const TranslationMap& translations;