Skip to content
Snippets Groups Projects

Extended support for linked scenarios

Merged Peter Naumann requested to merge feature/linked-scenarios into master
All threads resolved!
7 files
+ 203
20
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -57,6 +57,10 @@ OptionalEdit::OptionalEdit(const QString& elementName, const QString& propertyNa
combo->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
combo->addItems(valueList);
readOnlyLineEdit = new QLineEdit();
readOnlyLineEdit->setReadOnly(true);
readOnlyLineEdit->setVisible(false);
checkbox = new QCheckBox(nullptr);
checkbox->setToolTip("If checked, this property will be written into the config file");
checkbox->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
@@ -74,7 +78,9 @@ OptionalEdit::OptionalEdit(const QString& elementName, const QString& propertyNa
layout->addWidget(checkbox);
layout->addWidget(combo);
layout->addWidget(readOnlyLineEdit);
this->isReadOnly = false;
this->setLayout(layout);
}
@@ -103,6 +109,19 @@ void OptionalEdit::setPropertyEnabled(const bool& enabled)
}
}
void OptionalEdit::setReadOnly(bool readOnly)
{
if (readOnly == this->isReadOnly)
{
return;
}
checkbox->setDisabled(readOnly);
combo->setVisible(not readOnly);
readOnlyLineEdit->setVisible(readOnly);
}
void OptionalEdit::setValue(const QString& value)
{
@@ -110,6 +129,7 @@ void OptionalEdit::setValue(const QString& value)
bool enabledState = checkbox->isChecked();
// ARMARX_INFO << VAROUT(value.toStdString()) << VAROUT(enabledState);
combo->setCurrentText(value);
readOnlyLineEdit->setText(value);
if (checkbox->isChecked() != enabledState)
{
Loading