Abstract base class for all Open Inventor Qt components. More...
#include <Inventor/Qt/SoQtComponent.h>
Public Types | |
typedef void | SoQtComponentCB(void *userData, SoQtComponent *comp) |
Public Member Functions | |
virtual void | show () |
This shows the component. | |
virtual void | hide () |
This hides the component. | |
SbBool | isVisible () |
Returns TRUE if this component is mapped onto the screen. | |
virtual QWidget * | getWidget () const |
This returns the base widget handle for this component. | |
SbBool | isTopLevelShell () const |
Returns TRUE if this component is a top level shell component (has its own window). | |
QWidget * | getShellWidget () const |
Returns the topLevelShell widget handle (NULL if the topLevelShell hasn't been created by this component). | |
QWidget * | getParentWidget () const |
Returns the parent widget handle. | |
void | setSize (const SbVec2s &size) |
Convenience routine on the widget handle. | |
SbVec2s | getSize () |
Convenience routine on the widget handle. | |
virtual SbBool | setFullScreen (const SbBool enable) |
Switches the viewer into (or out of) fullscreen mode. | |
SbBool | isFullScreen (void) const |
Queries if the viewer is in fullscreen mode. | |
void | setFullScreenEnable (const SbBool enable) |
Enables/disables fullscreen mode. | |
SbBool | isFullScreenEnable (void) const |
Queries if it is possible to put the viewer in fullscreen mode. | |
SbGlContextHelper::Display | getDisplay () |
On UNIX, returns the X display associated with this components widget. | |
void | setTitle (const char *newTitle) |
Sets window title. | |
void | setTitle (const SbString &newTitle) |
Sets window title. | |
void | setTitle (const QString &newTitle) |
Sets window title. | |
const QString | getTitle () const |
Gets window title. | |
void | setIconTitle (const QString &newIconTitle) |
Included for portability only. | |
const QString | getIconTitle () const |
Included for portability only. | |
SbString | getWidgetName () const |
Returns the widget handle name. | |
SbString | getClassName () const |
Returns the class name. | |
void | setWindowCloseCallback (SoQtComponentCB *func, void *data=NULL) |
Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() is called on this component, unless a callback is set to something other than NULL. | |
Static Public Member Functions | |
static SoQtComponent * | getComponent (QWidget *widget) |
Returns the SoQtComponent for this widget handle. | |
Public Attributes | |
SbString | helpFileName |
Name of help file to open when the viewer Help button is pressed. | |
Abstract base class for all Open Inventor Qt components.
Abstract base class from which all Open Inventor Qt components are derived. This class provides a basic C++ protocol for building and displaying Qt components. Components are used to encapsulate some function or task into a reusable package in the form of a Qt widget handle that can be used in any Open Inventor Qt program. See the Example section on how to build and use SoQtComponents.
#include <Inventor/Qt/SoQt.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
void main(int, char* *argv)
// Initialize Inventor and Qt, which must be done
// before any Inventor calls are made.
QWidget* myWidget = SoQt::init(argv[0]);
// Create the viewer in the toplevel window
// and set some scene to display.
SoQtExaminerViewer *myViewer = new SoQtExaminerViewer(myWidget);
myViewer->setSceneGraph( new SoCone() );
// Map window on screen.
myViewer->show();
SoQt::show(myWidget); // calls Show()
// Loop forever
SoQt, SoQtRenderArea, SoQtViewer
Definition at line 101 of file SoQtComponent.h.
typedef void SoQtComponentCB(void *userData, SoQtComponent *comp) |
Definition at line 47 of file SoQtComponent.h.
|
inline |
Returns the class name.
The class name is predefined by each component.
Definition at line 397 of file SoQtComponent.h.
|
static |
Returns the SoQtComponent for this widget handle.
If the widget handle does not match that of any Open Inventor component, then NULL is returned.
|
inline |
On UNIX, returns the X display associated with this components widget.
Definition at line 379 of file SoQtComponent.h.
|
inline |
Included for portability only.
Definition at line 391 of file SoQtComponent.h.
|
inline |
Returns the parent widget handle.
Definition at line 145 of file SoQtComponent.h.
|
inline |
Returns the topLevelShell widget handle (NULL if the topLevelShell hasn't been created by this component).
Definition at line 140 of file SoQtComponent.h.
SbVec2s SoQtComponent::getSize | ( | ) |
Convenience routine on the widget handle.
|
inline |
Gets window title.
Definition at line 385 of file SoQtComponent.h.
|
inlinevirtual |
This returns the base widget handle for this component.
Definition at line 127 of file SoQtComponent.h.
|
inline |
Returns the widget handle name.
The widget handle name is passed to the build method.
Definition at line 403 of file SoQtComponent.h.
|
virtual |
This hides the component.
Reimplemented in SoQtColorEditor, SoQtDirectionalLightEditor, SoQtGLWidget, SoQtMaterialEditor, SoQtMaterialPalette, and SoQtFullViewer.
SbBool SoQtComponent::isFullScreen | ( | void | ) | const |
Queries if the viewer is in fullscreen mode.
SbBool SoQtComponent::isFullScreenEnable | ( | void | ) | const |
Queries if it is possible to put the viewer in fullscreen mode.
|
inline |
Returns TRUE if this component is a top level shell component (has its own window).
Subclasses may use this to decide if they are allowed to resize themselves.
Definition at line 134 of file SoQtComponent.h.
SbBool SoQtComponent::isVisible | ( | ) |
Returns TRUE if this component is mapped onto the screen.
For a component to be visible, its widget and the shell containing this widget must be mapped (which is FALSE when the component is iconified).
Switches the viewer into (or out of) fullscreen mode.
This works fine on Windows, but has certain problems under the X Window System. For details, see the Qt documentation for QWidget::showFullScreen.
void SoQtComponent::setFullScreenEnable | ( | const SbBool | enable | ) |
Enables/disables fullscreen mode.
If fullscreen mode is disabled, it is not possible to activate fullscreen mode with the right mouse button popup menu.
void SoQtComponent::setIconTitle | ( | const QString & | newIconTitle | ) |
Included for portability only.
void SoQtComponent::setSize | ( | const SbVec2s & | size | ) |
Convenience routine on the widget handle.
void SoQtComponent::setTitle | ( | const char * | newTitle | ) |
Sets window title.
The window title can be set for topLevelShell components or components which are directly under a shell window handle (i.e. components which have their own window).
void SoQtComponent::setTitle | ( | const QString & | newTitle | ) |
Sets window title.
The window title can be set for topLevelShell components or components which are directly under a shell window handle (i.e. components which have their own window).
void SoQtComponent::setTitle | ( | const SbString & | newTitle | ) |
Sets window title.
The window title can be set for topLevelShell components or components which are directly under a shell window handle (i.e. components which have their own window).
|
inline |
Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() is called on this component, unless a callback is set to something other than NULL.
A pointer to this class will be passed as the callback data.
Note: this callback is supplied because the user may wish to delete this component when it is closed.
Definition at line 266 of file SoQtComponent.h.
|
virtual |
This shows the component.
Reimplemented in SoQtColorEditor, SoQtDirectionalLightEditor, SoQtGLWidget, SoQtMaterialEditor, and SoQtMaterialPalette.
SbString SoQtComponent::helpFileName |
Name of help file to open when the viewer Help button is pressed.
Definition at line 247 of file SoQtComponent.h.