Add support for variables in file FileSelection widget

This commit is contained in:
WarmUpTill
2023-02-22 14:23:18 +01:00
committed by WarmUpTill
parent 1dd46fb777
commit 783f76d55d
3 changed files with 15 additions and 7 deletions

View File

@@ -7,12 +7,12 @@
#include <filesystem>
FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
: QWidget(parent), _type(type)
: QWidget(parent),
_type(type),
_filePath(new VariableLineEdit(this)),
_browseButton(
new QPushButton(obs_module_text("AdvSceneSwitcher.browse")))
{
_filePath = new QLineEdit();
_browseButton =
new QPushButton(obs_module_text("AdvSceneSwitcher.browse"));
QWidget::connect(_filePath, SIGNAL(editingFinished()), this,
SLOT(PathChange()));
QWidget::connect(_browseButton, SIGNAL(clicked()), this,
@@ -24,6 +24,11 @@ FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
setLayout(layout);
}
void FileSelection::SetPath(const VariableResolvingString &path)
{
_filePath->setText(path);
}
void FileSelection::SetPath(const QString &path)
{
_filePath->setText(path);