NDEVR
API Documentation
GenericOptionsWidget

Automatically creates a widget based on a GenericOption. More...

Collaboration diagram for GenericOptionsWidget:
[legend]

Public Member Functions

 GenericOptionsWidget (const GenericOption &option, QWidget *parent=nullptr)
 Constructs a GenericOptionsWidget from a GenericOption.
 GenericOptionsWidget (QWidget *parent=nullptr)
 Constructs an empty GenericOptionsWidget.
void edited ()
 Emitted when the option value has been edited.
void editingFinished ()
 Emitted when the user finishes editing.
GenericOptionoption ()
 Returns the GenericOption associated with this widget.
const GenericOptionoption () const
 Returns the GenericOption associated with this widget (const).
void refreshFileChooser ()
 Refreshes the file chooser portion of the widget, if applicable.
void refreshResetToDefault ()
 Refreshes the reset-to-default button state.
void refreshWidget ()
 Refreshes the widget to reflect the current option state.
void setOption (const GenericOption &option)
 Sets the option and rebuilds the widget accordingly.

Protected Member Functions

void init ()
 Initializes the widget layout and child widgets based on the option type.
void refreshColorWidget ()
 Refreshes the color picker widget for color options.
void refreshComboWidget ()
 Refreshes the combo box widget for enumerated options.
void refreshLineEditWidget ()
 Refreshes the line edit widget for string or numeric options.
void refreshMultilineWidget ()
 Refreshes the multiline text edit widget.
void refreshToggleWidget ()
 Refreshes the toggle (checkbox) widget for boolean options.
void refreshVectorWidget ()
 Refreshes the vector widget for vector-type options (placeholder).

Protected Attributes

Buttonm_browse_button = nullptr
 Browse button for file-type options.
FileChooserDialogm_chooser_dialog = nullptr
 File chooser dialog for file-type options.
GenericOption m_option
 The GenericOption this widget represents.
Buttonm_reset_button = nullptr
 Button to reset the option to its default value.
QWidget * m_widget = nullptr
 The main editing widget for the option.

Detailed Description

Automatically creates a widget based on a GenericOption.


Definition at line 13 of file GenericOptionsWidgets.h.

Constructor & Destructor Documentation

◆ GenericOptionsWidget() [1/2]

GenericOptionsWidget::GenericOptionsWidget ( const GenericOption & option,
QWidget * parent = nullptr )

Constructs a GenericOptionsWidget from a GenericOption.

Parameters
[in]optionThe option to create a widget for.
[in]parentThe parent widget.

References option().

◆ GenericOptionsWidget() [2/2]

GenericOptionsWidget::GenericOptionsWidget ( QWidget * parent = nullptr)

Constructs an empty GenericOptionsWidget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ option() [1/2]

GenericOption & GenericOptionsWidget::option ( )
inline

Returns the GenericOption associated with this widget.

Returns
A reference to the option.

Definition at line 46 of file GenericOptionsWidgets.h.

References m_option.

◆ option() [2/2]

const GenericOption & GenericOptionsWidget::option ( ) const
inline

Returns the GenericOption associated with this widget (const).

Returns
A const reference to the option.

Definition at line 38 of file GenericOptionsWidgets.h.

References m_option.

Referenced by GenericOptionsWidget(), and setOption().

◆ setOption()

void GenericOptionsWidget::setOption ( const GenericOption & option)

Sets the option and rebuilds the widget accordingly.

Parameters
[in]optionThe new GenericOption to display.

References option().


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