summaryrefslogtreecommitdiffstats
path: root/doc/html/motif-extension.html
blob: 8f3501851d7df65618a23026d4f63cbb3ee0d14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!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&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;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 &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;
    #include &lt;<a href="qpushbutton-h.html">qpushbutton.h</a>&gt;
    #include &lt;<a href="qsocket-h.html">qsocket.h</a>&gt;
    ...

    // QMotif* headers next
    #include &lt;<a href="qmotif-h.html">qmotif.h</a>&gt;
    #include &lt;<a href="qmotifdialog-h.html">qmotifdialog.h</a>&gt;
    #include &lt;<a href="qmotifwidget-h.html">qmotifwidget.h</a>&gt;

    // Xt/Motif and X11 headers last
    #include &lt;X11/Xlib.h&gt;
    #include &lt;Xt/Intrinsic.h&gt;
    #include &lt;Xm/Xm.h&gt;
    ...
</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>()-&gt;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 &copy; 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>