34#include <NDEVR/DesignTableModel.h>
35#include <NDEVR/Button.h>
36#include <NDEVR/Translator.h>
40#include <QItemDelegate>
45 class QCustomTableWidget;
46 class DesignObjectSearchWidget;
56 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
57 bool editorEvent(QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option,
const QModelIndex& index)
override;
77 void dataChanged(
const QModelIndex& topLeft,
const QModelIndex& bottomRight,
const QVector<int>& roles)
override;
78 void rowsInserted(
const QModelIndex& parent,
int start,
int end)
override;
97 bool event(QEvent* event)
override;
#define _t(english_string)
Definition Translator.h:90
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
DesignProperty
Values stored in the property database.
Definition DesignObject.h:93
A definition of data that is logically stored in the Model heirarchy. Data could be a property of a M...
Definition DesignParameter.h:46
A base class for tables wishing to show columns of DesignObject properties.
Definition DesignPropertyTable.h:86
Button * m_edit_button
Definition DesignPropertyTable.h:129
uint04 addParentPathColumn(const TranslatedString &custom_column_name=TranslatedString())
void setList(const Buffer< UUID > &models)
void setColumnVisible(uint04 column, bool visible)
uint04 addColumn(const ModelTableColumnSpec &column)
DesignPropertyTable(QWidget *parent=nullptr)
void addWidget(QWidget *widget)
void contextMenu(const QPoint &pos)
void filterAndSetList(Buffer< UUID > models)
QHBoxLayout * m_bottom_button_layout
Definition DesignPropertyTable.h:130
void setAddedFilter(const std::function< bool(const Model &)> &callback)
DesignObjectSearchWidget * m_search_text
Definition DesignPropertyTable.h:128
uint04 addColumn(const DesignParameter ¶meter, bool is_editable=true)
DesignTableModel * m_view_model
Definition DesignPropertyTable.h:133
void addListItem(const UUID &id)
virtual ~DesignPropertyTable()
bool event(QEvent *event) override
void setColumnEditable(uint04 column, bool editable)
void setSortCallback(const std::function< bool(const Model &a, const Model &b)> &callback)
void setEditable(bool editable)
void viewSettingsSignal()
virtual void setModelManager(QTModelManager *manager)
uint04 addColumn(const TranslatedString &name, const String &icon, const std::function< void(UUID)> &callback)
DesignSortFilterProxyModel * m_sort_model
Definition DesignPropertyTable.h:134
void showSearch(bool show_search)
QWidget * m_search_widget
Definition DesignPropertyTable.h:127
uint04 addColumn(DesignObject::DesignProperty property, bool is_editable=true)
Buffer< UUID > selectedIDs() const
void addOpenButton(std::function< void(Button *)> callback, const TranslatedString &new_title=_t("Open"), const String &add_icon="open")
uint04 addColumn(const TranslatedString &custom_column_name, const DesignParameter ¶meter, bool is_editable=true)
const std::function< void(Model, PopupInfo)> & selectedCallback() const
Definition DesignPropertyTable.h:120
QTModelManager * m_manager
Definition DesignPropertyTable.h:132
DesignPropertyTableView * m_table_view
Definition DesignPropertyTable.h:131
void setSelectedCallback(const std::function< void(Model, PopupInfo)> &callback)
Definition DesignPropertyTable.h:118
void updateRow(uint04 row)
DesignPropertyTable(QTModelManager *manager, QWidget *parent=nullptr)
void setTypeAddedFilter(const String &type)
uint04 addMaterialDataColumn(const TranslatedString &custom_column_name=TranslatedString())
void selected(QModelIndex index)
void addNewButton(std::function< void(Button *)> callback, const TranslatedString &new_title=_t("Add New"), const String &add_icon="plus")
A QTableView for showing Model or DesignObject properties.
Definition DesignPropertyTable.h:68
QSize minimumSizeHint() const override
DesignPropertyTableView(QWidget *parent=nullptr)
DesignTableModel * model() const
Definition DesignPropertyTable.h:72
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) override
DesignSortFilterProxyModel * m_table_model
Definition DesignPropertyTable.h:80
Buffer< UUID > selectedIDs() const
void setProxyModel(DesignSortFilterProxyModel *model)
void rowsInserted(const QModelIndex &parent, int start, int end) override
Provides the ability to pull data from a DesignObjectLookup for display in tables within the NDEVR AP...
Definition DesignTableModel.h:195
DesignTableModel * model()
Provides the ability to pull data from a DesignObjectLookup for display in tables within the NDEVR AP...
Definition DesignTableModel.h:124
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A QItemDelegate for showing model properties in a QTableView.
Definition DesignPropertyTable.h:52
void setModel(DesignSortFilterProxyModel *model)
Definition DesignPropertyTable.h:58
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
MaterialWidget * m_draw_material_widget
Definition DesignPropertyTable.h:61
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
MaterialWidget * m_click_material_widget
Definition DesignPropertyTable.h:62
DesignSortFilterProxyModel * m_table_model
Definition DesignPropertyTable.h:60
ModelTableDelegate(DesignSortFilterProxyModel *model, QObject *parent=nullptr)
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Provides the ability to pull specific data from a DesignObjectLookup for display in a column of a tab...
Definition DesignTableModel.h:53