NDEVR
API Documentation
DesignObjectSearchWidget

Allows the user to enter search terms for filtering out tables or other views. More...

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

Public Member Functions

 DesignObjectSearchWidget (QWidget *parent=nullptr)
 Constructs a DesignObjectSearchWidget with a search placeholder.
Buffer< UUIDgetObjectsBeginningWithSearch () const
 Returns the subset of objects whose search property begins with the current search text.
Buffer< UUIDgetObjectsContainingSearch () const
 Returns the subset of objects whose search property contains the current search text.
void setManager (DesignObjectLookup *lookup)
 Sets the design object lookup used to resolve object properties.
void setNDPO (NDPO property)
 Sets the design object property used for filtering and configures validation accordingly.
void setSearchIDs ()
 Clears the search IDs by setting an empty buffer.
void setSearchIDs (const Buffer< UUID > &objects)
 Sets the set of object UUIDs to search through.
void setSearchIDs (NDPO property, const Buffer< UUID > &objects)
 Sets both the property to search and the set of object UUIDs to search through.
Public Member Functions inherited from QCustomLineEdit
 QCustomLineEdit (const QString &value, QWidget *parent=Q_NULLPTR)
 Constructs a QCustomLineEdit with an initial value and the given parent widget.
 QCustomLineEdit (QWidget *parent=Q_NULLPTR)
 Constructs a QCustomLineEdit with the given parent widget.
 ~QCustomLineEdit ()
 Destroys the line edit and its resources.
RGBColor backgroundColor () const
 Returns the current background color of the line edit.
void clearBackgroundColor ()
 Clears any custom background color, reverting to the default.
void clearInputHint ()
 Clears the input hint text.
void clearValue ()
 Clears the current value of the line edit.
QCustomValidatorcustomValidator ()
 Returns a mutable reference to the custom validator used for input validation.
const QCustomValidatorcustomValidator () const
 Returns a const reference to the custom validator used for input validation.
void editedSignal ()
 Emitted when the text is edited by the user.
void editingFinishedSignal ()
 Emitted when the user finishes editing (focus lost or enter pressed).
bool event (QEvent *event) override
 Handles generic events such as tooltip and theme updates.
void forceValue (const StringView &forced_value)
 Ignores validation steps, password encoding, etc.
template<class t_type>
t_type getAs () const
 Returns the current value converted to the requested type.
template<class t_type>
t_type getAs (bool allow_placeholder) const
 Returns the current value converted to the requested type.
template<class t_angle_type = fltp08>
Angle< t_angle_type > getUnitAngle (bool allow_placeholder=true) const
 Returns the current value as an Angle in internal representation.
fltp08 getUnitValue (bool allow_placeholder=true) const
 Returns the current value as a floating-point number in user-facing units.
String getValue () const
 Returns the current text value of the line edit.
String getValue (bool allow_placeholder) const
 Returns the current text value of the line edit.
bool hasUserFocus () const
 Returns whether the line edit currently has user focus (keyboard or touch).
const TranslatedStringinputHint () const
 Returns the current input hint text.
void inputHintChangedSignal ()
 Emitted when the input hint text changes.
bool isEditable () const
 Returns whether the line edit is currently editable.
bool isEditing () const
 Returns whether the user is currently editing this line edit.
bool isPassword () const
 Returns whether this line edit is in password mode.
bool isValid () const
 Returns whether the current text passes validation.
QSize minimumSizeHint () const override
 Returns the minimum size hint for layout purposes.
void onEdited ()
 Slot invoked when the text has been edited by the user.
void onFinishedSlot ()
 Slot invoked when editing is finished, to commit the value.
const StringpasswordEncoder () const
 Returns the password encoder string used for cross-session password storage.
void setAllowPlaceholderAsValue (bool allow)
 Sets whether the placeholder text should be treated as a valid value when the field is empty.
void setAsKeyboardFocus ()
 Sets this line edit as the primary keyboard focus target.
void setAutoShowTooltip (bool auto_show_tooltip)
 Sets whether the tooltip should automatically update to show the current value.
void setBackgroundColor (const RGBColor &color)
 Sets the background color of the line edit.
void setBold (bool is_bold)
 Sets whether the line edit text is rendered in bold.
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 setEditable (bool editable)
 Sets whether the line edit is editable by the user.
void setFontMultiplier (fltp04 font_multiplier)
 Sets a multiplier applied to the base font size.
void setInputHint (const TranslatedString &hint)
 Sets an input hint displayed to guide the user on expected input.
void setIsPassword (bool is_password, const StringView &encoder=StringView())
 Sets this widget to be a password.
void setPlaceholderText (const QString &value)
 Sets the placeholder text displayed when the field is empty.
void setPlaceHolderUnitValue (fltp08 value)
 Sets the placeholder value as a floating-point number in user-facing units.
template<class t_type>
void setPlaceholderValue (const t_type &input_value, bool allow_placeholder_as_value=true)
 Sets a placeholder value displayed when the field is empty.
void setPlaceholderValue (const TranslatedString &input_value, bool allow_placeholder_as_value=true)
 Sets a translated placeholder value displayed when the field is empty.
void setRegex (const StringView &regex)
 Sets a custom regex pattern for input validation.
void setStep (fltp08 step)
 Sets the step increment used when scrolling or using arrow keys on numeric values.
virtual void setTitle (const TranslatedString &title)
 Sets the display title for the line edit, used as a label or placeholder context.
void setToolTip (const TranslatedString &tooltip)
 Sets the tooltip text for the line edit.
void setUnitType (UnitCategory unit, uint01 dimension=Constant< uint01 >::Invalid)
 Sets the unit type used for value formatting and conversion.
template<class t_angle_type>
void setUnitValue (Angle< t_angle_type > value)
 Sets the value as an angle, converting to internal representation first.
void setUnitValue (fltp08 value)
 Sets the value as a floating-point number in user-facing units.
template<class t_type>
void setup (ApplicationOption< t_type > &option)
 Sets up the line edit from an ApplicationOption, using its label and resource.
template<class t_type>
void setup (const TranslatedString &title)
 Sets up the line edit for a specific type with a title, configuring validation accordingly.
void setup (const TranslatedString &title, const TypeInfo &type)
 Sets up the line edit with a title and type info for validation.
void setup (const TranslatedString &title, Resource< String > &resource)
 Sets up the line edit bound to a String resource with a title.
template<class t_type>
void setup (const TranslatedString &title, Resource< t_type > &resource)
 Sets up two-way binding between this line edit and a Resource.
void setup (const TranslatedString &title, UnitCategory unit_type, uint01 dim=Constant< uint01 >::Invalid)
 Sets up the line edit with a title and unit type.
void setup (GenericOption &option)
 Sets up the line edit from a GenericOption, binding title, type, and resource.
void setup (Resource< String > &resource)
 Sets up the line edit bound to a String resource, using the resource name as the title.
void setValue (const Angle< fltp08 > &input_value)
 Sets the value from an Angle<fltp08>.
void setValue (const Angle< sint04 > &input_value)
 Sets the value from an Angle<sint04>.
void setValue (const PasswordString &input_value)
 Sets the value from a PasswordString.
void setValue (const StringView &input_value)
 Sets the value from a StringView.
template<class t_type>
std::enable_if< ObjectInfo< t_type >::Number, void >::type setValue (const t_type &input_value)
 Sets the value from a numeric type, applying unit formatting if configured.
void setValue (const TimeSpan &input_value)
 Sets the value from a TimeSpan.
void setValue (const TranslatedString &input_value)
 Sets the value from a TranslatedString.
QSize sizeHint () const override
 Returns the recommended size for the line edit.
void startUserEdit (bool select_all=true)
 Begins user editing of the line edit, optionally selecting all text.
void updateColor ()
 Slot to update the line edit color based on validation state.
void wheelEvent (QWheelEvent *event) override
 Handles mouse wheel events for incrementing or decrementing numeric values.

Protected Member Functions

void onObjectUpdatedSlot ()
 Slot called when the underlying objects are updated.

Protected Attributes

bool m_ignore_case
 Whether the search is case-insensitive.
DesignObjectLookupm_manager
 The lookup used to resolve object properties.
Buffer< UUIDm_objects_to_search
 The set of object UUIDs being searched.
NDPO m_property
 The design object property to search against.
Protected Attributes inherited from QCustomLineEdit
TranslatedString m_title
 The display title for the line edit.
TranslatedString m_tooltip
 The tooltip text.

Additional Inherited Members

Static Public Member Functions inherited from QCustomLineEdit
static bool UseKeypad ()
 Returns whether the touch keypad should be used for input.

Detailed Description

Allows the user to enter search terms for filtering out tables or other views.


Definition at line 45 of file DesignObjectSearchWidget.h.

Constructor & Destructor Documentation

◆ DesignObjectSearchWidget()

DesignObjectSearchWidget::DesignObjectSearchWidget ( QWidget * parent = nullptr)
inline

Constructs a DesignObjectSearchWidget with a search placeholder.

Parameters
[in]parentThe parent widget.

Definition at line 53 of file DesignObjectSearchWidget.h.

References QCustomLineEdit::QCustomLineEdit(), QCustomLineEdit::customValidator(), m_ignore_case, m_manager, m_property, property_size, and QCustomLineEdit::setPlaceholderText().

Member Function Documentation

◆ getObjectsBeginningWithSearch()

Buffer< UUID > DesignObjectSearchWidget::getObjectsBeginningWithSearch ( ) const
inlinenodiscard

Returns the subset of objects whose search property begins with the current search text.

Returns
A buffer of UUIDs that match, or all objects if the search is empty.

Definition at line 144 of file DesignObjectSearchWidget.h.

References Buffer< t_type, t_memory_manager >::add(), QCustomLineEdit::getValue(), m_ignore_case, m_manager, m_objects_to_search, and m_property.

◆ getObjectsContainingSearch()

Buffer< UUID > DesignObjectSearchWidget::getObjectsContainingSearch ( ) const
inlinenodiscard

Returns the subset of objects whose search property contains the current search text.

Returns
A buffer of UUIDs that match the search, or all objects if the search is empty.

Definition at line 122 of file DesignObjectSearchWidget.h.

References Buffer< t_type, t_memory_manager >::add(), QCustomLineEdit::getValue(), m_ignore_case, m_manager, m_objects_to_search, and m_property.

◆ onObjectUpdatedSlot()

void DesignObjectSearchWidget::onObjectUpdatedSlot ( )
inlineprotected

Slot called when the underlying objects are updated.

Currently a no-op placeholder.

Definition at line 165 of file DesignObjectSearchWidget.h.

Referenced by setNDPO(), setSearchIDs(), and setSearchIDs().

◆ setManager()

void DesignObjectSearchWidget::setManager ( DesignObjectLookup * lookup)
inline

Sets the design object lookup used to resolve object properties.

Parameters
[in]lookupThe DesignObjectLookup instance.

Definition at line 74 of file DesignObjectSearchWidget.h.

References m_manager.

◆ setNDPO()

void DesignObjectSearchWidget::setNDPO ( NDPO property)
inline

Sets the design object property used for filtering and configures validation accordingly.

Parameters
[in]propertyThe NDPO property to search against.

Definition at line 104 of file DesignObjectSearchWidget.h.

References QCustomLineEdit::customValidator(), file, RegexFunctions::FileRegex(), m_property, and onObjectUpdatedSlot().

◆ setSearchIDs() [1/2]

void DesignObjectSearchWidget::setSearchIDs ( const Buffer< UUID > & objects)
inline

Sets the set of object UUIDs to search through.

Parameters
[in]objectsThe UUIDs of the objects to search.

Definition at line 93 of file DesignObjectSearchWidget.h.

References m_objects_to_search, and onObjectUpdatedSlot().

◆ setSearchIDs() [2/2]

void DesignObjectSearchWidget::setSearchIDs ( NDPO property,
const Buffer< UUID > & objects )
inline

Sets both the property to search and the set of object UUIDs to search through.

Parameters
[in]propertyThe design object property to filter on.
[in]objectsThe UUIDs of the objects to search.

Definition at line 83 of file DesignObjectSearchWidget.h.

References m_objects_to_search, m_property, and onObjectUpdatedSlot().


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