Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 397cf13019f8c526877f271962f26f4c > files > 825

libqt3-devel-3.1.1-13mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/reggie/tmp/qt-3.1-reggie-23625/qt-x11-free-3.1.1/doc/mac.doc:35 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User Interface</title>
<style type="text/css"><!--
h3.fn,span.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>User Interface</h1>

 
<p> This file will outline known issues and possible workarounds for
limitations on Mac OS X with Qt. This list will not always be complete, so
please contact Trolltech support with issues you find to be missing:
<p> <h2> <a href="qcursor.html">QCursor</a>
</h2>
<a name="1"></a><p> Due to Mac OS X having only 16x16 custom cursors <a href="qcursor.html">QCursor</a> is limited by this
as well. For now the only workaround to this problem is to use a small
cursor (16x16).
<p> <h2> Anti-aliased text
</h2>
<a name="2"></a><p> Qt/Mac (starting with 3.0.5) has introduced some support for smooth text as
suggested by Apple's Aqua Style Guildelines. This support is limited to Mac
OS X >10.1.4, when this version is not detected it will fallback to the old
text rendering library.
<p> <h2> Bundle-based Libraries
</h2>
<a name="3"></a><p> If you want to incorporate dynamic libraries as part of your MacOSX
application bundle (the application directory), then you place these into a
directory called Frameworks, a subdirectory of the application bundle.
<p> The application finds these dynamic libraries if the libraries have an
install name of "@executable_path/../Frameworks/libname.dylib.
<p> If you use qmake and Makefiles, use the QMAKE_LFFLAGS_SONAME setting:
<p> <pre>
QMAKE_LFLAGS_SONAME  = -Wl,-install_name,@executable_path/../Frameworks/
</pre>
 
<p> In case of Project Builder, you set the Library targets to have their
install path (in the Build Settings of the target) set to
"@executable_path/.../Frameworks". You also need to add a custom build
setting called "SKIP_INSTALL" and set this to YES. In the Application
target you need to add a Copy Files build phase that will copy the library
product into the applications wrapper's Framework sub-folder.
<p> Note that DYLD_LIBRARY_PATH environment variables will override these
settings, same with any other default paths such as a lookup of dynamic
libraries inside /usr/lib and similar default locations.
<p> We still strongly recommend to build static applications where the library
code is incorporated into the MacOSX binary. However, in case you ship
applications that require plugin support,then you need to use dynamic
libraries as part of your application.
<p> <h2> Combining Libraries
If you want to build a new dynamic library combining the Qt 3.1 dynamic
libraries, you need to introduce the ld -r flag so that relocation information
is stored in the the output file, so that this file could be the subject of 
another ld run. This is done by setting the -r flag in the .pro file, and the
LFLAGS settings.
</h2>
<a name="4"></a><p> <h2> Compile-time Flags
</h2>
<a name="5"></a><p> If you want to wrap any specific MacOSX code in a define, use the Q_OS_MACX
flag, as in:
<p> <pre>
#if defined(Q_OS_MACX)
// the code used
#endif
</pre>
 
<p> Note that when you build under MacOSX 10.2, then the MACOSX_102 flag is
automatically included in the make builds.
<p> <h2> Problems building a static configuration
</h2>
<a name="6"></a><p> If a static build fails with the following error messages during the
designer make phase:
<p> <pre>
QWidget::<a href="qwidget.html#sizeHint">sizeHint</a>() const referenced from libqui expected to be defined in @executable_path/../Frameworks/libqt-mt.3.dylib
non-virtual thunk [nv:-40] to QWidget::metric(int) const referenced from libqui
 expected to be defined in @executable_path/../Frameworks/libqt-mt.3.dylib
</pre>
 
<p> then ensure that your library path does not have libqui libraries or
symbolic links. If you remove these, then the build will continue.
<p> <h2> Accessing the Bundle Path
</h2>
<a name="7"></a><p> The Macintosh application is actually a directory (ending with .app). This
directory has various other sub-directories and sources. In case you want
to place for example the plugin directory inside this bundle, then you need
to find out where the bundle resides on the disk. The following code will
do this:
<p> <pre>
        CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
        CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, 
                                               kCFURLPOSIXPathStyle);
        const char *pathPtr = CFStringGetCStringPtr(macPath, 
                                               CFStringGetSystemEncoding());
        <a href="qapplication.html#qDebug">qDebug</a>("Path = %s", pathPtr);
</pre>
 
<p> Do not forget to enclosure this in an #if defined(Q_OS_MACX) macro statement.
<p> <h2> Right-Mouse Clicks
<p>If you want to provide right-mouse click support for MacOSX, use the
<a href="qcontextmenuevent.html">QContextMenuEvent</a> class. This will map to a context menu event, in other
words a menu that will display a popup selection. This is the most common
use of right-mouse clicks, and maps to a control-click with the MacOSX
one-button mouse support.
</h2>
<a name="8"></a><p> <h2> Menubar
</h2>
<a name="9"></a><p> <p>Qt/Mac will automatically detect your menubars for you and turn them
into Mac native menubars. Fitting this into your existing Qt application
will normally be automatic, however, if you have special needs the Qt/Mac
implementation currently selects a menubar by starting at the active window
(ie <a href="qapplication.html#activeWindow">QApplication::activeWindow</a>()), and applying:
<p> 1) If the window has a <a href="qmenubar.html">QMenuBar</a> then it is used.
2) If the window is a modal then its menubar is used. If no menubar is
specified then a default menubar is used (as documented below)
3) If the window has no parent then the default menubar is used (as documented below).
<p> The above 3 steps are applied all the way up the parent window chain until
one of the above are satisifed. If all else fails a default menubar will be
created, the default menubar on Qt/Mac is an empty menubar, however you can
create a different default menubar by creating a parentless QMenuBar, the
first one created will thus be designated the default menubar, and will be
used whenever a default menubar is needed.
<p> 
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2002 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.1.1</div>
</table></div></address></body>
</html>