Man Linux: Main Page and Category List

NAME

       SoQtComponent - The SoQtComponent class is the base class for all GUI
       components.

SYNOPSIS

       #include <Inventor/Qt/SoQtComponent.h>

       Inherits SoQtObject.

       Inherited by SoQtGLWidget.

   Public Member Functions
       virtual ~SoQtComponent ()
       virtual void show (void)
       virtual void hide (void)
       virtual void setComponentCursor (const SoQtCursor &cursor)
       SbBool isFullScreen (void) const
       SbBool setFullScreen (const SbBool onoff)
       SbBool isVisible (void)
       SbBool isTopLevelShell (void) const
       QWidget * getWidget (void) const
       QWidget * getBaseWidget (void) const
       QWidget * getShellWidget (void) const
       QWidget * getParentWidget (void) const
       void setSize (const SbVec2s size)
       SbVec2s getSize (void) const
       void setTitle (const char *const title)
       const char * getTitle (void) const
       void setIconTitle (const char *const title)
       const char * getIconTitle (void) const
       const char * getWidgetName (void) const
       const char * getClassName (void) const
       void setWindowCloseCallback (SoQtComponentCB *const func, void *const
           user=NULL)

   Static Public Member Functions
       static void setWidgetCursor (QWidget *w, const SoQtCursor &cursor)
       static SoQtComponent * getComponent (QWidget *widget)
       static void initClasses (void)

   Protected Member Functions
       SoQtComponent (QWidget *const parent=NULL, const char *const name=NULL,
           const SbBool embed=TRUE)
       virtual void afterRealizeHook (void)
       void setClassName (const char *const name)
       void setBaseWidget (QWidget *widget)
       void registerWidget (QWidget *widget)
       void unregisterWidget (QWidget *widget)
       virtual const char * getDefaultWidgetName (void) const
       virtual const char * getDefaultTitle (void) const
       virtual const char * getDefaultIconTitle (void) const
       virtual void sizeChanged (const SbVec2s &size)
       void addVisibilityChangeCallback (SoQtComponentVisibilityCB *const
           func, void *const user=NULL)
       void removeVisibilityChangeCallback (SoQtComponentVisibilityCB *const
           func, void *const user=NULL)

   Friends
       class SoGuiComponentP
       class SoQtComponentP

Detailed Description

       The SoQtComponent class is the base class for all GUI components.

       Components in the SoQt component library all inherit this abstract base
       class. It provides basic methods for setting and querying about the
       relationship between the component object and its underlying Qt
       object(s).

       Application programmers should not need to interface any code against
       this class, unless they want to extend the SoQt library in entirely new
       directions. For making new viewer components, for instance, other
       classes further down the inheritance hierarchy would be better suited
       for subclassing.

       Note that the relationship between all SoQtComponent derived classes
       and Qt widgets is one of ’has-A’, not ’is-A’ -- i.e. SoQtComponent
       contains a QWidget *, it doesn’t derive from or subclass it.

Constructor & Destructor Documentation

   SoQtComponent::~SoQtComponent () [virtual]
       Destructor.

       References unregisterWidget().

   SoQtComponent::SoQtComponent (QWidget *const  parent = NULL, const char
       *const  name = NULL, const SbBool embed = TRUE) [protected]
       This is a protected constructor, used only by derived classes.

       The parent argument is the parent widget of the component. If you don’t
       supply a parent, the main window (the one given to or returned from
       SoQt::init()) is used (and the embed argument is considered to be
       FALSE).

       The name argument is the name of the component. If you don’t supply
       one, the name will default to something, depending on the inheritance
       hierarchy.

       The embed argument tells wether the component should be embedded in the
       parent widget or should create its own shell. This flag is only checked
       if the parent widget argument is specified (not NULL).

       If you create a non-embedded component, the component will create its
       own shell, which will be a toplevelshell type. If you embed the
       component, the component will create a formwidget type widget inside
       the parent widget, which you can get the handle of by calling
       SoQtComponent::getBaseWidget().

Member Function Documentation

   void SoQtComponent::show (void) [virtual]
       This function must be called by subclasses after the component’s widget
       has been otherwise initialized.

       This will show the widget, de-iconifiying and raising it if necessary.

       See also:
           hide(), isVisible()

       References sizeChanged().

   void SoQtComponent::hide (void) [virtual]
       This will hide the widget.

       See also:
           show(), isVisible()

   void SoQtComponent::setComponentCursor (const SoQtCursor & cursor)
       [virtual]
       Sets the cursor for this component.

       Note: not part of the original SGI InventorXt API.

       Reimplemented in SoQtFullViewer.

       References getWidget(), and setWidgetCursor().

   void SoQtComponent::setWidgetCursor (QWidget * w, const SoQtCursor &
       cursor) [static]
       Set cursor for a native widget in the underlying toolkit.

       Note: not part of the original SGI InventorXt API.

       References SoQtCursor::BUSY, SoQtCursor::CROSSHAIR,
       SoQtCursor::CUSTOM_BITMAP, SoQtCursor::DEFAULT,
       SoQtCursor::getCustomCursor(), SoQtCursor::getShape(), and
       SoQtCursor::UPARROW.

       Referenced by SoQtFullViewer::setComponentCursor(), and
       setComponentCursor().

   SbBool SoQtComponent::isFullScreen (void) const
       Returns if this widget/component is in full screen mode.

   SbBool SoQtComponent::setFullScreen (const SbBool onoff)
       Toggle full screen mode for this component, if possible.

       Returns FALSE if operation failed. This might happen if the toolkit
       doesn’t support attempts at making the component cover the complete
       screen or if the component is not a toplevel window.

       References getParentWidget(), getShellWidget(), and getWidget().

   SbBool SoQtComponent::isVisible (void)
       Returns visibility status on the widget. If any parents of this widget
       or this widget itself is hidden, returns FALSE.

       Note that a widget which is just obscured by other windows on the
       desktop is not hidden in this sense, and TRUE will be returned.

       See also:
           show(), hide()

       Referenced by SoQtRenderArea::actualOverlayRedraw(),
       SoQtRenderArea::actualRedraw(), SoQtRenderArea::redraw(), and
       SoQtRenderArea::redrawOverlay().

   SbBool SoQtComponent::isTopLevelShell (void) const
       Returns TRUE if this component is a toplevel shell, i.e. it has a
       window representation on the desktop.

       See also:
           getShellWidget()

       Referenced by SoQtGLWidget::buildWidget(), getShellWidget(), and
       setIconTitle().

   QWidget * SoQtComponent::getWidget (void) const
       Returns a pointer to the component’s window system widget.

       See also:
           getShellWidget(), getParentWidget()

       Referenced by getShellWidget(), setBaseWidget(), setComponentCursor(),
       setFullScreen(), setIconTitle(), setSize(), and setTitle().

   QWidget * SoQtComponent::getBaseWidget (void) const
       An SoQtComponent may be composed of any number of widgets in parent-
       children relationships in a tree structure with any depth. This method
       will return the root widget in that tree.

       See also:
           setBaseWidget()

   QWidget * SoQtComponent::getShellWidget (void) const
       This method returns the shell widget of the component, but only if it
       was created as a toplevel shell. NULL will be returned for embedded
       components.

       (The toplevel shell is the desktop window which contains the
       component.)

       To get the toplevel shell of embedded components, you can use the
       SoQt::getShellWidget() method.

       See also:
           isTopLevelShell(), getWidget()

       References getWidget(), and isTopLevelShell().

       Referenced by setBaseWidget(), setFullScreen(), setIconTitle(), and
       setSize().

   QWidget * SoQtComponent::getParentWidget (void) const
       Returns the widget which is the parent (i.e. contains) this component’s
       base widget.

       See also:
           getWidget(), baseWidget(), isTopLevelShell()

       Referenced by setFullScreen(),
       SoQtConstrainedViewer::SoQtConstrainedViewer(),
       SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and
       SoQtViewer::SoQtViewer().

   void SoQtComponent::setSize (const SbVec2s size)
       Resize the component widget.

       The method assumes the caller knows what he is doing.

       See also:
           getSize()

       References getShellWidget(), getWidget(), and sizeChanged().

       Referenced by SoQtFullViewer::SoQtFullViewer().

   SbVec2s SoQtComponent::getSize (void) const
       Returns the component widget size.

       The size that is returned is a cached size value, not a value fetched
       from the GUI system.

       See also:
           setSize()

       Referenced by SoQtRenderArea::setGLRenderAction().

   void SoQtComponent::setTitle (const char *const  title)
       Set the window title of this component. The title will appear on the
       window title bar, if the component manages its own window.

       Note that there is one peculiarity to be aware of if you are using the
       non-commercial version of Qt: only window titles with the substring
       ’Qt’ in them are allowed (!), and attempts to set a window title
       without this substring will simply be ignored.

       See also:
           getTitle(), setIconTitle(), isTopLevelShell()

       References getWidget().

       Referenced by setBaseWidget().

   const char * SoQtComponent::getTitle (void) const
       Returns the window title.

       If a title has been set, that title will be returned. If no title has
       been set, the default title is returned.

       See also:
           setTitle(), isTopLevelShell()

   void SoQtComponent::setIconTitle (const char *const  title)
       This method sets the title of the icon representation of the window.

       The title will appear on the window icon, if the component manages its
       own window.

       See also:
           getIconTitle(), setTitle(), isTopLevelShell()

       References getShellWidget(), getWidget(), and isTopLevelShell().

   const char * SoQtComponent::getIconTitle (void) const
       Returns the title the window has when iconfied.

       If an icon title has been set, that icon title is returned. If no icon
       title has been set, the default icon title is returned.

       See also:
           setIconTitle(), isTopLevelShell()

   const char * SoQtComponent::getWidgetName (void) const
       Returns name of the widget.

   const char * SoQtComponent::getClassName (void) const
       Returns class name of widget.

   void SoQtComponent::setWindowCloseCallback (SoQtComponentCB *const  func,
       void *const  data = NULL)
       Set up a callback function to use when the component gets closed. A
       component must be a toplevel shell for this to have any effect.

       For toplevel shells with no close callback set, the window will simply
       be hidden. The typical action to take in the callback would be to
       delete the component.

       See also:
           isTopLevelShell()

   SoQtComponent * SoQtComponent::getComponent (QWidget * widget) [static]
       Finds and returns the SoQtComponent corresponding to the given QWidget
       *, if any. If the widget does not seem to belong to any SoQtComponent,
       NULL will be returned.

   void SoQtComponent::initClasses (void) [static]
       This function initializes the type system for all the component
       classes. It is called indirectly for you when you call SoQt::init().

       See also:
           SoQt::init(), SoQtDevice::initClasses()

       References SoQtObject::initClass().

       Referenced by SoQtObject::init().

   void SoQtComponent::afterRealizeHook (void) [protected, virtual]
       A function ’hook’ / callback invoked just after the window for the
       component has been realized.

       Override this if you need specific initialization for your own
       component or viewer class to happen right after it has been made
       visible, but remember to call upwards in the inheritance hierarchy:

         void
         MyLittleViewer::afterRealizeHook(void)
         {
           <superclass>::afterRealizeHook();
           // [own initialization here]
         }

       Reimplemented in SoQtRenderArea, SoQtPlaneViewer, SoQtExaminerViewer,
       and SoQtFlyViewer.

   void SoQtComponent::setClassName (const char *const  name) [protected]
       Set class name of component.

       See also:
           getClassName(), componentClassName()

       Referenced by SoQtConstrainedViewer::SoQtConstrainedViewer(),
       SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and
       SoQtViewer::SoQtViewer().

   void SoQtComponent::setBaseWidget (QWidget * widget) [protected]
       Set the core widget for this SoQt component. It is important that
       subclasses get this correct, as the widget set here will be the widget
       returned from query methods.

       See also:
           baseWidget()

       References getDefaultIconTitle(), getDefaultTitle(),
       getDefaultWidgetName(), getShellWidget(), getWidget(),
       registerWidget(), setTitle(), and unregisterWidget().

       Referenced by SoQtConstrainedViewer::SoQtConstrainedViewer(),
       SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and
       SoQtViewer::SoQtViewer().

   void SoQtComponent::registerWidget (QWidget * widget) [protected]
       This method should be used by subclasses to register the widgets they
       set up from the underlying native toolkit, so they can be ’reverse’
       mapped to the owner component.

       Subclasses failing to register the widgets they use will cause the
       SoQtComponent::getComponent() method to fail with those widgets.

       See also:
           unregisterWidget(), getComponent()

       Referenced by SoQtGLWidget::buildWidget(),
       SoQtFullViewer::buildWidget(), and setBaseWidget().

   void SoQtComponent::unregisterWidget (QWidget * widget) [protected]
       Remove a previously registered native toolkit widget from the widget-
       to-component mappings used by SoQtComponent::getComponent().

       See also:
           registerWidget()

       Referenced by setBaseWidget(), ~SoQtComponent(),
       SoQtFullViewer::~SoQtFullViewer(), and SoQtGLWidget::~SoQtGLWidget().

   const char * SoQtComponent::getDefaultWidgetName (void) const [protected,
       virtual]
       This method returns the default name of a component widget class.

       It should be overridden by derived non-abstract classes for the topmost
       widget in the component to have a proper name.

       Reimplemented in SoQtRenderArea, SoQtPlaneViewer, SoQtExaminerViewer,
       and SoQtFlyViewer.

       Referenced by setBaseWidget().

   const char * SoQtComponent::getDefaultTitle (void) const [protected,
       virtual]
       This method returns the default window caption string of the component.

       It should be overridden by derived non-abstract classes so the window
       and popup menu will get a proper title.

       Reimplemented in SoQtRenderArea, SoQtPlaneViewer, SoQtExaminerViewer,
       and SoQtFlyViewer.

       Referenced by setBaseWidget().

   const char * SoQtComponent::getDefaultIconTitle (void) const [protected,
       virtual]
       This method returns the default icon title of the component.

       It should be overridden by derived non-abstract classes so icons will
       get proper titles.

       Reimplemented in SoQtRenderArea, SoQtPlaneViewer, SoQtExaminerViewer,
       and SoQtFlyViewer.

       Referenced by setBaseWidget().

   void SoQtComponent::sizeChanged (const SbVec2s & size) [protected, virtual]
       Called internally from within the SoQt library when the widget embedded
       in a component changes it size, which is usually triggered by end-user
       interaction.

       This method is then invoked to notify the component that the size has
       changed. It is called from the top and all the way down to the bottom,
       the size being adjusted to take into account extra decorations having
       been added at each level in the component class hierarchy.

       Reimplemented in SoQtGLWidget, SoQtRenderArea, SoQtViewer, and
       SoQtFullViewer.

       Referenced by setSize(), and show().

   void SoQtComponent::addVisibilityChangeCallback (SoQtComponentVisibilityCB
       *const  func, void *const  user = NULL) [protected]
       Add a callback which will be called whenever the widget component
       changes visibility status (because of iconification or deiconification,
       for instance).

       See also:
           removeVisibilityChangeCallback(), isVisible()

   void SoQtComponent::removeVisibilityChangeCallback
       (SoQtComponentVisibilityCB *const  func, void *const  data = NULL)
       [protected]
       Remove one of the callbacks from the list of visibility notification
       callbacks.

       See also:
           addVisibilityChangeCallback(), isVisible()

Author

       Generated automatically by Doxygen for SoQt from the source code.