34#include <NDEVR/DesignObject.h>
35#include <NDEVR/DesignParameter.h>
36#include <QSortFilterProxyModel>
37#include <QAbstractTableModel>
45 class QTResourceListener;
80 , type(
std::move(type))
87 bool is_clicked =
false;
89 bool is_currently_editable =
false;
104 [[nodiscard]] QVariant data(
const DesignObject& obj,
int role = Qt::DisplayRole)
const;
105 [[nodiscard]]
bool setData(
const DesignObject& obj,
const QVariant& value,
int role);
107 [[nodiscard]]
bool isValid()
const;
108 [[nodiscard]]
bool isTextEditable()
const;
109 [[nodiscard]]
bool isCheckEditable()
const;
113 [[nodiscard]] QVariant parameterData(
const DesignObject& obj,
int role)
const;
122 [[nodiscard]]
int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
123 [[nodiscard]]
int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
125 [[nodiscard]] QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
126 [[nodiscard]] QVariant userData(
const QModelIndex& index,
int role)
const;
127 [[nodiscard]]
bool isMaterialIndex(
const QModelIndex& index)
const;
128 [[nodiscard]]
bool isSpecialCallbackIndex(
const QModelIndex& index)
const;
129 [[nodiscard]]
bool setData(
const QModelIndex& index,
const QVariant& value,
int role)
override;
130 [[nodiscard]] QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
143 [[nodiscard]] Qt::ItemFlags flags(
const QModelIndex& index)
const override;
145 [[nodiscard]]
UUID getUUID(QModelIndex index)
const;
146 [[nodiscard]]
UUID getUUID(QModelIndex index,
int row)
const;
149 [[nodiscard]]
Model getModel(QModelIndex index)
const;
150 [[nodiscard]]
DesignObject getObject(QModelIndex index,
int row)
const;
151 [[nodiscard]]
DesignObject getObject(QModelIndex index)
const;
152 void onSelected(QModelIndex index,
const QRect& rect);
153 bool isEditable()
const;
154 bool isObjectAllowed(
const UUID&
object)
const;
155 bool canAddObject(
const Model&
object)
const;
156 bool isObjectAllowed(
const Model&
object)
const;
157 void setIsEditable(
bool is_editable);
158 void setColumnEditable(
uint04 column,
bool is_editable);
165 void updateColumn(
uint04 index);
188 void setSearchString(
const String& search_string);
190 void sort(Qt::SortOrder order = Qt::DescendingOrder);
191 void sort(
int column, Qt::SortOrder order = Qt::DescendingOrder)
override;
195 void onSelected(
const QModelIndex& index,
const QRect& rect);
196 Model getModel(
const QModelIndex& index);
197 UUID getUUID(
const QModelIndex& index);
201 [[nodiscard]]
bool isMaterialIndex(
const QModelIndex& index)
const;
202 [[nodiscard]]
bool isSpecialCallbackIndex(
const QModelIndex& index)
const;
203 bool isEditable()
const;
204 void setIsEditable(
bool is_editable);
205 void setColumnEditable(
uint04 column,
bool is_editable);
208 void setSortCallback(
const std::function<
bool(
const Model& a,
const Model& b)>& callback);
213 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex& sourceParent)
const override;
214 virtual bool lessThan(
const QModelIndex& left,
const QModelIndex& right)
const override;
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObject.h:66
DesignProperty
Definition DesignObject.h:94
Definition DesignParameter.h:42
Definition DesignTableModel.h:184
DesignTableModel * m_design_model
Definition DesignTableModel.h:223
void searchByParameterChangedSignal()
std::function< void(Model, PopupInfo)> m_selected_callback
Definition DesignTableModel.h:219
String m_search_string
Definition DesignTableModel.h:218
ModelTableColumnSpec m_search_parameter
Definition DesignTableModel.h:221
ModelTableColumnSpec m_current_search_parameter
Definition DesignTableModel.h:222
Buffer< ModelTableColumnSpec > m_sort_by
Definition DesignTableModel.h:224
const std::function< void(Model, PopupInfo)> & selectedCallback() const
Definition DesignTableModel.h:209
std::function< bool(const Model &a, const Model &b)> m_sort_function
Definition DesignTableModel.h:220
QTModelManager * modelManager() const
Definition DesignTableModel.h:206
void setSelectedCallback(const std::function< void(Model, PopupInfo)> &callback)
Definition DesignTableModel.h:207
Definition DesignTableModel.h:116
Buffer< UUID > m_models
Definition DesignTableModel.h:172
void setAddedFilter(const std::function< bool(const Model &)> &callback)
Definition DesignTableModel.h:132
std::function< bool(const Model &)> m_added_filter
Definition DesignTableModel.h:173
Buffer< TranslatedString > m_custom_column_titles
Definition DesignTableModel.h:175
Buffer< BitFlag > m_callback_clicked
Definition DesignTableModel.h:176
bool m_is_editable
Definition DesignTableModel.h:180
QTModelManager * m_manager
Definition DesignTableModel.h:171
QTModelManager * modelManager() const
Definition DesignTableModel.h:144
Buffer< ModelTableColumnSpec > m_columns
Definition DesignTableModel.h:174
Definition Pointer.hpp:303
Definition QTModelManager.h:94
Definition TranslatedString.h:9
constexpr int model_table_is_selected_index
Definition DesignTableModel.h:47
constexpr int model_table_is_clicked_index
Definition DesignTableModel.h:46
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
Definition DesignTableModel.h:71
String type
Definition DesignTableModel.h:73
RelativePathObject(RelativePath path, String type)
Definition DesignTableModel.h:78
RelativePathObject(RelativePath path)
Definition DesignTableModel.h:75
RelativePath path
Definition DesignTableModel.h:72
Definition DesignTableModel.h:49
uint04 min_decimal_places
Definition DesignTableModel.h:91
ModelTableType
Definition DesignTableModel.h:51
TranslatedString custom_column_name
Definition DesignTableModel.h:84
std::function< void(UUID)> callback
Definition DesignTableModel.h:92
bool is_editable
Definition DesignTableModel.h:88
String custom_icon
Definition DesignTableModel.h:86
TranslatedString custom_text
Definition DesignTableModel.h:85
DesignParameter design_parameter
Definition DesignTableModel.h:93
uint04 max_decimal_places
Definition DesignTableModel.h:90
ModelTableType column_type
Definition DesignTableModel.h:83
Buffer< RelativePathObject > relative_path
Definition DesignTableModel.h:94
RelativePath
Definition DesignTableModel.h:57
@ e_child_index
Definition DesignTableModel.h:60