39 const QString& propertyName,
41 QWidget(parent), elementName(elementName), propertyName(propertyName)
43 layout =
new QHBoxLayout;
45 layout->setSpacing(0);
47 const std::string file =
49 QSettings settings(QString(file.c_str()), QSettings::NativeFormat);
50 valueList = settings.value(elementName +
"/" + propertyName).toStringList();
54 combo->setEditable(
true);
55 combo->setAutoCompletion(
true);
56 combo->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
57 combo->addItems(valueList);
59 readOnlyLineEdit =
new QLineEdit();
60 readOnlyLineEdit->setReadOnly(
true);
61 readOnlyLineEdit->setVisible(
false);
63 checkbox =
new QCheckBox(
nullptr);
64 checkbox->setToolTip(
"If checked, this property will be written into the config file");
65 checkbox->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
67 setFocusPolicy(Qt::StrongFocus);
68 setAttribute(Qt::WA_InputMethodEnabled);
75 connect(checkbox, SIGNAL(stateChanged(
int)),
this, SLOT(slotEnabledChanged(
int)));
78 layout->addWidget(checkbox);
79 layout->addWidget(combo);
80 layout->addWidget(readOnlyLineEdit);
82 this->setLayout(layout);
140 valueList.push_front(combo->currentText());
141 valueList.removeDuplicates();
142 if (!fixComboboxValues)
146 combo->addItems(valueList);
150 const std::string file =
152 QSettings settings(QString(file.c_str()), QSettings::NativeFormat);
153 settings.setValue(elementName +
"/" + propertyName, QVariant(valueList));