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

#include <DesignTableModel.h>

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

Public Slots

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

Public Member Functions

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

Protected Member Functions

void updateColumn (uint04 index)
 

Protected Attributes

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

Constructor & Destructor Documentation

◆ DesignTableModel()

DesignTableModel ( QObject * parent = nullptr)
explicit

◆ ~DesignTableModel()

~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()

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

◆ modelUpdatedSlot

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

◆ objectAdded()

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

◆ objectAddedSlot

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

◆ objectDeleted()

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 files: