PropertiesQWidgetWrapper< PropertiesWidget > Class Template Reference
[Plug-In Shells]

A plug-in that both implements the Properties interface and provides a QWidget. More...

#include <PropertiesQWidgetWrapper.h>

Inheritance diagram for PropertiesQWidgetWrapper< PropertiesWidget >:

Inheritance graph

List of all members.

Public Member Functions

 PropertiesQWidgetWrapper ()
 ~PropertiesQWidgetWrapper ()
bool initialize (SessionItem *pItem)
bool applyChanges ()

Protected Member Functions

QWidget * createWidget ()


Detailed Description

template<typename PropertiesWidget>
class PropertiesQWidgetWrapper< PropertiesWidget >

A plug-in that both implements the Properties interface and provides a QWidget.

This templated class is used by writing a QWidget subclass and then doing the following to register the plug-in:

    //assume SampleProperties is a subclass of QWidget and
    //the plug-in belongs to a module that was registered
    //using REGISTER_MODULE(SampleModule);
    REGISTER_PLUGIN(SampleModule, SampleProperties, PropertiesQWidgetWrapper<SampleProperties>());

The templated argument must meet the following requirements:

Definition at line 46 of file PropertiesQWidgetWrapper.h.


Constructor & Destructor Documentation

template<typename PropertiesWidget>
PropertiesQWidgetWrapper< PropertiesWidget >::PropertiesQWidgetWrapper (  ) 

Instantiates this properties plug-in by querying the templated class using its provided static methods.

Definition at line 53 of file PropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
PropertiesQWidgetWrapper< PropertiesWidget >::~PropertiesQWidgetWrapper (  ) 

Destroys this properties plug-in.

Definition at line 69 of file PropertiesQWidgetWrapper.h.


Member Function Documentation

template<typename PropertiesWidget>
bool PropertiesQWidgetWrapper< PropertiesWidget >::initialize ( SessionItem pItem  )  [virtual]

Initializes the widget by calling initialize() on the templated class.

Parameters:
pItem 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.

Reimplemented from PropertiesShell.

Definition at line 84 of file PropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
bool PropertiesQWidgetWrapper< PropertiesWidget >::applyChanges (  )  [virtual]

Applies the changes in the widget.

This method is called when the user clicks the OK or Apply buttons in the properties dialog. It applies the changes in the widget by calling applyChanges() on the templated class. The applyChanges() method of the templated class should return true if all changes were successfully applied to the object. It should also return true if no updates need to be made.

Returns:
This method returns the value returned from applyChanges() of the templated class or NULL if the widget has not been created. If false is returned, the widget will be activated in the properties dialog if necessary and the dialog will not be closed if the OK button was clicked.

Implements Properties.

Definition at line 111 of file PropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
QWidget* PropertiesQWidgetWrapper< PropertiesWidget >::createWidget (  )  [protected, virtual]

Creates the properties widget.

This method creates the properties widget by directly instantiating the templated class, which must be a subclass of QWidget.

Implements PropertiesShell.

Definition at line 129 of file PropertiesQWidgetWrapper.h.


Software Development Kit - Opticks 4.9.0 Build 16218