Rework SourceSelectionWidget to support widget caching

This commit is contained in:
WarmUpTill
2025-05-20 21:37:18 +02:00
committed by WarmUpTill
parent 3dd3f576c3
commit ba3e87a761
15 changed files with 125 additions and 78 deletions

View File

@@ -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