PropertiesShell Class Reference
[Plug-In Shells]

A base class for plug-in shells or plug-in instances. More...

#include <PropertiesShell.h>

Inheritance diagram for PropertiesShell:

Inheritance graph

List of all members.

Public Member Functions

 PropertiesShell ()
virtual ~PropertiesShell ()
QWidget * getWidget ()
const std::string & getPropertiesName () const
bool initialize (SessionItem *pSessionItem)

Protected Member Functions

virtual QWidget * createWidget ()=0
void setPropertiesName (const std::string &name)
SessionItemgetSessionItem () const


Detailed Description

A base class for plug-in shells or plug-in instances.

This class provides a default implementation of the Properties plug-in interface. If a properties plug-in needs to implement a QWidget, try subclassing PropertiesQWidgetWrapper instead of PropertiesShell. However, if the properties plug-in should simply wrap an existing QWidget, subclass PropertiesShell.

See also:
Properties, PropertiesQWidgetWrapper

Definition at line 28 of file PropertiesShell.h.


Constructor & Destructor Documentation

PropertiesShell::PropertiesShell (  ) 

Creates the properties plug-in.

The constructor sets the plug-in type to PlugInManagerServices::PropertiesType().

See also:
getType()

virtual PropertiesShell::~PropertiesShell (  )  [virtual]

Destroys the properties plug-in.


Member Function Documentation

QWidget* PropertiesShell::getWidget (  )  [virtual]

Returns the widget that will be displayed to the user.

The widget will be displayed when the user selects the applicable tab in the properties dialog. It is only instantiated once per instance of this plug-in. The widget will be owned by the plug-in and should be destroyed when the plug-in is destroyed. Please note, that the properties dialog in which the widget will be displayed in is resizable, so ensure that the Qt layout for the 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 its constructor, the application will crash.
Returns:
Returns the widget that will be displayed to the user.

Default Implementation:
The default implementation calls createWidget() and stores and returns the returned widget pointer. Successive calls to this method will simply return the stored widget pointer.

Implements Properties.

const std::string& PropertiesShell::getPropertiesName (  )  const [virtual]

Returns the name of the properties.

This method is called by the properties dialog to get the name to display on the tab containing the widget returned by getWidget().

Returns:
Returns the properties name that is displayed to the user.

Default Implementation:
The default implementation returns the value provided to setPropertiesName(). If setPropertiesName() has not been called, this method returns an empty string.

Implements Properties.

bool PropertiesShell::initialize ( SessionItem pSessionItem  )  [virtual]

Initializes the widget to the properties of a given session item.

This method is called by the properties dialog for the widget to initialize its child widgets based on the current state of the given session item.

This method is guaranteed to only be called once per instance of the class.

Parameters:
pSessionItem The session item for which to initialize the widget's values.
Returns:
Returns true if the widget was successfully initialized from the given session item; otherwise returns false. If this method returns false, the widget is not added to the properties dialog.

Default Implementation:
The default implementation sets the member pointer that can be retrieved by calling getSessionItem() and returns true.

Implements Properties.

Reimplemented in PropertiesQWidgetWrapper< PropertiesWidget >.

virtual QWidget* PropertiesShell::createWidget (  )  [protected, pure virtual]

Creates the properties widget.

This method must be implemented in subclasses to create the QWidget. Upon creation, the widget should be populated with default values. Initialization of the widget will occur in initialize(), which is called after this method.

This method is guaranteed to be called only once per instance of this plug-in.

Returns:
The created properties widget.

Implemented in PropertiesQWidgetWrapper< PropertiesWidget >.

void PropertiesShell::setPropertiesName ( const std::string &  name  )  [protected]

Sets the properties name that will be returned from getPropertiesName().

Parameters:
name The properties name that will appear on a tab in the properties dialog.

SessionItem* PropertiesShell::getSessionItem (  )  const [protected]

Returns the session item for which the widget is initialized.

This method provides a means to retrieve the session item to which the widget is initialized. The returned pointer can be used when appying changes back to the session item.

Returns:
The session item to which changes should be applied.
See also:
initialize()


Software Development Kit - Opticks 4.9.0 Build 16218