mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Rework SourceSelectionWidget to support widget caching
This commit is contained in:
@@ -39,13 +39,16 @@ class ADVSS_EXPORT SourceSelectionWidget : public FilterComboBox {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SourceSelectionWidget(QWidget *parent, const QStringList &sourceNames,
|
||||
SourceSelectionWidget(QWidget *parent,
|
||||
const std::function<QStringList()> &populate,
|
||||
bool addVariables = true);
|
||||
void SetSource(const SourceSelection &);
|
||||
void SetSourceNameList(const QStringList &);
|
||||
signals:
|
||||
void SourceChanged(const SourceSelection &);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void SelectionChanged(int);
|
||||
void ItemAdd(const QString &name);
|
||||
@@ -59,7 +62,7 @@ private:
|
||||
bool NameUsed(const QString &name);
|
||||
|
||||
bool _addVariables;
|
||||
QStringList _sourceNames;
|
||||
std::function<QStringList()> _populateSourcesCallback;
|
||||
SourceSelection _currentSelection;
|
||||
|
||||
// Order of entries
|
||||
|
||||
Reference in New Issue
Block a user