Provides the ability to pull specific data from a DesignObjectLookup for display in a column of a table.
More...
|
| enum | ModelTableType { e_design_parameter
, e_model_material
, e_custom_callback
} |
| | The type of data a table column displays. More...
|
| enum | RelativePath {
e_parent
, e_last_child
, e_child_index = 10
, e_child_0 = e_child_index
,
e_child_1
, e_child_2
, e_child_3
, e_child_4
,
e_child_5
, e_child_6
, e_child_7
} |
| | Specifies a relative path from a design object to a related object in the hierarchy. More...
|
|
|
| ModelTableColumnSpec () |
| | Default constructor.
|
| | ModelTableColumnSpec (const DesignParameter ¶meter) |
| | Constructs a design parameter column.
|
| | ModelTableColumnSpec (const DesignParameter ¶meter, Buffer< RelativePathObject > relative_mode) |
| | Constructs a design parameter column with a relative path to the data source.
|
| | ModelTableColumnSpec (const std::function< void(UUID)> &callback) |
| | Constructs a custom callback column.
|
| | ModelTableColumnSpec (const TranslatedString &text, const StringView &icon, const std::function< void(UUID)> &callback) |
| | Constructs a button column with a label, icon, and click callback.
|
| | ModelTableColumnSpec (ModelTableType type) |
| | Constructs a column of the specified type.
|
| QVariant | data (const DesignObject &obj, int role=Qt::DisplayRole) const |
| | Returns the data for the given object and role.
|
| DesignObject | getTarget (const DesignObject &a, bool try_to_create) const |
| | Resolves the target design object by following the relative path.
|
| TranslatedString | headerTitle () const |
| | Returns the column header title.
|
| bool | isCheckEditable () const |
| | Returns whether this column supports checkbox editing.
|
| bool | isSortEqual (const DesignObject &a, const DesignObject &b) const |
| | Returns whether two design objects have equal sort values for this column.
|
| bool | isSortLessThan (const DesignObject &a, const DesignObject &b) const |
| | Returns whether the first design object sorts before the second for this column.
|
| bool | isTextEditable () const |
| | Returns whether this column supports inline text editing.
|
| bool | isValid () const |
| | Returns whether this column specification is valid.
|
| bool | setData (const DesignObject &obj, const QVariant &value, int role) |
| | Sets data on the given object for the specified role.
|
| StringAllocatingView | stringDisplayData (const DesignObject &obj) const |
| | Returns the string representation of the column data for the given object.
|
|
|
std::function< void(UUID)> | callback |
| | The callback invoked when a button column is clicked.
|
|
ModelTableType | column_type |
| | The type of data this column displays.
|
|
TranslatedString | custom_column_name |
| | Custom header name override.
|
|
String | custom_icon |
| | Icon name for button columns.
|
|
TranslatedString | custom_text |
| | Custom display text for button columns.
|
|
DesignParameter | design_parameter |
| | The design parameter displayed by this column.
|
|
bool | is_clicked = false |
| | Whether the button in this column is currently in a clicked state.
|
|
bool | is_currently_editable = false |
| | Whether this column is currently in an editable state.
|
|
bool | is_editable |
| | Whether this column allows editing.
|
|
uint04 | max_decimal_places |
| | Maximum number of decimal places for numeric display.
|
|
uint04 | min_decimal_places |
| | Minimum number of decimal places for numeric display.
|
|
Buffer< RelativePathObject > | relative_path |
| | The relative path from the row object to the actual data source.
|
|
| QVariant | parameterData (const DesignObject &obj, int role) const |
| | Returns data from the design parameter for the given object and role.
|
Provides the ability to pull specific data from a DesignObjectLookup for display in a column of a table.
Definition at line 52 of file DesignTableModel.h.
◆ ModelTableType
The type of data a table column displays.
| Enumerator |
|---|
| e_design_parameter | Column displays a design parameter value.
|
| e_model_material | Column displays a material swatch.
|
| e_custom_callback | Column displays a button that invokes a custom callback.
|
Definition at line 57 of file DesignTableModel.h.
◆ RelativePath
Specifies a relative path from a design object to a related object in the hierarchy.
| Enumerator |
|---|
| e_parent | Navigate to the parent object.
|
| e_last_child | Navigate to the last child object.
|
| e_child_index | Base index for child navigation by position.
|
| e_child_0 | Navigate to child at index 0.
|
| e_child_1 | Navigate to child at index 1.
|
| e_child_2 | Navigate to child at index 2.
|
| e_child_3 | Navigate to child at index 3.
|
| e_child_4 | Navigate to child at index 4.
|
| e_child_5 | Navigate to child at index 5.
|
| e_child_6 | Navigate to child at index 6.
|
| e_child_7 | Navigate to child at index 7.
|
Definition at line 66 of file DesignTableModel.h.
◆ ModelTableColumnSpec() [1/5]
| ModelTableColumnSpec::ModelTableColumnSpec |
( |
const std::function< void(UUID)> & | callback | ) |
|
|
explicit |
Constructs a custom callback column.
- Parameters
-
| [in] | callback | The function called with the object UUID when clicked. |
References callback.
◆ ModelTableColumnSpec() [2/5]
| ModelTableColumnSpec::ModelTableColumnSpec |
( |
const DesignParameter & | parameter | ) |
|
|
explicit |
Constructs a design parameter column.
- Parameters
-
| [in] | parameter | The design parameter to display. |
◆ ModelTableColumnSpec() [3/5]
Constructs a design parameter column with a relative path to the data source.
- Parameters
-
| [in] | parameter | The design parameter to display. |
| [in] | relative_mode | The relative path from the row object to the data source. |
◆ ModelTableColumnSpec() [4/5]
Constructs a column of the specified type.
- Parameters
-
| [in] | type | The table column type. |
◆ ModelTableColumnSpec() [5/5]
Constructs a button column with a label, icon, and click callback.
- Parameters
-
| [in] | text | The button label text. |
| [in] | icon | The icon name. |
| [in] | callback | The function called with the object UUID when clicked. |
References callback.
◆ data()
| QVariant ModelTableColumnSpec::data |
( |
const DesignObject & | obj, |
|
|
int | role = Qt::DisplayRole ) const |
|
nodiscard |
Returns the data for the given object and role.
- Parameters
-
| [in] | obj | The design object. |
| [in] | role | The Qt data role. |
- Returns
- The data as a QVariant.
◆ getTarget()
Resolves the target design object by following the relative path.
- Parameters
-
| [in] | a | The starting design object. |
| [in] | try_to_create | Whether to create missing children via callbacks. |
- Returns
- The resolved target DesignObject.
◆ headerTitle()
Returns the column header title.
- Returns
- The translated header title.
◆ isCheckEditable()
| bool ModelTableColumnSpec::isCheckEditable |
( |
| ) |
const |
|
nodiscard |
Returns whether this column supports checkbox editing.
- Returns
- True if check-editable.
◆ isSortEqual()
Returns whether two design objects have equal sort values for this column.
- Parameters
-
| [in] | a | The first design object. |
| [in] | b | The second design object. |
- Returns
- True if they sort equally.
◆ isSortLessThan()
Returns whether the first design object sorts before the second for this column.
- Parameters
-
| [in] | a | The first design object. |
| [in] | b | The second design object. |
- Returns
- True if a sorts before b.
◆ isTextEditable()
| bool ModelTableColumnSpec::isTextEditable |
( |
| ) |
const |
|
nodiscard |
Returns whether this column supports inline text editing.
- Returns
- True if text-editable.
◆ isValid()
| bool ModelTableColumnSpec::isValid |
( |
| ) |
const |
|
nodiscard |
Returns whether this column specification is valid.
- Returns
- True if valid.
◆ parameterData()
| QVariant ModelTableColumnSpec::parameterData |
( |
const DesignObject & | obj, |
|
|
int | role ) const |
|
nodiscardprotected |
Returns data from the design parameter for the given object and role.
- Parameters
-
| [in] | obj | The design object. |
| [in] | role | The Qt data role. |
- Returns
- The parameter data as a QVariant.
◆ setData()
| bool ModelTableColumnSpec::setData |
( |
const DesignObject & | obj, |
|
|
const QVariant & | value, |
|
|
int | role ) |
|
nodiscard |
Sets data on the given object for the specified role.
- Parameters
-
| [in] | obj | The design object. |
| [in] | value | The new value. |
| [in] | role | The Qt data role. |
- Returns
- True if the data was set successfully.
◆ stringDisplayData()
Returns the string representation of the column data for the given object.
- Parameters
-
| [in] | obj | The design object. |
- Returns
- The display string.
The documentation for this struct was generated from the following file: