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

A plug-in that both implements the Properties and Nitf::Properties interfaces and provides a QWidget. More...

#include <NitfPropertiesQWidgetWrapper.h>

Inheritance diagram for Nitf::PropertiesQWidgetWrapper< PropertiesWidget >:

Inheritance graph

List of all members.

Public Member Functions

 PropertiesQWidgetWrapper ()
virtual ~PropertiesQWidgetWrapper ()
bool initialize (SessionItem *pItem)
bool applyChanges ()
virtual std::string getTypeName () const
virtual bool canDisplayMetadata (const DynamicObject &metadata)
QWidget * getWidget ()
const std::string & getPropertiesName () const


Detailed Description

template<typename PropertiesWidget>
class Nitf::PropertiesQWidgetWrapper< PropertiesWidget >

A plug-in that both implements the Properties and Nitf::Properties interfaces 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 SampleTreProperties is a subclass of QWidget and
    //the plug-in belongs to a module that was registered
    //using REGISTER_MODULE(SampleTreModule);
    REGISTER_PLUGIN(SampleTreModule, SampleTreProperties,
                    Nitf::PropertiesQWidgetWrapper<SampleTreProperties>());

The templated argument must meet the following requirements:

Definition at line 55 of file NitfPropertiesQWidgetWrapper.h.


Constructor & Destructor Documentation

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

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

Definition at line 62 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
virtual Nitf::PropertiesQWidgetWrapper< PropertiesWidget >::~PropertiesQWidgetWrapper (  )  [virtual]

Destroys this properties plug-in.

Definition at line 79 of file NitfPropertiesQWidgetWrapper.h.


Member Function Documentation

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

Initializes the widget with a SessionItem 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.

Implements Properties.

Definition at line 94 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
bool Nitf::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 or if the widget is for display purposes only.

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 121 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
virtual std::string Nitf::PropertiesQWidgetWrapper< PropertiesWidget >::getTypeName (  )  const [virtual]

The name of the TRE or DES this plug-in displays.

Returns:
The name of the TRE or DES. This must exactly match the TRE or DES name as it appears in the DataElement metadata.

Implements Nitf::Properties.

Definition at line 135 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
virtual bool Nitf::PropertiesQWidgetWrapper< PropertiesWidget >::canDisplayMetadata ( const DynamicObject metadata  )  [virtual]

Determine if this plug-in can display and/or edit the specified metadata.

Parameters:
metadata The element metadata sub-tree for the named TRE or DES. This will be rooted at the metadata TRE or DES node with the same name as SubType().
Returns:
True if the metadata can be displayed and/or edited, otherwise false.

Implements Nitf::Properties.

Definition at line 143 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
QWidget* Nitf::PropertiesQWidgetWrapper< PropertiesWidget >::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.

Implements Properties.

Definition at line 156 of file NitfPropertiesQWidgetWrapper.h.

template<typename PropertiesWidget>
const std::string& Nitf::PropertiesQWidgetWrapper< PropertiesWidget >::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.

Implements Properties.

Definition at line 168 of file NitfPropertiesQWidgetWrapper.h.


Software Development Kit - Opticks 4.9.0 Build 16218