Home

QtMotif Class Reference

The QtMotif class provides the basis of the Motif Extension. More...

 #include <QtMotif>

Inherits QAbstractEventDispatcher.

Public Functions

Static Public Members

Additional Inherited Members


Detailed Description

The QtMotif class provides the basis of the Motif Extension.

QtMotif only provides a few public functions, but it is at the heart of the integration. QtMotif is responsible for initializing the Xt toolkit and the Xt application context. It does not open a connection to the X server; that is done by QApplication.

The only member function in QtMotif that depends on an X server connection is QtMotif::initialize(). QtMotif must be created before QApplication.

Example usage of QtMotif and QApplication:

 static char *resources[] = {
 ...
 };

 int main(int argc, char **argv)
 {
      QtMotif integrator("AppClass");
      XtAppSetFallbackResources(integrator.applicationContext(),
                                resources);
      QApplication app(argc, argv);

      ...

      return app.exec();
 }

Note for Qt versions 4.4 and later: There are cases where QtMotif's event handling will not function correctly in combination with Qt's non-native widget functionality. Hence, QtMotif by default disables this functionality. To reenable it, call QApplication::setAttribute(Qt::AA_NativeWindows, false) after creating the QtMotif object.


Member Function Documentation

QtMotif::QtMotif ( const char * applicationClass, XtAppContext context = NULL, XrmOptionDescRec * options = 0, int numOptions = 0 )

Constructs a QtMotif object to allow integration between Qt and Xt/Motif.

If context is 0, QtMotif creates a default application context itself. The context is accessible through applicationContext().

All arguments passed to this function (applicationClass, options and numOptions) are used to call XtDisplayInitialize() after QApplication has been constructed.

QtMotif::~QtMotif ()

Destroys the QtMotif object.

XtAppContext QtMotif::applicationContext () const

Returns the application context.

Display * QtMotif::display ()   [static]

Returns the X11 display connection used by the Qt Motif Extension.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Solutions