27 #include "../../../dataaccess/dataset/DataSetType.h" 28 #include "../../../dataaccess/dataset/Index.h" 29 #include "../utils/DoubleListWidget.h" 31 #include "ui_DoubleListWidgetForm.h" 32 #include "ui_IndexWidgetForm.h" 35 #include <QGridLayout> 36 #include <QMessageBox> 40 m_ui(new
Ui::IndexWidgetForm)
56 QGridLayout* layout =
new QGridLayout(
m_ui->m_widget);
64 std::vector<std::string> propValues;
85 if(
m_ui->m_nameLineEdit->text().isEmpty())
90 std::string indexName =
m_ui->m_nameLineEdit->text().toUtf8().data();
93 int currIndex =
m_ui->m_typeComboBox->currentIndex();
94 int indexType =
m_ui->m_typeComboBox->itemData(currIndex).toInt();
112 for(
size_t t = 0; t < vec.size(); ++t)
125 if(
m_ui->m_nameLineEdit->text().isEmpty())
127 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Index name not defined."));
136 QMessageBox::warning(
this, tr(
"Warning"), tr(
"No property selected."));
148 m_ui->m_nameLineEdit->setText(idx->
getName().c_str());
152 std::vector<te::dt::Property*> idxProps = idx->
getProperties();
153 std::vector<std::string> idxPropsStr;
154 for(std::size_t i = 0; i < idxProps.size(); ++i)
156 idxPropsStr.push_back(idxProps[i]->getName());
160 std::vector<std::string> dtPropsStr;
161 for(std::size_t i = 0; i < dtProps.size(); ++i)
163 std::string propStr = dtProps[i]->getName();
165 if(std::find(idxPropsStr.begin(), idxPropsStr.end(), propStr) != idxPropsStr.end())
168 dtPropsStr.push_back(propStr);
Property * getProperty(std::size_t i) const
It returns the i-th property.
A class that models the description of a dataset.
void setIndexType(IndexType t)
It sets the index type.
void add(te::dt::Property *p)
It adds the property to the list of properties of the index.
virtual Property * clone() const =0
It returns a clone of the object.
It models a property definition.
const std::vector< Property * > & getProperties() const
It returns the list of properties describing the CompositeProperty.
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that take part of the index.
void setName(const std::string &name)
It sets the index name.
IndexType getIndexType() const
It gets the index type.
It describes an index associated to a DataSetType.
const std::string & getName() const
It returns the property name.
const std::string & getName() const
It returns the index name.