Option Class Reference

Interface for option plug-ins. More...

#include <Option.h>

Inheritance diagram for Option:

Inheritance graph

List of all members.

Public Member Functions

virtual const std::string & getOptionName ()=0
virtual QWidget * getWidget ()=0
virtual void applyChanges ()=0

Protected Member Functions

virtual ~Option ()


Detailed Description

Interface for option plug-ins.

All option plug-ins will be displayed to the user when opening the application options dialog, ie. "Tools\Options". This interface can be implemented by a plug-in to get their custom option widgets to appear in the application options dialog. The application options dialog is modal and will instantiate all option plug-ins when shown and will destroy all option plug-ins when the dialog is closed.

See also:
OptionShell, OptionQWidgetWrapper

Definition at line 29 of file Option.h.


Constructor & Destructor Documentation

virtual Option::~Option (  )  [protected, virtual]

Since the Option interface is usually used in conjunction with the PlugIn interface, this should be destroyed by casting to the PlugIn interface and calling PlugInManagerServices::destroyPlugIn().

Definition at line 103 of file Option.h.


Member Function Documentation

virtual const std::string& Option::getOptionName (  )  [pure virtual]

Returns the name of the option.

This will be displayed to the user in a tree view, allowing them to show the widget returned by getWidget() for this option. This string can include '/', which will then create a group in the tree view. For instance, a returned string of "Windows/Workspace/Cube" would create a tree heirarchy like the following:

  • Windows
    • Workspace
      • Cube

If the string needs to actually include a '/', it can be escaped by using '//'. When placing option plug-ins into a heirarchy please attempt to put them into the already provided application heirarchy where possible. If not possible, please create a top-level node with the name of the plug-in suite and place option plug-ins under that node.

Returns:
Returns the name of the option.

Implemented in OptionShell.

virtual QWidget* Option::getWidget (  )  [pure virtual]

Returns the widget that will be displayed to the user.

The widget will only be displayed when the user selects the option in the options dialog. This widget should only be instantiated once per instance of this plug-in. This widget will be owned by this plug-in and should be destroyed when the plug-in is destroyed. Please note, that the option dialog that this widget will be displayed in is resizable, so ensure the Qt layout for this widget resizes properly.

Warning:
The QWidget* returned by this method should NEVER be instantiated in the constructor of this plug-in. When the application is run in batch mode, it will attempt to create this plug-in and if this plug-in attempts to create a QWidget* in it's constructor, the application will crash.
Returns:
Returns the widget that will be displayed to the user.

Implemented in OptionShell.

virtual void Option::applyChanges (  )  [pure virtual]

Apply the changes that the user made in the QWidget.

The values modified by the user while the QWidget was displayed should be stored permanently. This usually means storing the values in ConfigurationSettings, but can include any method that will store the values such that the values will be retained through a stop and start of the application and the values should generally be associated with the user running the application only. The values modified by the user should NEVER be permanently stored until this method is called. This method is guaranteed to only be called once per instance of the class.

Implemented in OptionQWidgetWrapper< OptionWidget >.


Software Development Kit - Opticks 4.9.0 Build 16218