GCF LOGO VCL LOGO

Extends GCF::Component to ease creation of GUI components. More...

#include <GCF3/GuiComponent>

Public Member Functions

 GuiComponent (QObject *parent=0)
 
- Public Member Functions inherited from GCF::Component
 Component (QObject *parent=0)
 
virtual QString name () const
 
virtual QString organization () const
 
virtual GCF::Version version () const
 
virtual QString buildTimestamp () const
 
const QSettings * settings () const
 
bool isLoaded () const
 
bool isActive () const
 
void load ()
 
void unload ()
 
void activate ()
 
void deactivate ()
 
void addContentObject (const QString &name, QObject *object, const QVariantMap &info=QVariantMap())
 
void addContentObject (QObject *object, const QVariantMap &info=QVariantMap())
 
void removeContentObject (QObject *object)
 
void removeContentObject (const QString &name)
 

Protected Member Functions

 ~GuiComponent ()
 
void contentObjectLoadEvent (GCF::ContentObjectLoadEvent *e)
 
void contentObjectMergeEvent (GCF::ContentObjectMergeEvent *e)
 
void contentObjectUnloadEvent (GCF::ContentObjectUnloadEvent *e)
 
void contentObjectUnmergeEvent (GCF::ContentObjectUnmergeEvent *e)
 
void activateContentObjectEvent (GCF::ActivateContentObjectEvent *e)
 
void deactivateContentObjectEvent (GCF::DeactivateContentObjectEvent *e)
 
virtual QWidget * loadWidget (const QString &name, const QVariantMap &info)
 
virtual bool unloadWidget (const QString &name, QWidget *widget, const QVariantMap &info)
 
virtual QAction * loadAction (const QString &name, const QVariantMap &info)
 
virtual bool unloadAction (const QString &name, QAction *action, const QVariantMap &info)
 
virtual QActionGroup * loadActionGroup (const QString &name, const QVariantMap &info)
 
virtual bool unloadActionGroup (const QString &name, QActionGroup *actionGroup, const QVariantMap &info)
 
virtual QMenu * loadMenu (const QString &name, const QVariantMap &info)
 
virtual bool unloadMenu (const QString &name, QMenu *menu, const QVariantMap &info)
 
virtual QMenuBar * loadMenuBar (const QString &name, const QVariantMap &info)
 
virtual bool unloadMenuBar (const QString &name, QMenuBar *menuBar, const QVariantMap &info)
 
virtual QToolBar * loadToolBar (const QString &name, const QVariantMap &info)
 
virtual bool unloadToolBar (const QString &name, QToolBar *toolBar, const QVariantMap &info)
 
bool mergeObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
bool unmergeObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool mergeWithWidget (QWidget *parent, QWidget *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeFromWidget (QWidget *parent, QWidget *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool mergeWithActionGroup (QActionGroup *parent, QAction *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeFromActionGroup (QActionGroup *parent, QAction *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool mergeWithMenu (QMenu *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeFromMenu (QMenu *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool mergeWithToolBar (QToolBar *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeFromToolBar (QToolBar *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool mergeWithMenuBar (QMenuBar *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool unmergeFromMenuBar (QMenuBar *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
bool activateObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
bool deactivateObject (QObject *parent, QObject *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool activateWidget (QWidget *parent, QWidget *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
virtual bool deactivateWidget (QWidget *parent, QWidget *child, const QVariantMap &parentInfo, const QVariantMap &childInfo)
 
- Protected Member Functions inherited from GCF::Component
 ~Component ()
 
virtual void finalizeEvent (GCF::FinalizeEvent *e)
 
virtual void initializeEvent (GCF::InitializeEvent *e)
 
virtual void activationEvent (GCF::ActivationEvent *e)
 
virtual void contentLoadEvent (GCF::ContentLoadEvent *e)
 
virtual void deactivationEvent (GCF::DeactivationEvent *e)
 
virtual void settingsLoadEvent (GCF::SettingsLoadEvent *e)
 
virtual void contentUnloadEvent (GCF::ContentUnloadEvent *e)
 
virtual void settingsUnloadEvent (GCF::SettingsUnloadEvent *e)
 
virtual QObject * loadObject (const QString &name, const QVariantMap &info)
 
virtual bool unloadObject (const QString &name, QObject *object, const QVariantMap &info)
 

Detailed Description

This class offers GUI (or widgets) friendly methods to make creation of GUI components simple and straight forward. It is not mandatory for you to implement from this class if you are writing GUI components. You can direclty subclass GCF::Component. However, inheriting from this class makes your code easier to comprehend and manage. Plus you can leverage on all the GUI freebies that this class offers.

This class reimplements

All of the specialized virtual methods called by the above event handlers have default implementations. This means that the specialized virtual methods already know how to create one or more object types and make your GUI component functional.

For instance, consider the content-file below

<content>
<!-- Create the top-level main-window -->
<object name="window" type="widget" class="QMainWindow">
<property>
<key>windowTitle</key>
<value>GCF::GuiComponent demo</value>
</property>
</object>
<!-- Create text editor into the workspace of the mainwindow -->
<object name="textEditor" type="widget" class="QTextEdit" parent="window">
<property>
<key>acceptRichText</key>
<value>false</value>
</property>
</object>
<!-- Create menu-bar -->
<object name="menuBar" type="menuBar" />
<!-- Create top-level menus -->
<object name="fileMenu" type="menu" title="File" parent="menuBar" />
<object name="editMenu" type="menu" title="Edit" parent="menuBar" />
<object name="helpMenu" type="menu" title="Help" parent="menuBar" />
<!-- Create actions -->
<object name="fileNew" type="action" text="New" parent="fileMenu" />
<object name="fileOpen" type="action" text="Open" parent="fileMenu" />
<object name="fileSave" type="action" text="Save" parent="fileMenu" />
<object name="fileSaveAs" type="action" text="Save As" parent="fileMenu" />
<object name="fileClose" type="action" text="Close" parent="fileMenu" />
<object name="fileExit" type="action" text="Exit" parent="fileMenu" >
<connection>
<sender>triggered()</sender>
<receiver>window::close()</receiver>
</connection>
</object>
<object name="editCut" type="action" text="Cut" parent="editMenu">
<connection>
<sender>triggered()</sender>
<receiver>textEditor::cut()</receiver>
</connection>
</object>
<object name="editCopy" type="action" text="Copy" parent="editMenu">
<connection>
<sender>triggered()</sender>
<receiver>textEditor::copy()</receiver>
</connection>
</object>
<object name="editPaste" type="action" text="Paste" parent="editMenu">
<connection>
<sender>triggered()</sender>
<receiver>textEditor::paste()</receiver>
</connection>
</object>
<object name="helpAbout" type="action" text="About" parent="helpMenu" />
</content>

Now when the above content-file is set for a GuiComponent (by reimplementing its GCF::Component::contentLoadEvent() and calling GCF::ContentLoadEvent::setContentFile() to set the file where the above XML is stored); GCF constructs a main-window with file, edit and help menus. It then creates a text-editor on the workspace area of the main-window. The output would look as follows

gui-component.png

Constructor & Destructor Documentation

GCF::GuiComponent::GuiComponent ( QObject *  parent = 0)

Constructor. Creates an instance of this class and inserts it as a child under parent.

Note
It is recommended that subclasses of GCF::GuiComponent declare their constructor as public and destructor as protected. This will ensure that the components are created on the heap always.
GCF::GuiComponent::~GuiComponent ( )
protected

Destructor.

Note
It is recommended that subclasses of GCF::GuiComponent declare their constructor as public and destructor as protected. This will ensure that the components are created on the heap always.

Member Function Documentation

void GCF::GuiComponent::contentObjectLoadEvent ( GCF::ContentObjectLoadEvent e)
protectedvirtual

This event handler is implemented to look for a type key in the information map (GCF::ContentObjectLoadEvent::info()) provided by the event-object. Depending on the type a specialized load function is called.

For all other values of type, the base class implementation of the event handler is called, which in-turn calls the GCF::Component::loadObject() method.

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

void GCF::GuiComponent::contentObjectMergeEvent ( GCF::ContentObjectMergeEvent e)
protectedvirtual

This event handler is implemented to look for the type key in parent information map, which is accessible via GCF::ContentObjectMergeEvent::parentInfo() method. Depending on the parent type; a specialized merge function is called.

For all other-values of type, the base class implementation of the event handler is called, which in-turn calls the GCF::Component::mergeObject() method.

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

void GCF::GuiComponent::contentObjectUnloadEvent ( GCF::ContentObjectUnloadEvent e)
protectedvirtual

This event handler is implemented to call a specialized unload function based on the type key in the information map obtained by calling GCF::ContentObjectUnloadEvent::info() on the event object. Depending on the value of type, a specialized unload function is called.

For all other-values of type, the base class implementation of the event handler is called, which in-turn calls the GCF::Component::unloadObject() method.

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

void GCF::GuiComponent::contentObjectUnmergeEvent ( GCF::ContentObjectUnmergeEvent e)
protectedvirtual

This event handler is implemented to look for the type key in parent information map, which is accessible via GCF::ContentObjectUnmergeEvent::parentInfo() method. Depending on the parent type; a specialized merge function is called.

For all other-values of type, the base class implementation of the event handler is called, which in-turn calls the GCF::Component::unmergeObject() method.

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

void GCF::GuiComponent::activateContentObjectEvent ( GCF::ActivateContentObjectEvent e)
protectedvirtual

This event handler is implemented to look for the type key in parent information map, which is accessible via GCF::ActivateContentObjectEvent::parentInfo() method.

If the type is widget, then the activateWidget() method is called. Otherwise the base-class implementation of this event handler is called, which in turn calls GCF::Component::activateObject()

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

void GCF::GuiComponent::deactivateContentObjectEvent ( GCF::DeactivateContentObjectEvent e)
protectedvirtual

This event handler is implemented to look for the type key in parent information map, which is accessible via GCF::DeactivateContentObjectEvent::parentInfo() method.

If the type is widget, then the deactivateWidget() method is called. Otherwise the base-class implementation of this event handler is called, which in turn calls GCF::Component::deactivateObject()

Note
the value of type is case-insensitive

Reimplemented from GCF::Component.

QWidget * GCF::GuiComponent::loadWidget ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function may be implemented to return pointer to a widget based on name and info parameters. The default implementation of this function does the following

  • Extracts value of the class key in info and creates an instance of the corresponding widget class. Currently widgets for classes QMainWindow, QTabWidget, QStackedWidget, QGroupBox, QTableWidget, QPlainTextEdit and QTextEdit are created. For all other class-names a QWidget instance is created. In a future release we will make it possible to create appropriate instance of any Qt widget.
  • Extracts the value of layout key in info and installs the corresponding layout on the widget. Accepted values of layout key are vertical, horizontal, grid and form.
  • Extracts the value of geometry key in info and splits the value across comma (,). The split list is considered to contain x, y, width and height values. This will then be set as the geoemtry of the created widget.
Parameters
namename of the widget to be loaded. This name would be set as the objectName of the returned QWidget.
infoinformation map, that provides some hints about the kind of widget that needs to be loaded.
Returns
Pointer to a widget that got loaded.
Note
The function always returns a valid QWidget pointer.
If you reimplement this function, please remember to call the default (this) implementation at the end.
bool GCF::GuiComponent::unloadWidget ( const QString &  name,
QWidget *  widget,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload a widget. The default implementation ignores name and info, and simply deletes the widget.

Parameters
namename of the widge that needs to be unloaded
widgetpointer to the QWidget that needs to be unloaded
infoinformation key=value map associated with the widget that needs to be unloaded
Returns
true upon successful unloading of the widget, false otherwise.
Note
the default implementation always returns true
QAction * GCF::GuiComponent::loadAction ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be reimplemented to load a QAction object based on name and info. The default implementation creates a new QAction instance and sets its text and tooltip values by reading from the text and tooltip keys from info.

Parameters
namename of the action to load
infoinformation key=value map of the action that needs to be loaded
Returns
pointer to a QAction instance
Note
the default implementation always returns a valid QAction pointer.
bool GCF::GuiComponent::unloadAction ( const QString &  name,
QAction *  action,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload an action. The default implementation ignores name and info, and simply deletes the action.

Parameters
namename of the action that needs to be unloaded
actionpointer to the QAction that needs to be unloaded
infoinformation key=value map associated with the action that needs to be unloaded
Returns
true upon successful unloading of the action, false otherwise.
Note
the default implementation always returns true
QActionGroup * GCF::GuiComponent::loadActionGroup ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be reimplemented to load a QActionGroup object based on name and info. The default implementation creates a new QActionGroup instance and sets its exclusive property by reading the exclusive key from info

Parameters
namename of the action group to load
infoinformation key=value map of the action group that needs to be loaded
Returns
pointer to a QActionGroup instance
Note
the default implementation always returns a valid QActionGroup pointer.
bool GCF::GuiComponent::unloadActionGroup ( const QString &  name,
QActionGroup *  actionGroup,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload an action group. The default implementation ignores name and info, and simply deletes the actionGroup.

Parameters
namename of the action group that needs to be unloaded
actionpointer to the QActionGroup that needs to be unloaded
infoinformation key=value map associated with the action group that needs to be unloaded
Returns
true upon successful unloading of the action group, false otherwise.
Note
the default implementation always returns true
QMenu * GCF::GuiComponent::loadMenu ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be reimplemented to load a QMenu object based on name and info. The default implementation creates a new QMenu instance and sets its text and tooltip values by reading from the text and tooltip keys from info.

Parameters
namename of the menu to load
infoinformation key=value map of the menu that needs to be loaded
Returns
pointer to a QMenu instance
Note
the default implementation always returns a valid QMenu pointer.
bool GCF::GuiComponent::unloadMenu ( const QString &  name,
QMenu *  menu,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload a menu. The default implementation ignores name and info, and simply deletes the menu.

Parameters
namename of the menu that needs to be unloaded
actionpointer to the QMenu that needs to be unloaded
infoinformation key=value map associated with the menu that needs to be unloaded
Returns
true upon successful unloading of the menu, false otherwise.
Note
the default implementation always returns true
QMenuBar * GCF::GuiComponent::loadMenuBar ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be reimplemented to load a QMenuBar object based on name and info. The default implementation ignores name and info and creates a new QMenuBar instance.

Parameters
namename of the menu-bar to load
infoinformation key=value map of the menu-bar that needs to be loaded
Returns
pointer to a QMenuBar instance
Note
the default implementation always returns a valid QMenuBar pointer.
bool GCF::GuiComponent::unloadMenuBar ( const QString &  name,
QMenuBar *  menuBar,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload a menu-bar. The default implementation ignores name and info, and simply deletes the menuBar.

Parameters
namename of the menu-bar that needs to be unloaded
actionpointer to the QMenuBar that needs to be unloaded
infoinformation key=value map associated with the menu-bar that needs to be unloaded
Returns
true upon successful unloading of the menu-bar, false otherwise.
Note
the default implementation always returns true
QToolBar * GCF::GuiComponent::loadToolBar ( const QString &  name,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be reimplemented to load a QToolBar object based on name and info. The default implementation creates a new QToolBar instance and sets it title property by reading the title key from info

Parameters
namename of the tool-bar to load
infoinformation key=value map of the tool-bar that needs to be loaded
Returns
pointer to a QToolBar instance
Note
the default implementation always returns a valid QToolBar pointer.
bool GCF::GuiComponent::unloadToolBar ( const QString &  name,
QToolBar *  toolBar,
const QVariantMap &  info 
)
protectedvirtual

This virtual function can be implemented to unload a tool-bar. The default implementation ignores name and info, and simply deletes the toolBar.

Parameters
namename of the tool-bar that needs to be unloaded
actionpointer to the QToolBar that needs to be unloaded
infoinformation key=value map associated with the tool-bar that needs to be unloaded
Returns
true upon successful unloading of the tool-bar, false otherwise.
Note
the default implementation always returns true
bool GCF::GuiComponent::mergeObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This virtual function is reimplemented from GCF::Component to handle the case where child is a layout and parent is a widget. For all other cases the base class implementation is called.

In the case where child is a layout and parent is a widget, the layout is set on the widget deleting any previous layout.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be merged (or parented) into parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented from GCF::Component.

bool GCF::GuiComponent::unmergeObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is reimplemented from GCF::Component to handle the case where child is a layout and parent is a widget. In such a case the child layout will be deleted and the widget will be left with no layout. For all other cases the base class implementation is called.

Parameters
parentpointer to a QObject added by this component.
childpointer to a QObject that needs to be unmerged (or parented) into parent
parentInfokey=value information map associated with the parent
childInfokey=value information map associated with the child
Returns
true on success, false otherwise. [Note: The return value is currently ignored]

Reimplemented from GCF::Component.

bool GCF::GuiComponent::mergeWithWidget ( QWidget *  parent,
QWidget *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This virtual function can be reimplemented to customize the way in which a child widget is parented into the parent widget. The default implementation makes use of the following rules while performing the merge.

  • if child is a QMenuBar, then it is set as a menu-widget in the parent's widget.
  • if parent is a QTabWidget, then the child is added as a tab; with the value of title from the childInfo as tab-title.
  • if parent is a QStackedWidget, then the child is added as a widget to it.
  • if parent is a QMainWindow, then the child is added as a widget to the central-widget. If no such central widget exist; then a default central widget with vertical layout is created. The child is then added to the newly created central widget.
  • if the parent is a QWidget and has a layout, then the child is added to the layout. Value of the layoutposition key in childInfo can provide hints about the insert-index. If parent has a form layout, then the label for child will be picked up from labeltext key of childInfo.
  • if parent does not have any layout associated with it; then child is reparented to parent. Position of the child within parent will be detemrined by the geometry key of childInfo.
Parameters
parentpointer to the parent QWidget into which the child should be merged
childpointer to the child QWidget that needs merging
parentInfopointer to the information key=value map associated with the parent
childInfopointer to the information key=value map associated with the child
Returns
true on success, false otherwise. (The default implementation always returns true)
bool GCF::GuiComponent::unmergeFromWidget ( QWidget *  parent,
QWidget *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

Thi function can be implemented to customize the way in which child is unmerged (or unparented) from parent. The default implementation removes child from the parent.

Parameters
parentpointer to the parent QWidget from which the child should be unmerged
childpointer to the child QWidget that needs unmerging
parentInfopointer to the information key=value map associated with the parent
childInfopointer to the information key=value map associated with the child
Returns
true on success, false otherwise. (The default implementation always returns true)
bool GCF::GuiComponent::mergeWithActionGroup ( QActionGroup *  parent,
QAction *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child action is added to the parent action-group. The default implementation simply adds the action to the action group.

Parameters
parentpointer to the QActionGroup into which an action needs to be added
childpointer to the QAction that needs to be added
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true on success, false otherwise. (The default implementation returns true always)
bool GCF::GuiComponent::unmergeFromActionGroup ( QActionGroup *  parent,
QAction *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child action is removed from the parent action-group. The default implementation simply removes the action from the action group.

Parameters
parentpointer to the QActionGroup from which an action needs to be removed
childpointer to the QAction that needs to be removed
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true on success, false otherwise. (The default implementation returns true always)
bool GCF::GuiComponent::mergeWithMenu ( QMenu *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is added to the parent menu. The default implementation

  • adds child as an action to parent, if child is a QAction
  • adds child as sub-menu to parent, if child is a QMenu
  • adds child as widget-action to parent, if child is a QWidget
Parameters
parentpointer to the QMenu into which the child needs to be added
childpointer to the QObject that needs to be added
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QAction, QMenu or QWidget. False otherwise.
bool GCF::GuiComponent::unmergeFromMenu ( QMenu *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is removed from the parent menu. The default implementation

  • removes child as an action from parent, if child is a QAction
  • removes child as sub-menu from parent, if child is a QMenu
  • removes child as widget-action from parent, if child is a QWidget
Parameters
parentpointer to the QMenu from which the child needs to be removed
childpointer to the QObject that needs to be removed
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QAction, QMenu or QWidget. False otherwise.
bool GCF::GuiComponent::mergeWithToolBar ( QToolBar *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is added to the parent toolbar. The default implementation

  • adds child as an action to parent, if child is a QAction
  • adds child as an menu to parent, if child is a QMenu
Parameters
parentpointer to the QToolBar into which the child needs to be added
childpointer to the QObject that needs to be added
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QAction or QMenu. False otherwise.
bool GCF::GuiComponent::unmergeFromToolBar ( QToolBar *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is removed from the parent toolbar. The default implementation

  • removes child as an action from parent, if child is a QAction
  • removes child as a menu from parent, if child is a QMenu
Parameters
parentpointer to the QToolBar from which the child needs to be added
childpointer to the QObject that needs to be added
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QAction or QMenu. False otherwise.
bool GCF::GuiComponent::mergeWithMenuBar ( QMenuBar *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is added to the parent menu-bar. The default implementation adds child as a menu to parent, if child is an instance of QMenu.

Parameters
parentpointer to the QMenuBar into which the child needs to be added
childpointer to the QObject that needs to be added
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QMenu. False otherwise.
bool GCF::GuiComponent::unmergeFromMenuBar ( QMenuBar *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be implemented to customize the way in which child is removed from the parent menu-bar. The default implementation removes child as a menu from parent, if child is an instance of QMenu.

Parameters
parentpointer to the QMenuBar from which the child needs to be removed
childpointer to the QObject that needs to be removed
parentInfoinformation key=value map associated with parent
childInfoinformation key=value map associated with child
Returns
true if child was a QMenu. False otherwise.
bool GCF::GuiComponent::activateObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is reimplemented from GCF::Component to set the enabled property of child as true, if child is an instance of QAction. The base class implementation is called for all other cases.

Reimplemented from GCF::Component.

bool GCF::GuiComponent::deactivateObject ( QObject *  parent,
QObject *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function is reimplemented from GCF::Component to set the enabled property of child as false, if child is an instance of QAction. The base class implementation is called for all other cases.

Reimplemented from GCF::Component.

bool GCF::GuiComponent::activateWidget ( QWidget *  parent,
QWidget *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be reimplemented to customize the way in which child is activated in parent, based on information provided by parentInfo and childInfo. The default implementation sets the enabled property of child as true. The default implementation always returns true.

bool GCF::GuiComponent::deactivateWidget ( QWidget *  parent,
QWidget *  child,
const QVariantMap &  parentInfo,
const QVariantMap &  childInfo 
)
protectedvirtual

This function can be reimplemented to customize the way in which child is deactivated in parent, based on information provided by parentInfo and childInfo. The default implementation sets the enabled property of child as false. The default implementation always returns false.