1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 18:45:36 +00:00
openmw/apps/opencs/model/prefs/enumsetting.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
941 B
C++
Raw Normal View History

2015-12-10 16:33:14 +00:00
#ifndef CSM_PREFS_ENUMSETTING_H
#define CSM_PREFS_ENUMSETTING_H
#include <span>
2022-10-19 17:02:00 +00:00
#include <string>
#include <string_view>
2022-10-19 17:02:00 +00:00
#include <utility>
2015-12-10 16:33:14 +00:00
#include <vector>
#include "enumvalueview.hpp"
2015-12-10 16:33:14 +00:00
#include "setting.hpp"
class QComboBox;
2015-12-10 16:33:14 +00:00
namespace CSMPrefs
{
2022-10-19 17:02:00 +00:00
class Category;
2023-11-11 23:52:09 +00:00
class EnumSetting final : public TypedSetting<std::string>
2015-12-10 16:33:14 +00:00
{
Q_OBJECT
std::string mTooltip;
std::span<const EnumValueView> mValues;
QComboBox* mWidget;
2015-12-10 16:33:14 +00:00
2022-09-22 18:26:05 +00:00
public:
explicit EnumSetting(Category* parent, QMutex* mutex, std::string_view key, const QString& label,
std::span<const EnumValueView> values, Settings::Index& index);
2015-12-10 16:33:14 +00:00
EnumSetting& setTooltip(const std::string& tooltip);
/// Return label, input widget.
SettingWidgets makeWidgets(QWidget* parent) override;
2015-12-10 16:33:14 +00:00
void updateWidget() override;
2015-12-10 16:33:14 +00:00
private slots:
void valueChanged(int value);
};
}
#endif