ParameterPanel Class Reference

Class representing a view for displaying and editing parameters of nodes. More...

#include <ParameterPanel.h>

Inheritance diagram for ParameterPanel:

Inheritance graph
[legend]
Collaboration diagram for ParameterPanel:

Collaboration graph
[legend]

List of all members.

Public Slots

void showParameters (Node *node)
 Displays the parameters and values for the given node.
void updateParameters (bool objectsSelected)
 Slot that is called when the selection in the scene model has changed.

Signals

void objectNameChangeRequested (const QString &oldName, const QString &newName)
 Signal that is emitted when the name of the currently edited node should change.
void parameterChangeRequested (const QString &objectName, const QString &parameterName, const QVariant &value)
 Signal that is emitted when the value of the parameter with the given name of the object with the given name should be changed to the given value.

Public Member Functions

 ParameterPanel (QWidget *parent=0, Qt::WindowFlags flags=0)
 Constructor of the ParameterPanel class.
virtual ~ParameterPanel ()
 Destructor of the ParameterPanel class.
virtual void fillToolBars (QToolBar *mainToolBar, QToolBar *panelToolBar)
 Fills the given tool bars in a panel frame with actions for the panel.

Protected Member Functions

virtual void timerEvent (QTimerEvent *event)
 Event handler that reacts to timer events.

Private Slots

void on_m_nodeNameEdit_editingFinished ()
 Requests a name change for the currently edited node and displays the successfully changed name in the node name edit widget.
void on_m_searchEdit_textChanged (const QString &text)
 Starts the timer that launches the parameter filtering search after a specific delay.
void on_ui_resetSearchAction_triggered (bool checked=false)
 Cancels a running parameter search and resets the parameter search settings for the currently edited node.
void loadTabPage (int index)
 Fills the tab page of the given index with widgets for editing the parameters that the tab page represents.
void labelContextMenuRequested (const QPoint &position)
 Opens a context menu at the given position with actions for the label.
void checkBoxToggled (bool checked)
 Applies an edited boolean value to the parameter represented by the checkbox widget calling this slot.
void spinBoxEditingFinished ()
 Applies an edited numeric value to the parameter represented by the spinbox widget calling this slot.
void sliderValueChanged ()
 Applies an edited numeric value to the parameter represented by the slider widget calling this slot.
void doubleSpinBoxEditingFinished ()
 Applies an edited floating point numeric value to the parameter represented by the spinbox widget calling this slot.
void doubleSliderValueChanged ()
 Applies an edited floating point numeric value to the parameter represented by the slider widget calling this slot.
void lineEditEditingFinished ()
 Applies an edited string value to the parameter represented by the line edit widget calling this slot.
void browseButtonClicked ()
 Displays a dialog for selecting a file for the edited parameter.
void reloadButtonClicked ()
 Reloads the file that the edited parameter represents.
void selectColor ()
 Displays a dialog for selecting a color for the edited parameter.
void comboBoxIndexChanged (int index)
 Applies a changed combo box item selection to the edited parameter.
void commandButtonClicked ()
 Requests the execution of the command represented by the clicked button.
void updateBooleanWidget ()
 Updates the widget showing a boolean parameter's value.
void updateIntegerWidgets ()
 Updates the widgets showing an integer number parameter's value.
void updateIntegerWidgets (int index)
 Updates the widgets showing the component with the given index of an integer number parameter.
void updateUnsignedIntegerWidgets ()
 Updates the widgets showing an unsigned integer number parameter's value.
void updateUnsignedIntegerWidgets (int index)
 Updates the widgets showing the component with the given index of an unsigned integer number parameter.
void updateFloatingPointWidgets ()
 Updates the widgets showing a floating point number parameter's value.
void updateFloatingPointWidgets (int index)
 Updates the widgets showing the component with the given index of a floating point number parameter.
void updateStringWidget ()
 Updates the widget showing a string parameter's value.
void updateFilenameWidgets ()
 Updates the widgets showing a filename parameter's value.
void updateColorWidget ()
 Updates the widget showing a color parameter's value.
void updateEnumerationWidget ()
 Updates the widget showing an enumeration parameter's value.
void updateTextInfoWidget ()
 Updates the label showing the text info parameter's value.
void updateImageWidget ()
 Updates the label showing info about the image parameter's image.

Private Member Functions

void activateCustomContextMenu (QLabel *label)
 Activates the custom context menu for the given label widget.
void grayOut (QWidget *widget)
 Updates the given widget's palette so that it is painted with a Window color background instead of a Base color background.
void clear ()
 Removes all widgets from the layout.
void addRows (ParameterGroup *parameterGroup, QFormLayout *formLayout)
 Adds widgets for editing the parameters of the given parameter group to the given form layout.
void addRows (Parameter *parameter, QFormLayout *formLayout)
 Adds widgets for editing the given parameter to the given form layout.
QWidget * createBooleanWidget (Parameter *parameter)
 Creates a widget for editing a boolean parameter.
QLayout * createIntegerLayout (NumberParameter *numberParameter, int index=0)
 Creates a layout with widgets for editing editing an integer parameter.
QLayout * createUnsignedIntegerLayout (NumberParameter *numberParameter, int index=0)
 Creates a layout with widgets for editing an unsigned integer parameter.
QLayout * createFloatingPointLayout (NumberParameter *numberParameter, int index=0)
 Creates a layout with widgets for editing a floating point parameter.
QWidget * createStringWidget (Parameter *parameter)
 Creates a widget for editing a string parameter or displaying a read-only parameter's value.
QLayout * createFilenameLayout (FilenameParameter *filenameParameter)
 Creates a layout with widgets for editing a filename parameter.
QWidget * createColorWidget (Parameter *parameter)
 Creates a widget for editing a color parameter.
QWidget * createEnumerationWidget (EnumerationParameter *enumerationParameter)
 Creates a widget for editing an enumeration parameter.
QWidget * createTextInfoWidget (Parameter *parameter)
 Creates a label widget for displaying the text info contained in the given parameter.
QWidget * createCommandWidget (Parameter *parameter)
 Creates a button widget for executing the command represented by the given parameter.
QWidget * createImageWidget (Parameter *parameter)
 Creates a widget displaying information about the image represented by the given parameter.
QLayout * createVectorLayout (Parameter *parameter)
 Creates a layout with widgets for editing a parameter that stores several values of a specific type.
void requestParameterChange (const QString &name, const QVariant &value)
 Notifies connected objects that a parameter of the currently edited object should be changed.
void filterParameters ()
 Filters the parameters displayed in the panel by the search text entered in the search edit widget.
QWidget * createPluginWidget (Parameter *parameter)
 Creates a plugin widget.

Private Attributes

Nodem_node
 The node for which parameters are displayed in the view.
QObject * m_editedWidget
 The widget that is currently being edited which causes the requestParameterChange() function to be called.
QMultiMap< QString, QWidget * > m_widgetMap
 A map with parameter names as keys and pointers to editing widgets as values.
QLabel * m_nodeTypeLabel
 The label displaying the type of the currently edited node.
QAction * m_nodeTypeLabelAction
 The action by which the label displaying the type of the currently edited node in the tool bar can be accessed.
QLineEdit * m_nodeNameEdit
 The line edit for editing the name of the currently edited node.
QAction * m_nodeNameEditAction
 The action by which the line edit for editing the name of the currently edited node in the tool bar can be accessed.
QLineEdit * m_searchEdit
 The line edit for editing the string for a parameter search.
int m_searchTimer
 The ID of the timer that is (re-)started each time the search text in the search edit widget is changed.


Detailed Description

Class representing a view for displaying and editing parameters of nodes.

Constructor & Destructor Documentation

ParameterPanel::ParameterPanel ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

Constructor of the ParameterPanel class.

Constructors and Destructors.

Parameters:
parent The parent widget the created instance will be a child of.
flags Extra widget options.
Constructor of the ParameterPanel class.

Parameters:
parent The parent widget the created instance will be a child of.
flags Extra widget options.

ParameterPanel::~ParameterPanel (  )  [virtual]

Destructor of the ParameterPanel class.

Destructor of the NetworkPanel class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.


Member Function Documentation

void ParameterPanel::showParameters ( Node node  )  [slot]

Displays the parameters and values for the given node.

Public Slots.

Parameters:
node The node whose parameters to display in the parameter view.
Displays the parameters and values for the given node.

Parameters:
node The node whose parameters to display in the parameter view.

void ParameterPanel::updateParameters ( bool  objectsSelected  )  [slot]

Slot that is called when the selection in the scene model has changed.

Parameters:
objectsSelected Flag that states whether objects in the scene are selected.

void ParameterPanel::fillToolBars ( QToolBar *  mainToolBar,
QToolBar *  panelToolBar 
) [virtual]

Fills the given tool bars in a panel frame with actions for the panel.

Public Functions.

Parameters:
mainToolBar The main tool bar to fill with actions.
panelToolBar The panel tool bar to fill with actions.
Fills the given tool bars in a panel frame with actions for the panel.

Parameters:
mainToolBar The main tool bar to fill with actions.
panelToolBar The panel tool bar to fill with actions.

Reimplemented from Panel.

void ParameterPanel::objectNameChangeRequested ( const QString &  oldName,
const QString &  newName 
) [signal]

Signal that is emitted when the name of the currently edited node should change.

Parameters:
oldName The name of the object to rename.
newName The new name for the object to rename.

void ParameterPanel::parameterChangeRequested ( const QString &  objectName,
const QString &  parameterName,
const QVariant &  value 
) [signal]

Signal that is emitted when the value of the parameter with the given name of the object with the given name should be changed to the given value.

Parameters:
objectName The name of the object for which to change the parameter.
parameterName The name of the parameter to change.
value The new value for the parameter.

void ParameterPanel::timerEvent ( QTimerEvent *  event  )  [protected, virtual]

Event handler that reacts to timer events.

Protected Events.

Parameters:
event The description of the timer event.
Event handler that reacts to timer events.

Parameters:
event The description of the timer event.

void ParameterPanel::on_m_nodeNameEdit_editingFinished (  )  [private, slot]

Requests a name change for the currently edited node and displays the successfully changed name in the node name edit widget.

Private Slots.

Is called when editing the node's name has finished.

Requests a name change for the currently edited node and displays the successfully changed name in the node name edit widget.

Is called when editing the node's name has finished.

void ParameterPanel::on_m_searchEdit_textChanged ( const QString &  text  )  [private, slot]

Starts the timer that launches the parameter filtering search after a specific delay.

Is called when the text in the search edit widget has changed.

Parameters:
text The text that has been entered in the search edit widget.

void ParameterPanel::on_ui_resetSearchAction_triggered ( bool  checked = false  )  [private, slot]

Cancels a running parameter search and resets the parameter search settings for the currently edited node.

Is called when the reset search action has been triggered.

Parameters:
checked The state of the action (unused).

void ParameterPanel::loadTabPage ( int  index  )  [private, slot]

Fills the tab page of the given index with widgets for editing the parameters that the tab page represents.

Is called when the index of the current tab in a tab widget has changed.

Parameters:
index The index of the tab page to fill with editing widgets.

void ParameterPanel::labelContextMenuRequested ( const QPoint &  position  )  [private, slot]

Opens a context menu at the given position with actions for the label.

Is called when a context menu is requested for a label widget.

Parameters:
position The position at which to open the context menu.

void ParameterPanel::checkBoxToggled ( bool  checked  )  [private, slot]

Applies an edited boolean value to the parameter represented by the checkbox widget calling this slot.

Private Slots for updating parameter values when widgets change.

Is called when a checkbox representing a parameter has been toggled.

Parameters:
checked The state of the check box.
Applies an edited boolean value to the parameter represented by the checkbox widget calling this slot.

Is called when a checkbox representing a parameter has been toggled.

Parameters:
checked The state of the check box.

void ParameterPanel::spinBoxEditingFinished (  )  [private, slot]

Applies an edited numeric value to the parameter represented by the spinbox widget calling this slot.

Is called when editing the value of a spin box representing a parameter has finished.

void ParameterPanel::sliderValueChanged (  )  [private, slot]

Applies an edited numeric value to the parameter represented by the slider widget calling this slot.

Is called when the value of a slider representing a parameter has changed.

void ParameterPanel::doubleSpinBoxEditingFinished (  )  [private, slot]

Applies an edited floating point numeric value to the parameter represented by the spinbox widget calling this slot.

Is called when editing the value of a double spin box representing a parameter has finished.

void ParameterPanel::doubleSliderValueChanged (  )  [private, slot]

Applies an edited floating point numeric value to the parameter represented by the slider widget calling this slot.

Is called when the value of a double slider representing a parameter has changed.

void ParameterPanel::lineEditEditingFinished (  )  [private, slot]

Applies an edited string value to the parameter represented by the line edit widget calling this slot.

Is called when editing the text of a line edit widget representing a parameter has finished.

void ParameterPanel::browseButtonClicked (  )  [private, slot]

Displays a dialog for selecting a file for the edited parameter.

Is called when the browse button for a filename parameter has been clicked.

void ParameterPanel::reloadButtonClicked (  )  [private, slot]

Reloads the file that the edited parameter represents.

Is called when the reload button for a filename parameter has been clicked.

void ParameterPanel::selectColor (  )  [private, slot]

Displays a dialog for selecting a color for the edited parameter.

Is called when the color button representing a color parameter has been clicked.

void ParameterPanel::comboBoxIndexChanged ( int  index  )  [private, slot]

Applies a changed combo box item selection to the edited parameter.

Is called when the index of the currently selected item of a combo box representing an enumeration parameter has changed.

Parameters:
index The index of the item currently selected in the combo box.

void ParameterPanel::commandButtonClicked (  )  [private, slot]

Requests the execution of the command represented by the clicked button.

Is called when the button representing a command parameter is clicked.

void ParameterPanel::updateBooleanWidget (  )  [private, slot]

Updates the widget showing a boolean parameter's value.

Private Slots for updating widgets when parameter values change.

Is called when the value of a boolean parameter has changed.

Updates the widget showing a boolean parameter's value.

Is called when the value of a boolean parameter has changed.

void ParameterPanel::updateIntegerWidgets (  )  [private, slot]

Updates the widgets showing an integer number parameter's value.

Is called when the value of an integer number parameter has changed.

void ParameterPanel::updateIntegerWidgets ( int  index  )  [private, slot]

Updates the widgets showing the component with the given index of an integer number parameter.

Is called when one of the values of an integer number parameter that contains a list of values has changed.

Parameters:
index The index of the value that has changed in the list of integer values.

void ParameterPanel::updateUnsignedIntegerWidgets (  )  [private, slot]

Updates the widgets showing an unsigned integer number parameter's value.

Is called when the value of an unsigned integer number parameter has changed.

void ParameterPanel::updateUnsignedIntegerWidgets ( int  index  )  [private, slot]

Updates the widgets showing the component with the given index of an unsigned integer number parameter.

Is called when one of the values of an unsigned integer number parameter that contains a list of values has changed.

Parameters:
index The index of the value that has changed in the list of unsigned integer values.

void ParameterPanel::updateFloatingPointWidgets (  )  [private, slot]

Updates the widgets showing a floating point number parameter's value.

Is called when the value of a floating point number parameter has changed.

void ParameterPanel::updateFloatingPointWidgets ( int  index  )  [private, slot]

Updates the widgets showing the component with the given index of a floating point number parameter.

Is called when one of the values of a floating point number parameter that contains a list of values has changed.

Parameters:
index The index of the value that has changed in the list of floating point values.

void ParameterPanel::updateStringWidget (  )  [private, slot]

Updates the widget showing a string parameter's value.

Is called when the value of a string parameter has changed.

void ParameterPanel::updateFilenameWidgets (  )  [private, slot]

Updates the widgets showing a filename parameter's value.

Is called when the value of a filename parameter has changed.

void ParameterPanel::updateColorWidget (  )  [private, slot]

Updates the widget showing a color parameter's value.

Is called when the value of a color parameter has changed.

void ParameterPanel::updateEnumerationWidget (  )  [private, slot]

Updates the widget showing an enumeration parameter's value.

Is called when the value of an enumeration parameter has changed.

void ParameterPanel::updateTextInfoWidget (  )  [private, slot]

Updates the label showing the text info parameter's value.

Updates the label showing a text info parameter's value.

Is called when the value of a text info parameter has changed.

void ParameterPanel::updateImageWidget (  )  [private, slot]

Updates the label showing info about the image parameter's image.

Is called when the value of an image parameter has changed.

void ParameterPanel::activateCustomContextMenu ( QLabel *  label  )  [private]

Activates the custom context menu for the given label widget.

Private Functions.

Parameters:
label The label widget to activate a custom context menu for.
Activates the custom context menu for the given label widget.

Parameters:
label The label widget to activate a custom context menu for.

void ParameterPanel::grayOut ( QWidget *  widget  )  [private]

Updates the given widget's palette so that it is painted with a Window color background instead of a Base color background.

Parameters:
widget The widget to gray out.

void ParameterPanel::clear (  )  [private]

Removes all widgets from the layout.

void ParameterPanel::addRows ( ParameterGroup parameterGroup,
QFormLayout *  formLayout 
) [private]

Adds widgets for editing the parameters of the given parameter group to the given form layout.

Adds widgets for editing the parameters of the given parameter group to the form layout.

Parameters:
parameterGroup The parameter group to create editing widgets for.
formLayout The form layout to add editing widgets to.

void ParameterPanel::addRows ( Parameter parameter,
QFormLayout *  formLayout 
) [private]

Adds widgets for editing the given parameter to the given form layout.

Adds widgets for editing the given parameter to the form layout.

Parameters:
parameter The parameter to create editing widgets for.
formLayout The form layout to add editing widgets to.

QWidget * ParameterPanel::createBooleanWidget ( Parameter parameter  )  [private]

Creates a widget for editing a boolean parameter.

Parameters:
parameter The boolean parameter to create an editing widget for.
Returns:
A widget for editing a boolean parameter.
Parameters:
parameter The parameter to create an editing widget for.
Returns:
A widget for editing a boolean parameter.

QLayout * ParameterPanel::createIntegerLayout ( NumberParameter numberParameter,
int  index = 0 
) [private]

Creates a layout with widgets for editing editing an integer parameter.

Creates a layout with widgets for editing an integer parameter.

Parameters:
numberParameter The number parameter to create an editing widget for.
index The index of the value to edit (for parameters that contain lists of values).
Returns:
A widget for editing an integer parameter.
Parameters:
numberParameter The number parameter to create an editing widget for.
index The index of the value to edit (for parameters that contain lists of values).
Returns:
A layout with widgets for editing an integer parameter.

QLayout * ParameterPanel::createUnsignedIntegerLayout ( NumberParameter numberParameter,
int  index = 0 
) [private]

Creates a layout with widgets for editing an unsigned integer parameter.

Parameters:
numberParameter The number parameter to create an editing widget for.
index The index of the value to edit (for parameters that contain lists of values).
Returns:
A widget for editing an unsigned integer parameter.
Parameters:
numberParameter The number parameter to create an editing widget for.
index The index of the value to edit (for parameters that contain lists of values).
Returns:
A layout with widgets for editing an unsigned integer parameter.

QLayout * ParameterPanel::createFloatingPointLayout ( NumberParameter numberParameter,
int  index = 0 
) [private]

Creates a layout with widgets for editing a floating point parameter.

Parameters:
numberParameter The number parameter to create an editing widget for.
index The index of the value to edit (for parameters that contain lists of values).
Returns:
A layout with widgets for editing a floating point parameter.

QWidget * ParameterPanel::createStringWidget ( Parameter parameter  )  [private]

Creates a widget for editing a string parameter or displaying a read-only parameter's value.

Parameters:
parameter The string parameter to create an editing widget for.
Returns:
A widget for editing a string parameter.

QLayout * ParameterPanel::createFilenameLayout ( FilenameParameter filenameParameter  )  [private]

Creates a layout with widgets for editing a filename parameter.

Parameters:
filenameParameter The filename parameter to create an editing widget for.
Returns:
A layout with widgets for editing a filename parameter.

QWidget * ParameterPanel::createColorWidget ( Parameter parameter  )  [private]

Creates a widget for editing a color parameter.

Parameters:
parameter The color parameter to create an editing widget for.
Returns:
A widget for editing a color parameter.

QWidget * ParameterPanel::createEnumerationWidget ( EnumerationParameter enumerationParameter  )  [private]

Creates a widget for editing an enumeration parameter.

Parameters:
enumerationParameter The parameter to create an editing widget for.
Returns:
A widget for editing an enumeration parameter.
Parameters:
enumerationParameter The enumeration parameter to create an editing widget for.
Returns:
A widget for editing an enumeration parameter.

QWidget * ParameterPanel::createTextInfoWidget ( Parameter parameter  )  [private]

Creates a label widget for displaying the text info contained in the given parameter.

Parameters:
parameter The text info parameter to create a label widget for.
Returns:
A label widget for displaying the text info contained in the given parameter.

QWidget * ParameterPanel::createCommandWidget ( Parameter parameter  )  [private]

Creates a button widget for executing the command represented by the given parameter.

Parameters:
parameter The command parameter to create a button widget for.
Returns:
A widget for execting the command represented by the given parameter.

QWidget * ParameterPanel::createImageWidget ( Parameter parameter  )  [private]

Creates a widget displaying information about the image represented by the given parameter.

Parameters:
parameter The image parameter to create a widget for.
Returns:
A widget displaying information about the image represented by the given parameter, or 0 if not applicable.

QLayout * ParameterPanel::createVectorLayout ( Parameter parameter  )  [private]

Creates a layout with widgets for editing a parameter that stores several values of a specific type.

Parameters:
parameter The vector parameter to create a layout with editing widgets for.
Returns:
A layout with widgets for editing a parameter that stores several values of a specific type.

void ParameterPanel::requestParameterChange ( const QString &  parameterName,
const QVariant &  value 
) [private]

Notifies connected objects that a parameter of the currently edited object should be changed.

Parameters:
name The name of the parameter to change.
value The new value for the parameter.
parameterName The name of the parameter to change.
value The new value for the parameter.

void ParameterPanel::filterParameters (  )  [private]

Filters the parameters displayed in the panel by the search text entered in the search edit widget.

QWidget * ParameterPanel::createPluginWidget ( Parameter parameter  )  [private]

Creates a plugin widget.

Parameters:
parameter the parameter of the widget
Returns:
The plugin widget


Member Data Documentation

The node for which parameters are displayed in the view.

QObject* ParameterPanel::m_editedWidget [private]

The widget that is currently being edited which causes the requestParameterChange() function to be called.

See also:
requestParameterChange()

QMultiMap<QString, QWidget *> ParameterPanel::m_widgetMap [private]

A map with parameter names as keys and pointers to editing widgets as values.

The label displaying the type of the currently edited node.

The action by which the label displaying the type of the currently edited node in the tool bar can be accessed.

QLineEdit* ParameterPanel::m_nodeNameEdit [private]

The line edit for editing the name of the currently edited node.

The action by which the line edit for editing the name of the currently edited node in the tool bar can be accessed.

QLineEdit* ParameterPanel::m_searchEdit [private]

The line edit for editing the string for a parameter search.

The ID of the timer that is (re-)started each time the search text in the search edit widget is changed.


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

Generated on Wed Feb 24 15:01:02 2010 for Frapper by  doxygen 1.5.9