diff options
author | axis <qt-info@nokia.com> | 2009-04-24 14:03:55 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-04-27 07:09:01 (GMT) |
commit | e74c8dc65e2feffb9a55d00aee5ca634fba41df8 (patch) | |
tree | 3a131f9235fb6a455793178d8313655e4fd0036e /doc/src | |
parent | 8f427b2b914d5b575a4a7c0ed65d2fb8f45acc76 (diff) | |
parent | 211bea9838bcc2acd7f54b65468fe1be2d81b1e0 (diff) | |
download | Qt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.zip Qt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.tar.gz Qt-e74c8dc65e2feffb9a55d00aee5ca634fba41df8.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Configure.exe recompiled with MSVC6.
Conflicts:
configure.exe
examples/network/network.pro
src/gui/dialogs/qfiledialog_p.h
src/gui/dialogs/qfilesystemmodel_p.h
src/gui/kernel/qapplication.cpp
tests/auto/_Categories/qmake.txt
tests/auto/qfile/test/test.pro
tests/auto/qfile/tst_qfile.cpp
tests/auto/qlibrary/tst_qlibrary.cpp
tests/auto/qline/tst_qline.cpp
tests/auto/qstyle/tst_qstyle.cpp
tests/auto/qtextstream/tst_qtextstream.cpp
tests/auto/qtranslator/qtranslator.pro
tests/auto/qwaitcondition/tst_qwaitcondition.cpp
translations/qt_ja_JP.ts
Diffstat (limited to 'doc/src')
49 files changed, 716 insertions, 823 deletions
diff --git a/doc/src/activeqt.qdoc b/doc/src/activeqt.qdoc index ea13e59..3919823 100644 --- a/doc/src/activeqt.qdoc +++ b/doc/src/activeqt.qdoc @@ -73,7 +73,7 @@ To build the static libraries, change into the \c activeqt directory (usually \c QTDIR/src/activeqt), and run \c qmake and your make tool in both the \c container and the \c control subdirectory. - The libraries \c qaxcontainer.lib and \c qaxserver.lib will be linked + The libraries \c qaxcontainer.lib and \c qaxserver.lib will be linked into \c QTDIR/lib. If you are using a shared configuration of Qt enter the \c plugin @@ -81,8 +81,8 @@ plugin that integrates the QAxContainer module into \l{Qt Designer}. - The ActiveQt modules are part of the \l{Qt Full Framework Edition}. They - are \e not part of the \l{Open Source Versions of Qt}. + The ActiveQt modules are part of the \l{Qt Full Framework Edition} and + the \l{Open Source Versions}. \sa {QAxContainer Module}, {QAxServer Module} */ diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc index d2c7a9e..bcfa93d 100644 --- a/doc/src/deployment.qdoc +++ b/doc/src/deployment.qdoc @@ -89,7 +89,8 @@ of Qt, you get Qt as a shared library. The disadvantage with the shared library approach is that you - will get more files to deploy. + will get more files to deploy. For more information, see + \l{sharedlibrary.html}{Creating Shared Libraries}. \section1 Deploying Qt's Libraries @@ -110,13 +111,14 @@ \o \l {QtNetwork} \o \l {QtOpenGL} \o \l {QtScript} - \o \l {QtSql} + \o \l {QtScriptTools} \row + \o \l {QtSql} \o \l {QtSvg} \o \l {QtWebKit} \o \l {QtXml} - \o \l {QtXmlPatterns} \row + \o \l {QtXmlPatterns} \o \l {Phonon Module}{Phonon} \o \l {Qt3Support} \endtable @@ -177,11 +179,13 @@ Please see \l{QtWebKit Module#License Information}{the QtWebKit module documentation} for more information. - \row \o Phonon \o Phonon + \row \o \l{Phonon Module}{Phonon} \o Phonon \o Phonon relies on the native multimedia engines on different platforms. Phonon itself is licensed under the GNU LGPL version 2. Please see \l{Phonon Module#License Information}{the Phonon module documentation} - for more information. + for more information on licensing and the + \l{Phonon Overview#Backends}{Phonon Overview} for details of the backends + in use on different platforms. \endtable \section1 Platform-Specific Notes @@ -907,7 +911,7 @@ Then qApp->libraryPaths() would return something like this: "C:/customPath/plugins " - "C:/Qt/4.5.0/plugins" + "C:/Qt/%VERSION%/plugins" "E:/myApplication/directory/" The executable will look for the plugins in these directories and diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 9eb43b7..e10a5be 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -2443,6 +2443,10 @@ pixmap property in the property editor. \target BuildingandInstallingthePlugin \section1 Building and Installing the Plugin + \section2 A Simple Plugin + + The \l{Custom Widget Plugin Example} demonstrates a simple \QD plugin. + The \c{.pro} file for a plugin must specify the headers and sources for both the custom widget and the plugin interface. Typically, this file only has to specify that the plugin's project is to be built as a library, but @@ -2477,65 +2481,42 @@ pixmap property in the property editor. See QCoreApplication::libraryPaths() for more information about customizing paths for libraries and plugins with Qt applications. -\omit - \section1 Using Qt Script to Aid in Building Forms - - Starting with Qt 4.3, \c .ui files may contain - \l{QtScript}{Qt Script} snippets that are executed by \l uic or QUiLoader - when building forms. + \section2 Splitting up the Plugin - The snippets are executed per widget. The snippet may modify properties - or invoke slots on the widget. + In a real world scenario, you do not want to have dependencies of the + application making use of the custom widgets to the \QD headers and + libraries as introduced by the simple approach explained above. - Special variables are used to access the widget: + There are two ways to resolve this: - \table - \header - \o Name - \o Value - \row \o \c widget - \o The widget being built. - \row \o \c childWidgets - \o An array containing the child widgets. This is useful - for QDesignerContainerExtension subclasses. - \endtable + \list + \i Create a \c{.pri} file that contains the headers sources and sources + of the custom widget: - If scripts are present in an \c {uic}-generated form, the application - must be configured with Qt Script support. + \code + INCLUDEPATH += $$PWD + HEADERS += $$PWD/analogclock.h + SOURCES += $$PWD/analogclock.cpp + \endcode - \snippet doc/src/snippets/code/doc_src_designer-manual.qdoc 5 + This file would then be included by the \c{.pro} file of the plugin and + the application: - For security reasons, the execution of scripts is disabled - by default in QUiLoader. You can enable it by - calling the QUiLoader::setScriptingEnabled() method. + \code + include(customwidget.pri) + \endcode - The resulting script snippet is concatenated from snippets occurring in - several places: + Running \c{qmake -Wall} on the \c{.pro} files causes a warning to be + printed if an included \c{.pri} file cannot be found. - \table - \header - \o Source - \o Usage - \row \o The \c codeTemplate() function of QDesignerCustomWidgetInterface - \o Allows snippets to be run on a per-class basis; for example, to set up a - container using the QDesignerContainerExtension. - \row \o The \c script() method of QDesignerScriptExtension - \o Allows snippets to be run on a per-widget basis; for example, - to set up the internal state of a custom widget. - - Such an internal state might be, for example, the contents of - a custom item view container widget, for which an editor - is provided by an QDesignerTaskMenuExtension object. - - \row \o Snippets entered at run-time using the \gui{Change script...} - option of the form's context menu - \o Fast prototyping. To get an idea, - drag a QLineEdit onto the form, enter the script - \snippet doc/src/snippets/code/doc_src_designer-manual.qdoc 6 - and preview the form. - \endtable -\endomit + \i Create a standalone shared library containing the custom widgets only + as described in + \l{sharedlibrary.html}{Creating Shared Libraries}. + This library would then be used by the application as well as by the + \QD plugin. Care must be taken to ensure that the plugin can locate + the library at run-time. + \endlist \section1 Related Examples diff --git a/doc/src/diagrams/qtransform-representation.sk b/doc/src/diagrams/qtransform-representation.sk new file mode 100644 index 0000000..17dcbfe --- /dev/null +++ b/doc/src/diagrams/qtransform-representation.sk @@ -0,0 +1,103 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,630) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,630) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,630) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m33',(329.16,589.968)) +G() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('dy',(274.828,577.768)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m32',(264.16,602.768)) +G_() +G() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m31',(199.16,602.768)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('dx',(209.828,577.8)) +G_() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m11',(199.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m12',(264.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m13',(329.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m21',(199.16,654.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m22',(264.16,654.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m23',(329.16,654.968)) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,5,5),1,(0,0,1),'Grid') diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc index 77c5591..2d57389 100644 --- a/doc/src/examples.qdoc +++ b/doc/src/examples.qdoc @@ -209,6 +209,7 @@ \o \l{network/loopback}{Loopback} \o \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster \o \l{network/torrent}{Torrent} + \o \l{network/googlesuggest}{Google Suggest} \endlist \section1 OpenGL @@ -234,6 +235,7 @@ \o \l{painting/fontsampler}{Font Sampler} \o \l{painting/imagecomposition}{Image Composition}\raisedaster \o \l{painting/painterpaths}{Painter Paths}\raisedaster + \o \l{painting/svggenerator}{SVG Generator}\raisedaster \o \l{painting/svgviewer}{SVG Viewer} \o \l{painting/transformations}{Transformations}\raisedaster \endlist @@ -309,6 +311,7 @@ \section1 Threads \list + \o \l{threads/queuedcustomtype}{Queued Custom Type}\raisedaster \o \l{threads/mandelbrot}{Mandelbrot}\raisedaster \o \l{threads/semaphores}{Semaphores}\raisedaster \o \l{threads/waitconditions}{Wait Conditions}\raisedaster @@ -320,6 +323,8 @@ \o \l{tools/codecs}{Codecs} \o \l{tools/completer}{Completer}\raisedaster \o \l{tools/customcompleter}{Custom Completer}\raisedaster + \o \l{tools/customtype}{Custom Type}\raisedaster + \o \l{tools/customtypesending}{Custom Type Sending}\raisedaster \o \l{tools/echoplugin}{Echo Plugin}\raisedaster \o \l{tools/i18n}{I18N} \o \l{tools/plugandpaint}{Plug & Paint}\raisedaster @@ -344,6 +349,8 @@ \list \o \l{webkit/previewer}{Previewer}\raisedaster \o \l{webkit/formextractor}{Form Extractor} + \o \l{webkit/googlechat}{Google Chat} + \o \l{webkit/fancybrowser}{Fancy Browser} \endlist \section1 Widgets diff --git a/doc/src/examples/collidingmice-example.qdoc b/doc/src/examples/collidingmice-example.qdoc index 7ea2ca2..657a204 100644 --- a/doc/src/examples/collidingmice-example.qdoc +++ b/doc/src/examples/collidingmice-example.qdoc @@ -66,7 +66,7 @@ \section1 Mouse Class Definition - The \c mouse class inherits both QObject and QGraphicsItem. The + The \c mouse class inherits from QGraphicsItem. The QGraphicsItem class is the base class for all graphical items in the Graphics View framework, and provides a light-weight foundation for writing your own custom items. @@ -78,14 +78,11 @@ {QGraphicsItem::}{boundingRect()}, which returns an estimate of the area painted by the item, and \l {QGraphicsItem::}{paint()}, which implements the actual painting. In addition, we reimplement - the \l {QGraphicsItem::}{shape()} function to return an accurate + the \l {QGraphicsItem::}{shape()} and \l {QGraphicsItem::}{advance()}. + We reimplement \l {QGraphicsItem::}{shape()} to return an accurate shape of our mouse item; the default implementation simply returns - the item's bounding rectangle. - - The rationale for deriving from QObject in addition to - QGraphicsItem is to be able to animate our items by reimplementing - QObject's \l {QObject::}{timerEvent()} function and use - QObject::startTimer() to generate timer events. + the item's bounding rectangle. We reimplement \l {QGraphicsItem::}{advance()} + to handle the animation so it all happens on one update. \section1 Mouse Class Definition @@ -105,19 +102,18 @@ calling the item's \l {QGraphicsItem::rotate()}{rotate()} function we alter the direction in which the mouse will start moving. - In the end we call QObject's \l {QObject::}{startTimer()} - function, emitting a timer event every 1000/33 millisecond. This - enables us to animate our mouse item using our reimplementation of - the \l {QObject::}{timerEvent()} function; whenever a mouse - receives a timer event it will trigger \l - {QObject::}{timerEvent()}: - + When the QGraphicsScene decides to advance the scene a frame it will call + QGraphicsItem::advance() on each of the items. This enables us to animate + our mouse using our reimplementation of the advance() function. + \snippet examples/graphicsview/collidingmice/mouse.cpp 4 \snippet examples/graphicsview/collidingmice/mouse.cpp 5 \snippet examples/graphicsview/collidingmice/mouse.cpp 6 - First we ensure that the mice stays within a circle with a radius - of 150 pixels. + First, we don't bother doing any advance if the step is 0 since we want to our advance in + the actual advance (advance() is called twice, once with step == 0 indicating that items + are about to advance and with step == 1 for the actual advance). We also ensure that the + mice stays within a circle with a radius of 150 pixels. Note the \l {QGraphicsItem::mapFromScene()}{mapFromScene()} function provided by QGraphicsItem. This function maps a position @@ -275,5 +271,12 @@ In the end, we set the application window's title and size before we enter the main event loop using the QApplication::exec() function. -*/ + Finally, we create a QTimer and connect its timeout() signal to the advance() + slot of the scene. Every time the timer fires, the scene will advance one frame. + We then tell the timer to fire every 1000/33 millisecond. This will + give us a frame rate of 30 frames a second, which is fast enough for most animations. + Doing the animation with a single timer connect to advance the scene ensures that all the + mice are moved at one point and, more importantly, only one update is sent to the screen + after all the mice have moved. +*/
\ No newline at end of file diff --git a/doc/src/examples/extension.qdoc b/doc/src/examples/extension.qdoc index 8a0ca3a..02e0698 100644 --- a/doc/src/examples/extension.qdoc +++ b/doc/src/examples/extension.qdoc @@ -80,9 +80,9 @@ user type a word to search for, we need several \l {QCheckBox}{QCheckBox}es to facilitate the search options, and we need three \l {QPushButton}{QPushButton}s: the \gui Find button to - start a search, the \gui More button to enable an advanced search, - and the \gui Close button to exit the application. Finally, we - need a QWidget representing the application's extension part. + start a search and the \gui More button to enable an advanced search. + Finally, we need a QWidget representing the application's extension + part. \section1 FindDialog Class Implementation @@ -128,8 +128,7 @@ the connection makes sure that the extension widget is shown depending on the state of \gui More button. - We also connect the \gui Close button to the QWidget::close() - slot, and we put the checkboxes associated with the advanced + We also put the check boxes associated with the advanced search options into a layout we install on the extension widget. \snippet examples/dialogs/extension/finddialog.cpp 4 @@ -137,7 +136,7 @@ Before we create the main layout, we create several child layouts for the widgets: First we allign the QLabel ans its buddy, the QLineEdit, using a QHBoxLayout. Then we vertically allign the - QLabel and QLineEdit with the checkboxes associated with the + QLabel and QLineEdit with the check boxes associated with the simple search, using a QVBoxLayout. We also create a QVBoxLayout for the buttons. In the end we lay out the two latter layouts and the extension widget using a QGridLayout. diff --git a/doc/src/snippets/webkit/simple/main.cpp b/doc/src/examples/fancybrowser.qdoc index a6a4fc2..9001c20 100644 --- a/doc/src/snippets/webkit/simple/main.cpp +++ b/doc/src/examples/fancybrowser.qdoc @@ -39,18 +39,13 @@ ** ****************************************************************************/ -#include <QApplication> -#include <QUrl> -#include <QWebView> +/*! + \example webkit/fancybrowser + \title Fancy Browser Example -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QWidget *parent = 0; -//! [Using QWebView] - QWebView *view = new QWebView(parent); - view->load(QUrl("http://qtsoftware.com/")); - view->show(); -//! [Using QWebView] - return app.exec(); -} + The Fancy Browser example shows how to use jQuery with QtWebKit to + make a web browser with some special effects and content manipulation. + + \image fancybrowser-example.png + +*/ diff --git a/doc/src/examples/googlechat.qdoc b/doc/src/examples/googlechat.qdoc new file mode 100644 index 0000000..f2d61cf --- /dev/null +++ b/doc/src/examples/googlechat.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webkit/googlechat + \title Google Chat Example + + The Google Chat example shows how to use implement a simple Google Chat + client with QtWebKit. + + \image googlechat-example.png + +*/ diff --git a/doc/src/examples/googlesuggest.qdoc b/doc/src/examples/googlesuggest.qdoc new file mode 100644 index 0000000..a9b09f9 --- /dev/null +++ b/doc/src/examples/googlesuggest.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example network/googlesuggest + \title Google Suggest Example + + The Google Suggest example shows how to use the network access manager + to get the list of suggested search terms from Google. + + \image googlesuggest-example.png + +*/ diff --git a/doc/src/examples/qxmlstreambookmarks.qdoc b/doc/src/examples/qxmlstreambookmarks.qdoc index 7059043..fb3a1c1 100644 --- a/doc/src/examples/qxmlstreambookmarks.qdoc +++ b/doc/src/examples/qxmlstreambookmarks.qdoc @@ -103,8 +103,9 @@ The \c read() function accepts a QIODevice and sets it using \l{QXmlStreamReader::setDevice()}{setDevice()}. The actual process - of reading only takes place in event the file is a valid XBEL 1.0 - file. Otherwise, the \l{QXmlStreamReader::raiseError()} + of reading only takes place if the file is a valid XBEL 1.0 file. + Note that the XML input needs to be well-formed to be accepted by + QXmlStreamReader. Otherwise, the \l{QXmlStreamReader::raiseError()} {raiseError()} function is used to display an error message. \snippet examples/xml/streambookmarks/xbelreader.cpp 1 diff --git a/doc/src/examples/svggenerator.qdoc b/doc/src/examples/svggenerator.qdoc new file mode 100644 index 0000000..32bb89a --- /dev/null +++ b/doc/src/examples/svggenerator.qdoc @@ -0,0 +1,136 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example painting/svggenerator + \title SVG Generator Example + + The SVG Generator example shows how to add SVG file export to applications. + + \image svggenerator-example.png + + Scalable Vector Graphics (SVG) is an XML-based language for describing + two-dimensional vector graphics. Qt provides classes for rendering and + generating SVG drawings. This example allows the user to create a simple + picture and save it to an SVG file. + + The example consists of two classes: \c Window and \c DisplayWidget. + + The \c Window class contains the application logic and constructs the user + interface from a Qt Designer \c{.ui} file as described in the + \l{Using a Designer .ui File in Your Application#The Multiple Inheritance Approach}{Qt Designer manual}. + It also contains the code to write an SVG file. + + The \c DisplayWidget class performs all the work of painting a picture on + screen. Since we want the SVG to resemble this picture as closely as + possible, we make this code available to the \c Window class so that it can + be used to generate SVG files. + + \section1 The DisplayWidget Class + + The \c DisplayWidget class displays a drawing consisting of a selection of + elements chosen by the user. These are defined using \c Shape and + \c Background enums that are included within the class definition: + + \snippet examples/painting/svggenerator/displaywidget.h DisplayWidget class definition + + Much of this class is used to configure the appearance of the drawing. The + \c paintEvent() and \c paint() functions are most relevant to the purpose + of this example, so we will describe these here and leave the reader to + look at the source code for the example to see how shapes and colors are + handled. + + We reimplement the QWidget::paintEvent() function to display the drawing + on screen: + + \snippet examples/painting/svggenerator/displaywidget.cpp paint event + + Here, we only construct a QPainter object, begin painting on the device + and set a render hint for improved output quality before calling the + \c paint() function to perform the painting itself. When this returns, + we close the painter and return. + + The \c paint() function is designed to be used for different painting + tasks. In this example, we use it to draw on a \c DisplayWidget instance + and on a QSvgGenerator object. We show how the painting is performed to + demonstrate that there is nothing device-specific about the process: + + \snippet examples/painting/svggenerator/displaywidget.cpp paint function + + \section1 The Window Class + + The \c Window class represents the example's window, containing the user + interface, which has been created using Qt Designer: + + \snippet examples/painting/svggenerator/window.h Window class definition + + As with the \c DisplayWidget class, we concentrate on the parts of the code + which are concerned with painting and SVG generation. In the \c Window + class, the \c saveSvg() function is called whenever the \gui{Save As...} + button is clicked; this connection was defined in the \c{window.ui} file + using Qt Designer. + + The start of the \c saveSvg() function performs the task of showing a file + dialog so that the user can specify a SVG file to save the drawing to. + + \snippet examples/painting/svggenerator/window.cpp save SVG + + In the rest of the function, we set up the generator and configure it to + generate output with the appropriate dimensions and write to the + user-specified file. We paint on the QSvgGenerator object in the same way + that we paint on a widget, calling the \c DisplayWidget::paint() function + so that we use exactly the same code that we used to display the drawing. + + The generation process itself begins with the call to the painter's + \l{QPainter::}{begin()} function and ends with call to its + \l{QPainter::}{end()} function. The QSvgGenerator paint device relies on + the explicit use of these functions to ensure that output is written to + the file. + + \section1 Further Reading + + The \l{SVG Viewer Example} shows how to display SVG drawings in an + application, and can be used to show the contents of SVG files created + by this example. + + See the QtSvg module documentation for more information about SVG and Qt's + SVG classes. +*/ diff --git a/doc/src/images/extension-example.png b/doc/src/images/extension-example.png Binary files differindex dfaacc0..18fab52 100644 --- a/doc/src/images/extension-example.png +++ b/doc/src/images/extension-example.png diff --git a/doc/src/images/extension_more.png b/doc/src/images/extension_more.png Binary files differindex 2b06809..407af27 100644 --- a/doc/src/images/extension_more.png +++ b/doc/src/images/extension_more.png diff --git a/doc/src/images/fancybrowser-example.png b/doc/src/images/fancybrowser-example.png Binary files differnew file mode 100644 index 0000000..717ac9d --- /dev/null +++ b/doc/src/images/fancybrowser-example.png diff --git a/doc/src/images/googlechat-example.png b/doc/src/images/googlechat-example.png Binary files differnew file mode 100644 index 0000000..0338445 --- /dev/null +++ b/doc/src/images/googlechat-example.png diff --git a/doc/src/images/googlesuggest-example.png b/doc/src/images/googlesuggest-example.png Binary files differnew file mode 100644 index 0000000..4ef072a --- /dev/null +++ b/doc/src/images/googlesuggest-example.png diff --git a/doc/src/images/qtransform-representation.png b/doc/src/images/qtransform-representation.png Binary files differindex 2608872..883d5dc 100644 --- a/doc/src/images/qtransform-representation.png +++ b/doc/src/images/qtransform-representation.png diff --git a/doc/src/images/svggenerator-example.png b/doc/src/images/svggenerator-example.png Binary files differnew file mode 100644 index 0000000..e7a8e53 --- /dev/null +++ b/doc/src/images/svggenerator-example.png diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 49dfafd..4ead9e4 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -85,12 +85,6 @@ \endif \endif - \if defined(opensourceedition) - \bold{Note:} This edition is for the development of \l{Qt - Open Source Edition}{Free and Open Source} software only; see - \l{Qt Commercial Editions}. - \endif - \raw HTML <table cellpadding="2" cellspacing="1" border="0" width="100%" bgcolor="#e5e5e5"> <tr> diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index fb0314e..85ea20c 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -724,7 +724,7 @@ in the \l{Qt for Windows CE Requirements} document. <td><tt>-xinerama</tt> or auto-detected</td><td>1.1.0</td> </tr><tr id="DefaultColor"> <td> Xi </td><td> libXi </td><td> X11 Input Extensions</td> - <td>auto-detected</td><td>1.3.0</td> + <td><tt>-xinput</tt> or auto-detected</td><td>1.3.0</td> </tr><tr id="DefaultColor"> <td> Xt </td><td> libXt </td><td> Xt Intrinsics</td><td></td><td>0.99</td> </tr><tr id="DefaultColor"> diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc index b42b882..1c3f6d2 100644 --- a/doc/src/licenses.qdoc +++ b/doc/src/licenses.qdoc @@ -239,6 +239,24 @@ \o Parts of the internal QImageSmoothScaler::scale() function use code based on pnmscale.c by Jef Poskanzer. \endlist + + \hr + + jQuery JavaScript Library v1.3.2 + http://jquery.com/ + + Copyright (c) 2009 John Resig + Dual licensed under the MIT and GPL licenses. + http://docs.jquery.com/License + + Sizzle CSS Selector Engine - v0.9.3 + Copyright 2009, The Dojo Foundation + Released under the MIT, BSD, and GPL Licenses. + More information: http://sizzlejs.com/ + + \list + \o examples/webkit/fancybrowser/jquery.min.js + \endlist */ /*! diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 01f7c8a..501b5a5 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -2568,7 +2568,7 @@ details. Phonon also provides EffectWidget, which lets the user modify the - parameters of an effect an the fly, e.g., with comboboxes. + parameters of an effect an the fly; e.g., with combo boxes. \sa {Phonon Module}, EffectWidget */ @@ -2656,7 +2656,7 @@ To find out what \l{Phonon::}{AudioOutputDevice}s are available for AudioOutput, you can call - BackendCapabilities::availableAudioDevices(). A default device is + BackendCapabilities::availableAudioOutputDevices(). A default device is selected by the backend, but it is possible to set the device to be used with setOutputDevice(). The outputDeviceChanged() signal will be emitted if the device changes. @@ -4457,12 +4457,12 @@ */ /*! - \fn QList<int> Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, HideAdvancedDevicesOverride override = FromSettings) const + \fn QList<int> Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ /*! - \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category) const + \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ diff --git a/doc/src/phonon.qdoc b/doc/src/phonon.qdoc index e86ccf6..9470e61 100644 --- a/doc/src/phonon.qdoc +++ b/doc/src/phonon.qdoc @@ -49,7 +49,7 @@ \section1 Introduction Qt uses the Phonon multimedia framework to provide functionality - for playback of the most common multimedia formats.The media can + for playback of the most common multimedia formats. The media can be read from files or streamed over a network, using a QURL to a file. @@ -566,7 +566,8 @@ framework, but rather use exchangeable backends to do the work. See the \l{Phonon Module} page for general information about the - framework. + framework and the \l{Phonon Overview} for an introductory tour of its + features. */ /*! diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc index d5eee27..c8046c4 100644 --- a/doc/src/platform-notes.qdoc +++ b/doc/src/platform-notes.qdoc @@ -232,9 +232,7 @@ \section1 Windows Vista - Known issues for Qt on Vista will be listed here. - - As of Qt 4.2.0 no Vista-specific issues are known. + At the time Qt %VERSION% was released, there were no known Vista-specific issues. \target Windows NT \section1 Windows XP, Windows 2000 and Windows NT @@ -493,7 +491,6 @@ \row \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X} \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \o MIPSpro 7.4.2m \o{5,1} \e{Unsupported - see the Unsupported Platforms table} \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X} \row \o \l{Known Issues in %VERSION%}{Intel CC 10 (see note)} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} diff --git a/doc/src/porting4-removedvirtual.qdocinc b/doc/src/porting4-removedvirtual.qdocinc index 3eedad2..1af4fa6 100644 --- a/doc/src/porting4-removedvirtual.qdocinc +++ b/doc/src/porting4-removedvirtual.qdocinc @@ -22,7 +22,7 @@ \row \o void QButton::drawButtonLabel(QPainter *) \o Use Q3Button instead or reimplement QButton::paintEvent(). \row \o void QButton::setAccel(const QKeySequence &) \o Setter. \row \o void QButton::setAutoRepeat(bool) \o Setter. -\row \o void QButton::setDown(bool) \o Setter. +\row \o void QButton::setDown(bool) \o Use Q3Button instead or reimplement or port to the new QPushButton API. \row \o void QButton::setPixmap(const QPixmap &) \o Setter. \row \o void QButton::setState(ToggleState) \o Setter. \row \o void QButton::setText(const QString &) \o Use the QAbstractButton::setText() setter function. diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc index 459fb81..b33c250 100644 --- a/doc/src/qalgorithms.qdoc +++ b/doc/src/qalgorithms.qdoc @@ -490,7 +490,10 @@ of \a value in the variable passed as a reference in argument \a n. \overload - This is the same as qLowerBound(\a{container}.begin(), \a{container}.end(), value); + For read-only iteration over containers, this function is broadly equivalent to + qLowerBound(\a{container}.begin(), \a{container}.end(), value). However, since it + returns a const iterator, you cannot use it to modify the container; for example, + to insert items. */ /*! \fn RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) diff --git a/doc/src/qdesktopwidget.qdoc b/doc/src/qdesktopwidget.qdoc index 0361aae..5a27fb4 100644 --- a/doc/src/qdesktopwidget.qdoc +++ b/doc/src/qdesktopwidget.qdoc @@ -48,6 +48,9 @@ \ingroup environment \mainclass + QApplication::desktop() function should be used to get an instance + of the QDesktopWidget. + Systems with more than one graphics card and monitor can manage the physical screen space available either as multiple desktops, or as a large virtual desktop, which usually has the size of the bounding @@ -86,12 +89,14 @@ screens. The correct width and height values are obtained using availableGeometry() or screenGeometry() for a particular screen. - \sa QApplication, QX11Info::appRootWindow() + \sa QApplication, QApplication::desktop(), QX11Info::appRootWindow() */ /*! \fn QDesktopWidget::QDesktopWidget() + \internal + Creates the desktop widget. If the system supports a virtual desktop, this widget will have @@ -104,6 +109,8 @@ /*! \fn QDesktopWidget::~QDesktopWidget() + \internal + Destroys the desktop widget and frees any allocated resources. */ diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index 2805d35..b2a7a34 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -367,15 +367,20 @@ \row \o debug \o The project is to be built in debug mode. \row \o debug_and_release \o The project is built in \e both debug and release modes. + \row \o debug_and_release_target \o The project is built in \e both debug + and release modes. TARGET is built into \e both the debug and release directories. \row \o build_all \o If \c debug_and_release is specified, the project is built in both debug and release modes by default. + \row \o autogen_precompile_source \o Automatically generates a \c .cpp file that includes + the precompiled header file specified in the .pro file. \row \o ordered \o When using the \c subdirs template, this option specifies that the directories listed should be processed in the order in which they are given. \row \o warn_on \o The compiler should output as many warnings as possible. This is ignored if \c warn_off is specified. \row \o warn_off \o The compiler should output as few warnings as possible. - \endtable + \row \o copy_dir_files \o Enables the install rule to also copy directories, not just files. + \endtable The \c debug_and_release option is special in that it enables \e both debug and release versions of a project to be built. In such a case, the Makefile that @@ -3400,6 +3405,9 @@ called \c{.qmake.cache} in parent directories of the current directory. If it fails to find this file, it will silently ignore this step of processing. + If it finds a \c{.qmake.cache} file then it will process this file first before + it processes the project file. + \target LibDepend \section1 Library Dependencies diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index 592af80..674169e 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -142,7 +142,7 @@ QAction::iconVisibleInMenu property. Menus that are currently open or menus already created in the native - Mac OS X menubar MAY NOT pick up a change in this attribute. Changes + Mac OS X menubar \e{may not} pick up a change in this attribute. Changes in the QAction::iconVisibleInMenu property will always be picked up. \value AA_NativeWindows Ensures that widgets have native windows. @@ -508,11 +508,11 @@ \value DirectConnection When emitted, the signal is immediately delivered to the slot. \value QueuedConnection When emitted, the signal is queued until the event loop is able to deliver it to the slot. - \value - BlockingQueuedConnection Same as QueuedConnection, except that the current thread blocks + \value BlockingQueuedConnection + Same as QueuedConnection, except that the current thread blocks until the slot has been delivered. This connection type should only be used for receivers in a different thread. Note that misuse - of this type can lead to dead locks in your application. + of this type can lead to deadlocks in your application. \value AutoConnection If the signal is emitted from the thread in which the receiving object lives, the slot is invoked directly, as with diff --git a/doc/src/qprintdialog.qdoc b/doc/src/qprintdialog.qdoc index 6cac1c9..a4cd18b 100644 --- a/doc/src/qprintdialog.qdoc +++ b/doc/src/qprintdialog.qdoc @@ -39,26 +39,34 @@ ** ****************************************************************************/ +#ifdef QT3_SUPPORT /*! - \fn QPrinter *QPrintDialog::printer() const + \fn QPrinter *QPrintDialog::printer() const - Returns a pointer to the printer this dialog configures, or 0 if - this dialog does not operate on any printer. + Returns a pointer to the printer this dialog configures, or 0 if + this dialog does not operate on any printer. + + This function is available for Unix platforms only. */ /*! - \fn void QPrintDialog::setPrinter(QPrinter *printer, bool pickupSettings) + \fn void QPrintDialog::setPrinter(QPrinter *printer, bool pickupSettings) + + Sets this dialog to configure printer \a printer, or no printer if \a printer + is null. If \a pickupSettings is true, the dialog reads most of + its settings from \a printer. If \a pickupSettings is false (the + default) the dialog keeps its old settings. - Sets this dialog to configure printer \a printer, or no printer if \a printer - is null. If \a pickupSettings is true, the dialog reads most of - its settings from \a printer. If \a pickupSettings is false (the - default) the dialog keeps its old settings. + This function is available for Unix platforms only. */ /*! - \fn void QPrintDialog::addButton(QPushButton *button) + \fn void QPrintDialog::addButton(QPushButton *button) + + Adds the \a button to the layout of the print dialog. The added + buttons are arranged from the left to the right below the + last groupbox of the printdialog. - Adds the \a button to the layout of the print dialog. The added - buttons are arranged from the left to the right below the - last groupbox of the printdialog. + This function is available for Unix platforms only. */ +#endif diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index cd66c10..5d83ef2 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -161,9 +161,9 @@ \o Support for OLE verbs and MIME data handling in \l{ActiveQt}. \endlist - For more information about improvements in the current release, see - the \l{http://www.qtsoftware.com/developer/changes/changes-4.1.4/} - {detailed list of changes}. + For more information about improvements in each Qt release, see + the \l{http://www.qtsoftware.com/developer/changes/} + {detailed lists of changes}. \section1 Significant Improvements @@ -447,11 +447,10 @@ \l{http://www.qtsoftware.com/developer/changes/changes-4.5.0}{available online}. A \l{Known Issues in %VERSION%}{list of known issues} for this release is also available. - \omit + Changes between this release and the previous release are provided in the \c{changes-%VERSION%} file (also \l{http://www.qtsoftware.com/developer/changes/changes-%VERSION%}{available online}). - \endomit A list of other Qt 4 features can be found on the \bold{\l{What's New in Qt 4}} page. diff --git a/doc/src/qtcocoa-known-issues.qdoc b/doc/src/qtcocoa-known-issues.qdoc deleted file mode 100644 index eedbd68..0000000 --- a/doc/src/qtcocoa-known-issues.qdoc +++ /dev/null @@ -1,168 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtcocoa-known-issues.html - \title Known Issues with the Qt/Mac Cocoa Port - - This document explains the current list of features in the Qt/Mac Cocoa port - that are currently not working. Most of the issues will be addressed in - upcoming snapshots and beta releases. We hope that all the issues should be - addressed by the time the of the final 4.5.0 release. - - \tableofcontents - - \section1 What Works - - Here are the things that we can say about the current state of the Qt/Mac Cocoa port. - - \list - \i \e{64-bit Support}: - The Qt libraries currently do build and link as 64-bit frameworks and it is - possible to build and run many of the Qt examples as 64-bit. - - \i \e{HIViews are now NSViews}: - Every QWidget is now backed by an NSView pointer instead of an HIViewRef. - QWidget::winId() will return an NSView pointer that can be used in other - Cocoa technologies (e.g., Core Animation). - - \i \e{Some Native Dialogs Work}: - QFileDialog and QColorDialog have been ported to use NSOpen-/NSSavePanel and - NSColorPanel respectively. QPrintDialog and QPageSetupDialog are not in - this release, but are on their way. Currently, none of these dialogs show - up as sheets pending the creation of an asynchronous API. - - \i \e{Painting, Printing, and Styles}: - Since printing and painting used Quartz 2D and styling used HITheme, these - sub-systems work without any changes. - - \i \e {OpenGL}: - OpenGL is fully supported,including pixel buffers and framebuffer objects. - - \i \e{Clipboard}: - Using QClipboard to copy and paste data works as expected. - - \i \e{Mouse, Keyboard, and Wheel events}: - Mouse, keyboard, and wheel events are dispatched to the proper - widget. The Qt/Mac Cocoa port respects Cocoa's idea of a "First - Responder." - - \endlist - - \section1 Current Known Issues - - The following are items that don't currently work, but that we plan to have - resolved before the final release of the Qt/Mac Cocoa port. Please do not - file bugs on these. - - \list - \i \e{Carbon Support}: - The current source tree for the Qt/Mac Cocoa port contains source for - building Qt/Mac with Cocoa. It contains some of the source code that is - used for the Carbon port, but it is currently not set up to build the - Carbon Qt/Mac libraries. Please use a normal release or snapshot if you - want to use Carbon. - - \i \e{Drag and Drop Support}: - Drag and Drop is currently not implemented and needs to be ported to Cocoa, - but using the clipboard does work at this time. - - \i \e {Accessibility}: - Accessibility support is not implemented and needs to be ported to Cocoa. - - \i \e {Text}: - Most text rendering works fine for Latin-1 characters. However, rendering - non-Latin-1 characters has not been tested. - - \i \e {Input Methods}: - Input methods also need to be ported to Cocoa. - - \i \e {Shortcuts}: - Shortcuts that exist outside of the menu bar may not be dispatched. - - \i \e {Tablet Support}: - The tablet support has not been ported from Carbon yet. However, it should - still be possible to use the tablet as a mouse. - - \i \e {Phonon}: - Phonon uses the QuickTime backend that is only available on 32-bit. Using - Phonon in 64-bit requires a QTKit-based backend and has not been done. - - \i \e {Unified Toolbar}: - The QMainWindow::setUnifiedTitleAndToolBarOnMac() method currently does nothing. - - \i \e {Dialogs, Tool Windows, Sheets, and Drawers}: - At the moment, all windows are subclasses of NSWindow. This means that - window types like drawers and sheets do not work and tool windows do not - get the right decorations. Modal dialogs do show up at the correct window - level, but are not yet considered "panels." Many window flags are not - recognized. - - \endlist - - \section1 Things We Don't Expect to Support - - The following items that we do not plan on spending any resources on unless - there is monumental outcry for their inclusion. - - \list - \i \e{Qt3Support}: - At this time we have no plans for making the Qt3Support module work with - the Qt/Mac Cocoa port in 64-bit mode. Following in footsteps of Apple, we - would like to encourage you to consider the time of going Cocoa and 64-bit - as a chance to jettison Qt 3 constructs and classes. - - \i \e{Support for versions of Mac OS X below 10.5}: - We are using methods and classes that are only available in 10.5 and - higher. Most of these functions don't have any equivalent on earlier - versions. We recommend using the Carbon version for earlier versions of Mac - OS X. We anticipate keeping the Carbon port supported at least for the - lifetime of 4.5. - - \i \e{Support for -no-framework or -static}: - Cocoa requires that we load a nib in order to properly access the global - menu bar. This nib has to reside on disk somewhere. The most logical place - for it to reside is inside the QtGui framework. For this reason, building - Qt as standard "dylibs" or statically is no longer supported. - - \endlist - -*/ diff --git a/doc/src/qtwebkit.qdoc b/doc/src/qtwebkit.qdoc deleted file mode 100644 index 0092950..0000000 --- a/doc/src/qtwebkit.qdoc +++ /dev/null @@ -1,189 +0,0 @@ -/*! - \module QtWebKit - \title QtWebKit Module - \contentspage Qt's Modules - \previouspage QtSvg - \nextpage QtXml - \ingroup architecture - \ingroup modules - \brief An introduction to the QtWebKit module. - - \keyword Browser - \keyword Web Browser - - \since 4.4 - - QtWebKit provides a Web browser engine that makes it easy to embed content - from the World Wide Web into your Qt application. At the same time Web - content can be enhanced with native controls. - - QtWebKit provides facilities for rendering of HyperText Markup Language - (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector - Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and - scripted with JavaScript. - - A bridge between the JavaScript execution environment and the Qt object - model makes it possible for custom QObjects to be scripted. Integration - with the Qt networking module enables Web pages to be transparently loaded - from Web servers, the local file system or even the Qt resource system. - - In addition to providing pure rendering features, HTML documents can be - made fully editable to the user through the use of the \c{contenteditable} - attribute on HTML elements. - - QtWebKit is based on the Open Source WebKit engine. More information about - WebKit itself can be found on the \l{WebKit Open Source Project} Web site. - - The QtWebKit module is part of the \l{Qt Full Framework Edition}, and the - \l{Open Source Versions of Qt}. - - \note Building the QtWebKit module with debugging symbols is problematic - on many platforms due to the size of the WebKit engine. We recommend - building the module in release mode only for embedded platforms. - - \note Web site icons, also known as "FavIcons", are currently not supported - on Windows. We plan to address this in a future release. - - \note WebKit has certain minimum requirements that must be met on - Embedded Linux systems. See the \l{Qt for Embedded Linux Requirements} - document for more information. - - Topics: - - \tableofcontents - - \section1 Configuring the Build Process - - Applications that use QtWebKit's classes need to be configured to be built - against the QtWebKit module. The following declaration in a \c qmake - project file ensures that an application is compiled and linked - appropriately: - - \snippet doc/src/snippets/code/doc_src_qtwebkit.qdoc 0 - - This line is necessary because only the QtCore and QtGui modules are used - in the default build process. - - To include the definitions of the module's classes, use the following - directive: - - \snippet doc/src/snippets/code/doc_src_qtwebkit.qdoc 1 - - \section1 Architecture - - The easiest way to render content is through the QWebView class. As a - widget it can be embedded into your forms or a graphics view, and it - provides convenience functions for downloading and rendering web sites. - - \snippet snippets/webkit/simple/main.cpp Using QWebView - - QWebView acts as a view onto Web pages, each of which is represented by an - instance of the QWebPage class. QWebPage provides access to the document - structure in a page, describing features such as frames, the navigation - history, and the undo/redo stack for editable content. - - HTML documents can be nested using frames in a frameset. An individual - frame in HTML is represented using the QWebFrame class. It includes the - bridge to the JavaScript window object and can be painted using QPainter. - Each QWebPage has one QWebFrame object as its main frame. - - Individual browser features, defaults and other settings can be configured - through the QWebSettings class. It is possible to provide defaults for all - QWebPage instances through the default settings. Individual attributes - can be overidden by the page specific settings object. - - \section1 Netscape Plugin Support - - Since WebKit supports the Netscape Plugin API, Qt applications can display - Web pages that embed common plugins, as long as the user has the appropriate - binary files for those plugins installed. - - The following locations are searched for plugins: - - \table - \header \o Linux/Unix \o Windows - \row \o{1,3} - \list - \o \c{.mozilla/plugins} in the user's home directory - \o \c{.netscape/plugins} in the user's home directory - \o System locations, such as - \list - \o \c{/usr/lib/browser/plugins} - \o \c{/usr/local/lib/mozilla/plugins} - \o \c{/usr/lib/firefox/plugins} - \o \c{/usr/lib64/browser-plugins} - \o \c{/usr/lib/browser-plugins} - \o \c{/usr/lib/mozilla/plugins} - \o \c{/usr/local/netscape/plugins} - \o \c{/opt/mozilla/plugins} - \o \c{/opt/mozilla/lib/plugins} - \o \c{/opt/netscape/plugins} - \o \c{/opt/netscape/communicator/plugins} - \o \c{/usr/lib/netscape/plugins} - \o \c{/usr/lib/netscape/plugins-libc5} - \o \c{/usr/lib/netscape/plugins-libc6} - \o \c{/usr/lib64/netscape/plugins} - \o \c{/usr/lib64/mozilla/plugins} - \endlist - \o Locations specified by environment variables: - \list - \o \c{$MOZILLA_HOME/plugins} - \o \c{$MOZ_PLUGIN_PATH} - \o \c{$QTWEBKIT_PLUGIN_PATH} - \endlist - \endlist - - \o - \list - \o The user's \c{Application Data\Mozilla\plugins} directory - \o Standard system locations of plugins for Quicktime, Flash, etc. - \endlist - - \row - \raw HTML - <th class="qt-style">Mac OS X</th> - \endraw - \row - \o - \list - \o \c{Library/Internet Plug-Ins} in the user's home directory - \o The system \c{/Library/Internet Plug-Ins} directory - \endlist - \endtable - - \section1 License Information - - This is a snapshot of the Qt port of WebKit. The exact version information - can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt. - - Qt Commercial Edition licensees that wish to distribute applications that - use the QtWebKit module need to be aware of their obligations under the - GNU Lesser General Public License (LGPL). - - Developers using the Open Source Edition can choose to redistribute - the module under the appropriate version of the GNU LGPL; version 2.1 - for applications and libraries licensed under the GNU GPL version 2, - or version 3 for applications and libraries licensed under the GNU - GPL version 2. - - \legalese - WebKit is licensed under the GNU Library General Public License. - Individual contributor names and copyright dates can be found - inline in the code. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - \endlegalese -*/ diff --git a/doc/src/sharedlibrary.qdoc b/doc/src/sharedlibrary.qdoc new file mode 100644 index 0000000..3febb8f --- /dev/null +++ b/doc/src/sharedlibrary.qdoc @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the Qt GUI Toolkit. +** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE +** +****************************************************************************/ + +/*! + \group deployment + \page sharedlibrary.html + \ingroup buildsystem + + \title Creating Shared Libraries + The following sections list certain things that should be taken into + account when creating shared libraries. + + \section1 Using Symbols from Shared Libraries + + Symbols - functions, variables or classes - contained in shared libraries + intended to be used by \e{clients}, such as applications or other + libraries, must be marked in a special way. These symbols are called + \e{public symbols} that are \e{exported} or made publicly visible. + + The remaining symbols should not be visible from the outside. On most + platforms, compilers will hide them by default. On some platforms, a + special compiler option is required to hide these symbols. + + When compiling a shared library, it must be marked for \e{export}. To use + the shared library from a client, some platforms may require a special + \e{import} declaration as well. + + Depending on your target platform, Qt provides special macros that contain + the necessary definitions: + \list + \o \c{Q_DECL_EXPORT} must be added to the declarations of symbols used + when compiling a shared library. + \o \c{Q_DECL_IMPORT} must be added to the declarations of symbols used + when compiling a client that uses the shared library. + \endlist + + Now, we need to ensure that the right macro is invoked -- whether we + compile a share library itself, or just the client using the shared + library. + Typically, this can be solved by adding a special header. + + Let us assume we want to create a shared library called \e{mysharedlib}. + A special header for this library, \c{mysharedlib_global.h}, looks like + this: + + \code + #include <QtCore/QtGlobal> + + #if defined(MYSHAREDLIB_LIBRARY) + # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT + #else + # define MYSHAREDLIB_EXPORT Q_DECL_IMPORT + #endif + \endcode + + In the \c{.pro} file of the shared library, we add: + + \code + DEFINES += MYSHAREDLIB_LIBRARY + \endcode + + In each header of the library, we specify the following: + + \code + #include "mysharedlib_global.h" + + MYSHAREDLIB_EXPORT void foo(); + class MYSHAREDLIB_EXPORT MyClass... + \endcode + This ensures that the right macro is seen by both library and clients. We + also use this technique in Qt's sources. + + + \section1 Header File Considerations + + Typically, clients will include only the public header files of shared + libraries. These libraries might be installed in a different location, when + deployed. Therefore, it is important to exclude other internal header files + that were used when building the shared library. + + For example, the library might provide a class that wraps a hardware device + and contains a handle to that device, provided by some 3rd-party library: + + \code + #include <footronics/device.h> + + class MyDevice { + private: + FOOTRONICS_DEVICE_HANDLE handle; + }; + \endcode + + A similar situation arises with forms created by Qt Designer when using + aggregation or multiple inheritance: + + \code + #include "ui_widget.h" + + class MyWidget : public QWidget { + private: + Ui::MyWidget m_ui; + }; + \endcode + + When deploying the library, there should be no dependency to the internal + headers \c{footronics/device.h} or \c{ui_widget.h}. + + This can be avoided by making use of the \e{Pointer to implementation} + idiom described in various C++ programming books. For classes with + \e{value semantics}, consider using QSharedDataPointer. + + + \section1 Binary compatibility + + For clients loading a shared library, to work correctly, the memory + layout of the classes being used must match exactly the memory layout of + the library version that was used to compile the client. In other words, + the library found by the client at runtime must be \e{binary compatible} + with the version used at compile time. + + This is usually not a problem if the client is a self-contained software + package that ships all the libraries it needs. + + However, if the client application relies on a shared library that belongs + to a different installation package or to the operating system, then we + need to think of a versioning scheme for shared libraries and decide at + which level \e{Binary compatibility} is to be maintained. For example, Qt + libraries of the same \e{major version number} are guaranteed to be binary + compatible. + + Maintaining \e{Binary compatibility} places some restrictions on the changes + you can make to the classes. A good explanation can be found at + \l{http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++} + {KDE - Policies/Binary Compatibility Issues With C++}. These issues should + be considered right from the start of library design. + We recommend that the principle of \e{Information hiding} and the + \e{Pointer to implementation} technique be used wherever possible. +*/ diff --git a/doc/src/snippets/alphachannel.cpp b/doc/src/snippets/alphachannel.cpp index 7783271..ad0885a 100644 --- a/doc/src/snippets/alphachannel.cpp +++ b/doc/src/snippets/alphachannel.cpp @@ -47,11 +47,8 @@ #include <qfile.h> #include <qdir.h> #include <qfileinfo.h> - -#if (QT_VERSION) >= 0x040000 #include <QtGui> #include <QtCore> -#endif class MyClass : public QWidget { @@ -95,12 +92,10 @@ protected: //! [0] } - QPixmap channelImage, pixmap; + QPixmap channelImage, pixmap; QSize sizeHint() const { return QSize(500, 500); } }; - - int main(int argc, char **argv) { QApplication app(argc, argv); diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index f048f7c..2930317 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -44,7 +44,7 @@ PATH - to locate qmake, moc and other Qt tools //! [8] C: -cd /D C:\Qt\4.4.0-rc1 +cd /D C:\Qt\%VERSION% configure //! [8] diff --git a/doc/src/snippets/code/doc_src_qtestlib.qdoc b/doc/src/snippets/code/doc_src_qtestlib.qdoc index a4ef52e..a0e4944 100644 --- a/doc/src/snippets/code/doc_src_qtestlib.qdoc +++ b/doc/src/snippets/code/doc_src_qtestlib.qdoc @@ -61,7 +61,7 @@ void TestQString::toUpper() //! [9] -/myTestDirectory$ qmake -project "QT += testlib" +/myTestDirectory$ qmake -project "CONFIG += qtestlib" /myTestDirectory$ qmake /myTestDirectory$ make //! [9] @@ -69,7 +69,7 @@ void TestQString::toUpper() //! [10] ********* Start testing of TestQString ********* -Config: Using QTest library 4.1.0, Qt 4.1.0 +Config: Using QTest library %VERSION%, Qt %VERSION% PASS : TestQString::initTestCase() PASS : TestQString::toUpper() PASS : TestQString::cleanupTestCase() @@ -99,4 +99,4 @@ private slots: } } }; -//! [12]
\ No newline at end of file +//! [12] diff --git a/doc/src/snippets/code/doc_src_qtwebkit.qdoc b/doc/src/snippets/code/doc_src_qtwebkit.qdoc deleted file mode 100644 index d4fc2bd..0000000 --- a/doc/src/snippets/code/doc_src_qtwebkit.qdoc +++ /dev/null @@ -1,8 +0,0 @@ -//! [0] -QT += webkit -//! [0] - - -//! [1] -#include <QtWebKit> -//! [1] diff --git a/doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp b/doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp deleted file mode 100644 index f04cd29..0000000 --- a/doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -void wrapInFunction() -{ - -//! [0] - view->page()->history(); -//! [0] - - -//! [1] - view->page()->settings(); -//! [1] - - -//! [2] - view->triggerAction(QWebPage::Copy); -//! [2] - - -//! [3] - view->page()->triggerPageAction(QWebPage::Stop); -//! [3] - - -//! [4] - view->page()->triggerPageAction(QWebPage::GoBack); -//! [4] - - -//! [5] - view->page()->triggerPageAction(QWebPage::GoForward); -//! [5] - -} - diff --git a/doc/src/snippets/code/src_corelib_global_qglobal.cpp b/doc/src/snippets/code/src_corelib_global_qglobal.cpp index 72663e9..287181a 100644 --- a/doc/src/snippets/code/src_corelib_global_qglobal.cpp +++ b/doc/src/snippets/code/src_corelib_global_qglobal.cpp @@ -456,3 +456,11 @@ class MyClass : public QObject //! [45] QWidget w = QWidget(); //! [45] + +//! [46] + // Instead of comparing with 0.0 + qFuzzyCompare(0.0,1.0e-200); // This will return false + // Compare adding 1 to both values will fix the problem + qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true +//! [46] + diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp index 355a237..783852b 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp @@ -33,7 +33,7 @@ MyStruct s2 = var.value<MyStruct>(); //! [3] int id = QMetaType::type("MyClass"); -if (id != -1) { +if (id == 0) { void *myClassPtr = QMetaType::construct(id); ... QMetaType::destroy(id, myClassPtr); diff --git a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp index a9c630b..5001984 100644 --- a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp +++ b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp @@ -11,7 +11,10 @@ public slots: QDesktopServices::setUrlHandler("help", helpInstance, "showHelp"); //! [0] - //! [1] mailto:user@foo.com?subject=Test&body=Just a test //! [1] + +//! [2] +QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode)); +//! [2] diff --git a/doc/src/snippets/code/src_qdbus_qdbusargument.cpp b/doc/src/snippets/code/src_qdbus_qdbusargument.cpp index b982510..efd54ac 100644 --- a/doc/src/snippets/code/src_qdbus_qdbusargument.cpp +++ b/doc/src/snippets/code/src_qdbus_qdbusargument.cpp @@ -4,7 +4,7 @@ struct MyStructure int count; QString name; }; -QT_DECLARE_METATYPE(MyStructure) +Q_DECLARE_METATYPE(MyStructure) // Marshall the MyStructure data into a D-Bus argument QDBusArgument &operator<<(QDBusArgument &argument, const MyStructure &mystruct) diff --git a/doc/src/snippets/webkit/simple/simple.pro b/doc/src/snippets/webkit/simple/simple.pro deleted file mode 100644 index 61cd3bf..0000000 --- a/doc/src/snippets/webkit/simple/simple.pro +++ /dev/null @@ -1,2 +0,0 @@ -QT += webkit -SOURCES = main.cpp diff --git a/doc/src/snippets/webkit/webpage/main.cpp b/doc/src/snippets/webkit/webpage/main.cpp deleted file mode 100644 index b433ac2..0000000 --- a/doc/src/snippets/webkit/webpage/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include <QtGui> -#include <QWebPage> -#include <QWebFrame> - -//! [0] -class Thumbnailer : public QObject -{ - Q_OBJECT - -public: - Thumbnailer(const QUrl &url); - -signals: - void finished(); - -private slots: - void render(); - -private: - QWebPage page; - -}; -//! [0] - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Thumbnailer thumbnail(QUrl("http://qtsoftware.com")); - - QObject::connect(&thumbnail, SIGNAL(finished()), - &app, SLOT(quit())); - - return app.exec(); -} - -//! [1] -Thumbnailer::Thumbnailer(const QUrl &url) -{ - page.mainFrame()->load(url); - connect(&page, SIGNAL(loadFinished(bool)), - this, SLOT(render())); -} -//! [1] - -//! [2] -void Thumbnailer::render() -{ - page.setViewportSize(page.mainFrame()->contentsSize()); - QImage image(page.viewportSize(), QImage::Format_ARGB32); - QPainter painter(&image); - - page.mainFrame()->render(&painter); - painter.end(); - - QImage thumbnail = image.scaled(400, 400); - thumbnail.save("thumbnail.png"); - - emit finished(); -} -//! [2] -#include "main.moc" diff --git a/doc/src/snippets/webkit/webpage/webpage.pro b/doc/src/snippets/webkit/webpage/webpage.pro deleted file mode 100644 index fcad03b..0000000 --- a/doc/src/snippets/webkit/webpage/webpage.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG += console -QT += webkit -SOURCES = main.cpp
\ No newline at end of file diff --git a/doc/src/tutorials/addressbook-sdk.qdoc b/doc/src/tutorials/addressbook-sdk.qdoc deleted file mode 100644 index b6b257d..0000000 --- a/doc/src/tutorials/addressbook-sdk.qdoc +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page tutorials-addressbook-sdk.html - - \startpage {index.html}{Qt Reference Documentation} - \nextpage \l{Designing the User Interface}{Chapter 1} - - \title Address Book Tutorial - \ingroup howto - \ingroup tutorials - \brief An introduction to GUI programming with Qt and Qt Creator, - describing in detail how to put together a simple yet fully- - functioning application. - - This tutorial gives an introduction to GUI programming using the Qt SDK. - - ### Screenshot - - In the process, we will learn about some basic technologies provided by - Qt, such as: - - \list - \o Widgets and layout managers - \o Container classes - \o Signals and slots - \o Input and output devices - \endlist - - If you are completely new to Qt, please read \l{How to Learn Qt} if you - have not already done so. - - The tutorial's source code is located in Qt's - \c{examples/tutorials/addressbook} directory. - - Tutorial chapters: - - \list 1 - \o \l{Designing the User Interface} - \o \l{Adding Addresses} - \o \l{Navigating between Entries} - \o \l{Editing and Removing Addresses} - \o \l{Adding a Find Function} - \o \l{Loading and Saving} - \o \l{Additional Features} - \endlist - - Although this little application does not look much like a fully-fledged - modern GUI application, it uses many of the basic techniques that are used - in more complex applications. After you have worked through it, we - recommend checking out the \l{mainwindows/application}{Application} - example, which presents a small GUI application, with menus, toolbars, a - status bar, and so on. -*/ - - -/*! - \page tutorials-addressbook-sdk-part1.html - \contentspage {Address Book Tutorial}{Contents} - \nextpage \l{Adding Addresses}{Chapter 2} - \title Address Book 1 - Designing the User Interface - - The first part of this tutorial covers the design of the basic graphical - user interface (GUI) we use for the Address Book application. - - The first step to creating a GUI program is to design the user interface. - In this chapter, our goal is to set up the labels and input fields needed - to implement a basic address book application. The figure below is a - screenshot of our expected output. - - \image addressbook-tutorial-part1-screenshot.png - - We begin by launching Qt Creator and use it to generate a new project. To - do this, select \gui New from the \gui File menu. In the - \gui{New File or Project} dialog. Follow the step by step guide on how to - create a \gui Project with Qt Creator, refer to the document - \l{Creating a Project in Qt Creator}{here}. Ensure that you select QWidget - as your subclass and name it \c AddressBook. - - There are five files generated in this \gui{Project}: - - \list - \o \c{addressbook.pro} - the project file, - \o \c{addressbook.h} - the definition file for the \c AddressBook - class, - \o \c{addressbook.cpp} - the implementation file for the - \c AddressBook class, - \o \c{main.cpp} - the file containing a \c main() function, with an - instance of \c AddressBook, and - \o \c{addressbook.ui} - the user interface file created with \QD. - \endlist - - Now we have all the files we need, let's move on to designing the user - interface. - - \section1 Placing the Widgets on the Form - - In the \gui{Project Sidebar}, double-click on the \c{addressbook.ui} file. - The \QD plugin will be launched, allowing you to design your program's user - interface. - - We require two \l{QLabel}s to label the input fields as well as a - QLineEdit and a QTextEdit as the input fields. So, drag those widgets from - the \gui{Widget Box} to your form. In the \gui{Property Editor}, set their - \gui{objectName} property to \c nameLabel and \c addressLabel for the - \l{QLabel}s, \c nameLine for the QLineEdit and finally, \c addressText for - the QTextEdit. - - Next, we have to position the widgets properly, according to the screenshot - earlier. We use a QGridLayout to position our labels and input fields in a - structured manner. QGridLayout divides the available space into a grid and - places widgets in the cells we specify with row and column numbers. The - diagram below shows the layout cells and the position of our widgets. - - \image addressbook-tutorial-part1-labeled-screenshot.png - - - \section1 Qt Programming - Subclassing - - When writing Qt programs, we usually subclass Qt objects to add - functionality. This is one of the essential concepts behind creating custom - widgets or collections of standard widgets. Subclassing to extend or change - the behavior of a widget has the following advantages: - - \list - \o We can write implementations of virtual or pure virtual functions - to obtain exactly what we need, falling back on the base class's - implementation when necessary. - \o It allows us to encapsulate parts of the user interface within a - class, so that the other parts of the application do not need to - know about the individual widgets in the user interface. - \o The subclass can be used to create multiple custom widgets in the - same application or library, and the code for the subclass can be - reused in other projects. - \endlist - - - - -*/ diff --git a/doc/src/tutorials/widgets-tutorial.qdoc b/doc/src/tutorials/widgets-tutorial.qdoc index ce977f3..ead44af 100644 --- a/doc/src/tutorials/widgets-tutorial.qdoc +++ b/doc/src/tutorials/widgets-tutorial.qdoc @@ -80,7 +80,7 @@ \raw HTML <table align="left" width="100%"> - <tr><td> + <tr class="qt-code"><td> \endraw \snippet snippets/widgets-tutorial/toplevel/main.cpp create, resize and show \raw HTML @@ -98,7 +98,7 @@ \raw HTML <table align="left" width="100%"> - <tr><td> + <tr class="qt-code"><td> \endraw \snippet snippets/widgets-tutorial/childwidget/main.cpp create, position and show \raw HTML @@ -123,7 +123,7 @@ \raw HTML <table align="left" width="100%"> - <tr><td> + <tr class="qt-code"><td> \endraw \snippet snippets/widgets-tutorial/windowlayout/main.cpp create, lay out widgets and show \raw HTML @@ -157,7 +157,7 @@ \raw HTML <table align="left" width="100%"> - <tr><td> + <tr class="qt-code"><td> \endraw \snippet snippets/widgets-tutorial/nestedlayouts/main.cpp create, lay out widgets and show \raw HTML @@ -171,23 +171,4 @@ As well as QHBoxLayout and QVBoxLayout, Qt also provides QGridLayout and QFormLayout classes to help with more complex user interfaces. - - - - \omit - In the simple example below, the widget is created on the stack and will - automatically be deleted when the \c{main()} function exits. - - {{{#include <QtGui> - - int main(int argc, char *argv[]) - { - QApplication app(argc, argv); - QWidget window; - window.resize(480, 360); - window.show(); - return app.exec(); - } - }}} - \endomit */ |