[Kde-cygwin-cvs] CVS: qt-2/src/doc HOWTO-Framebuffer.doc,1.1.1.1,1.2 appicon.doc,1.1.1.1,1.2 install
Status: Inactive
Brought to you by:
habacker
Update of /cvsroot/kde-cygwin/qt-2/src/doc In directory usw-pr-cvs1:/tmp/cvs-serv3563/src/doc Modified Files: HOWTO-Framebuffer.doc appicon.doc installation.doc moc.doc object.doc qarray.doc qws.doc Log Message: upgrade to 2.3.1 release Index: HOWTO-Framebuffer.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/HOWTO-Framebuffer.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- HOWTO-Framebuffer.doc 19 May 2001 18:11:48 -0000 1.1.1.1 +++ HOWTO-Framebuffer.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -205,7 +205,7 @@ // Open the file for reading and writing fbfd = open("/dev/fb0", O_RDWR); - if (!fbfd) { + if (fbfd < 0) { printf("Error: cannot open framebuffer device.\n"); exit(1); } Index: appicon.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/appicon.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- appicon.doc 19 May 2001 18:11:47 -0000 1.1.1.1 +++ appicon.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -77,8 +77,4 @@ program on the .rc file, then link your application with the resulting .res file. -If an application icon has been set in this way, Qt will also use it in -all top-level windows where you do not specify another icon using -QWidget::setIcon(). - */ Index: installation.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/installation.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- installation.doc 19 May 2001 18:11:48 -0000 1.1.1.1 +++ installation.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -87,6 +87,8 @@ <tr><td>PATH <td> to locate the moc program and other Qt tools <tr><td>MANPATH <td> to access the Qt man pages <tr><td>LD_LIBRARY_PATH <td> for the shared Qt library + <tr><td>QT_FONTPATH <td> optional. A list of directories where Qt can find type1 or true type fonts for + print embedding. </table> <p> @@ -112,6 +114,17 @@ setenv MANPATH $QTDIR/man:$MANPATH setenv LD_LIBRARY_PATH $QTDIR/lib:$LD_LIBRARY_PATH </pre> + +<p> + If you have some true type or type1 fonts installed in non + standard places, you might want to set the QT_FONTPATH environment + variable to point to these directories. This is not needed, when + all fonts are accessed through local font directories or a local + font server, as Qt will automatically scan the fontpath and the + font servers configuration file. All directories in the fontpath + will need to have a valid fonts.dir file, so Qt can map from X11 + font names to the corresponding embeddable font. +</p> <p> After you have done this, you will need to login again, or Index: moc.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/moc.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- moc.doc 19 May 2001 18:11:48 -0000 1.1.1.1 +++ moc.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -527,18 +527,18 @@ \code [...] public slots: - void MyWidget::setLocation (pair<int,int> location); + void MyWidget::setLocation (pair<int,int> location); [...] public signals: - void MyObject::moved (pair<int,int> location); + void MyObject::moved (pair<int,int> location); \endcode However, you can work around this limitation by explicitly typedef'ing the parameter types, like this: \code - typedef pair<int,int> IntPair; + typedef pair<int,int> IntPair; [...] public slots: void MyWidget::setLocation (IntPair location); @@ -549,6 +549,43 @@ \endcode This will work as expected. + +<h4>Namespace of parent class must be specified even if it is the same as +that of the subclass</h4> + +In the following example, classes x::A and x::B are defined: + +\code + namespace x { + class A : public QObject { + Q_OBJECT + + public: + ... + }; + } + + namespace x { + class B : public A { + Q_OBJECT + + public: + ... + }; + } +\endcode + +Unfortunately, moc will not understand the +\code + class B : public A { +\endcode +line. You have either to write +\code + class B : public x::A { +\endcode +or define classes A and B in the same namespace block. + +This limitation will disappear with Qt 3.0. <h4>Properties need to be declared before the public section that contains the respective get and set functions</h4> Index: object.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/object.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- object.doc 19 May 2001 18:11:48 -0000 1.1.1.1 +++ object.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -463,7 +463,7 @@ Finally, many applications want to create and send their own events. -Creatint an event of a built-in type is very simple: Create an object +Creating an event of a built-in type is very simple: Create an object of the relevant type, and then call \l QApplication::sendEvent() or \l QApplication::postEvent(). Index: qarray.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/qarray.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- qarray.doc 19 May 2001 18:11:48 -0000 1.1.1.1 +++ qarray.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -216,7 +216,7 @@ Returns TRUE if the array is empty, i.e. size() == 0, otherwise FALSE. isEmpty() is equivalent with isNull() for QArray. Note that this is not - the case for QString::isEmpty(). + the case for QCString::isEmpty(). */ /*! Index: qws.doc =================================================================== RCS file: /cvsroot/kde-cygwin/qt-2/src/doc/qws.doc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- qws.doc 19 May 2001 18:11:49 -0000 1.1.1.1 +++ qws.doc 19 Apr 2002 10:52:59 -0000 1.2 @@ -458,9 +458,9 @@ <table> <tr><th>Platform</th><th>Macro</th></tr> -<tr><td>Qt/X11</td><td>_WS_X11_</td></tr> -<tr><td>Qt/Windows</td><td>_WS_WIN_</td></tr> -<tr><td>Qt/Embedded</td><td>_WS_QWS_</td></tr> +<tr><td>Qt/X11</td><td>Q_WS_X11</td></tr> +<tr><td>Qt/Windows</td><td>Q_WS_WIN</td></tr> +<tr><td>Qt/Embedded</td><td>Q_WS_QWS</td></tr> </table> */ @@ -638,3 +638,104 @@ */ +/*! \page performance-qws.html +\title Qt/Embedded Performance Tuning + +When building embedded applications on low-powered devices, a number +of options are available that would not be considered in a desktop +application environment. These options reduce the memory and/or CPU +requirements at the cost of other factors. + +<ul> + <li><a href=features.html><b>Tuning the functionality of Qt</b></a> + <li><a href=#general>General programming style</a> + <li><a href=#static>Static vs. Dynamic linking</a> + <li><a href=#alloc>Alternative memory allocation</a> +</ul> + +<a name=general> +<h3>General programming style</h3> +</a> +<p> +The following guidelines will improve CPU performance: +<ul> + <li>Create dialogs and widgets once, then QWidget::hide() and + QWidget::show() them, rather than creating them and deleting + them every time they are needed. + This will use a little more memory, but will be much faster. + Try to create them the first time "lazily" to avoid slow startup + (only create the Find dialog the first time the user invokes it). +</ul> + +<a name=static> +<h3>Static vs. Dynamic linking</h3> +</a> +<p>Much CPU and memory is used by the ELF linking process. You can make +significant savings by using a static build of your application suite. +This means that rather than having a dynamic library (<tt>libqte.so</tt>) +and a collection of executables which link dynamically to that library, +you build all the applications into a single executable and statically +link that with a static library (<tt>libqt.a</tt>). This improves start-up +time, and reduces memory usage, at the expense of flexibility (to add a new +application, you must recompile the single executable) and robustness (if +one application has a bug, it might harm other applications). If you need +to install end-user applications, this may not be an option, but if you are +building a single application suite for a device with limited CPU power +and memory, this option could be very beneficial. + +To compile Qt as a static library, add the <tt>-static</tt> options when +you run configure. + +To build your application suite as an all-in-one application, design each +application as a stand-alone widget or set of widgets, with only minimal +code in the <tt>main()</tt> function. Then, write an application that gives +some way to choose among the applications (eg. a QIconView). The +<a href=http://www.trolltech.com/products/qt/embedded/qpe.html>QPE</a> +is an example of this - it can be built either as a set of dynamically-linked +executables, or as a single static application. + +Note that you should generally still link dynamically against the standard +C library and any other libraries which might be used by other applications +on your device. + +<a name=alloc> +<h3>Alternative memory allocation</h3> +</a> +<p>We have found that the libraries shipped with some C++ compilers on +some platforms have poor performance in the built-in "new" and "delete" +operators. You might gain performance by re-implementing these +functions. For example, you can switch to the plain C allocators +by adding the following to your code: + +\code +void* operator new[](size_t size) +{ + return malloc(size); +} + +void* operator new(size_t size) +{ + return malloc(size); +} + +void operator delete[](void* p) +{ + free(p); +} + +void operator delete[](void* p, size_t size) +{ + free(p); +} + +void operator delete(void* p) +{ + free(p); +} + +void operator delete(void* p, size_t size) +{ + free(p); +} +\endcode +*/ |