API Documentation
Loading...
Searching...
No Matches
DesignTableModel Class Reference

Provides the ability to pull data from a DesignObjectLookup for display in tables within the NDEVR API. More...

#include <DesignTableModel.h>

Inheritance diagram for DesignTableModel:
[legend]
Collaboration diagram for DesignTableModel:
[legend]

Public Slots

void modelUpdatedSlot (const Buffer< UUID > &ids)
 
void objectAddedSlot (const Buffer< UUID > &ids)
 
void objectDeletedSlot (const Buffer< UUID > &ids)
 

Public Member Functions

uint04 addColumn (const DesignParameter &parameter, bool is_editable)
 
uint04 addColumn (const ModelTableColumnSpec &column)
 
uint04 addColumn (const TranslatedString &name, const String &icon, const std::function< void(UUID)> &callback)
 
uint04 addColumn (DesignObject::DesignProperty property, bool is_editable)
 
uint04 addGrandparentNameColumn (const TranslatedString &custom_column_name=TranslatedString())
 
uint04 addMaterialDataColumn (const TranslatedString &custom_column_name=TranslatedString())
 
uint04 addParentDataColumn (const DesignParameter &param, bool is_editable, const TranslatedString &custom_column_name=TranslatedString())
 
uint04 addParentPathColumn (const TranslatedString &custom_column_name=TranslatedString())
 
bool canAddObject (const Model &object) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
 DesignTableModel (QObject *parent=nullptr)
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
const ModelTableColumnSpecgetColumnSpec (uint04 column) const
 
DynamicPointer< QTDesignObjectgetDesignObject (QModelIndex index) const
 
DynamicPointer< QTDesignObjectgetDesignObject (QModelIndex index, int row) const
 
Model getModel (QModelIndex index) const
 
DesignObject getObject (QModelIndex index) const
 
DesignObject getObject (QModelIndex index, int row) const
 
UUID getUUID (QModelIndex index) const
 
UUID getUUID (QModelIndex index, int row) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
bool isEditable () const
 
bool isMaterialIndex (const QModelIndex &index) const
 
bool isObjectAllowed (const Model &object) const
 
bool isObjectAllowed (const UUID &object) const
 
bool isSpecialCallbackIndex (const QModelIndex &index) const
 
QTModelManagermodelManager () const
 
virtual void modelUpdated (const Buffer< UUID > &ids)
 
virtual void objectAdded (const Buffer< UUID > &ids)
 
virtual void objectDeleted (const Buffer< UUID > &ids)
 
void onSelected (QModelIndex index, const QRect &rect)
 
void refreshAll ()
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
void setAddedFilter (const std::function< bool(const Model &)> &callback)
 
void setColumnEditable (uint04 column, bool is_editable)
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
void setIsEditable (bool is_editable)
 
void setList (const Buffer< UUID > &models)
 
void setModelManager (QTModelManager *manager)
 
void setup ()
 
QVariant userData (const QModelIndex &index, int role) const
 
virtual ~DesignTableModel ()
 

Protected Member Functions

void updateColumn (uint04 index)
 

Protected Attributes

std::function< bool(const Model &)> m_added_filter
 
QTResourceListenerm_angle_listener = nullptr
 
Buffer< BitFlagm_callback_clicked
 
Buffer< ModelTableColumnSpecm_columns
 
QTResourceListenerm_coord_listener = nullptr
 
Buffer< TranslatedStringm_custom_column_titles
 
bool m_is_editable
 
QTModelManagerm_manager
 
Buffer< UUIDm_models
 
QTResourceListenerm_orientation_listener = nullptr
 

Detailed Description

Provides the ability to pull data from a DesignObjectLookup for display in tables within the NDEVR API.


Constructor & Destructor Documentation

◆ DesignTableModel()

DesignTableModel ( QObject * parent = nullptr)
explicit

◆ ~DesignTableModel()

virtual ~DesignTableModel ( )
virtual

Member Function Documentation

◆ addColumn() [1/4]

uint04 addColumn ( const DesignParameter & parameter,
bool is_editable )

◆ addColumn() [2/4]

uint04 addColumn ( const ModelTableColumnSpec & column)

◆ addColumn() [3/4]

uint04 addColumn ( const TranslatedString & name,
const String & icon,
const std::function< void(UUID)> & callback )

◆ addColumn() [4/4]

uint04 addColumn ( DesignObject::DesignProperty property,
bool is_editable )

◆ addGrandparentNameColumn()

uint04 addGrandparentNameColumn ( const TranslatedString & custom_column_name = TranslatedString())

◆ addMaterialDataColumn()

uint04 addMaterialDataColumn ( const TranslatedString & custom_column_name = TranslatedString())

◆ addParentDataColumn()

uint04 addParentDataColumn ( const DesignParameter & param,
bool is_editable,
const TranslatedString & custom_column_name = TranslatedString() )

◆ addParentPathColumn()

uint04 addParentPathColumn ( const TranslatedString & custom_column_name = TranslatedString())

◆ canAddObject()

bool canAddObject ( const Model & object) const

◆ columnCount()

int columnCount ( const QModelIndex & parent = QModelIndex()) const
nodiscardoverride

◆ data()

QVariant data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
nodiscardoverride

◆ flags()

Qt::ItemFlags flags ( const QModelIndex & index) const
nodiscardoverride

◆ getColumnSpec()

const ModelTableColumnSpec & getColumnSpec ( uint04 column) const
nodiscard

◆ getDesignObject() [1/2]

DynamicPointer< QTDesignObject > getDesignObject ( QModelIndex index) const
nodiscard

◆ getDesignObject() [2/2]

DynamicPointer< QTDesignObject > getDesignObject ( QModelIndex index,
int row ) const
nodiscard

◆ getModel()

Model getModel ( QModelIndex index) const
nodiscard

◆ getObject() [1/2]

DesignObject getObject ( QModelIndex index) const
nodiscard

◆ getObject() [2/2]

DesignObject getObject ( QModelIndex index,
int row ) const
nodiscard

◆ getUUID() [1/2]

UUID getUUID ( QModelIndex index) const
nodiscard

◆ getUUID() [2/2]

UUID getUUID ( QModelIndex index,
int row ) const
nodiscard

◆ headerData()

QVariant headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
nodiscardoverride

◆ isEditable()

bool isEditable ( ) const

◆ isMaterialIndex()

bool isMaterialIndex ( const QModelIndex & index) const
nodiscard

◆ isObjectAllowed() [1/2]

bool isObjectAllowed ( const Model & object) const

◆ isObjectAllowed() [2/2]

bool isObjectAllowed ( const UUID & object) const

◆ isSpecialCallbackIndex()

bool isSpecialCallbackIndex ( const QModelIndex & index) const
nodiscard

◆ modelManager()

QTModelManager * modelManager ( ) const
inlinenodiscard

◆ modelUpdated()

virtual void modelUpdated ( const Buffer< UUID > & ids)
virtual

◆ modelUpdatedSlot

void modelUpdatedSlot ( const Buffer< UUID > & ids)
slot

◆ objectAdded()

virtual void objectAdded ( const Buffer< UUID > & ids)
virtual

◆ objectAddedSlot

void objectAddedSlot ( const Buffer< UUID > & ids)
slot

◆ objectDeleted()

virtual void objectDeleted ( const Buffer< UUID > & ids)
virtual

◆ objectDeletedSlot

void objectDeletedSlot ( const Buffer< UUID > & ids)
slot

◆ onSelected()

void onSelected ( QModelIndex index,
const QRect & rect )

◆ refreshAll()

void refreshAll ( )

◆ rowCount()

int rowCount ( const QModelIndex & parent = QModelIndex()) const
nodiscardoverride

◆ setAddedFilter()

void setAddedFilter ( const std::function< bool(const Model &)> & callback)
inline

◆ setColumnEditable()

void setColumnEditable ( uint04 column,
bool is_editable )

◆ setData()

bool setData ( const QModelIndex & index,
const QVariant & value,
int role )
nodiscardoverride

◆ setIsEditable()

void setIsEditable ( bool is_editable)

◆ setList()

void setList ( const Buffer< UUID > & models)

◆ setModelManager()

void setModelManager ( QTModelManager * manager)

◆ setup()

void setup ( )

◆ updateColumn()

void updateColumn ( uint04 index)
protected

◆ userData()

QVariant userData ( const QModelIndex & index,
int role ) const
nodiscard

Member Data Documentation

◆ m_added_filter

std::function<bool(const Model&)> m_added_filter
protected

◆ m_angle_listener

QTResourceListener* m_angle_listener = nullptr
protected

◆ m_callback_clicked

Buffer<BitFlag> m_callback_clicked
protected

◆ m_columns

Buffer<ModelTableColumnSpec> m_columns
protected

◆ m_coord_listener

QTResourceListener* m_coord_listener = nullptr
protected

◆ m_custom_column_titles

Buffer<TranslatedString> m_custom_column_titles
protected

◆ m_is_editable

bool m_is_editable
protected

◆ m_manager

QTModelManager* m_manager
protected

◆ m_models

Buffer<UUID> m_models
protected

◆ m_orientation_listener

QTResourceListener* m_orientation_listener = nullptr
protected

The documentation for this class was generated from the following file: