| 43 | class Ui_Array2D; |
| 44 | |
| 45 | class Array2D: public QDialog |
| 46 | { |
| 47 | Q_OBJECT |
| 48 | |
| 49 | public: |
| 50 | Array2D(const QString& propertyName, |
| 51 | const std::shared_ptr<Materials::Material>& material, |
| 52 | QWidget* parent = nullptr); |
| 53 | ~Array2D() override = default; |
| 54 | |
| 55 | void onDataChanged(const QModelIndex& topLeft, |
| 56 | const QModelIndex& bottomRight, |
| 57 | const QVector<int>& roles = QVector<int>()); |
| 58 | void onDelete(bool checked); |
| 59 | void onContextMenu(const QPoint& pos); |
| 60 | |
| 61 | void accept() override; |
| 62 | void reject() override; |
| 63 | |
| 64 | private: |
| 65 | std::unique_ptr<Ui_Array2D> ui; |
| 66 | std::shared_ptr<Materials::Material> _material; |
| 67 | std::shared_ptr<Materials::MaterialProperty> _property; |
| 68 | std::shared_ptr<Materials::Array2D> _value; |
| 69 | |
| 70 | QAction _deleteAction; |
| 71 | |
| 72 | void setColumnWidths(QTableView* table); |
| 73 | void setColumnDelegates(QTableView* table); |
| 74 | void setupArray(); |
| 75 | |
| 76 | bool newRow(const QModelIndex& index); |
| 77 | int confirmDelete(); |
| 78 | void deleteSelected(); |
| 79 | }; |
| 80 | |
| 81 | } // namespace MatGui |
no outgoing calls