18 #include <QVBoxLayout>
21 QStringList toList(
const std::vector<std::string>& container)
24 for (
const auto& str : container)
25 result.push_back(QString::fromStdString(str));
35 setAutoFillBackground(
true);
36 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
38 auto layout =
new QVBoxLayout;
40 layout->setSpacing(0);
41 layout->addWidget(
m_box);
49 return m_box->sizeHint();
54 return m_box->minimumSizeHint();
66 if (comboProperty.currentIndex() != index) {
68 setDataIntern(QVariant::fromValue<ComboProperty>(comboProperty));
90 return comboProperty.
values();
106 connect(
m_box,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
this,
109 disconnect(
m_box,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
int internIndex()
Returns index for QComboBox.
void setConnected(bool isConnected)
virtual void onIndexChanged(int index)
QSize minimumSizeHint() const override
QSize sizeHint() const override
std::vector< std::string > internLabels()
Returns list of labels for QComboBox.
bool is_persistent() const override
Returns true if editor should remains alive after editing finished.
void update_components() override
Should update widget components from m_data, if necessary.
ComboPropertyEditor(QWidget *parent=nullptr)
Custom property to define list of string values with multiple selections.
std::vector< std::string > values() const
void setCurrentIndex(int index)
Base class for all custom variant editors.
void setDataIntern(const QVariant &data)
Saves the data as given by editor's internal components and notifies the model.
materialitems.h Collection of materials to populate MaterialModel.