![]() |
NDEVR
API Documentation
|
Shows a filtered list of models in a combobox that the user can use to select a desired Model. More...
Public Member Functions | |
| DesignObjectComboWidget (QWidget *parent=nullptr) | |
| Constructs a DesignObjectComboWidget. | |
| void | clearTarget () |
| Clears the current target design object. | |
| void | setNDPO (NDPO property) |
| Sets the design object property that this combo box reads and writes. | |
| void | setTarget (const DynamicPointer< QTDesignObject > &object) |
| Sets the target design object and connects update/delete signals. | |
| void | setTarget (NDPO property, const DynamicPointer< QTDesignObject > &object) |
| Sets the target design object and the property to display. | |
| void | setTitle (const TranslatedString &title) |
| Sets the display title for this combo box. | |
| void | setupForMetadata (const StringView &metadata) |
| Configures this combo box to read and write a metadata key on the target object. | |
| Public Member Functions inherited from QCustomComboBox | |
| QCustomComboBox (QWidget *parent=nullptr) | |
| Constructs a QCustomComboBox with the given parent widget. | |
| template<class t_type> | |
| void | add (const t_type &value, const TranslatedString &display_value, bool refresh_widget=false) |
| Adds a value and its display string to the combo box. | |
| void | clearValue () |
| Clears the current selection and value. | |
| TranslatedString | currentDisplayValue () const |
| Returns the currently displayed translated string. | |
| QCustomValidator & | customValidator () |
| Returns a mutable reference to the custom validator used for input validation. | |
| const QCustomValidator & | customValidator () const |
| Returns a const reference to the custom validator used for input validation. | |
| const Buffer< TranslatedString > & | displayValues () const |
| Returns the translated display values of the combo box. | |
| void | edited () |
| Emitted when the combo box value is edited by the user. | |
| bool | event (QEvent *event) override |
| Handles generic events for the combo box, including tooltip and theme updates. | |
| void | focusInEvent (QFocusEvent *e) override |
| Handles focus-in events for the combo box. | |
| template<class t_type> | |
| t_type | getAs () const |
| Returns the current value converted to the requested type. | |
| template<class t_type> | |
| t_type | getAs (uint04 index) const |
| Returns the value at the given index converted to the requested type. | |
| Angle< fltp08 > | getUnitAngle () const |
| Returns the current value as an Angle in internal representation. | |
| fltp08 | getUnitValue () const |
| Returns the current value as a floating-point number in user-facing units. | |
| void | hidePopup () override |
| Hides the popup list of items. | |
| bool | isUsingCustom () const |
| Returns whether the combo box is currently using a custom (user-entered) value. | |
| void | lockInCustomValue () |
| Locks in the current custom value as the definitive selection. | |
| QSize | minimumSizeHint () const override |
| Returns the minimum size hint for layout purposes. | |
| void | paintEvent (QPaintEvent *) override |
| Custom paint event for rendering the combo box. | |
| void | refresh () |
| Refreshes the widget contents and updates its geometry. | |
| template<class t_type> | |
| void | remove (const t_type &value, bool refresh_widget=false) |
| Removes a value and its corresponding display string from the combo box. | |
| void | resizeEvent (QResizeEvent *event) override |
| Handles widget resize events. | |
| template<class t_enum> | |
| std::enable_if< ObjectInfo< t_enum >::Enum >::type | set (t_enum value) |
| Sets the current selection to the given enum value. | |
| void | setAllowCustom (bool allow_custom) |
| Sets whether the user can enter a custom value not in the predefined list. | |
| void | setAutoFormat (bool auto_format) |
| Sets whether the combo box should automatically format display values. | |
| void | setConstantUnit (const ConstPointer< Unit > &unit, uint01 dimension=Constant< uint01 >::Invalid) |
| Sets a constant unit for value formatting and conversion. | |
| void | setCustomUnit (const StringView &unit, UnitCategory fallback_unit, uint01 dimension=Constant< uint01 >::Invalid) |
| Sets a custom unit string with a fallback unit category. | |
| void | setCustomValidator (const QCustomValidator &validator) |
| Sets the custom validator used for input validation and formatting. | |
| void | setSuffix (const TranslatedString &suffix) |
| Sets a suffix appended to each display value. | |
| void | setTitle (const TranslatedString &title) |
| Sets the display title for the combo box. | |
| void | setToolTip (const TranslatedString &tooltip) |
| Sets the tooltip text for the combo box. | |
| void | setUnitType (UnitCategory unit, uint01 dimension=Constant< uint01 >::Invalid) |
| Sets the unit type used for value formatting and conversion. | |
| void | setUnitValue (fltp08 value, uint01 unit_dimension=0) |
| Sets the value as a floating-point number in user-facing units. | |
| template<class t_object> | |
| void | setup (const TranslatedString &title, const Buffer< std::pair< String, t_object > > &items) |
| Sets up the combo box from a buffer of String/value pairs. | |
| template<class t_object> | |
| void | setup (const TranslatedString &title, const Buffer< std::pair< TranslatedString, t_object > > &items) |
| Sets up the combo box from a buffer of TranslatedString/value pairs. | |
| void | setup (const TranslatedString &title, const Buffer< String > &values, const Buffer< TranslatedString > &display_values) |
| Sets up the combo box with a title, raw values, and corresponding translated display values. | |
| template<class t_object> | |
| std::enable_if<!ObjectInfo< t_object >::Enum &&!ObjectInfo< t_object >::Number >::type | setup (const TranslatedString &title, const Buffer< t_object > &items) |
| Sets up the combo box from a buffer of non-enum, non-number values using display strings. | |
| template<class t_object> | |
| std::enable_if< ObjectInfo< t_object >::Number >::type | setup (const TranslatedString &title, const Buffer< t_object > &items) |
| Sets up the combo box from a buffer of numeric values, formatting each with the validator. | |
| template<class t_object> | |
| std::enable_if< ObjectInfo< t_object >::Enum >::type | setup (const TranslatedString &title, const Buffer< t_object > &items) |
| Sets up the combo box from a buffer of enum values, using display strings for each. | |
| void | setup (const TranslatedString &title, const Buffer< TranslatedString > &values) |
| Sets up the combo box with a title and a list of translated display values. | |
| template<class t_enum> | |
| std::enable_if< ObjectInfo< t_enum >::Enum >::type | setup (const TranslatedString &title, t_enum first, t_enum last) |
| Sets up the combo box with a range of enum values from first to last (inclusive). | |
| template<class t_enum> | |
| std::enable_if< ObjectInfo< t_enum >::Enum >::type | setup (const TranslatedString &title, uint04 size) |
| Sets up the combo box with all values of an enum type, given the total count. | |
| template<class t_type> | |
| void | setupResource (const TranslatedString &title, Resource< t_type > &resource) |
| Sets up two-way binding between this combo box and a Resource. | |
| void | setValue (const String &value) |
| Sets the current value from a raw String. | |
| template<class t_type> | |
| void | setValue (const t_type &t_value) |
| Sets the current value of the combo box. | |
| void | setValue (const TranslatedString &t_value) |
| Sets the current value from a TranslatedString. | |
| void | showPopup () override |
| Shows the popup list of items. | |
| QSize | sizeHint () const override |
| Returns the recommended size for layout purposes. | |
| void | sortAlphabetically (uint04 start=0, uint04 size=Constant< uint04 >::Invalid) |
| Sorts the combo box entries alphabetically by display value. | |
| const TranslatedString & | suffix () const |
| Returns the current suffix appended to display values. | |
| void | updateFontSize () |
| Updates the font size to match the current application theme settings. | |
| const Buffer< String > & | values () const |
| Returns the internal string values of the combo box. | |
| void | wheelEvent (QWheelEvent *e) override |
| Handles mouse wheel events, typically to scroll through values. | |
Protected Member Functions | |
| void | onObjectDeletedSlot () |
| Slot called when the target design object is deleted. | |
| void | onObjectUpdatedSlot () |
| Slot called when the target object is updated. | |
| void | sendCommand () |
| Sends a command to update the target object property with the current combo value. | |
| Protected Member Functions inherited from QCustomComboBox | |
| void | adjustLineEditSize () |
| Adjusts the embedded line edit size to fit the current combo box dimensions. | |
| void | onChange () |
| Slot invoked when the selected index changes. | |
| void | onEdit () |
| Slot invoked when the user finishes editing the custom line edit. | |
| void | onEditTextChangedSlot () |
| Slot invoked when the editable line edit text changes. | |
| virtual void | onSorted (const Buffer< uint04 > &swap_indices) |
| Called after sorting to allow subclasses to react to reordered indices. | |
| void | refreshWidget () |
| Rebuilds the widget contents from the internal value and display buffers. | |
Protected Attributes | |
| String | m_meta_data_title |
| The metadata key name when bound to metadata. | |
| NDPO | m_property |
| The design object property this combo box is bound to. | |
| DynamicPointer< QTDesignObject > | m_target |
| The target design object. | |
| TranslatedString | m_title |
| The custom display title, if set. | |
| Protected Attributes inherited from QCustomComboBox | |
| Dictionary< uint04, uint04 > | enum_to_index |
| Maps enum numeric values to combo box indices. | |
| Dictionary< uint04, uint04 > | index_to_enum |
| Maps combo box indices to enum numeric values. | |
| bool | m_allow_custom |
| Whether custom user-entered values are permitted. | |
| bool | m_auto_format |
| Whether values are automatically formatted before display. | |
| String | m_current_custom |
| The current custom value entered by the user. | |
| uint04 | m_custom_index |
| The index of the custom value entry in the list. | |
| Buffer< TranslatedString > | m_display_values |
| The translated display strings for each option. | |
| bool | m_is_changing = false |
| Whether the selection is currently being changed programmatically. | |
| bool | m_is_refreshing = false |
| Whether the widget is currently being refreshed. | |
| bool | m_is_showing_popup = false |
| Whether the popup list is currently visible. | |
| uint04 | m_last_index |
| The last selected index before the current change. | |
| QCustomLineEdit * | m_line_edit |
| The embedded line edit for custom value entry. | |
| QTResourceListener * | m_resource_changed_listener |
| Listener for external resource changes. | |
| bool | m_sort_alphabetically = false |
| Whether items should be sorted alphabetically. | |
| uint04 | m_sort_offset = 0 |
| The starting index offset for alphabetical sorting. | |
| TranslatedString | m_suffix |
| A suffix appended to each display value. | |
| TranslatedString | m_title |
| The display title of the combo box. | |
| TranslatedString | m_tooltip |
| The tooltip text for the combo box. | |
| bool | m_using_custom |
| Whether the current selection is a custom value. | |
| Buffer< String > | m_values |
| The internal string values for each option. | |
Shows a filtered list of models in a combobox that the user can use to select a desired Model.
Definition at line 44 of file DesignObjectComboWidget.h.
|
inline |
Constructs a DesignObjectComboWidget.
| [in] | parent | The parent widget. |
Definition at line 52 of file DesignObjectComboWidget.h.
References QCustomComboBox::QCustomComboBox(), QCustomComboBox::edited(), m_property, property_size, and sendCommand().
|
inlineprotected |
Slot called when the target design object is deleted.
Clears the target.
Definition at line 156 of file DesignObjectComboWidget.h.
References setTarget().
Referenced by setTarget().
|
inlineprotected |
Slot called when the target object is updated.
Refreshes the displayed value.
Definition at line 181 of file DesignObjectComboWidget.h.
References DesignObject::hasMetaData(), m_meta_data_title, m_property, m_target, meta_data, property_size, and QCustomComboBox::setValue().
Referenced by setNDPO(), and setTarget().
|
inline |
Sets the design object property that this combo box reads and writes.
| [in] | property | The NDPO property to bind to. |
Definition at line 101 of file DesignObjectComboWidget.h.
References QCustomComboBox::customValidator(), file, RegexFunctions::FileRegex(), QCustomComboBox::getAs(), m_meta_data_title, m_property, m_title, meta_data, onObjectUpdatedSlot(), QCustomComboBox::setCustomValidator(), and QCustomValidator::setRegex().
Referenced by setTarget(), and setupForMetadata().
|
inline |
Sets the target design object and connects update/delete signals.
| [in] | object | The target design object. |
Definition at line 79 of file DesignObjectComboWidget.h.
References QTDesignObject::deletedSignal(), m_target, onObjectDeletedSlot(), onObjectUpdatedSlot(), and QTDesignObject::updatedSignal().
|
inline |
Sets the target design object and the property to display.
| [in] | property | The design object property to bind to. |
| [in] | object | The target design object. |
Definition at line 70 of file DesignObjectComboWidget.h.
References setNDPO(), and setTarget().
Referenced by clearTarget(), onObjectDeletedSlot(), and setTarget().
|
inline |
Sets the display title for this combo box.
| [in] | title | The translated title string. If empty, the property name is used. |
Definition at line 137 of file DesignObjectComboWidget.h.
References QCustomComboBox::getAs(), m_meta_data_title, m_property, m_title, and meta_data.
|
inline |
Configures this combo box to read and write a metadata key on the target object.
| [in] | metadata | The metadata key name to bind to. |
Definition at line 128 of file DesignObjectComboWidget.h.
References m_meta_data_title, meta_data, and setNDPO().