mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-10-22 08:36:23 -05:00
Add ValueInputWidget
This commit is contained in:
38
lib/utils/value-input.hpp
Normal file
38
lib/utils/value-input.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "export-symbol-helper.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
#include <string>
|
||||
|
||||
class QComboBox;
|
||||
|
||||
namespace advss {
|
||||
|
||||
enum class ValueInputType {
|
||||
File,
|
||||
Folder,
|
||||
Scene,
|
||||
Source,
|
||||
String,
|
||||
Variable,
|
||||
Selection,
|
||||
};
|
||||
|
||||
void PopulateValueInputTypeSelection(QComboBox *list);
|
||||
|
||||
class ValueInputWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValueInputWidget(ValueInputType type, const std::string &defaultValue,
|
||||
const QStringList &options = {},
|
||||
QWidget *parent = nullptr);
|
||||
std::string Value() const;
|
||||
|
||||
private:
|
||||
std::function<std::string()> _getValue;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
Reference in New Issue
Block a user