<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/extensions/motif/doc/index.doc:3 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Qt Motif Extension</title> <style type="text/css"><!-- fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>Qt Motif Extension</h1> <p> <!-- index Motif --><a name="Motif"></a> <p> This module is part of the <a href="commercialeditions.html">Qt Enterprise Edition</a> and is <em>not</em> part of the Free or Non-Commercial Editions. <p> <h2> Introduction </h2> <a name="1"></a><p> The Qt Motif Extension assists the migration of old Xt and Motif based applications to the more comfortable Qt toolkit. This extension replaces the older Xt/Motif Support Extension included with earlier versions of Qt. <p> The Qt Motif Extension consists of the following classes: <p> <ul> <li> <a href="qmotif.html">QMotif</a> - Provides the basis of the Qt Motif Extension. <li> <a href="qmotifwidget.html">QMotifWidget</a> - Provides the <a href="qwidget.html">QWidget</a> API for Motif widgets. <li> <a href="qmotifdialog.html">QMotifDialog</a> - Provides the <a href="qdialog.html">QDialog</a> API for Motif dialogs. <li> <a href="qxtwidget.html">QXtWidget</a> - The Xt/Motif integration widget from the previous Xt/Motif extension. This class is unsupported and has many known problems and limitations. It is provided only to keep existing source working; it should not be used in new code. </ul> <p> <h3> Additional Documentation </h3> <a name="1-1"></a><p> <ul> <p> <li> <a href="motif-examples.html">Examples</a> <li> <a href="motif-walkthrough.html">Migration Walkthrough</a> - A complete migration of a Motif based program to the Qt toolkit. <p> </ul> <p> <h2> Common Problems </h2> <a name="2"></a><p> <h3> Incorrect CDE Color Scheme </h3> <a name="2-1"></a><p> <a href="qmotifwidget.html">QMotifWidget</a> and <a href="qmotifdialog.html">QMotifDialog</a> will use the same Visual, Colormap and color depth that <a href="qapplication.html">QApplication</a> uses. When using CDE, the color scheme may be incorrect when using a Visual, Colormap and color depth that is not the default. To work around this problem, add the following resource string to your startup files (for example, <tt>$HOME/.dt/sessions/current/dt.resources</tt>): <p> <pre> *userColorObj: false </pre> <p> <h3> X11 Header Conflicts </h3> <a name="2-2"></a><p> The X11 headers define some constants that conflict with the Qt headers. The solution is to include all Qt headers first, followed by headers from this extension, and all Xt/Motif and X11 headers last. For example: <p> <pre> // Qt headers first #include <<a href="qapplication-h.html">qapplication.h</a>> #include <<a href="qpushbutton-h.html">qpushbutton.h</a>> #include <<a href="qsocket-h.html">qsocket.h</a>> ... // QMotif* headers next #include <<a href="qmotif-h.html">qmotif.h</a>> #include <<a href="qmotifdialog-h.html">qmotifdialog.h</a>> #include <<a href="qmotifwidget-h.html">qmotifwidget.h</a>> // Xt/Motif and X11 headers last #include <X11/Xlib.h> #include <Xt/Intrinsic.h> #include <Xm/Xm.h> ... </pre> <p> <h3> Multiple Screen Support </h3> <a name="2-3"></a><p> <a href="qmotifwidget.html">QMotifWidget</a> can be used together with <a href="qdesktopwidget.html">QDesktopWidget</a> to create top-level windows on multiple screens. A common mistake is to create a QMotifWidget on a non-default screen while the Xt/Motif widgets are created on the default screen. The solution is to specify the screen to both QMotifWidget and the Xt/Motif child. For example: <p> <pre> Display *dpy = QMotif::<a href="qmotif.html#x11Display">x11Display</a>(); Arg args[1]; // make sure both QMotifWidget and the XmMainWindow are on screen 1 XtSetArg(args[0], XtNscreen, ScreenOfDisplay(dpy, 1)); <a href="qmotifwidget.html">QMotifWidget</a> *toplevel = new <a href="qmotifwidget.html">QMotifWidget</a>(QApplication::<a href="qapplication.html#desktop">desktop</a>()->screen(1), xmMainWindowWidgetClass, args, 1, "mainwindow"); </pre> <p> <!-- eof --> <p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2007 <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> <td align=right><div align=right>Qt 3.3.8</div> </table></div></address></body> </html>