.TH "SoQtComponent" 3 "Sun Dec 11 2011" "Version 1.5.0" "SoQt" \" -*- nroff -*- .ad l .nh .SH NAME SoQtComponent \- .PP The \fBSoQtComponent\fP class is the base class for all GUI components\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoQtObject\fP\&. .PP Inherited by \fBSoQtGLWidget\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fB~SoQtComponent\fP ()" .br .ti -1c .RI "virtual void \fBshow\fP (void)" .br .ti -1c .RI "virtual void \fBhide\fP (void)" .br .ti -1c .RI "virtual void \fBsetComponentCursor\fP (const \fBSoQtCursor\fP &cursor)" .br .ti -1c .RI "SbBool \fBisFullScreen\fP (void) const " .br .ti -1c .RI "SbBool \fBsetFullScreen\fP (const SbBool onoff)" .br .ti -1c .RI "SbBool \fBisVisible\fP (void)" .br .ti -1c .RI "SbBool \fBisTopLevelShell\fP (void) const " .br .ti -1c .RI "QWidget * \fBgetWidget\fP (void) const " .br .ti -1c .RI "QWidget * \fBgetBaseWidget\fP (void) const " .br .ti -1c .RI "QWidget * \fBgetShellWidget\fP (void) const " .br .ti -1c .RI "QWidget * \fBgetParentWidget\fP (void) const " .br .ti -1c .RI "void \fBsetSize\fP (const SbVec2s size)" .br .ti -1c .RI "SbVec2s \fBgetSize\fP (void) const " .br .ti -1c .RI "void \fBsetTitle\fP (const char *const title)" .br .ti -1c .RI "const char * \fBgetTitle\fP (void) const " .br .ti -1c .RI "void \fBsetIconTitle\fP (const char *const title)" .br .ti -1c .RI "const char * \fBgetIconTitle\fP (void) const " .br .ti -1c .RI "const char * \fBgetWidgetName\fP (void) const " .br .ti -1c .RI "const char * \fBgetClassName\fP (void) const " .br .ti -1c .RI "void \fBsetWindowCloseCallback\fP (SoQtComponentCB *const func, void *const user=NULL)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBsetWidgetCursor\fP (QWidget *w, const \fBSoQtCursor\fP &cursor)" .br .ti -1c .RI "static \fBSoQtComponent\fP * \fBgetComponent\fP (QWidget *widget)" .br .ti -1c .RI "static void \fBinitClasses\fP (void)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBSoQtComponent\fP (QWidget *const parent=NULL, const char *const name=NULL, const SbBool embed=TRUE)" .br .ti -1c .RI "virtual void \fBafterRealizeHook\fP (void)" .br .ti -1c .RI "void \fBsetClassName\fP (const char *const name)" .br .ti -1c .RI "void \fBsetBaseWidget\fP (QWidget *widget)" .br .ti -1c .RI "void \fBregisterWidget\fP (QWidget *widget)" .br .ti -1c .RI "void \fBunregisterWidget\fP (QWidget *widget)" .br .ti -1c .RI "virtual const char * \fBgetDefaultWidgetName\fP (void) const " .br .ti -1c .RI "virtual const char * \fBgetDefaultTitle\fP (void) const " .br .ti -1c .RI "virtual const char * \fBgetDefaultIconTitle\fP (void) const " .br .ti -1c .RI "virtual void \fBsizeChanged\fP (const SbVec2s &size)" .br .ti -1c .RI "void \fBaddVisibilityChangeCallback\fP (SoQtComponentVisibilityCB *const func, void *const user=NULL)" .br .ti -1c .RI "void \fBremoveVisibilityChangeCallback\fP (SoQtComponentVisibilityCB *const func, void *const user=NULL)" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBSoGuiComponentP\fP" .br .ti -1c .RI "class \fBSoQtComponentP\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoQtComponent\fP class is the base class for all GUI components\&. Components in the \fBSoQt\fP 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)\&. .PP Application programmers should not need to interface any code against this class, unless they want to extend the \fBSoQt\fP 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\&. .PP Note that the relationship between all \fBSoQtComponent\fP derived classes and Qt widgets is one of 'has-A', \fInot\fP 'is-A' -- i\&.e\&. \fBSoQtComponent\fP \fIcontains\fP a QWidget *, it doesn't derive from or subclass it\&. .SH "Constructor & Destructor Documentation" .PP .SS "\fBSoQtComponent::~SoQtComponent\fP ()\fC [virtual]\fP"Destructor\&. .PP References unregisterWidget()\&. .SS "\fBSoQtComponent::SoQtComponent\fP (QWidget *constparent = \fCNULL\fP, const char *constname = \fCNULL\fP, const SbBoolembed = \fCTRUE\fP)\fC [protected]\fP"This is a protected constructor, used only by derived classes\&. .PP The \fIparent\fP 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 \fBSoQt::init()\fP) is used (and the \fIembed\fP argument is considered to be \fCFALSE\fP)\&. .PP The \fIname\fP argument is the name of the component\&. If you don't supply one, the name will default to something, depending on the inheritance hierarchy\&. .PP The \fIembed\fP argument tells wether the component should be embedded in the \fIparent\fP widget or should create its own shell\&. This flag is only checked if the \fIparent\fP widget argument is specified (not \fCNULL\fP)\&. .PP 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 \fIparent\fP widget, which you can get the handle of by calling \fBSoQtComponent::getBaseWidget()\fP\&. .PP References getDefaultWidgetName(), and setClassName()\&. .SH "Member Function Documentation" .PP .SS "void \fBSoQtComponent::show\fP (void)\fC [virtual]\fP"This will show the widget, de-iconifiying and raising it if necessary\&. .PP \fBSee also:\fP .RS 4 \fBhide()\fP, \fBisVisible()\fP .RE .PP This function \fImust\fP be called by subclasses after the component's widget has been otherwise initialized\&. .PP References sizeChanged()\&. .SS "void \fBSoQtComponent::hide\fP (void)\fC [virtual]\fP"This will hide the widget\&. .PP \fBSee also:\fP .RS 4 \fBshow()\fP, \fBisVisible()\fP .RE .PP .SS "void \fBSoQtComponent::setComponentCursor\fP (const \fBSoQtCursor\fP &cursor)\fC [virtual]\fP"Sets the cursor for this component\&. .PP Note: not part of the original SGI InventorXt API\&. .PP Reimplemented in \fBSoQtFullViewer\fP\&. .PP References getWidget(), and setWidgetCursor()\&. .SS "void \fBSoQtComponent::setWidgetCursor\fP (QWidget *w, const \fBSoQtCursor\fP &cursor)\fC [static]\fP"Set cursor for a native widget in the underlying toolkit\&. .PP Note: not part of the original SGI InventorXt API\&. .PP References SoQtCursor::BUSY, SoQtCursor::CROSSHAIR, SoQtCursor::CUSTOM_BITMAP, SoQtCursor::DEFAULT, SoQtCursor::getCustomCursor(), SoQtCursor::getShape(), and SoQtCursor::UPARROW\&. .PP Referenced by setComponentCursor(), and SoQtFullViewer::setComponentCursor()\&. .SS "SbBool \fBSoQtComponent::isFullScreen\fP (void) const"Returns if this widget/component is in full screen mode\&. .SS "SbBool \fBSoQtComponent::setFullScreen\fP (const SbBoolonoff)"Toggle full screen mode for this component, if possible\&. .PP Returns \fCFALSE\fP 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\&. .PP References getParentWidget(), getShellWidget(), and getWidget()\&. .SS "SbBool \fBSoQtComponent::isVisible\fP (void)"Returns visibility status on the widget\&. If any parents of this widget or this widget itself is hidden, returns \fCFALSE\fP\&. .PP Note that a widget which is just obscured by other windows on the desktop is not hidden in this sense, and \fCTRUE\fP will be returned\&. .PP \fBSee also:\fP .RS 4 \fBshow()\fP, \fBhide()\fP .RE .PP .PP Referenced by SoQtRenderArea::actualOverlayRedraw(), SoQtRenderArea::actualRedraw(), SoQtRenderArea::redraw(), and SoQtRenderArea::redrawOverlay()\&. .SS "SbBool \fBSoQtComponent::isTopLevelShell\fP (void) const"Returns \fCTRUE\fP if this component is a toplevel shell, i\&.e\&. it has a window representation on the desktop\&. .PP \fBSee also:\fP .RS 4 \fBgetShellWidget()\fP .RE .PP .PP Referenced by SoQtGLWidget::buildWidget(), getIconTitle(), getShellWidget(), and setIconTitle()\&. .SS "QWidget * \fBSoQtComponent::getWidget\fP (void) const"Returns a pointer to the component's window system widget\&. .PP \fBSee also:\fP .RS 4 \fBgetShellWidget()\fP, \fBgetParentWidget()\fP .RE .PP .PP Referenced by getIconTitle(), getShellWidget(), getTitle(), setBaseWidget(), setComponentCursor(), setFullScreen(), setIconTitle(), setSize(), and setTitle()\&. .SS "QWidget * \fBSoQtComponent::getBaseWidget\fP (void) const"An \fBSoQtComponent\fP 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\&. .PP \fBSee also:\fP .RS 4 \fBsetBaseWidget()\fP .RE .PP .SS "QWidget * \fBSoQtComponent::getShellWidget\fP (void) const"This method returns the shell widget of the component, but only if it was created as a toplevel shell\&. \fCNULL\fP will be returned for embedded components\&. .PP (The toplevel shell is the desktop window which contains the component\&.) .PP To get the toplevel shell of embedded components, you can use the \fBSoQt::getShellWidget()\fP method\&. .PP \fBSee also:\fP .RS 4 \fBisTopLevelShell()\fP, \fBgetWidget()\fP .RE .PP .PP References getWidget(), and isTopLevelShell()\&. .PP Referenced by getIconTitle(), setBaseWidget(), setFullScreen(), setIconTitle(), and setSize()\&. .SS "QWidget * \fBSoQtComponent::getParentWidget\fP (void) const"Returns the widget which is the parent (i\&.e\&. contains) this component's base widget\&. .PP \fBSee also:\fP .RS 4 \fBgetWidget()\fP, baseWidget(), \fBisTopLevelShell()\fP .RE .PP .PP Referenced by setFullScreen(), SoQtConstrainedViewer::SoQtConstrainedViewer(), SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and SoQtViewer::SoQtViewer()\&. .SS "void \fBSoQtComponent::setSize\fP (const SbVec2ssize)"Resize the component widget\&. .PP The method assumes the caller knows what he is doing\&. .PP \fBSee also:\fP .RS 4 \fBgetSize()\fP .RE .PP .PP References getShellWidget(), getWidget(), and sizeChanged()\&. .PP Referenced by SoQtFullViewer::SoQtFullViewer()\&. .SS "SbVec2s \fBSoQtComponent::getSize\fP (void) const"Returns the component widget size\&. .PP The size that is returned is a cached size value, not a value fetched from the GUI system\&. .PP \fBSee also:\fP .RS 4 \fBsetSize()\fP .RE .PP .PP Referenced by SoQtRenderArea::setGLRenderAction()\&. .SS "void \fBSoQtComponent::setTitle\fP (const char *consttitle)"Set the window title of this component\&. The title will appear on the window title bar, if the component manages its own window\&. .PP 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\&. .PP \fBSee also:\fP .RS 4 \fBgetTitle()\fP, \fBsetIconTitle()\fP, \fBisTopLevelShell()\fP .RE .PP .PP References getWidget()\&. .PP Referenced by setBaseWidget()\&. .SS "const char * \fBSoQtComponent::getTitle\fP (void) const"Returns the window title\&. .PP If a title has been set, that title will be returned\&. If no title has been set, the default title is returned\&. .PP \fBSee also:\fP .RS 4 \fBsetTitle()\fP, \fBisTopLevelShell()\fP .RE .PP .PP References getWidget()\&. .SS "void \fBSoQtComponent::setIconTitle\fP (const char *consttitle)"This method sets the title of the icon representation of the window\&. .PP The title will appear on the window icon, if the component manages its own window\&. .PP \fBSee also:\fP .RS 4 \fBgetIconTitle()\fP, \fBsetTitle()\fP, \fBisTopLevelShell()\fP .RE .PP .PP References getShellWidget(), getWidget(), and isTopLevelShell()\&. .SS "const char * \fBSoQtComponent::getIconTitle\fP (void) const"Returns the title the window has when iconfied\&. .PP 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\&. .PP \fBSee also:\fP .RS 4 \fBsetIconTitle()\fP, \fBisTopLevelShell()\fP .RE .PP .PP References getShellWidget(), getWidget(), and isTopLevelShell()\&. .SS "const char * \fBSoQtComponent::getWidgetName\fP (void) const"Returns name of the widget\&. .SS "const char * \fBSoQtComponent::getClassName\fP (void) const"Returns class name of widget\&. .SS "void \fBSoQtComponent::setWindowCloseCallback\fP (SoQtComponentCB *constfunc, void *constdata = \fCNULL\fP)"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\&. .PP 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\&. .PP \fBSee also:\fP .RS 4 \fBisTopLevelShell()\fP .RE .PP .SS "\fBSoQtComponent\fP * \fBSoQtComponent::getComponent\fP (QWidget *widget)\fC [static]\fP"Finds and returns the \fBSoQtComponent\fP corresponding to the given QWidget *, if any\&. If the widget does not seem to belong to any \fBSoQtComponent\fP, \fCNULL\fP will be returned\&. .SS "void \fBSoQtComponent::initClasses\fP (void)\fC [static]\fP"This function initializes the type system for all the component classes\&. It is called indirectly for you when you call \fBSoQt::init()\fP\&. .PP \fBSee also:\fP .RS 4 \fBSoQt::init()\fP, \fBSoQtDevice::initClasses()\fP .RE .PP .PP References SoQtObject::initClass()\&. .PP Referenced by SoQtObject::init()\&. .SS "void \fBSoQtComponent::afterRealizeHook\fP (void)\fC [protected, virtual]\fP"A function 'hook' / callback invoked just after the window for the component has been realized\&. .PP 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: .PP .PP .nf void MyLittleViewer::afterRealizeHook(void) { ::afterRealizeHook(); // [own initialization here] } .fi .PP .PP Reimplemented in \fBSoQtRenderArea\fP, \fBSoQtExaminerViewer\fP, \fBSoQtPlaneViewer\fP, and \fBSoQtFlyViewer\fP\&. .SS "void \fBSoQtComponent::setClassName\fP (const char *constname)\fC [protected]\fP"Set class name of component\&. .PP \fBSee also:\fP .RS 4 \fBgetClassName()\fP, componentClassName() .RE .PP .PP Referenced by SoQtComponent(), SoQtConstrainedViewer::SoQtConstrainedViewer(), SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and SoQtViewer::SoQtViewer()\&. .SS "void \fBSoQtComponent::setBaseWidget\fP (QWidget *widget)\fC [protected]\fP"Set the core widget for this \fBSoQt\fP component\&. It is important that subclasses get this correct, as the widget set here will be the widget returned from query methods\&. .PP \fBSee also:\fP .RS 4 baseWidget() .RE .PP .PP References getDefaultIconTitle(), getDefaultTitle(), getShellWidget(), getWidget(), registerWidget(), setTitle(), and unregisterWidget()\&. .PP Referenced by SoQtConstrainedViewer::SoQtConstrainedViewer(), SoQtFullViewer::SoQtFullViewer(), SoQtGLWidget::SoQtGLWidget(), and SoQtViewer::SoQtViewer()\&. .SS "void \fBSoQtComponent::registerWidget\fP (QWidget *widget)\fC [protected]\fP"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\&. .PP Subclasses failing to register the widgets they use will cause the \fBSoQtComponent::getComponent()\fP method to fail with those widgets\&. .PP \fBSee also:\fP .RS 4 \fBunregisterWidget()\fP, \fBgetComponent()\fP .RE .PP .PP Referenced by SoQtFullViewer::buildWidget(), SoQtGLWidget::buildWidget(), and setBaseWidget()\&. .SS "void \fBSoQtComponent::unregisterWidget\fP (QWidget *widget)\fC [protected]\fP"Remove a previously registered native toolkit widget from the widget-to-component mappings used by \fBSoQtComponent::getComponent()\fP\&. .PP \fBSee also:\fP .RS 4 \fBregisterWidget()\fP .RE .PP .PP Referenced by setBaseWidget(), ~SoQtComponent(), SoQtFullViewer::~SoQtFullViewer(), and SoQtGLWidget::~SoQtGLWidget()\&. .SS "const char * \fBSoQtComponent::getDefaultWidgetName\fP (void) const\fC [protected, virtual]\fP"This method returns the default name of a component widget class\&. .PP It should be overridden by derived non-abstract classes for the topmost widget in the component to have a proper name\&. .PP Reimplemented in \fBSoQtRenderArea\fP, \fBSoQtExaminerViewer\fP, \fBSoQtFlyViewer\fP, and \fBSoQtPlaneViewer\fP\&. .PP Referenced by SoQtComponent()\&. .SS "const char * \fBSoQtComponent::getDefaultTitle\fP (void) const\fC [protected, virtual]\fP"This method returns the default window caption string of the component\&. .PP It should be overridden by derived non-abstract classes so the window and popup menu will get a proper title\&. .PP Reimplemented in \fBSoQtRenderArea\fP, \fBSoQtExaminerViewer\fP, \fBSoQtFlyViewer\fP, and \fBSoQtPlaneViewer\fP\&. .PP Referenced by setBaseWidget()\&. .SS "const char * \fBSoQtComponent::getDefaultIconTitle\fP (void) const\fC [protected, virtual]\fP"This method returns the default icon title of the component\&. .PP It should be overridden by derived non-abstract classes so icons will get proper titles\&. .PP Reimplemented in \fBSoQtRenderArea\fP, \fBSoQtExaminerViewer\fP, \fBSoQtFlyViewer\fP, and \fBSoQtPlaneViewer\fP\&. .PP Referenced by setBaseWidget()\&. .SS "void \fBSoQtComponent::sizeChanged\fP (const SbVec2s &size)\fC [protected, virtual]\fP"Called internally from within the \fBSoQt\fP library when the widget embedded in a component changes it size, which is usually triggered by end-user interaction\&. .PP 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\&. .PP Reimplemented in \fBSoQtViewer\fP, \fBSoQtGLWidget\fP, \fBSoQtRenderArea\fP, and \fBSoQtFullViewer\fP\&. .PP Referenced by setSize(), and show()\&. .SS "void \fBSoQtComponent::addVisibilityChangeCallback\fP (SoQtComponentVisibilityCB *constfunc, void *constuser = \fCNULL\fP)\fC [protected]\fP"Add a callback which will be called whenever the widget component changes visibility status (because of iconification or deiconification, for instance)\&. .PP \fBSee also:\fP .RS 4 \fBremoveVisibilityChangeCallback()\fP, \fBisVisible()\fP .RE .PP .SS "void \fBSoQtComponent::removeVisibilityChangeCallback\fP (SoQtComponentVisibilityCB *constfunc, void *constdata = \fCNULL\fP)\fC [protected]\fP"Remove one of the callbacks from the list of visibility notification callbacks\&. .PP \fBSee also:\fP .RS 4 \fBaddVisibilityChangeCallback()\fP, \fBisVisible()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for SoQt from the source code\&.