mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-03 07:05:52 -05:00
Extract argument list to generic string list class and widget
To be used for http header support.
This commit is contained in:
49
src/utils/string-list.hpp
Normal file
49
src/utils/string-list.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
#include <obs-data.h>
|
||||
#include <obs-module.h>
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QListWidget>
|
||||
#include <QStringList>
|
||||
|
||||
class StringList : public QStringList {
|
||||
public:
|
||||
bool Save(obs_data_t *obj, const char *name,
|
||||
const char *elementName = "string") const;
|
||||
bool Load(obs_data_t *obj, const char *name,
|
||||
const char *elementName = "string");
|
||||
|
||||
friend class StringListEdit;
|
||||
};
|
||||
|
||||
class StringListEdit : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StringListEdit(QWidget *parent, const QString &addString = "",
|
||||
const QString &addStringDescription = "");
|
||||
void SetStringList(const StringList &);
|
||||
|
||||
private slots:
|
||||
void Add();
|
||||
void Remove();
|
||||
void Up();
|
||||
void Down();
|
||||
void Clicked(QListWidgetItem *);
|
||||
signals:
|
||||
void StringListChanged(const StringList &);
|
||||
|
||||
private:
|
||||
void SetListSize();
|
||||
|
||||
StringList _stringList;
|
||||
|
||||
QListWidget *_list;
|
||||
QPushButton *_add;
|
||||
QPushButton *_remove;
|
||||
QPushButton *_up;
|
||||
QPushButton *_down;
|
||||
|
||||
QString _addString;
|
||||
QString _addStringDescription;
|
||||
};
|
||||
Reference in New Issue
Block a user