1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 23:54:01 +00:00
openmw/apps/opencs/model/prefs/stringsetting.hpp

43 lines
851 B
C++
Raw Normal View History

#ifndef CSM_PREFS_StringSetting_H
#define CSM_PREFS_StringSetting_H
#include "setting.hpp"
2022-10-19 17:02:00 +00:00
#include <string>
#include <utility>
class QLineEdit;
2022-10-19 17:02:00 +00:00
class QMutex;
class QObject;
class QWidget;
namespace CSMPrefs
{
2022-10-19 17:02:00 +00:00
class Category;
class StringSetting : public Setting
{
2022-09-22 18:26:05 +00:00
Q_OBJECT
2022-09-22 18:26:05 +00:00
std::string mTooltip;
std::string mDefault;
QLineEdit* mWidget;
2022-09-22 18:26:05 +00:00
public:
2023-07-29 07:44:39 +00:00
StringSetting(Category* parent, QMutex* mutex, const std::string& key, const std::string& label,
std::string_view default_);
2022-09-22 18:26:05 +00:00
StringSetting& setTooltip(const std::string& tooltip);
2022-09-22 18:26:05 +00:00
/// Return label, input widget.
std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent) override;
2022-09-22 18:26:05 +00:00
void updateWidget() override;
2022-09-22 18:26:05 +00:00
private slots:
2022-09-22 18:26:05 +00:00
void textChanged(const QString& text);
};
}
#endif