27 #include "../../../dataaccess/datasource/DataSourceManager.h" 28 #include "../../../dataaccess/datasource/DataSourceCapabilities.h" 29 #include "../../../datatype/DateTimeProperty.h" 30 #include "../../../datatype/NumericProperty.h" 31 #include "../../../datatype/SimpleProperty.h" 32 #include "../../../datatype/StringProperty.h" 33 #include "../../../geometry/GeometryProperty.h" 37 #include "ui_NewPropertyWidgetForm.h" 40 #include <QMessageBox> 45 m_ui(new
Ui::NewPropertyWidgetForm),
47 m_simpleProperty(nullptr)
53 m_layout->setAlignment(Qt::AlignTop);
70 m_ui->m_dataTypeComboBox->clear();
72 m_ui->m_dataTypeComboBox->addItem(
"");
158 if(
m_ui->m_dataTypeComboBox->currentText().isEmpty())
160 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Type not selected."));
164 if(
m_ui->m_nameLineEdit->text().isEmpty())
166 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Name not defined."));
169 std::string name =
m_ui->m_nameLineEdit->text().toUtf8().data();
171 std::string defaultValue;
172 if(
m_ui->m_defaultValueLineEdit->text().isEmpty() ==
false)
174 defaultValue =
m_ui->m_defaultValueLineEdit->text().toUtf8().data();
177 bool isRequired =
m_ui->m_requiredCheckBox->isChecked();
179 bool isAutoNumber =
m_ui->m_autoNumberCheckBox->isChecked();
184 int index =
m_ui->m_dataTypeComboBox->currentIndex();
185 int dataType =
m_ui->m_dataTypeComboBox->itemData(index).toInt();
201 if (defaultValue.empty())
212 if (defaultValue.empty())
221 if (defaultValue.empty())
232 if (defaultValue.empty())
241 if (defaultValue.empty())
265 m_ui->m_nameLineEdit->clear();
267 m_ui->m_defaultValueLineEdit->clear();
268 m_ui->m_defaultValueLineEdit->setEnabled(
true);
270 m_ui->m_autoNumberCheckBox->setChecked(
false);
271 m_ui->m_autoNumberCheckBox->setEnabled(
true);
273 m_ui->m_requiredCheckBox->setChecked(
false);
274 m_ui->m_requiredCheckBox->setEnabled(
true);
280 QVariant var =
m_ui->m_dataTypeComboBox->itemData(index);
285 int dataType = var.toInt();
void setAutoNumber(bool a)
It tells if the property is an autonumber or not.
bool supportsUInt16() const
An atomic property like an integer or double.
bool supportsUInt32() const
bool supportsBoolean() const
bool supportsChar() const
boost::shared_ptr< DataSource > DataSourcePtr
const DataTypeCapabilities & getDataTypeCapabilities() const
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
static te::dt::Date ds(2010, 01, 01)
bool supportsNumeric() const
A class that represents the supported data types of a specific data source.
The type for arbitrary precison numbers, like numeric(p, q).
bool supportsInt16() const
te::da::DataTypeCapabilities dataTypeCapabilities
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
bool supportsString() const
te::da::DataSourceCapabilities capabilities
bool supportsInt64() const
The type for string types: FIXED_STRING, VAR_STRING or STRING.
bool supportsFloat() const
virtual Property * clone() const
It returns a clone of the object.
bool supportsUInt64() const
bool supportsGeometry() const
static const factory_type * find(const int &factoryKey)
The type for date and time types: date, date period, date duration, time duration, time instant, time period, time instant with time zone or time period with time zone.
bool supportsInt32() const
bool supportsDateTime() const
bool supportsUChar() const
bool supportsDouble() const