diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-02-15 11:20:37 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-02-15 11:20:37 (GMT) |
commit | 3a20058dee330b77d4b906695343d643077fa999 (patch) | |
tree | 93f35d95c0f2966556452a299822f499b4cdedae /doc/src/frameworks-technologies | |
parent | e61abd249d4148c05b6c24ff787ff98978bbc2f9 (diff) | |
parent | bb9b7f0517abb92ec5ed8b293f0b56a751718096 (diff) | |
download | Qt-3a20058dee330b77d4b906695343d643077fa999.zip Qt-3a20058dee330b77d4b906695343d643077fa999.tar.gz Qt-3a20058dee330b77d4b906695343d643077fa999.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'doc/src/frameworks-technologies')
-rw-r--r-- | doc/src/frameworks-technologies/accessible.qdoc | 2 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/activeqt-container.qdoc | 4 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/activeqt-server.qdoc | 36 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/containers.qdoc | 48 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/dbus-adaptors.qdoc | 26 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/graphicsview.qdoc | 14 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/implicit-sharing.qdoc | 4 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/model-view-programming.qdoc | 16 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/phonon.qdoc | 2 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/plugins-howto.qdoc | 10 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/qthelp.qdoc | 2 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/richtext.qdoc | 14 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/unicode.qdoc | 8 |
13 files changed, 93 insertions, 93 deletions
diff --git a/doc/src/frameworks-technologies/accessible.qdoc b/doc/src/frameworks-technologies/accessible.qdoc index 1d15dbd..e7bf171 100644 --- a/doc/src/frameworks-technologies/accessible.qdoc +++ b/doc/src/frameworks-technologies/accessible.qdoc @@ -256,7 +256,7 @@ variable set to 1. For example, this is set in the following way with the bash shell: - \snippet doc/src/snippets/code/doc_src_qt4-accessibility.qdoc environment + \snippet doc/src/snippets/code/doc_src_qt4-accessibility.cpp environment Accessibility features are built into Qt by default when the libraries are configured and built. diff --git a/doc/src/frameworks-technologies/activeqt-container.qdoc b/doc/src/frameworks-technologies/activeqt-container.qdoc index 436f375..862408b 100644 --- a/doc/src/frameworks-technologies/activeqt-container.qdoc +++ b/doc/src/frameworks-technologies/activeqt-container.qdoc @@ -67,7 +67,7 @@ To build Qt applications that can host COM objects and ActiveX controls link the application against the QAxContainer module by adding - \snippet doc/src/snippets/code/doc_src_qaxcontainer.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qaxcontainer.pro 0 to your application's \c .pro file. @@ -128,7 +128,7 @@ want to use, or integrate it into the build system by adding the type libraries to the \c TYPELIBS variable in your application's \c .pro file: - \snippet doc/src/snippets/code/doc_src_qaxcontainer.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qaxcontainer.pro 1 Note that \l dumpcpp might not be able to expose all APIs in the type library. diff --git a/doc/src/frameworks-technologies/activeqt-server.qdoc b/doc/src/frameworks-technologies/activeqt-server.qdoc index 9af2b65..77cacf8 100644 --- a/doc/src/frameworks-technologies/activeqt-server.qdoc +++ b/doc/src/frameworks-technologies/activeqt-server.qdoc @@ -60,10 +60,10 @@ An out-of-process executable server is generated from a \c .pro file like this: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qaxserver.pro 0 To build an in-process server, use a \c .pro file like this: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qaxserver.pro 1 The files \c qaxserver.rc and \c qaxserver.def are part of the framework and can be used from their usual location (specify a @@ -91,7 +91,7 @@ Additionally you can specify a version number using the \c VERSION variable, e.g. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 2 + \snippet doc/src/snippets/code/doc_src_qaxserver.pro 2 The version number specified will be used as the version of the type library and of the server when registering. @@ -186,12 +186,12 @@ or any existing QObject subclass. If the class is a subclass of QWidget, the COM object will be an ActiveX control. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 3 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 3 The Q_OBJECT macro is required to provide the meta object information about the widget to the ActiveQt framework. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 4 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 4 Use the Q_CLASSINFO() macro to specify the COM identifiers for the COM object. \c ClassID and \c InterfaceID are required, while \c EventsID is @@ -201,7 +201,7 @@ You can specify additional attributes for each of your classes; see \l{Class Information and Tuning} for details. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 5 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 5 Use the Q_PROPERTY() macro to declare properties for the ActiveX control. @@ -216,7 +216,7 @@ your implementation of QAxFactory::create. \endfootnote - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 6 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 6 The ActiveQt framework will expose properties and public slots as ActiveX properties and methods, and signals as ActiveX events, and convert between @@ -428,7 +428,7 @@ To make the properties bindable for the ActiveX client, use multiple inheritance from the QAxBindable class: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 7 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 7 When implementing the property write functions, use the QAxBindable class's requestPropertyChange() and propertyChanged() @@ -453,7 +453,7 @@ an implementation of a QAxFactory. The easist way to do this is to use a set of macros: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 8 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 8 This will export \c MyWidget and \c MyWidget2 as COM objects that can be created by COM clients, and will register \c MySubType as a type that can @@ -470,7 +470,7 @@ server. Use QAxFactory::isServer() to create and run a standard application interface, or to prevent a stand-alone execution: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 9 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 9 This is however not necessary as ActiveQt provides a default implementation of a main function. The default implemenation calls QAxFactory::startServer(), @@ -512,7 +512,7 @@ macro, the QAxFactory subclass had no appropriate constructor. Provide a public class constructor like - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 10 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 10 for your factory class. @@ -560,7 +560,7 @@ your installer process, resolve the \c DllRegisterServer symbol and call the function: - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 11 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 11 \section3 Distributing Servers over the Internet @@ -766,7 +766,7 @@ own API, and is available in the "Insert Objects" dialog of Microsoft Office applications. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 15 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 15 \section2 Developing Licensed Components @@ -782,7 +782,7 @@ To mark a Qt class as licensed specify a "LicenseKey" using the Q_CLASSINFO() macro. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 16 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 16 The key is required to be able to create an instance of \c MyLicensedControl on a machine that is not licensed itself. The licensed developer can now @@ -805,12 +805,12 @@ Create a new subclass of QAxAggregated and use multiple inheritance to subclass additional COM interface classes. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 17 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 17 Reimplement the QAxAggregated::queryInterface() function to support the additional COM interfaces. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 18 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 18 Since \c ISomeCOMInterface is a subclass of \c IUnknown you will have to implement the \c QueryInterface(), \c AddRef(), and \c @@ -820,7 +820,7 @@ returned by the QAxAggregated::controllingUnknown() function, e.g. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 19 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 19 Do not support the \c IUnknown interface itself in your \l{QAxAggregated::queryInterface()}{queryInterface()} @@ -833,5 +833,5 @@ QAxBindable::createAggregate() to return a new object of the QAxAggregated subclass. - \snippet doc/src/snippets/code/doc_src_qaxserver.qdoc 20 + \snippet doc/src/snippets/code/doc_src_qaxserver.cpp 20 */ diff --git a/doc/src/frameworks-technologies/containers.qdoc b/doc/src/frameworks-technologies/containers.qdoc index 991588e..f28e5dc 100644 --- a/doc/src/frameworks-technologies/containers.qdoc +++ b/doc/src/frameworks-technologies/containers.qdoc @@ -205,7 +205,7 @@ Here's an example custom data type that meets the requirement of an assignable data type: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 0 + \snippet doc/src/snippets/code/doc_src_containers.cpp 0 If we don't provide a copy constructor or an assignment operator, C++ provides a default implementation that performs a @@ -306,7 +306,7 @@ Here's a typical loop for iterating through all the elements of a QList<QString> in order and printing them to the console: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 1 + \snippet doc/src/snippets/code/doc_src_containers.cpp 1 It works as follows: The QList to iterate over is passed to the QListIterator constructor. At that point, the iterator is located @@ -319,7 +319,7 @@ Here's how to iterate backward in a QList: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 2 + \snippet doc/src/snippets/code/doc_src_containers.cpp 2 The code is symmetric with iterating forward, except that we start by calling \l{QListIterator::toBack()}{toBack()} @@ -358,7 +358,7 @@ QMutableListIterator. Here's an example where we remove all odd numbers from a QList<int> using QMutableListIterator: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 3 + \snippet doc/src/snippets/code/doc_src_containers.cpp 3 The next() call in the loop is made every time. It jumps over the next item in the list. The @@ -368,13 +368,13 @@ the iterator, so it is safe to continue using it. This works just as well when iterating backward: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 4 + \snippet doc/src/snippets/code/doc_src_containers.cpp 4 If we just want to modify the value of an existing item, we can use \l{QMutableListIterator::setValue()}{setValue()}. In the code below, we replace any value larger than 128 with 128: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 5 + \snippet doc/src/snippets/code/doc_src_containers.cpp 5 Just like \l{QMutableListIterator::remove()}{remove()}, \l{QMutableListIterator::setValue()}{setValue()} operates on the @@ -387,7 +387,7 @@ operations, we don't even need \l{QMutableListIterator::setValue()}{setValue()}: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 6 + \snippet doc/src/snippets/code/doc_src_containers.cpp 6 As mentioned above, QLinkedList's, QVector's, and QSet's iterator classes have exactly the same API as QList's. We will now turn to @@ -410,7 +410,7 @@ The following example removes all (capital, country) pairs where the capital's name ends with "City": - \snippet doc/src/snippets/code/doc_src_containers.qdoc 7 + \snippet doc/src/snippets/code/doc_src_containers.cpp 7 QMapIterator also provides a key() and a value() function that operate directly on the iterator and that return the key and @@ -418,7 +418,7 @@ example, the following code copies the contents of a QMap into a QHash: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 8 + \snippet doc/src/snippets/code/doc_src_containers.cpp 8 If we want to iterate through all the items with the same value, we can use \l{QMapIterator::findNext()}{findNext()} @@ -426,7 +426,7 @@ Here's an example where we remove all the items with a particular value: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 9 + \snippet doc/src/snippets/code/doc_src_containers.cpp 9 \section2 STL-Style Iterators @@ -473,7 +473,7 @@ Here's a typical loop for iterating through all the elements of a QList<QString> in order and converting them to lowercase: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 10 + \snippet doc/src/snippets/code/doc_src_containers.cpp 10 Unlike \l{Java-style iterators}, STL-style iterators point directly at items. The begin() function of a container returns an @@ -493,7 +493,7 @@ decrement the iterator \e before we access the item. This requires a \c while loop: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 11 + \snippet doc/src/snippets/code/doc_src_containers.cpp 11 In the code snippets so far, we used the unary \c * operator to retrieve the item (of type QString) stored at a certain iterator @@ -504,7 +504,7 @@ For read-only access, you can use const_iterator, constBegin(), and constEnd(). For example: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 12 + \snippet doc/src/snippets/code/doc_src_containers.cpp 12 The following table summarizes the STL-style iterators' API: @@ -536,7 +536,7 @@ value() function to retrieve the value. For example, here's how we would print all items in a QMap to the console: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 13 + \snippet doc/src/snippets/code/doc_src_containers.cpp 13 Thanks to \l{implicit sharing}, it is very inexpensive for a function to return a container per value. The Qt API contains @@ -545,7 +545,7 @@ using an STL iterator, you should always take a copy of the container and iterate over the copy. For example: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 14 + \snippet doc/src/snippets/code/doc_src_containers.cpp 14 This problem doesn't occur with functions that return a const or non-const reference to a container. @@ -567,35 +567,35 @@ statement. For example, here's how to use \c foreach to iterate over a QLinkedList<QString>: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 15 + \snippet doc/src/snippets/code/doc_src_containers.cpp 15 The \c foreach code is significantly shorter than the equivalent code that uses iterators: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 16 + \snippet doc/src/snippets/code/doc_src_containers.cpp 16 Unless the data type contains a comma (e.g., \c{QPair<int, int>}), the variable used for iteration can be defined within the \c foreach statement: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 17 + \snippet doc/src/snippets/code/doc_src_containers.cpp 17 And like any other C++ loop construct, you can use braces around the body of a \c foreach loop, and you can use \c break to leave the loop: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 18 + \snippet doc/src/snippets/code/doc_src_containers.cpp 18 With QMap and QHash, \c foreach accesses the value component of the (key, value) pairs. If you want to iterate over both the keys and the values, you can use iterators (which are fastest), or you can write code like this: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 19 + \snippet doc/src/snippets/code/doc_src_containers.cpp 19 For a multi-valued map: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 20 + \snippet doc/src/snippets/code/doc_src_containers.cpp 20 Qt automatically takes a copy of the container when it enters a \c foreach loop. If you modify the container as you are @@ -611,12 +611,12 @@ In addition to \c foreach, Qt also provides a \c forever pseudo-keyword for infinite loops: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 21 + \snippet doc/src/snippets/code/doc_src_containers.cpp 21 If you're worried about namespace pollution, you can disable these macros by adding the following line to your \c .pro file: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 22 + \snippet doc/src/snippets/code/doc_src_containers.cpp 22 \section1 Other Container-Like Classes @@ -736,7 +736,7 @@ Consider the following code, which builds a QString from another QString: - \snippet doc/src/snippets/code/doc_src_containers.qdoc 23 + \snippet doc/src/snippets/code/doc_src_containers.cpp 23 We build the string \c out dynamically by appending one character to it at a time. Let's assume that we append 15000 characters to diff --git a/doc/src/frameworks-technologies/dbus-adaptors.qdoc b/doc/src/frameworks-technologies/dbus-adaptors.qdoc index 7494f2d..82545db 100644 --- a/doc/src/frameworks-technologies/dbus-adaptors.qdoc +++ b/doc/src/frameworks-technologies/dbus-adaptors.qdoc @@ -85,14 +85,14 @@ using an adaptor. A sample usage of QDBusAbstractAdaptor is as follows: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 0 The code above would create an interface that could be represented more or less in the following canonical representation: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 1 This adaptor could be used in the application's main function as follows - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 2 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 2 Break-down analysis: \tableofcontents @@ -100,7 +100,7 @@ \section1 The header The header of the example is: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 3 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 3 The code does the following: \list @@ -112,10 +112,10 @@ \section1 The properties The properties are declared as follows: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 4 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 4 And are implemented as follows: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 5 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 5 The code declares three properties: one of them is a read-write property called "caption" of string type. The other two are read-only, also of the string type. @@ -129,7 +129,7 @@ \section1 The constructor The constructor: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 6 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 6 The constructor does the following: \list @@ -149,7 +149,7 @@ \section1 Slots/methods The public slots in the example (which will be exported as D-Bus methods) are the following: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 7 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 7 This snippet of code defines 4 methods with different properties each: \list 1 @@ -176,7 +176,7 @@ \section1 Signals The signals in this example are defined as follows: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 8 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 8 However, signal definition isn't enough: signals have to be emitted. One simple way of emitting signals is to connect another signal to them, so that Qt's signal handling system chains them @@ -187,7 +187,7 @@ When simple signal-to-signal connection isn't enough, one can use a private slot do do some work. This is what was done for the mainWindowHasFocus signal: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 9 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 9 This private slot (which will not be exported as a method via D-Bus) was connected to the \c focusChanged signal in the adaptor's constructor. It is therefore able to shape the @@ -291,7 +291,7 @@ \l{QDBusMessage::setDelayedReply()}{QDBusMessage::setDelayedReply(true)} that the response will be sent later. - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 10 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 10 The use of \l{QDBusConnection::send()}{QDBusConnection::sessionBus().send(data->reply)} @@ -303,7 +303,7 @@ using the \c QDBusMessage object that was obtained. In our example, the reply code could be something as follows: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 11 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 11 As can be seen in the example, when a delayed reply is in place, the return value(s) from the slot will be ignored by QtDBus. They @@ -473,7 +473,7 @@ You can use this macro in your own adaptors by placing it before your method's return value (which must be "void") in the class declaration, as shown in the example: - \snippet doc/src/snippets/code/doc_src_qdbusadaptors.qdoc 12 + \snippet doc/src/snippets/code/doc_src_qdbusadaptors.cpp 12 Its presence in the method implementation (outside the class declaration) is optional. diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc index f689446..1903df5 100644 --- a/doc/src/frameworks-technologies/graphicsview.qdoc +++ b/doc/src/frameworks-technologies/graphicsview.qdoc @@ -95,7 +95,7 @@ descending stacking order (i.e., the first returned item is topmost, and the last item is bottom-most). - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 0 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 0 QGraphicsScene's event propagation architecture schedules scene events for delivery to items, and also manages propagation between items. If @@ -126,7 +126,7 @@ enable OpenGL support, you can set a QGLWidget as the viewport by calling QGraphicsView::setViewport(). - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 1 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 1 The view receives input events from the keyboard and mouse, and translates these to scene events (converting the coordinates used @@ -333,7 +333,7 @@ Here is an example of how to implement zoom and rotate slots in a subclass of QGraphicsView: - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 2 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 2 The slots could be connected to \l{QToolButton}{QToolButtons} with \l{QAbstractButton::autoRepeat}{autoRepeat} enabled. @@ -353,7 +353,7 @@ a QPainter to either of the rendering functions. This example shows how to print the whole scene into a full page, using QPrinter. - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 3 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 3 The difference between the scene and view rendering functions is that one operates in scene coordinates, and the other in view coordinates. @@ -364,7 +364,7 @@ is to render the exact contents of the viewport using the provided painter. - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 4 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 4 When the source and target areas' sizes do not match, the source contents are stretched to fit into the target area. By passing a @@ -390,7 +390,7 @@ so in mousePressEvent() or mouseMoveEvent(), you can get the originating widget pointer from the event. For example: - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 5 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 5 To intercept drag and drop events for the scene, you reimplement QGraphicsScene::dragEnterEvent() and whichever event handlers your @@ -449,7 +449,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_graphicsview.qdoc 6 + \snippet doc/src/snippets/code/doc_src_graphicsview.cpp 6 \section2 Item Groups diff --git a/doc/src/frameworks-technologies/implicit-sharing.qdoc b/doc/src/frameworks-technologies/implicit-sharing.qdoc index 8938d9e..46567e9 100644 --- a/doc/src/frameworks-technologies/implicit-sharing.qdoc +++ b/doc/src/frameworks-technologies/implicit-sharing.qdoc @@ -109,7 +109,7 @@ data in all member functions that change the internal data. Code fragment: - \snippet doc/src/snippets/code/doc_src_groups.qdoc 0 + \snippet doc/src/snippets/code/doc_src_groups.cpp 0 \section1 List of Classes @@ -124,7 +124,7 @@ concern for the copying overhead. Example: - \snippet doc/src/snippets/code/doc_src_groups.qdoc 1 + \snippet doc/src/snippets/code/doc_src_groups.cpp 1 In this example, \c p1 and \c p2 share data until QPainter::begin() is called for \c p2, because painting a pixmap will modify it. diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc index 92067b9..58b51e5 100644 --- a/doc/src/frameworks-technologies/model-view-programming.qdoc +++ b/doc/src/frameworks-technologies/model-view-programming.qdoc @@ -32,7 +32,7 @@ /*! \page model-view-programming.html - \ingroup qt-basic-concepts + \ingroup qt-basic-concepts \title Model/View Programming \brief A guide to Qt's extensible model/view architecture. @@ -328,7 +328,7 @@ contain a pointer to the model that created them, and this prevents confusion when working with more than one model. - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 0 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 0 Model indexes provide \e temporary references to pieces of information, and can be used to retrieve or modify data via the model. Since models may @@ -355,7 +355,7 @@ item by specifying its row and column numbers to the model, and we receive an index that represents the item: - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 1 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 1 Models that provide interfaces to simple, single level data structures like lists and tables do not need any other information to be provided but, as @@ -371,7 +371,7 @@ index that refers to an item of data by passing the relevant row and column numbers to the model. - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 2 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 2 Top level items in a model are always referenced by specifying \c QModelIndex() as their parent item. This is discussed in the next @@ -392,7 +392,7 @@ about the item's parent. Outside the model, the only way to refer to an item is through a model index, so a parent model index must also be given: - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 3 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 3 \table \row \i \inlineimage modelview-treemodel.png @@ -403,12 +403,12 @@ Items "A" and "C" are represented as top-level siblings in the model: - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 4 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 4 Item "A" has a number of children. A model index for item "B" is obtained with the following code: - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 5 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 5 \endtable \section3 Item roles @@ -423,7 +423,7 @@ corresponding to the item, and by specifying a role to obtain the type of data we want: - \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 6 + \snippet doc/src/snippets/code/doc_src_model-view-programming.cpp 6 \table \row \i \inlineimage modelview-roles.png diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc index 1456eae6..9eb56ea 100644 --- a/doc/src/frameworks-technologies/phonon.qdoc +++ b/doc/src/frameworks-technologies/phonon.qdoc @@ -165,7 +165,7 @@ The \c .pro file for a project needs the following line to be added: - \snippet doc/src/snippets/code/doc_src_phonon.qdoc 0 + \snippet doc/src/snippets/code/doc_src_phonon.pro 0 Phonon comes with several widgets that provide functionality commonly associated with multimedia players - notably SeekSlider diff --git a/doc/src/frameworks-technologies/plugins-howto.qdoc b/doc/src/frameworks-technologies/plugins-howto.qdoc index b332d57..15b1547 100644 --- a/doc/src/frameworks-technologies/plugins-howto.qdoc +++ b/doc/src/frameworks-technologies/plugins-howto.qdoc @@ -109,12 +109,12 @@ straightforward, here is the class definition (\c mystyleplugin.h): - \snippet doc/src/snippets/code/doc_src_plugins-howto.qdoc 0 + \snippet doc/src/snippets/code/doc_src_plugins-howto.cpp 0 Ensure that the class implementation is located in a \c .cpp file (including the class definition): - \snippet doc/src/snippets/code/doc_src_plugins-howto.qdoc 1 + \snippet doc/src/snippets/code/doc_src_plugins-howto.cpp 1 (Note that QStylePlugin is case insensitive, and the lower-case version of the key is used in our @@ -127,7 +127,7 @@ you might want to set a style explicitly in code. To apply a style, use code like this: - \snippet doc/src/snippets/code/doc_src_plugins-howto.qdoc 2 + \snippet doc/src/snippets/code/doc_src_plugins-howto.cpp 2 Some plugin classes require additional functions to be implemented. See the class documentation for details of the @@ -284,12 +284,12 @@ the required plugins to your build using \c QTPLUGIN. For example, in your \c main.cpp: - \snippet doc/src/snippets/code/doc_src_plugins-howto.qdoc 4 + \snippet doc/src/snippets/code/doc_src_plugins-howto.cpp 4 In the \c .pro file for your application, you need the following entry: - \snippet doc/src/snippets/code/doc_src_plugins-howto.qdoc 5 + \snippet doc/src/snippets/code/doc_src_plugins-howto.pro 5 It is also possible to create your own static plugins, by following these steps: diff --git a/doc/src/frameworks-technologies/qthelp.qdoc b/doc/src/frameworks-technologies/qthelp.qdoc index 42bc482..f4d75b6 100644 --- a/doc/src/frameworks-technologies/qthelp.qdoc +++ b/doc/src/frameworks-technologies/qthelp.qdoc @@ -218,7 +218,7 @@ we get the actual help contents by calling fileData() and display the document to the user. - \snippet doc/src/snippets/code/doc_src_qthelp.qdoc 6 + \snippet doc/src/snippets/code/doc_src_qthelp.cpp 6 For further information on how to use the API, have a look at the QHelpEngine class reference. diff --git a/doc/src/frameworks-technologies/richtext.qdoc b/doc/src/frameworks-technologies/richtext.qdoc index 089f84d..313cf46 100644 --- a/doc/src/frameworks-technologies/richtext.qdoc +++ b/doc/src/frameworks-technologies/richtext.qdoc @@ -145,11 +145,11 @@ Although QTextEdit makes it easy to display and edit rich text, documents can also be used independently of any editor widget, for example: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 0 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 0 Alternatively, they can be extracted from an existing editor: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 1 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 1 This flexibility enables applications to handle multiple rich text documents without the overhead of multiple editor widgets, or requiring @@ -728,24 +728,24 @@ A text editor widget can be constructed and used to display HTML in the following way: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 2 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 2 By default, the text editor contains a document with a root frame, inside which is an empty text block. This document can be obtained so that it can be modified directly by the application: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 3 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 3 The text editor's cursor may also be used to edit a document: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 4 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 4 Although a document can be edited using many cursors at once, a QTextEdit only displays a single cursor at a time. Therefore, if we want to update the editor to display a particular cursor or its selection, we need to set the editor's cursor after we have modified the document: - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 5 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 5 \section1 Selecting Text @@ -833,7 +833,7 @@ We give an example of the latter technique from the list. We assume that the text edit is visible. - \snippet doc/src/snippets/code/doc_src_richtext.qdoc 6 + \snippet doc/src/snippets/code/doc_src_richtext.cpp 6 \omit Ideas for other sections: diff --git a/doc/src/frameworks-technologies/unicode.qdoc b/doc/src/frameworks-technologies/unicode.qdoc index b4a9347..d2a6500 100644 --- a/doc/src/frameworks-technologies/unicode.qdoc +++ b/doc/src/frameworks-technologies/unicode.qdoc @@ -125,12 +125,12 @@ QString provides implicit casting from \c{const char *} so that things like - \snippet doc/src/snippets/code/doc_src_unicode.qdoc 0 + \snippet doc/src/snippets/code/doc_src_unicode.cpp 0 will work. There is also a function, QObject::tr(), that provides translation support, like this: - \snippet doc/src/snippets/code/doc_src_unicode.qdoc 1 + \snippet doc/src/snippets/code/doc_src_unicode.cpp 1 QObject::tr() maps from \c{const char *} to a Unicode string, and uses installable QTranslator objects to do the mapping. @@ -151,11 +151,11 @@ fast functions for mapping to and from them. For example, to open an application's icon one might do this: - \snippet doc/src/snippets/code/doc_src_unicode.qdoc 2 + \snippet doc/src/snippets/code/doc_src_unicode.cpp 2 or - \snippet doc/src/snippets/code/doc_src_unicode.qdoc 3 + \snippet doc/src/snippets/code/doc_src_unicode.cpp 3 Regarding output, Qt will do a best-effort conversion from Unicode to whatever encoding the system and fonts provide. |