Routines for Open Inventor/Qt compatibility. More...
#include <Inventor/Qt/SoQt.h>
Static Public Member Functions | |
static SoNONUNICODE QWidget * | init (const char *appName, const char *className="Inventor") |
This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so that Open Inventor sensors will work correctly. | |
static QWidget * | init (const SbString &appName, const SbString &className="Inventor") |
This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so that Open Inventor sensors will work correctly. | |
static void | init (QWidget *topLevelWidget) |
This alternate form of init allows the application to initialize Qt. | |
static void | show (QWidget *widget) |
Convenience routine to show the passed widget handle. | |
static void | hide (QWidget *widget) |
Convenience routine to hide the passed widget handle. | |
static int | mainLoop () |
Enters the main event loop and waits until exit() is called or QCoreApplication::exit() is called. | |
static void | exit (int returnCode=0) |
Tells the main event loop to exit with a return code. | |
static void | nextEvent (XtAppContext appContext, XEvent *event) |
This method is included for portability only. | |
static SbGlContextHelper::Display | getDisplay () |
This method is included for portability only. | |
static SbGlContextHelper::GLContext | getAppContext () |
This method is included for portability only. | |
static Boolean | dispatchEvent (XEvent *) |
This method is included for portability only. | |
static QWidget * | getTopLevelWidget () |
Returns information based on the initial QWidget handle returned by or passed to init. | |
static void | setWidgetSize (QWidget *widget, const SbVec2s &size) |
Convenience routine to set the size of the given widget. | |
static SbVec2s | getWidgetSize (QWidget *widget) |
Convenience routine to get the size of the given widget. | |
static SoNONUNICODE void | createSimpleErrorDialog (QWidget *widget, char *dialogTitle, char *errorStr1, char *errorStr2=NULL) |
Convenience routine which brings a simple Qt error dialog box displaying the given error string(s) and window title. | |
static void | createSimpleErrorDialog (QWidget *widget, const SbString &sdialogTitle, const SbString &errorStr1, const SbString &errorStr2="") |
Convenience routine which brings a simple Qt error dialog box displaying the given error string(s) and window title. | |
static void | finish () |
Frees Open Inventor's internal static memory allocations. | |
static bool | isInitialized () |
Returns TRUE if SoQt module is currently initialized. | |
static int | getExtensionEventNumber () |
Returns the type number of the Open Inventor extension QCustomEvent. | |
Deprecated | |
SoDEPRECATED static SoNONUNICODE QWidget * | threadInit (const char *appName, const char *className="Inventor") |
Non Unicode: This function should not be used in a Unicode application. | |
static SoDEPRECATED QWidget * | threadInit (const SbString &appName, const SbString &className="Inventor") |
static SoDEPRECATED void | threadInit (QWidget *topLevelWidget) |
Routines for Open Inventor/Qt compatibility.
The SoQt class initializes Open Inventor for use with Qt. SoQt::init() must be called in order for Open Inventor to work properly with Qt. SoQt::finish() should be called to clean up static memory allocations.
SoQt::mainLoop() must be called in order for extension device messages to be passed to Open Inventor render areas. The other methods are convenience functions.
Refer to the SoQtComponent reference pages for examples on how this class should be used when using Open Inventor Qt components.
|
static |
Convenience routine which brings a simple Qt error dialog box displaying the given error string(s) and window title.
The OK button, which destroys the dialog, is the only button displayed.
Non Unicode: This function should not be used in a Unicode application.
|
static |
Convenience routine which brings a simple Qt error dialog box displaying the given error string(s) and window title.
The OK button, which destroys the dialog, is the only button displayed.
This method is included for portability only.
It processes all the pending events So that code written for Xt can be used also on Qt implementations.
|
static |
Tells the main event loop to exit with a return code.
After this function has been called, the mainLoop() function returns returnCode. If the event loop is not running, this function does nothing.
By convention, a returnCode of 0 means success, and any non-zero value indicates an error.
|
static |
Frees Open Inventor's internal static memory allocations.
This avoids false positives from memory leak checking software. We recommend calling this method and it should be the last Open Inventor method called by the application. This method calls SoDB::finish(), SoNodeKit::finish(), and SoInteraction::finish().
Note: Open Inventor objects should be destroyed before you call this method.
For example:
Wrong Open Inventor Ending | Safe Open Inventor Endings | ||
void main() {
QWidget myW = SoQt::init("");
SoQtExaminerViewer viewer( myW );
....
....
SoQt::finish();
}
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Viewer component... Definition SoQtExaminerViewer.h:188 static int mainLoop() Enters the main event loop and waits until exit() is called or QCoreApplication::exit() is called. static SoNONUNICODE QWidget * init(const char *appName, const char *className="Inventor") This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so...
|
| ||
SoQt doesn't end properly: SoQtExaminerViewer is destroyed after the finish() method has been called. | The SoQtExaminerViewer (that uses Open Inventor) is destroyed before calling the finish() method. |
|
static |
This method is included for portability only.
So that code written for Xt can be used also on Qt implementations.
|
static |
This method is included for portability only.
|
static |
Returns the type number of the Open Inventor extension QCustomEvent.
This number can be set with the environment variable OIV_EXTENSION_EVENT_NUMBER.
|
static |
Returns information based on the initial QWidget handle returned by or passed to init.
|
static |
Convenience routine to get the size of the given widget.
|
static |
Convenience routine to hide the passed widget handle.
This includes any children the widget may have.
|
static |
This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so that Open Inventor sensors will work correctly.
This returns the top level shell widget handle. This method calls SoDB::init(), SoNodeKit::init(), and SoInteraction::init(), and creates an initial window.
Non Unicode: This function should not be used in a Unicode application.
|
static |
This is called to initialize Open Inventor and Qt, and bind Open Inventor with Qt message handling so that Open Inventor sensors will work correctly.
This returns the top level shell widget handle. This method calls SoDB::init(), SoNodeKit::init(), and SoInteraction::init(), and creates an initial window.
|
static |
This alternate form of init allows the application to initialize Qt.
The passed widget handle should be the top level widget handle returned from the Qt initialization. This method will call SoDB::init(), SoNodeKit::init(), and SoInteraction::init().
|
static |
Returns TRUE if SoQt module is currently initialized.
|
static |
Enters the main event loop and waits until exit() is called or QCoreApplication::exit() is called.
Returns the value that was passed to exit() or QCoreApplication::exit().
It calls nextEvent() and dispatchEvent() to retrieve and dispatch events.
|
static |
This method is included for portability only.
So that code written for Xt can be used also on Qt implementations.
|
static |
Convenience routine to set the size of the given widget.
|
static |
Convenience routine to show the passed widget handle.
This includes any children the widget may have.
|
static |
Non Unicode: This function should not be used in a Unicode application.
|
static |
|
static |