Add property models for FEM
This commit is contained in:
@@ -62,6 +62,7 @@ Array2D::Array2D(const QString& propertyName,
|
||||
if (_property) {
|
||||
_value =
|
||||
std::static_pointer_cast<Materials::Material2DArray>(_property->getMaterialValue());
|
||||
setWindowTitle(_property->getDisplayName());
|
||||
}
|
||||
else {
|
||||
_value = nullptr;
|
||||
@@ -81,16 +82,6 @@ Array2D::Array2D(const QString& propertyName,
|
||||
connect(ui->standardButtons, &QDialogButtonBox::rejected, this, &Array2D::reject);
|
||||
}
|
||||
|
||||
void Array2D::setHeaders(QStandardItemModel* model)
|
||||
{
|
||||
QStringList headers;
|
||||
auto columns = _property->getColumns();
|
||||
for (auto column = columns.begin(); column != columns.end(); column++) {
|
||||
headers.append(column->getName());
|
||||
}
|
||||
model->setHorizontalHeaderLabels(headers);
|
||||
}
|
||||
|
||||
void Array2D::setColumnWidths(QTableView* table)
|
||||
{
|
||||
int length = _property->columns();
|
||||
|
||||
@@ -68,7 +68,6 @@ private:
|
||||
|
||||
QAction _deleteAction;
|
||||
|
||||
void setHeaders(QStandardItemModel* model);
|
||||
void setColumnWidths(QTableView* table);
|
||||
void setColumnDelegates(QTableView* table);
|
||||
void setupArray();
|
||||
|
||||
@@ -111,7 +111,7 @@ QVariant Array2DModel::headerData(int section, Qt::Orientation orientation, int
|
||||
if (role == Qt::DisplayRole) {
|
||||
if (orientation == Qt::Horizontal) {
|
||||
const Materials::MaterialProperty& column = _property->getColumn(section);
|
||||
return column.getName();
|
||||
return column.getDisplayName();
|
||||
}
|
||||
else if (orientation == Qt::Vertical) {
|
||||
// Vertical header
|
||||
@@ -251,7 +251,7 @@ QVariant Array3DDepthModel::headerData(int section, Qt::Orientation orientation,
|
||||
if (role == Qt::DisplayRole) {
|
||||
if (orientation == Qt::Horizontal) {
|
||||
const Materials::MaterialProperty& column = _property->getColumn(section);
|
||||
return column.getName();
|
||||
return column.getDisplayName();
|
||||
}
|
||||
if (orientation == Qt::Vertical) {
|
||||
// Vertical header
|
||||
@@ -406,7 +406,7 @@ QVariant Array3DModel::headerData(int section, Qt::Orientation orientation, int
|
||||
if (role == Qt::DisplayRole) {
|
||||
if (orientation == Qt::Horizontal) {
|
||||
const Materials::MaterialProperty& column = _property->getColumn(section + 1);
|
||||
return column.getName();
|
||||
return column.getDisplayName();
|
||||
}
|
||||
if (orientation == Qt::Vertical) {
|
||||
// Vertical header
|
||||
|
||||
Reference in New Issue
Block a user