summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-09 07:10:11 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-09 07:10:11 (GMT)
commit5b56189c9a6c322fa595b716a9f17e39a35bcbc0 (patch)
tree2e8b4fc397d631207aa32a8c68c94100a54f0f61 /doc
parent888f57107e698731c4a1dd2c46745c6293b2222e (diff)
parent7343bbb230161d563b0226011e4519f695fdc593 (diff)
downloadQt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.zip
Qt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.tar.gz
Qt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/qml/qmlengine.cpp
Diffstat (limited to 'doc')
-rw-r--r--doc/doc.pri11
-rw-r--r--doc/src/classes.qdoc3
-rw-r--r--doc/src/declarative/components.qdoc92
-rw-r--r--doc/src/declarative/extending-examples.qdoc258
-rw-r--r--doc/src/declarative/extending.qdoc722
-rw-r--r--doc/src/declarative/qmlforcpp.qdoc55
-rw-r--r--doc/src/declarative/qmlformat.qdoc6
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc6
-rw-r--r--doc/src/developing-on-mac.qdoc73
-rw-r--r--doc/src/examples.qdoc1
-rw-r--r--doc/src/examples/frozencolumn.qdoc4
-rw-r--r--doc/src/examples/moveblocks.qdoc228
-rw-r--r--doc/src/images/checkboxes-exclusive.pngbin0 -> 5079 bytes
-rw-r--r--doc/src/images/checkboxes-non-exclusive.pngbin0 -> 5614 bytes
-rw-r--r--doc/src/images/move-blocks-chart.pngbin0 -> 15740 bytes
-rw-r--r--doc/src/images/moveblocks-example.pngbin0 -> 4532 bytes
-rw-r--r--doc/src/index.qdoc2
-rw-r--r--doc/src/installation.qdoc26
-rw-r--r--doc/src/phonon-api.qdoc7
-rw-r--r--doc/src/platform-notes.qdoc7
-rw-r--r--doc/src/properties.qdoc6
-rw-r--r--doc/src/qmake-manual.qdoc69
-rw-r--r--doc/src/qnamespace.qdoc55
-rw-r--r--doc/src/qsqldatatype-table.qdoc584
-rw-r--r--doc/src/qtopenvg.qdoc283
-rw-r--r--doc/src/qtscript.qdoc2
-rw-r--r--doc/src/qtsql.qdoc3
-rw-r--r--doc/src/snippets/code/doc_src_properties.qdoc3
-rw-r--r--doc/src/snippets/code/src_gui_qproxystyle.cpp10
-rw-r--r--doc/src/tutorials/addressbook.qdoc59
30 files changed, 2325 insertions, 250 deletions
diff --git a/doc/doc.pri b/doc/doc.pri
index 367ef29..0dfef66 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -2,13 +2,6 @@
# Qt documentation build
#####################################################################
-win32 {
- QT_WINCONFIG = release/
- !CONFIG(release, debug|release) {
- QT_WINCONFIG = debug/
- }
-}
-
DOCS_GENERATION_DEFINES = -Dopensourceedition
GENERATOR = $$QT_BUILD_TREE/bin/qhelpgenerator
@@ -21,9 +14,9 @@ win32:!win32-g++ {
}
$$unixstyle {
- QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/tools/qdoc3/$${QT_WINCONFIG}qdoc3 $$DOCS_GENERATION_DEFINES
+ QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/tools/qdoc3/qdoc3 $$DOCS_GENERATION_DEFINES
} else {
- QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/tools/qdoc3/$${QT_WINCONFIG}qdoc3.exe $$DOCS_GENERATION_DEFINES
+ QDOC = cd $$QT_SOURCE_TREE/tools/qdoc3/test && set QT_BUILD_TREE=$$QT_BUILD_TREE&& set QT_SOURCE_TREE=$$QT_SOURCE_TREE&& $$QT_BUILD_TREE/tools/qdoc3/qdoc3.exe $$DOCS_GENERATION_DEFINES
QDOC = $$replace(QDOC, "/", "\\")
}
macx {
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 69ca716..dddc96f 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -47,9 +47,6 @@
This is a list of all Qt classes excluding the \l{Qt 3
compatibility classes}. For a shorter list that only includes the
most frequently used classes, see \l{Qt's Main Classes}.
- \omit This is old and dingy now.
- and the \l{http://doc.trolltech.com/extras/qt43-class-chart.pdf}{Qt 4.3 Class Chart (PDF)}.
- \endomit
\generatelist classes
diff --git a/doc/src/declarative/components.qdoc b/doc/src/declarative/components.qdoc
deleted file mode 100644
index d7a4ba6..0000000
--- a/doc/src/declarative/components.qdoc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*!
-\page components.html
-\target components
-\title Components
-
-A \bold component is a reusable, encapsulated Qml element with a well-defined interface.
-
-Writing and using components allows you to:
-\list
-\o Reuse sections of Qml without copy-and-paste.
-\o Have consistent Look and Feel between different parts of your UI.
-\o Create new Qml elements without writing a new C++ class. (See \l {cppitem}{Creating Qml elements in C++})
-\endlist
-
-Components are placed in \e <Name>.qml files, allowing \e <Name> to then be used as a tag
-elsewhere. For example, if you have a Slider.qml file, you can then use \c {Slider { ... }} to
-make a slider, just as if it was a built-in type.
-
-Components may be collected into \l {qmlmodules}{modules}.
-
-\section1 Example: Creating a MyButton Component
-
-This example describes how to create a component from an existing snippet of Qml.
-
-Assume you have an existing UI with a single 'Save' button, defined as follows:
-
-\code
-Image {
- source: "pics/button-background.png"
- Text {
- text: "Save"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseRegion {
- anchors.fill: parent
- onClick: { saveData() }
- }
-}
-\endcode
-
-For the next release, you plan to add 'Cancel' and 'Reset' buttons. Rather than copying and pasting the above markup, you can create a component:
-
-\list 1
-\o Create a file called MyButton.qml, and copy the relevant Qml snippet into that file.
-\o Make some minor changes to define the component's interface:
-
-\code
-Image {
- property string label
- signal clicked
- source: "pics/button-background.png"
- Text {
- text: parent.label
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseRegion {
- anchors.fill: parent
- onClick: { parent.click.emit() }
- }
-}
-\endcode
-
-The \a label property and \a click signal that were added effectively become part of the 'public API' of the MyButton component. In a similar manner, the Text and MouseRegion elements become invisible to anyone using the component. Note that the Text element now binds in its data from \a label, and the MouseRegion emits a generic signal.
-
-\o The component can now be used elsewhere as MyButton:
-
-\code
-MyButton { label: "Save"; onClicked: saveData() }
-...
-MyButton { label: "Cancel"; onClicked: cancelData() }
-...
-MyButton { label: "Reset"; onClicked: resetData() }
-\endcode
-
-\endlist
-
-\section1 Placing .qml Files
-
-When one component refers to a another, the second must be found either in the same directory
-as the first, or in a directory imported using the \c import statement:
-
-\code
-import "library"
-\endcode
-
-\section1 Namespaces
-
-Namespaces for QML will be supported in Qt 4.6.
-
-*/
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc
new file mode 100644
index 0000000..09239c1
--- /dev/null
+++ b/doc/src/declarative/extending-examples.qdoc
@@ -0,0 +1,258 @@
+/****************************************************************************
+**
+** 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 declarative/extending/adding
+\title Extending QML - Adding Types Example
+
+The Adding Types Example shows how to add a new element type, \c Person, to QML.
+The \c Person type can be used from QML like this:
+
+\snippet examples/declarative/extending/adding/example.qml 0
+
+\section1 Declare the Person class
+
+All QML elements map to C++ types. Here we declare a basic C++ Person class
+with the two properties we want accessible on the QML type - name and shoeSize.
+Although in this example we use the same name for the C++ class as the QML
+element, the C++ class can be named differently, or appear in a namespace.
+
+\snippet examples/declarative/extending/adding/person.h 0
+
+Following the class declaration, we include the QML_DECLARE_TYPE() macro. This
+is necessary to declare the type to QML. It also includes the logic necessary
+to expose the class to Qt's meta system - that is, it includes the
+Q_DECLARE_METATYPE() functionality.
+
+\section1 Define the Person class
+
+\snippet examples/declarative/extending/adding/person.cpp 0
+
+The Person class implementation is quite basic. The property accessors simply
+return members of the object instance.
+
+The implementation must also include the QML_DEFINE_TYPE() macro. This macro
+registers the Person class with QML, and defines the mapping between the C++
+and QML class names.
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/extending/properties
+\title Extending QML - Object and List Property Types Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Object and List Property Types example shows how to add object and list
+properties in QML. This example adds a BirthdayParty element that specifies
+a birthday party, consisting of a celebrant and a list of guests. People are
+specified using the People QML type built in the previous example.
+
+\snippet examples/declarative/extending/properties/example.qml 0
+
+\section1 Declare the BirthdayParty
+
+The BirthdayParty class is declared like this:
+
+\snippet examples/declarative/extending/properties/birthdayparty.h 0
+\snippet examples/declarative/extending/properties/birthdayparty.h 1
+\snippet examples/declarative/extending/properties/birthdayparty.h 2
+\snippet examples/declarative/extending/properties/birthdayparty.h 3
+
+The class contains a member to store the celebrant object, and also a
+QmlConcreteList<Person *> member.
+
+In QML, the type of a list properties - and the guests property is a list of
+people - are all of type QmlList<T *>*. QmlList is an abstract list interface
+that allows a developer to react to QML accessing and modifying the contents of
+the list. This is useful for implementing "virtual lists" or other advanced
+scenarios, but can't be used directly for the common case of just wanting a
+regular list of things. For this a concrete implementation, QmlConcreteList, is
+provided and that is used here.
+
+\section2 Define the BirthdayParty
+
+The implementation of BirthdayParty property accessors is straight forward.
+
+\snippet examples/declarative/extending/properties/birthdayparty.cpp 0
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/extending/coercion
+\title Extending QML - Inheritance and Coercion Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Inheritance and Coercion Example shows how to use base classes to assign
+elements of more than one type to a property. It specializes the Person element
+developed in the previous examples into two elements - a \c Boy and a \c Girl.
+
+\snippet examples/declarative/extending/coercion/example.qml 0
+
+\section1 Declare Boy and Girl
+
+\snippet examples/declarative/extending/coercion/person.h 0
+
+The Person class remains unaltered in this example and the Boy and Girl C++
+classes are trivial extensions of it. As an example, the inheritance used here
+is a little contrived, but in real applications it is likely that the two
+extensions would add additional properties or modify the Person classes
+behavior.
+
+\section2 Define People as a base class
+
+The implementation of the People class itself has not changed since the the
+previous example. However, as we have repurposed the People class as a common
+base for Boy and Girl, we want to prevent it from being instantiated from QML
+directly - an explicit Boy or Girl should be instantiated instead.
+
+\snippet examples/declarative/extending/coercion/person.cpp 0
+
+While we want to disallow instantiating Person from within QML, it still needs
+to be registered with the QML engine, so that it can be used as a property type
+and other types can be coerced to it. To register a type, without defining a
+named mapping into QML, we use the QML_DEFINE_NOCREATE_TYPE() macro instead of
+the QML_DEFINE_TYPE() macro used previously.
+
+\section2 Define Boy and Girl
+
+The implementation of Boy and Girl are trivial.
+
+\snippet examples/declarative/extending/coercion/person.cpp 1
+
+All that is necessary is to implement the constructor, and to register the types
+and their QML name with the QML engine.
+
+\section1 Running the example
+
+The BirthdayParty element has not changed since the previous example. The
+celebrant and guests property still use the People type.
+
+\snippet examples/declarative/extending/coercion/birthdayparty.h 0
+
+However, as all three types, Person, Boy and Girl, have been registered with the
+QML system, on assignment QML automatically (and type-safely) converts the Boy
+and Girl objects into a Person.
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/extending/default
+\title Extending QML - Default Property Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+The Default Property Example is a minor modification of the
+\l {Extending QML - Inheritance and Coercion Example} that simplifies the
+specification of a BirthdayParty through the use of a default property.
+
+\snippet examples/declarative/extending/default/example.qml 0
+
+\section1 Declaring the BirthdayParty class
+
+The only difference between this example and the last, is the addition of the
+\c DefaultProperty class info annotation.
+
+\snippet examples/declarative/extending/default/birthdayparty.h 0
+
+The default property specifies the property to assign to whenever an explicit
+property is not specified, in the case of the BirthdayParty element the guest
+property. It is purely a syntactic simplification, the behavior is identical
+to specifying the property by name, but it can add a more natural feel in many
+situations. The default property must be either an object or list property.
+
+\section1 Running the example
+
+The main.cpp file in the example includes a simple shell application that
+loads and runs the QML snippet shown at the beginning of this page.
+*/
+
+/*!
+\example declarative/extending/grouped
+\title Extending QML - Grouped Properties Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
+
+/*!
+\example declarative/extending/grouped
+\title Extending QML - Attached Properties Example
+
+This example builds on:
+\list
+\o \l {Extending QML - Grouped Properties Example}
+\o \l {Extending QML - Default Property Example}
+\o \l {Extending QML - Inheritance and Coercion Example}
+\o \l {Extending QML - Object and List Property Types Example}
+\o \l {Extending QML - Adding Types Example}
+\endlist
+
+*/
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
new file mode 100644
index 0000000..0f9148a
--- /dev/null
+++ b/doc/src/declarative/extending.qdoc
@@ -0,0 +1,722 @@
+/****************************************************************************
+**
+** 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 qml-extending.html
+\title Extending QML
+
+The QML syntax declaratively describes how to construct an in memory object
+tree. In Qt, QML is mainly used to describe a visual scene graph, but it is
+not conceptually limited to this: the QML format is an abstract description of
+any object tree. All the QML element types included in Qt are implemented using
+the C++ extension mechanisms describe on this page. Programmers can use these
+APIs to add new types that interact with the existing Qt types, or to repurpose
+QML for their own independent use.
+
+\tableofcontents
+
+\section1 Adding Types
+
+\snippet examples/declarative/extending/adding/example.qml 0
+
+The QML snippet shown above instantiates one \c Person instance and sets
+the name and shoeSize properties on it. Everything in QML ultimately comes down
+to either instantiating an object instance, or assigning a property a value.
+QML relies heavily on Qt's meta object system and can only instantiate classes
+that derive from QObject.
+
+The QML engine has no intrinsic knowledge of any class types. Instead the
+programmer must define the C++ types, and their corresponding QML name.
+
+Custom C++ types are made available to QML using these two macros:
+
+\quotation
+\code
+#define QML_DECLARE_TYPE(T)
+#define QML_DEFINE_TYPE(T,QmlName)
+\endcode
+
+Register the C++ type \a T with the QML system, and make it available in QML
+under the name \a QmlName. \a T and \a QmlName may be the same.
+
+Generally the QML_DECLARE_TYPE() macro should be included immediately following
+the type declaration (usually in its header file), and the QML_DEFINE_TYPE()
+macro in the implementation file. QML_DEFINE_TYPE() must not be present in
+a header file.
+
+Type \a T must be a concrete type that inherits QObject and has a default
+constructor.
+\endquotation
+
+Once registered, all of the \l {Qt's Property System}{properties} of a supported
+type are available for use within QML. QML has intrinsic support for properties
+of these types:
+
+\list
+\o bool
+\o unsigned int, int
+\o float, double, qreal
+\o QString
+\o QUrl
+\o QColor
+\o QDate, QTime, QDateTime
+\o QPoint, QPointF
+\o QSize, QSizeF
+\o QRect, QRectF
+\o QVariant
+\endlist
+
+QML is typesafe. Attempting to assign an invalid value to a property will
+generate an error. For example, assuming the name property of the \c Person
+element had a type of QString, this would cause an error:
+
+\code
+Person {
+ // Will NOT work
+ name: 12
+}
+\endcode
+
+\l {Extending QML - Adding Types Example} shows the complete code used to create
+the \c Person type.
+
+\section1 Object and List Property Types
+
+\snippet examples/declarative/extending/properties/example.qml 0
+
+The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's
+celebrant property, and assigns three \c Person objects to the guests property.
+
+QML can set properties of types that are more complex than basic intrinsics like
+integers and strings. Properties can also be object pointers, Qt interface
+pointers, lists of object points, and lists of Qt interface pointers. As QML
+is typesafe it ensures that only valid types are assigned to these properties,
+just like it does for primitive types.
+
+Properties that are pointers to objects or Qt interfaces are declared with the
+Q_PROPERTY() macro, just like other properties. The celebrant property
+declaration looks like this:
+
+\snippet examples/declarative/extending/properties/birthdayparty.h 1
+
+As long as the property type, in this case Person, is registered with QML the
+property can be assigned.
+
+QML also supports assigning Qt interfaces. To assign to a property whose type
+is a Qt interface pointer, the interface must also be registered with QML. As
+they cannot be instantiated directly, registering a Qt interface is different
+from registering a new QML type. The following macros are used instead:
+
+\quotation
+\code
+ #define QML_DECLARE_INTERFACE(T)
+ #define QML_DEFINE_INTERFACE(T)
+\endcode
+
+Register the C++ interface \a T with the QML system.
+
+Generally the QML_DECLARE_INTERFACE() macro should be included immediately
+following the interface declaration (usually in its header file), and the
+QML_DEFINE_INTERFACE() macro in an implementation file. QML_DEFINE_INTERFACE()
+must not be present in a header file.
+
+Following registration, QML can coerce objects that implement this interface
+for assignment to appropriately typed properties.
+\endquotation
+
+The guests property is a list of \c Person objects. Properties that are lists
+of objects or Qt interfaces are also declared with the Q_PROPERTY() macro, just
+like other properties. List properties must have the type \c {QmlList<T *>*}.
+As with object properties, the type \a T must be registered with QML.
+
+The guest property declaration looks like this:
+
+\snippet examples/declarative/extending/properties/birthdayparty.h 2
+
+\l {Extending QML - Object and List Property Types Example} shows the complete
+code used to create the \c BirthdayParty type.
+
+\section1 Inheritance and Coercion
+
+\snippet examples/declarative/extending/coercion/example.qml 0
+
+The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's
+celebrant property, and assigns three other objects to the guests property.
+
+QML supports C++ inheritance heirarchies and can freely coerce between known,
+valid object types. This enables the creation of common base classes that allow
+the assignment of specialized classes to object or list properties. In the
+snippet shown, both the celebrant and the guests properties retain the Person
+type used in the previous section, but the assignment is valid as both the Boy
+and Girl objects inherit from Person.
+
+To assign to a property, the property's type must have been registered with QML.
+Both the QML_DEFINE_TYPE() and QML_DEFINE_INTERFACE() macros already shown can
+be used to register a type with QML. Additionally, if a type that acts purely
+as a base class that cannot be instantiated from QML needs to be
+registered these macros can be used:
+
+\quotation
+\code
+ #define QML_DECLARE_TYPE(T)
+ #define QML_DEFINE_NOCREATE_TYPE(T)
+\endcode
+
+Register the C++ type \a T with the QML system. QML_DEFINE_NOCREATE_TYPE()
+differs from QML_DEFINE_TYPE() in that it does not define a mapping between the
+C++ class and a QML element name, so the type is not instantiable from QML, but
+it is available for type coercion.
+
+Generally the QML_DECLARE_TYPE() macro should be included immediately following
+the type declaration (usually in its header file), and the
+QML_DEFINE_NOCREATE_TYPE() macro in the implementation file.
+QML_DEFINE_NOCREATE_TYPE() must not be present in a header file.
+
+Type \a T must inherit QObject, but there are no restrictions on whether it is
+concrete or the signature of its constructor.
+\endquotation
+
+QML will automatically coerce C++ types when assigning to either an object
+property, or to a list property. Only if coercion fails does an assignment
+error occur.
+
+\l {Extending QML - Inheritance and Coercion Example} shows the complete
+code used to create the \c Boy and \c Girl types.
+
+\section1 Default Property
+
+\snippet examples/declarative/extending/default/example.qml 0
+
+The QML snippet shown above assigns a collection of objects to the
+\c BirthdayParty's default property.
+
+The default property is a syntactic convenience that allows a type designer to
+specify a single property as the type's default. The default property is
+assigned to whenever no explicit property is specified. As a convenience, it is
+behaviorally identical to assigning the default property explicitly by name.
+
+From C++, type designers mark the default property using a Q_CLASSINFO()
+annotation:
+
+\quotation
+\code
+Q_CLASSINFO("DefaultProperty", "property")
+\endcode
+
+Mark \a property as the class's default property. \a property must be either
+an object property, or a list property.
+
+A default property is optional. A derived class inherits its base class's
+default property, but may override it in its own declaration. \a property can
+refer to a property declared in the class itself, or a property inherited from a
+base class.
+\endquotation
+
+\l {Extending QML - Default Property Example} shows the complete code used to
+specify a default property.
+
+\section1 Grouped Properties
+
+\snippet examples/declarative/extending/grouped/example.qml 1
+
+The QML snippet shown above assigns a number properties to the \c Boy object,
+including four properties using the grouped property syntax.
+
+Grouped properties collect similar properties together into a single named
+block. Grouped properties can be used to present a nicer API to developers, and
+may also simplify the implementation of common property collections across
+different types through implementation reuse.
+
+A grouped property block is implemented as a read-only object property. The
+shoe property shown is declared like this:
+
+\snippet examples/declarative/extending/grouped/person.h 1
+
+The ShoeDescription type declares the properties available to the grouped
+property block - in this case the size, color, brand and price properties.
+
+Grouped property blocks may declared and accessed be recusively.
+
+\l {Extending QML - Grouped Properties Example} shows the complete code used to
+implement the \c shoe property grouping.
+
+\section1 Attached Properties
+
+\snippet examples/declarative/extending/attached/example.qml 1
+
+The QML snippet shown above assigns the rsvp property using the attached
+property syntax.
+
+Attached properties allow unrelated types to annotate other types with some
+additional properties, generally for their own use. Attached properties are
+identified through the use of the attacher type name, in the case shown
+\c BirthdayParty, as a suffix to the property name.
+
+In the example shown, \c BirthdayParty is called the attaching type, and the
+Box instance the attachee object instance.
+
+For the attaching type, an attached property block is implemented as a new
+QObject derived type, called the attachment object. The properties on the
+attachment object are those that become available for use as the attached
+property block.
+
+Any QML type can become an attaching type by declaring the
+\c qmlAttachedProperties() public function:
+
+\quotation
+\code
+static AttachedPropertiesType *qmlAttachedProperties(QObject *object)
+\endcode
+Return an attachment object, of type \a AttachedPropertiesType, for the
+attachee \a object instance. It is customary, though not strictly required, for
+the attachment object to be parented to \a object to prevent memory leaks.
+
+\a AttachedPropertiesType must be a QObject derived type. The properties on
+this type will be accessible through the attached properties syntax.
+
+This method will be called at most once for each attachee object instance. The
+QML engine will cache the returned instance pointer for subsequent attached
+property accesses. Consequently the attachment object may not be deleted until
+\a object is destroyed.
+\endquotation
+
+Conceptually, attached properties are a \e type exporting a set of additional
+properties that can be set on \e any other object instance. Attached properties
+cannot be limited to only attaching to a sub-set of object instances, although
+their effect may be so limited.
+
+For example, a common usage scenario is for a type to enhance the properties
+available to its children in order to gather instance specific data. Here we
+add a rsvp field to all the guests coming to a birthday party:
+\code
+BirthdayParty {
+ Boy { BirthdayParty.rsvp: "2009-06-01" }
+}
+\endcode
+However, as a type cannot limit the instances to which the attachment object
+must attach, the following is also allowed, even though adding a birthday party
+rsvp in this context will have no effect.
+\code
+GraduationParty {
+ Boy { BirthdayParty.rsvp: "2009-06-01" }
+}
+\endcode
+
+From C++, including the attaching type implementation, the attachment object for
+an instance can be accessed using the following method:
+
+\quotation
+\code
+template<typename T>
+QObject *qmlAttachedPropertiesObject<T>(QObject *attachee, bool create = true);
+\endcode
+Returns the attachment object attached to \a attachee by the attaching type
+\a T. If type \a T is not a valid attaching type, this method always returns 0.
+
+If \a create is true, a valid attachment object will always be returned,
+creating it if it does not already exist. If \a create is false, the attachment
+object will only be returned if it has previously been created.
+\endquotation
+
+\l {Extending QML - Attached Properties Example} shows the complete code used to
+implement the rsvp attached property.
+
+\section1 Signal support
+
+\section1 Property Binding
+
+\section1 Property Value Sources
+
+\section1 Extension Objects
+
+\section1 Parser Status
+
+*/
+
+
+/*!
+\page qml-extending-types.html
+\title Extending types from QML
+
+Many of the elements available for use in QML are implemented in
+\l {QML for C++ Programmers}{C++}. These types are know as "core types". QML
+allows programmers to build new, fully functional elements without using C++.
+Existing core types can be extended, and new types defined entirely in the QML
+language.
+
+\tableofcontents
+
+\section1 Adding new properties
+
+New properties can be added to an existing type. These new properties are
+available for use within QML, and also appear as regular Qt properties on the
+C++ object, accessible through the regular property access mechanisms.
+
+Like all properties in QML, custom properties are typed. The type is used to
+define the property's behavior, and also determines the C++ type of the created
+Qt property. The following table shows the list of types available when
+declaring a new property, and the corresponding C++ type.
+
+\table
+\header \o QML Type Name \o C++ Type Name
+\row \o int \o int
+\row \o bool \o bool
+\row \o double \o double
+\row \o real \o double
+\row \o string \o QString
+\row \o url \o QUrl
+\row \o color \o QColor
+\row \o date \o QDate
+\row \o var \o QVariant
+\row \o variant \o QVariant
+\endtable
+
+QML supports two methods for adding a new property to a type - a new property
+definition, and a property alias.
+
+\section2 Property definitions
+
+Property definitions add a new property to an existing type. The storage of the
+property is managed by QML. The defined property may be read, written and bound
+to and from.
+
+The syntax for defining a new property is:
+\code
+ [default] property <type> <name>[: defaultValue]
+\endcode
+
+This declaration may appear anywhere within a type body, but it is customary to
+include it at the top. Attempting to declare two properties with the same name
+in the same type block is an error. However, a new property may reuse the name
+of an existing property on the type. This should be done with caution, as the
+existing property will be hidden, and become inaccessible.
+
+The <type> must be one of the QML type names shown in the above table.
+Additionally, an optional default value of the property can be provided. The
+default value is a convenient shortcut, but is behaviorally identical to doing
+it in two steps, like this:
+
+\code
+ // Use default value
+ property int myProperty: 10
+
+ // Longer, but behaviorally identical
+ property int myProperty
+ myProperty: 10
+\endcode
+
+If specified, the optional "default" attribute marks the new property as the
+types default property, overriding any existing default property. Using the
+default attribute twice in the same type block is an error.
+
+The following example shows how to declare a new "innerColor" property that
+controls the color of the inner rectangle.
+
+\code
+ Rect {
+ property color innerColor: "black"
+
+ color: "red"; width: 100; height: 100
+ Rect {
+ anchors.centeredIn: parent
+ width: parent.width - 10
+ height: parent.height - 10
+ color: innerColor
+ }
+ }
+\endcode
+
+\section2 Property aliases
+
+Property aliases are a more advanced form of property declaration. Unlike a
+property definition, that allocates a new, unique storage space for the
+property, a property alias connects the newly declared property (called the
+aliasing property) to an existing property (the aliased property). Read
+operations on the aliasing property act as read operations on the aliased
+property, and write operations on the aliasing property as write operations on
+the aliased property.
+
+A property alias declaration looks a lot like a property definition:
+\code
+ [default] property alias <name>: <alias reference>
+\endcode
+
+As the aliasing property has the same type as the aliased property, an explicit
+type is omitted, and the special "alias" keyword is used. Instead of a default
+value, a property alias includes a compulsary alias reference. The alias
+reference is used to locate the aliased property. While similar to a property
+binding, the alias reference syntax is highly restricted.
+
+An alias reference takes the form
+\code
+ <Id>.<property>
+\endcode
+where <Id> must refer to an object id within the same component as the type
+declaring the alias, and <property> refers to a property on this object. The
+alias reference syntax may become more flexibly in future releases.
+
+Here is the property definition example rewritten to use property aliases.
+\code
+Rect {
+ property alias innerColor: InnerRect.color
+
+ color: "red"; width: 100; height: 100
+ Rect {
+ id: InnerRect
+ anchors.centeredIn: parent
+ width: parent.width - 10
+ height: parent.height - 10
+ color: "black"
+ }
+}
+\endcode
+
+Aliases are most useful when \l {Defining new Components}. Consequently
+they have several apparent limitations that only make sense in this context.
+
+Aliases are only activated once the component specifying them is completed. The
+most obvious consequence of this is that the component itself cannot generally
+use the aliased property directly. For example, this will not work:
+
+\code
+ // Does NOT work
+ property alias innerColor: InnerRect.color
+ innerColor: "black"
+\endcode
+
+This behavior is required to allow type developers to redefine the behavior
+of existing property names while continuing to use the existing behavior within
+the type they are building, something that is not possible with property
+definitions. In the example used so far, this could allows the developer to fix
+the external rectangle's color as "red" and redefine the "color" property to
+refer to the inner rectangle, like this:
+
+\code
+Rect {
+ property alias color: InnerRect.color
+
+ color: "red"; width: 100; height: 100
+ Rect {
+ id: InnerRect
+ anchors.centeredIn: parent
+ width: parent.width - 10
+ height: parent.height - 10
+ color: "black"
+ }
+}
+\endcode
+
+Users of this type would not be able to affect the color of the red rectangle,
+but would find using the "color" property, rather than the strange new
+"innerColor" property, much more familiar.
+
+A second, much less significant, consequence of the delayed activation of
+aliases is that an alias reference cannot refer to another aliasing property
+declared within the same component. This will not work:
+
+\code
+ // Does NOT work
+ id: Root
+ property alias innerColor: InnerRect.color
+ property alias innerColor2: Root.innerColor
+\endcode
+
+From outside the component, aliasing properties appear as regular Qt properties
+and consequently can be used in alias references.
+
+\section1 Adding new signals
+
+New signals can be added to an existing type. These new signals are available
+for use within QML, and also appear as regular Qt signals on the C++ object that
+can be used in Qt signal/slot connections.
+
+The syntax for defining a new signal is:
+\code
+signal <name>[([<type> <parameter name>[, ...]])]
+\endcode
+
+This declaration may appear anywhere within a type body, but it is customary to
+include it at the top. Attempting to declare two signals or methods with the
+same name in the same type block is an error. However, a new signal may reuse
+the name of an existing signal on the type. This should be done with caution,
+as the existing signal may be hidden and become inaccessible.
+
+The options for parameter types are the same as for property types (see
+\l {Adding new properties}. If this signal has no parameters, the parameter
+list may be omitted entirely.
+
+Here are three examples of signal declarations:
+\code
+ Item {
+ signal clicked
+ signal hovered()
+ signal performAction(string action, var actionArgument)
+ }
+\endcode
+
+\section1 Adding new methods
+
+New methods can be added to an existing type. These new methods are available
+for use within QML, and also appear as regular Qt slots on the C++ object that
+can be used in Qt signal/slot connections.
+
+\code
+function <name>([<parameter name>[, ...]]) { <body> }
+\endcode
+
+This declaration may appear anywhere within a type body, but it is customary to
+include it at the top. Attempting to declare two methods or signals with the
+same name in the same type block is an error. However, a new method may reuse
+the name of an existing method on the type. This should be done with caution,
+as the existing method may be hidden and become inaccessible.
+
+Methods parameters are not typed. In C++ these parameters are of type QVariant.
+The body of the method is written in JavaScript and may access the parameters by
+name.
+
+This example adds a new method that behaves like a child:
+\code
+Item {
+ function say(text) {
+ print("You said " + text);
+ }
+}
+\endcode
+
+\section1 Defining new Components
+
+A component is a reusable type with a well-defined interface built entirely in
+QML. Components appear as regular QML elements, and can be used interchangably
+with core types. Components allow developers to create new types to be reused
+in other projects without the use of C++. Components can also help to reduce
+duplication inside one project by limiting the need for large numbers of
+copy-and-pasted blocks.
+
+Any snippet of QML code can become a component, just by placing it in the file
+"<Name>.qml" where <Name> is the new element name, and begins with an uppercase
+letter. These QML files automatically become available as new QML element types
+to other QML components and applications in the same directory.
+
+For example, here we show how a component named "Box" is defined and used
+multiple times by an application.
+
+\table
+\row
+\o application.qml
+\code
+Rect {
+ width: 100; height: 400;
+ Box { x: 0; y: 0 }
+ Box { x: 0; y: 150 }
+ Box { x: 0; y: 300 }
+}
+\endcode
+\o Box.qml
+\code
+Rect {
+ width: 100; height: 100;
+ color: "blue"
+}
+\endcode
+\endtable
+
+Components may be collected into \l {Modules of Components} that gives the
+developer more freedom than just putting files in the same directory.
+
+\section2 Building reusable components
+
+A component type built to be reused by others must have a well defined
+interface. In QML, an interface consists of a defined collection of
+properties, signals and methods. Users of a component have access to all the
+properties, signals and methods defined on the root element of the component.
+
+In the component example above, the root element of the "Box" component is a
+Rect. As the Rect type has a "color" property, this property is accessible to
+users of the Box component. For example, the application.qml can be modified
+to show three different colored boxes like this:
+\code
+Rect {
+ width: 100; height: 400;
+ Box { x: 0; y: 0; color: "red"; }
+ Box { x: 0; y: 150; color: "yellow"; }
+ Box { x: 0; y: 300; color: "green"; }
+}
+\endcode
+
+As expected, adding additional properties to the root element of Box, makes them
+available externally. Here we add a "text" property:
+
+\table
+\row
+\o application.qml
+\code
+Rect {
+ width: 100; height: 400;
+ Box { x: 0; y: 0; color: "red"; text: "stop" }
+ Box { x: 0; y: 150; color: "yellow"; text: "slow" }
+ Box { x: 0; y: 300; color: "green"; text: "go" }
+}
+\endcode
+\o Box.qml
+\code
+Rect {
+ property alias text: MyText.text
+ width: 100; height: 100;
+ color: "blue"
+ Text {
+ id: MyText
+ anchors.centeredIn: parent
+ }
+}
+\endcode
+\endtable
+
+Methods and signals may be added in the same way.
+
+As all external methods, signals and properties are accessible to external
+users, developers should ensure that setting these properties does not have
+any undesirable side-effects. For most resiliance, root level properties should
+only be used for literal default values. When a root level property must be
+used inside the component - such as the children property - property aliases
+can be used to redirect this property to a "safe" location for external users.
+Try to think of the root level properties as being "owned" by the components
+user, rather than the component itself.
+*/
diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc
index c95cb71..38f5665 100644
--- a/doc/src/declarative/qmlforcpp.qdoc
+++ b/doc/src/declarative/qmlforcpp.qdoc
@@ -567,61 +567,6 @@
engine will automatically set the property as the target of the value
source.
- \section1 Extending types in QML
-
- QML is designed to allow you to build fully working types without writing
- a line of C++ code. This is, for example, used extensively when designing
- applications using the Fluid UI primitives. To create new types, it is
- necessary to be able to define new signals, slots and properties in QML.
-
- In this example, a Button is extended to have an additional
- "text2" property (which always returns "Hello world!") and an additional
- signal "clicked2" that is also emitted when the button is clicked. Not
- a very useful extension, but an extension nonetheless.
-
- \table
- \row
- \o
- \code
- QmlEngine engine;
- QmlComponent component(&engine, qmlData);
- QObject *object = component.create();
- // Will print "Hello world!"
- qDebug() << object->property("text2");
- // Will be emitted whenever the button is clicked
- QObject::connect(object, SIGNAL(clicked2()), this, SLOT(...));
- \endcode
- \o
- \code
- Button {
- property string text2
- signal clicked2
-
- text: "Hello!"
- text2: "Hello world!"
- onClicked: clicked2.emit()
- }
- \endcode
- \endtable
-
- The general syntax for defining new properties and signals is:
-
- \list
- \o
- \code
- [default] property <type> <name> [: <default value>]
- \endcode
-
- Where type can be one of \e int, \e bool, \e double, \e real, \e string,
- \e color, \e date, \e var or \e variant.
-
- \o
- \code
- signal <name>
- \endcode
- Currently only parameterless signals are supported.
- \endlist
-
\section1 Parser Status
Generally using QML is a breeze - you implement your classes in C++, add
diff --git a/doc/src/declarative/qmlformat.qdoc b/doc/src/declarative/qmlformat.qdoc
new file mode 100644
index 0000000..fd22ab5
--- /dev/null
+++ b/doc/src/declarative/qmlformat.qdoc
@@ -0,0 +1,6 @@
+/*!
+ \page qmlformat.html
+ \title QML Format
+
+ Format reference here...
+*/
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 4fe9994..c5d32fe 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -68,24 +68,26 @@
\o \l {qmlforcpp}{QML For C++ Programmers}
\endlist
- Core Features:
+ Core QML Features:
\list
\o \l {binding}{Data Binding}
\o \l {anchor-layout}{Layout Anchors}
\o \l {qmlanimation}{Animation}
\o \l {qmleffects}{Visual Effects}
- \o \l {components}{Components}
\o \l {qmlmodules}{Modules}
\o \l {qmlfocus}{Keyboard Focus}
+ \o \l {Extending types from QML}
\endlist
QML Reference:
\list
+ \o \l {QML Format}
\o \l {elements}{Qml Elements}
\endlist
C++ Reference:
\list
+ \o \l {Extending QML}
\o \l {qtbinding}{C++ Data Binding}
\o \l {cppitem}{C++ Components}
\endlist
diff --git a/doc/src/developing-on-mac.qdoc b/doc/src/developing-on-mac.qdoc
index 60c928d..849e79a 100644
--- a/doc/src/developing-on-mac.qdoc
+++ b/doc/src/developing-on-mac.qdoc
@@ -60,17 +60,15 @@
\section1 What Versions of Mac OS X are Supported?
- As of Qt 4.5, Qt supports Mac OS X versions 10.3 (for \bold{deployment
- only}, not for development), 10.4 and 10.5. It is usually in the best
- interest of the developer and user to be running the latest updates to any
- version. We test internally against Mac OS X 10.3.9 and Mac OS X 10.4.11 as
- well as the updated release of Mac OS X 10.5.
-
+ As of Qt 4.6, Qt supports Mac OS X versions 10.4 and up. It is usually in
+ the best interest of the developer and user to be running the latest
+ updates to any version. We test internally against Mac OS X 10.4.11 as well
+ as the updated release of Mac OS X 10.5 and Mac OS X 10.6.
\section2 Carbon or Cocoa?
Historically, Qt has used the Carbon toolkit, which supports 32-bit
- applications on Mac OS X 10.3 and up. Qt 4.5 adds support for the Cocoa
+ applications on Mac OS X 10.4 and up. Qt 4.5 and up has support for the Cocoa
toolkit, which requires 10.5 and provides 64-bit support.
This detail is typically not important to Qt application developers. Qt is
@@ -79,17 +77,21 @@
version will be discontinued. This is something to keep in mind when you
consider writing code directly against native APIs.
- The current binary for Qt is built for Carbon. If you want to choose which
- framework Qt will use, you must build from scratch. Carbon or Cocoa is
- chosen when configuring the package for building. The configure process
- selects Carbon by default, to specify Cocoa use the \c{-cocoa} flag.
- configure for a 64-bit architecture using one of the \c{-arch} flags (see
- \l{universal binaries}{Universal Binaries}).
-
- Currently, Apple's GCC 4.0.1 is used by default. When building on 10.5,
- Apple's GCC 4.2 is also available and selectable with the configure flag:
- \c{-platform macx-g++42}. GCC 3.x will \e not work. Experimental LLVM-GCC
- support is available by passing in the \c{-platform macx-llvm} flag.
+ The current binary for Qt is built in two flavors, 32-bit Carbon and full
+ universal Cocoa (32-bit and 64-bit). If you want a different setup for
+ Qt will use, you must build from scratch. Carbon or Cocoa is chosen when
+ configuring the package for building. The configure process selects Carbon
+ by default, to specify Cocoa use the \c{-cocoa} flag. configure for a
+ 64-bit architecture using one of the \c{-arch} flags (see \l{universal
+ binaries}{Universal Binaries}).
+
+ Currently, Apple's default GCC compiler is used by default (GCC 4.0.1 on
+ 10.4 and 10.5, GCC 4.2 on 10.6). You can specify alternate compilers
+ though. For example, on Mac OS X 10.5, Apple's GCC 4.2 is also available
+ and selectable with the configure flag: \c{-platform macx-g++42}. LLVM-GCC
+ support is available by passing in the \c{-platform macx-llvm} flag. GCC
+ 3.x will \e not work. Though they may work, We do not support custom-built
+ GCC's.
The following table summarizes the different versions of Mac OS X and what
capabilities are used by Qt.
@@ -103,13 +105,6 @@
\o CPU Architecture Supported
\o Development Platform
\row
- \o 10.3
- \o Panther
- \o Carbon
- \o 32
- \o PPC
- \o No
- \row
\o 10.4
\o Tiger
\o Carbon
@@ -130,6 +125,20 @@
\o 32/64
\o PPC/Intel
\o Yes
+ \row
+ \o 10.6
+ \o Snow Leopard
+ \o Carbon
+ \o 32
+ \o PPC/Intel
+ \o Yes
+ \row
+ \o 10.6
+ \o Snow Leopard
+ \o Cocoa
+ \o 32/64
+ \o PPC/Intel
+ \o Yes
\endtable
\section2 Which One Should I Use?
@@ -144,15 +153,21 @@
Carbon universal application with the appropriate checks in your code to
choose the right path based on where you are running the application.
+ For Mac OS X 10.6, Apple has started recommending developers to build their
+ applications 64-bit. The main reason is that there is a small speed
+ increase due to the extra registers on Intel CPU's, all their machine
+ offerings have been 64-bit since 2007, and there is a cost for reading all
+ the 32-bit libraries into memory if everything else is 64-bit. If you want
+ to follow this advice, there is only one choice, 64-bit Cocoa.
+
\target universal binaries
\section1 Universal Binaries
In 2006, Apple begin transitioning from PowerPC (PPC) to Intel (x86)
systems. Both architectures are supported by Qt. The release of Mac OS X
10.5 in October 2007 added the possibility of writing and deploying 64-bit
- GUI applications. Qt 4.5 supports both the 32-bit (PPC and x86) and 64-bit
- (PPC64 and x86-64) versions of PowerPC and Intel-based systems are
- supported.
+ GUI applications. Qt 4.5 and up supports both the 32-bit (PPC and x86) and
+ 64-bit (PPC64 and x86-64) versions of PowerPC and Intel-based systems.
Universal binaries are used to bundle binaries for more than one
architecture into a single package, simplifying deployment and
@@ -221,7 +236,7 @@
In general, Qt supports building on one Mac OS X version and deploying on
all others, both forward and backwards. You can build on 10.4 Tiger and run
- the same binary on 10.3 and 10.5.
+ the same binary on 10.5 and up.
Some restrictions apply:
diff --git a/doc/src/examples.qdoc b/doc/src/examples.qdoc
index 1f20b91..f6bb877 100644
--- a/doc/src/examples.qdoc
+++ b/doc/src/examples.qdoc
@@ -90,6 +90,7 @@
\section1 Animation
\list
+ \o \l{animation/moveblocks}{Move Blocks}\raisedaster
\o \l{animation/stickman}{Stick man}\raisedaster
\endlist
diff --git a/doc/src/examples/frozencolumn.qdoc b/doc/src/examples/frozencolumn.qdoc
index e5a3b59..9d89478 100644
--- a/doc/src/examples/frozencolumn.qdoc
+++ b/doc/src/examples/frozencolumn.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** 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.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc
new file mode 100644
index 0000000..2bdcca5
--- /dev/null
+++ b/doc/src/examples/moveblocks.qdoc
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** 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 animation/moveblocks
+ \title Move Blocks Example
+
+ The Move Blocks example shows how to animate items in a
+ QGraphicsScene using a QStateMachine with a custom transition.
+
+ \image moveblocks-example.png
+
+ The example animates the blue blocks that you can see in the image
+ above. The animation moves the blocks between four preset positions.
+
+ The example consists of the following classes:
+
+ \list
+ \o \c StateSwitcher inherits QState and can add
+ \c {StateSwitchTransition}s to other states.
+ When entered, it will randomly transition to one of these
+ states.
+ \o \c StateSwitchTransition is a custom transition that
+ triggers on \c{StateSwitchEvent}s.
+ \o \c StateSwitchEvent is a QEvent that trigger \c{StateSwitchTransition}s.
+ \o \c QGraphicsRectWidget is a QGraphicsWidget that simply
+ paints its background in a solid \l{Qt::}{blue} color.
+ \endlist
+
+ The blocks are instances of \c QGraphicsRectWidget and are
+ animated in a QGraphicsScene. We do this by building a state
+ graph, which we insert animations into. The graph is then executed
+ in a QStateMachine. All this is done in \c main().
+ Let's look at the \c main() function first.
+
+ \section1 The \c main() Function
+
+ After QApplication has been initialized, we set up the
+ QGraphicsScene with its \c{QGraphicsRectWidget}s.
+
+ \snippet examples/animation/moveblocks/main.cpp 1
+
+ After adding the scene to a QGraphicsView, it is time to build the
+ state graph. Let's first look at a statechart of what we are
+ trying to build.
+
+ \image move-blocks-chart.png
+
+ Note that the \c group has seven sub states, but we have only
+ included three of them in the diagram. The code that builds this
+ graph will be examined line-by-line, and will show how the graph
+ works. First off, we construct the \c group state:
+
+ \snippet examples/animation/moveblocks/main.cpp 2
+
+ The timer is used to add a delay between each time the blocks are
+ moved. The timer is started when \c group is entered. As we will
+ see later, \c group has a transition back to the \c StateSwitcher
+ when the timer times out. \c group is the initial state in the
+ machine, so an animation will be scheduled when the example is
+ started.
+
+ \snippet examples/animation/moveblocks/main.cpp 3
+ \dots
+ \snippet examples/animation/moveblocks/main.cpp 4
+
+ \c createGeometryState() returns a QState that will set the
+ geometry of our items upon entry. It also assigns \c group as the
+ parent of this state.
+
+ A QPropertyAnimation inserted into a transition will use the
+ values assigned to a QState (with QState::assignProperty()), i.e.,
+ the animation will interpolate between the current values of the
+ properties and the values in the target state. We add animated
+ transitions to the state graph later.
+
+ \snippet examples/animation/moveblocks/main.cpp 5
+
+ We move the items in parallel. Each item is added to \c
+ animationGroup, which is the animation that is inserted into the
+ transitions.
+
+ \snippet examples/animation/moveblocks/main.cpp 6
+
+ The sequential animation group, \c subGroup, helps us insert a
+ delay between the animation of each item.
+
+ \snippet examples/animation/moveblocks/main.cpp 7
+ \dots
+ \snippet examples/animation/moveblocks/main.cpp 8
+
+ A StateSwitchTransition is added to the state switcher
+ in \c StateSwitcher::addState(). We also add the animation in this
+ function. Since QPropertyAnimation uses the values from the
+ states, we can insert the same QPropertyAnimation instance in all
+ \c {StateSwitchTransition}s.
+
+ As mentioned previously, we add a transition to the state switcher
+ that triggers when the timer times out.
+
+ \snippet examples/animation/moveblocks/main.cpp 9
+
+ Finally, we can create the state machine, add our initial state,
+ and start execution of the state graph.
+
+ \section2 The \c createGemetryState() Function
+
+ In \c createGeometryState(), we set up the geometry for each
+ graphics item.
+
+ \snippet examples/animation/moveblocks/main.cpp 13
+
+ As mentioned before, QAbstractTransition will set up an animation
+ added with \l{QAbstractTransition::}{addAnimation()} using
+ property values set with \l{QState::}{assignProperty()}.
+
+ \section1 The StateSwitcher Class
+
+ \c StateSwitcher has state switch transitions to each \l{QState}s
+ we created with \c createGemetryState(). Its job is to transition
+ to one of these states at random when it is entered.
+
+ All functions in \c StateSwitcher are inlined. We'll step through
+ its definition.
+
+ \snippet examples/animation/moveblocks/main.cpp 10
+
+ \c StateSwitcher is a state designed for a particular purpose and
+ will always be a top-level state. We use \c m_stateCount to keep
+ track of how many states we are managing, and \c m_lastIndex to
+ remember which state was the last state to which we transitioned.
+
+ \snippet examples/animation/moveblocks/main.cpp 11
+
+ We select the next state we are going to transition to, and post a
+ \c StateSwitchEvent, which we know will trigger the \c
+ StateSwitchTransition to the selected state.
+
+ \snippet examples/animation/moveblocks/main.cpp 12
+
+ This is where the magic happens. We assign a number to each state
+ added. This number is given to both a StateSwitchTransition and to
+ StateSwitchEvents. As we have seen, state switch events will
+ trigger a transition with the same number.
+
+ \section1 The StateSwitchTransition Class
+
+ \c StateSwitchTransition inherits QAbstractTransition and triggers
+ on \c{StateSwitchEvent}s. It contains only inline functions, so
+ let's take a look at its \l{QAbstractTransition::}{eventTest()}
+ function, which is the only function that we define..
+
+ \snippet examples/animation/moveblocks/main.cpp 14
+
+ \c eventTest is called by QStateMachine when it checks whether a
+ transition should be triggered--a return value of true means that
+ it will. We simply check if our assigned number is equal to the
+ event's number (in which case we fire away).
+
+ \section1 The StateSwitchEvent Class
+
+ \c StateSwitchEvent inherits QEvent, and holds a number that has
+ been assigned to a state and state switch transition by \c
+ StateSwitcher. We have already seen how it is used to trigger \c
+ \c{StateSwitchTransition}s in \c StateSwitcher.
+
+ \snippet examples/animation/moveblocks/main.cpp 15
+
+ We only have inlined functions in this class, so a look at its
+ definition will do.
+
+ \section1 The QGraphicsRectWidget Class
+
+ QGraphicsRectWidget inherits QGraphicsWidget and simply paints its
+ \l{QWidget::}{rect()} blue. We inline \l{QWidget::}{paintEvent()},
+ which is the only function we define. Here is the
+ QGraphicsRectWidget class definition:
+
+ \snippet examples/animation/moveblocks/main.cpp 16
+
+ \section1 Moving On
+
+ The technique shown in this example works equally well for all
+ \l{QPropertyAnimation}s. As long as the value to be animated is a
+ Qt property, you can insert an animation of it into a state graph.
+
+ QState::addAnimation() takes a QAbstractAnimation, so any type
+ of animation can be inserted into the graph.
+*/
+
diff --git a/doc/src/images/checkboxes-exclusive.png b/doc/src/images/checkboxes-exclusive.png
new file mode 100644
index 0000000..0ada3a0
--- /dev/null
+++ b/doc/src/images/checkboxes-exclusive.png
Binary files differ
diff --git a/doc/src/images/checkboxes-non-exclusive.png b/doc/src/images/checkboxes-non-exclusive.png
new file mode 100644
index 0000000..4211aae
--- /dev/null
+++ b/doc/src/images/checkboxes-non-exclusive.png
Binary files differ
diff --git a/doc/src/images/move-blocks-chart.png b/doc/src/images/move-blocks-chart.png
new file mode 100644
index 0000000..fd0c165
--- /dev/null
+++ b/doc/src/images/move-blocks-chart.png
Binary files differ
diff --git a/doc/src/images/moveblocks-example.png b/doc/src/images/moveblocks-example.png
new file mode 100644
index 0000000..56353d1
--- /dev/null
+++ b/doc/src/images/moveblocks-example.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 0ca1975..b59523e 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -152,7 +152,6 @@
<li><a href="qt-embedded.html">Qt for Embedded Platforms</a></li>
<li><a href="overviews.html">All Overviews and HOWTOs</a></li>
<li><a href="gallery.html">Qt Widget Gallery</a></li>
- <li><a href="http://doc.trolltech.com/extras/qt43-class-chart.pdf">Class Chart</a></li>
<li><a href="qtglobal.html">Qt Global Declarations</a></li>
</ul>
</td>
@@ -181,6 +180,7 @@
<li><a href="qthelp.html">Help Module</a></li>
<li><a href="qtnetwork.html">Network Module</a></li>
<li><a href="qtopengl.html">OpenGL Module</a></li>
+ <li><a href="qtopenvg.html">OpenVG Module</a></li>
<li><a href="qtscript.html">Script Module</a></li>
<li><a href="qtsql.html">SQL Module</a></li>
<li><a href="qtsvg.html">SVG Module</a></li>
diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc
index f5d3788..d868069 100644
--- a/doc/src/installation.qdoc
+++ b/doc/src/installation.qdoc
@@ -595,7 +595,9 @@ in the \l{Qt for Windows CE Requirements} document.
\endraw
The QtGui module and the QtCore module, which provides the non-GUI features required
- by QtGui, depend on the libraries described in the following table.
+ by QtGui, depend on the libraries described in the following table. To build
+ Qt from its source code, you will also need to install the development
+ packages for these libraries for your system.
\table 90%
\header \o Name \o Library \o Notes \o Configuration options \o Minimum working version
@@ -653,6 +655,28 @@ in the \l{Qt for Windows CE Requirements} document.
\note You must compile with XRender support to get alpha transparency
support for pixmaps and images.
+ Development packages for these libraries contain header files that are used
+ when building Qt from its source code. On Debian-based GNU/Linux systems,
+ for example, we recommend that you install the following development
+ packages:
+
+ \list
+ \o libfontconfig1-dev
+ \o libfreetype6-dev
+ \o libx11-dev
+ \o libxcursor-dev
+ \o libxext-dev
+ \o libxfixes-dev
+ \o libxft-dev
+ \o libxi-dev
+ \o libxrandr-dev
+ \o libxrender-dev
+ \endlist
+
+ Some of these packages depend on others in this list, so installing one
+ may cause others to be automatically installed. Other distributions may
+ provide system packages with similar names.
+
\section1 Phonon Dependencies
As described in the \l{Phonon Overview}, Phonon uses the GStreamer multimedia
diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc
index 0743bab..09274bf 100644
--- a/doc/src/phonon-api.qdoc
+++ b/doc/src/phonon-api.qdoc
@@ -1115,6 +1115,11 @@
\note Sequential devices can also be used, but MediaObject::isSeekable() will
return false as a result.
+ \warning On Windows, we only support \l{QIODevice}s containing the
+ \c avi, \c mp3, or \c mpg formats. Use the constructor that takes
+ a file name to open files (the Qt backend does not use a QFile
+ internally).
+
\sa setAutoDelete()
*/
@@ -1864,7 +1869,7 @@
\snippet doc/src/snippets/code/doc_src_phonon-api.qdoc 14
- \sa currentSource()
+ \sa currentSource(), MediaSource
*/
/*!
diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc
index 23094e1..8fe8170 100644
--- a/doc/src/platform-notes.qdoc
+++ b/doc/src/platform-notes.qdoc
@@ -397,7 +397,7 @@
\row \o Apple Mac OS X (32-bit) \o gcc 4.0.1
\row \o Linux (32 and 64-bit) \o gcc 4.1, 4.2, 4.3
\row \o Microsoft Windows \o gcc 3.4.2 (MinGW) (32-bit), MSVC 2003, 2005 (32 and 64-bit), 2008,
- \l{Known Issues in %VERSION%}{Intel icc (see note)}
+ \l{Intel C++ Compiler}{Intel icc (see note)}
\endtable
Any platform-compiler combinations not listed here should be considered unsupported.
@@ -596,8 +596,9 @@
\section1 Intel C++ Compiler
- \warning Please see the \l{Known Issues in %VERSION%} page for information
- about an issue with this compiler.
+ Qt supports the Intel C++ compiler on both Windows and Linux.
+ However, there are a few issues on Linux (see the following
+ section).
\section2 Intel C++ Compiler for Linux
diff --git a/doc/src/properties.qdoc b/doc/src/properties.qdoc
index 5490dd0..1aa41a9 100644
--- a/doc/src/properties.qdoc
+++ b/doc/src/properties.qdoc
@@ -122,6 +122,12 @@
editable property for (checkable) buttons. Note that QItemDelegate
gets and sets a widget's \c USER property.
+ \o The presence of the \c CONSTANT attibute indicates that the property
+ value is constant. For a given object instance, the \c READ method of a
+ constant property must return the same value every time it is called. This
+ constant value may be different for different instances of the object. A
+ constant property cannot have a \c WRITE method or a \c NOTIFY signal.
+
\endlist
The \c READ, \c WRITE, and \c RESET functions can be inherited.
diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc
index f8347c1..d4d51c7 100644
--- a/doc/src/qmake-manual.qdoc
+++ b/doc/src/qmake-manual.qdoc
@@ -858,10 +858,12 @@
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 21
-
Each time you update the project file, you need to run \c qmake to generate
an updated Visual Studio project.
+ \note If you are using the Visual Studio Add-in, you can import \c .pro
+ files via the \gui{Qt->Import from .pro file} menu item.
+
\section2 Visual Studio 2005 Manifest Files
When deploying Qt applications built using Visual Studio 2005, it is
@@ -1922,6 +1924,14 @@
typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
needs to be modified.
+ \target QMAKE_INCDIR_EGL
+ \section1 QMAKE_INCDIR_EGL
+
+ This variable contains the location of EGL header files to be added
+ to INCLUDEPATH when building an application with OpenGL/ES or
+ OpenVG support. The value of this variable is typically handled by
+ \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
\target QMAKE_INCDIR_OPENGL
\section1 QMAKE_INCDIR_OPENGL
@@ -1930,6 +1940,20 @@
value of this variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ If the OpenGL implementation uses EGL (most OpenGL/ES systems),
+ then QMAKE_INCDIR_EGL may also need to be set.
+
+ \target QMAKE_INCDIR_OPENVG
+ \section1 QMAKE_INCDIR_OPENVG
+
+ This variable contains the location of OpenVG header files to be added
+ to INCLUDEPATH when building an application with OpenVG support. The
+ value of this variable is typically handled by \c qmake or
+ \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ If the OpenVG implementation uses EGL then QMAKE_INCDIR_EGL may also
+ need to be set.
+
\target QMAKE_INCDIR_QT
\section1 QMAKE_INCDIR_QT
@@ -2078,6 +2102,13 @@
\c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \section1 QMAKE_LIBDIR_EGL
+
+ This variable contains the location of the EGL library
+ directory, when EGL is used with OpenGL/ES or OpenVG. The value
+ of this variable is typically handled by \c qmake or
+ \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
\section1 QMAKE_LIBDIR_OPENGL
This variable contains the location of the OpenGL library
@@ -2085,6 +2116,19 @@
\c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ If the OpenGL implementation uses EGL (most OpenGL/ES systems),
+ then QMAKE_LIBDIR_EGL may also need to be set.
+
+ \section1 QMAKE_LIBDIR_OPENVG
+
+ This variable contains the location of the OpenVG library
+ directory. The value of this variable is typically handled by
+ \c qmake or
+ \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+
+ If the OpenVG implementation uses EGL, then QMAKE_LIBDIR_EGL
+ may also need to be set.
+
\section1 QMAKE_LIBDIR_QT
This variable contains the location of the Qt library
@@ -2116,18 +2160,41 @@
project on Windows. \l{#QMAKE_LIBS_WINDOW}{QMAKE_LIBS_WINDOW}
should now be used instead.
+ \section1 QMAKE_LIBS_EGL
+
+ This variable contains all EGL libraries when building Qt with
+ OpenGL/ES or OpenVG. The value of this variable is typically
+ handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
+ needs to be modified. The usual value is \c{-lEGL}.
+
\section1 QMAKE_LIBS_OPENGL
This variable contains all OpenGL libraries. The value of this
variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ If the OpenGL implementation uses EGL (most OpenGL/ES systems),
+ then QMAKE_LIBS_EGL may also need to be set.
+
\section1 QMAKE_LIBS_OPENGL_QT
This variable contains all OpenGL Qt libraries.The value of this
variable is typically handled by \c qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \section1 QMAKE_LIBS_OPENVG
+
+ This variable contains all OpenVG libraries. The value of this
+ variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf}
+ and rarely needs to be modified. The usual value is \c{-lOpenVG}.
+
+ Some OpenVG engines are implemented on top of OpenGL. This will
+ be detected at configure time and QMAKE_LIBS_OPENGL will be implicitly
+ added to QMAKE_LIBS_OPENVG wherever the OpenVG libraries are linked.
+
+ If the OpenVG implementation uses EGL, then QMAKE_LIBS_EGL may also
+ need to be set.
+
\section1 QMAKE_LIBS_QT
This variable contains all Qt libraries.The value of this
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index 7e655b6..805855a 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -1203,6 +1203,11 @@
on Mac when using Carbon. This attribute has no effect on Cocoa.
The attribute is off by default and can be enabled on a per-window basis.
+ \value WA_AcceptTouchEvents Allows touch events (see QTouchEvent)
+ to be sent to the widget. Must be set on all widgets that can
+ handle touch events. Without this attribute set, events from a
+ touch device will be sent as mouse events.
+
\omitvalue WA_SetLayoutDirection
\omitvalue WA_InputMethodTransparent
\omitvalue WA_WState_CompressKeys
@@ -1232,6 +1237,7 @@
\omitvalue WA_X11BypassTransientForHint
\omitvalue WA_SetWindowModality
\omitvalue WA_WState_WindowOpacitySet
+ \omitvalue WA_WState_AcceptedTouchBeginEvent
*/
/*! \typedef Qt::HANDLE
@@ -2691,3 +2697,52 @@
\internal
*/
+/*! \enum Qt::GestureType
+ \since 4.6
+
+ This enum lists standard gestures.
+
+ \value UnknownGesture An unknown gesture. This enum value shouldn't be used.
+ \value TapGesture A single tap gesture.
+ \value DoubleTapGesture A double tap gesture.
+ \value TrippleTapGesture A tripple tap gesture.
+ \value TapAndHoldGesture A tap-and-hold (long tap) gesture.
+ \value PanGesture A pan gesture.
+ \value PinchGesture A pinch gesture.
+*/
+
+/*!
+ \enum Qt::GestureState
+ \since 4.6
+
+ This enum type describes the state of a gesture.
+
+ \omitvalue NoGesture
+ \value GestureStarted A continuous gesture has started.
+ \value GestureUpdated A gesture continiues.
+ \value GestureFinished A gesture has finished.
+
+ \sa QGesture
+*/
+
+/*!
+ \enum Qt::DirectionType
+ \since 4.6
+
+ This enum type describes directions. This could be used by the
+ gesture recognizers.
+
+ \value NoDirection Non-specific direction.
+ \value LeftDownDirection
+ \value DownLeftDirection
+ \value DownDirection
+ \value RightDownDirection
+ \value DownRightDirection
+ \value LeftDirection
+ \value RightDirection
+ \value LeftUpDirection
+ \value UpLeftDirection
+ \value UpDirection
+ \value RightUpDirection
+ \value UpRightDirection
+*/
diff --git a/doc/src/qsqldatatype-table.qdoc b/doc/src/qsqldatatype-table.qdoc
new file mode 100644
index 0000000..5ab6413
--- /dev/null
+++ b/doc/src/qsqldatatype-table.qdoc
@@ -0,0 +1,584 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+ \module QtSql
+
+ \page qsqldatatype-table.html
+
+ \title QtSql Module - Recommended use of data types
+
+ \section1 Recommended use of types and widgets in Qt supported Databases
+
+ This table shows the recommended data types used when extracting data
+ from the databases supported in Qt. It is important to note that the
+ types used in Qt not necessary are valid as input to the specific
+ database. One example could be that a double would work perfect as
+ input for floating point records in a database, but not necessary
+ as output to the database since it would be stored with 64-bit in C++.
+
+ \tableofcontents
+
+ \section2 IBM DB2 data type
+
+ \table
+ \row
+ \header IBM DB2 data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type and Qt )
+ \row
+ \o SMALLINT
+ \o 16-bit signed integer
+ \o typedef qint16
+ \row
+ \o INTEGER
+ \o 32-bit signed integer
+ \o typedef qint32
+ \row
+ \o BIGINT
+ \o 64-bit signed integer
+ \o typedef qint64
+ \row
+ \o REAL
+ \o 32-bit Single-precision floating point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE PRECISION
+ \o 64-bit Double-precision floating point
+ \o By default mapping to QString
+ \row
+ \o FLOAT
+ \o 64-bit Double-precision floating point
+ \o By default mapping to QString
+ \row
+ \o CHAR
+ \o Fixed-length, null-terminated character string
+ \o Mapped to QString
+ \row
+ \o VARCHAR
+ \o Null-terminated varying length string
+ \o Mapped to QString
+ \row
+ \o LONG VARCHAR
+ \o Not null-terminated varying length character string
+ \o Mapped to QString
+ \row
+ \o BLOB
+ \o Not null-terminated varying binary string with 4-byte string
+ length indicator
+ \o Mapped to QByteArray
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o DATE
+ \o Null-terminated character string of the following format:
+ yyyy-mm-dd
+ \o Mapped to QDate
+ \row
+ \o TIME
+ \o Null-terminated character string of the following format: hh.mm.ss
+ \o Mapped to QTime
+ \row
+ \o TIMESTAMP
+ \o Null-terminated character string of the following format: yyyy-mm-dd-hh.mm.ss.nnnnnn
+ \o Mapped to QDateTime
+ \endtable
+
+ \section2 Borland InterBase data type
+
+ \table
+ \row
+ \header Borland InterBase data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o BOOLEAN
+ \o Boolean
+ \o bool
+ \row
+ \o TINYINT
+ \o 8 bit signed integer
+ \o typedef qint8
+ \row
+ \o SMALLINT
+ \o 16-bit signed integer
+ \o typedef qint16
+ \row
+ \o INTEGER
+ \o 32-bit signed integer
+ \o typedef qint32
+ \row
+ \o BIGINT LONG
+ \o 64-bit signed integer
+ \o typedef qint64
+ \row
+ \o REAL FLOAT
+ \o 32-bit floating point
+ \o By default mapping to QString
+ \row
+ \o FLOAT
+ \o 64-bit floating point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE
+ \o 64-bit floating point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE PRECISION
+ \o 64-bit Double-precision floating point
+ \o By default mapping to QString
+ \row
+ \o VARCHAR STRING
+ \o Character string, Unicode
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o DATE
+ \o Displays date. Format: 'yyyy-mm-dd'
+ \o Mapped to QDate
+ \row
+ \o TIME
+ \o Displays time. Format is 'hh:mm:ss' in 24-hour format
+ \o Mapped to QTime
+ \row
+ \o TIMESTAMP
+ \o Displays a timestamp. Format is 'yyyy-mm-dd hh:mm:ss'
+ \o Mapped to QDateTime
+ \endtable
+
+ \section2 MySQL data type
+
+ \table
+ \row
+ \header MySQL data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o TINYINT
+ \o 8 bit signed integer
+ \o typedef qint8
+ \row
+ \o TINYINT UNSIGNED
+ \o 8 bit unsigned integer
+ \o typedef quint8
+ \row
+ \o SMALLINT
+ \o 16-bit signed integer
+ \o typedef qint16
+ \row
+ \o SMALLINT UNSIGNED
+ \o 16-bit unsigned integer
+ \o typedef quint16
+ \row
+ \o INT
+ \o 32-bit signed integer
+ \o typedef qint32
+ \row
+ \o INT UNSIGNED
+ \o 32-bit unsigned integer
+ \o typedef quint32
+ \row
+ \o BIGINT
+ \o 64-bit signed integer
+ \o typedef qint64
+ \row
+ \o FLOAT
+ \o 32-bit Floating Point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE
+ \o 64-bit Floating Point
+ \o By default mapping to QString
+ \row
+ \o CHAR
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o VARCHAR
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o TINYTEXT
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o TEXT
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o MEDIUMTEXT
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o LONGTEXT
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o all BLOB types
+ \o BLOB
+ \o Mapped to QByteArray
+ \row
+ \o DATE
+ \o Date without Time
+ \o Mapped to QDate
+ \row
+ \o DATETIME
+ \o Date and Time
+ \o Mapped to QDateTime
+ \row
+ \o TIMESTAMP
+ \o Date and Time
+ \o Mapped to QDateTime
+ \row
+ \o TIME
+ \o Time
+ \o Mapped to QTime
+ \row
+ \o YEAR
+ \o Year (int)
+ \o Mapped to QDateTime
+ \row
+ \o ENUM
+ \o Enumeration of Value Set
+ \o Mapped to QString
+ \endtable
+
+ \section2 Oracle Call Interface data type
+
+ \table
+ \row
+ \header Oracle Call Interface data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o NUMBER
+ \o FLOAT, DOUBLE, PRECISIONc REAL
+ \o By default mapping to QString
+ \row
+ \o NUMBER(38)
+ \o INTEGER INT SMALLINT
+ \o typedef qint8/16/32/64
+ \row
+ \o NUMBER(p,s)
+ \o NUMERIC(p,s) DECIMAL(p,s)a
+ \o By default mapping to QString
+ \row
+ \o NVARCHAR2(n)
+ \o Character string (NATIONAL CHARACTER VARYING(n) NATIONAL
+ CHAR VARYING(n) NCHAR VARYING(n))
+ \o Mapped to QString
+ \row
+ \o NCHAR(n)
+ \o Character string (NATIONAL CHARACTER(n) NATIONAL CHAR(n)
+ NCHAR(n))
+ \o Mapped to QString
+ \row
+ \o CHAR(n)
+ \o Character string (CHARACTER(n) CHAR(n))
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o BLOB
+ \o A binary large object
+ \o Mapped to QByteArray
+ \row
+ \o TIMESTAMP
+ \o Year, month, and day values of date, as well as hour, minute,
+ and second values of time
+ \o Mapped to QDateTime
+ \endtable
+
+ \section2 ODBC data type
+
+ \table
+ \row
+ \header ODBC data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o BIT
+ \o Boolean
+ \o BOOL
+ \row
+ \o TINYINT
+ \o 8 bit integer
+ \o typedef qint8
+ \row
+ \o SMALLINT
+ \o 16-bit signed integer
+ \o typedef qint16
+ \row
+ \o INTEGER
+ \o 32-bit signed integer
+ \o typedef qint32
+ \row
+ \o BIGINT
+ \o 64-bit signed integer
+ \o typedef qint64
+ \row
+ \o REAL
+ \o 32-bit Single-precision floating point
+ \o By default mapping to QString
+ \row
+ \o FLOAT
+ \o 64-bit Double floating point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE
+ \o 64-bit Double floating point
+ \o By default mapping to QString
+ \row
+ \o CHAR
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o VARCHAR
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o LONGVARCHAR
+ \o Character string
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o DATE
+ \o Character string
+ \o Mapped to QDate
+ \row
+ \o TIME
+ \o Character Time, Character string
+ \o Mapped to QTime
+ \row
+ \o TIMESTAMP
+ \o Character Time, Character string
+ \o Mapped to QDateTime
+ \endtable
+
+ \section2 PostgreSQL data type
+
+ \table
+ \row
+ \header PostgreSQL data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o BOOLEAN
+ \o Boolean
+ \o bool
+ \row
+ \o SMALLINT
+ \o 16-bit signed integer
+ \o typedef qint16
+ \row
+ \o INTEGER
+ \o 32-bit signed integer
+ \o typedef qint32
+ \row
+ \o BIGINT
+ \o 64-bit signed integer
+ \o typedef qint64
+ \row
+ \o REAL
+ \o 32-bit variable-precision floating point
+ \o By default mapping to QString
+ \row
+ \o DOUBLE PRECISION
+ \o 64-bit variable-precision floating point
+ \o By default mapping to QString
+ \row
+ \o DECIMAL VARIABLE
+ \o user-specified precision, exact
+ \o Mapped to QString
+ \row
+ \o NUMERIC VARIABLE
+ \o user-specified precision, exact
+ \o Mapped to QString
+ \row
+ \o VARCHAR
+ \o variable-length character string
+ \o Mapped to QString
+ \row
+ \o CHARACTER
+ \o Character string of fixed-length
+ \o Mapped to QString
+ \row
+ \o TEXT
+ \o Character string of variable-length
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o TIMESTAMP
+ \o 8 bytes, both date and time
+ \o Mapped to QDateTime
+ \row
+ \o TIMESTAMP
+ \o 8 bytes, both date and time, with time zone
+ \o Mapped to QDateTime
+ \row
+ \o DATE
+ \o 4 bytes, dates only
+ \o Mapped to QDate
+ \row
+ \o TIME
+ \o 8 bytes, times of day only 00:00:00.00 - 23:59:59.99
+ \o Mapped to QTime
+ \row
+ \o TIME
+ \o 12 bytes times of day only, with time zone 00:00:00.00+12
+ \o Mapped to QDateTime
+ \endtable
+
+ \section2 QSQLITE SQLite version 3 data type
+
+ \table
+ \row
+ \header QSQLITE SQLite version 3 data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o NULL
+ \o NULL value.
+ \o NULL
+ \row
+ \o INTEGER
+ \o Signed integer, stored in 8, 16, 24, 32, 48, or 64-bits
+ depending on the magnitude of the value.
+ \o typedef qint8/16/32/64
+ \row
+ \o REAL
+ \o 64-bit floating point value.
+ \o By default mapping to QString
+ \row
+ \o TEXT
+ \o Character string (UTF-8, UTF-16BE or UTF-16-LE).
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o BLOB
+ \o The value is a BLOB of data, stored exactly as it was input.
+ \o Mapped to QByteArray
+ \endtable
+
+ \section2 Sybase Adaptive Server data type
+
+ \table
+ \row
+ \header Sybase Adaptive Server data type
+ \header SQL Type Description
+ \header Recommended input (C++ data type/Qt Widget)
+ \row
+ \o BINARY
+ \o Describes a fixed-length binary value up to 255 bytes in size.
+ \o Mapped to QByteArray
+ \row
+ \o CHAR
+ \o Character String
+ \o Mapped to QString
+ \row
+ \o DATETIME
+ \o Date and time. Range: 1753-01-01 00:00:00 through
+ 9999-12-31 23:59:59.
+ \o Mapped to QDateTime
+ \row
+ \o NCHAR
+ \o Character String of fixed length
+ \o Mapped to QString
+ \row
+ \o NVARACHAR
+ \o Character String of variable length
+ \o Mapped to QString
+ \row
+ \o VARCHAR
+ \o Character String of fixed length
+ \o Mapped to QString
+ \row
+ \o CLOB
+ \o Character large string object
+ \o Mapped to QString
+ \row
+ \o TIMESTAMP
+ \o A unique number within a database
+ \o Mapped to QString
+ \row
+ \o SMALLDATETIME
+ \o Date and time. Range: 1900-01-01 00:00 through 2079-12-31 23:59
+ \o Mapped to QDateTime
+ \row
+ \o UNICHAR
+ \o Character String of fixed length.(Unicode)
+ \o Mapped to QString
+ \row
+ \o UNIVARCHAR
+ \o Character String of variable length.(Unicode)
+ \o Mapped to QString
+ \row
+ \o VARBINARY
+ \o Describes a variable-length binary value up to 255 bytes in size
+ \o Mapped to QByteArray
+ \endtable
+
+ \section2 SQLite Version 2
+ SQLite V.2 is "typeless". This means that you can store any kind of
+ data you want in any column of any table, regardless of the declared
+ data type of that column. We recommend that you map the data to QString.
+
+*/
diff --git a/doc/src/qtopenvg.qdoc b/doc/src/qtopenvg.qdoc
index ad036ef..38be288 100644
--- a/doc/src/qtopenvg.qdoc
+++ b/doc/src/qtopenvg.qdoc
@@ -42,32 +42,283 @@
/*!
\module QtOpenVG
\title QtOpenVG Module
+ \since 4.6
\contentspage Qt's Modules
\previouspage QtOpenGL
- \nextpage QtSql
+ \nextpage QtScript
\ingroup modules
- \brief The QtOpenVG module offers classes that make it easy to
- use OpenVG in Qt applications.
+ \brief The QtOpenVG module provides support classes for OpenVG painting.
- From the OpenVG 1.1 Specification:
+ \tableofcontents
- \quotation
+ OpenVG is a standard API from the
+ \l{http://www.khronos.org/openvg}{Khronos Group} for accelerated
+ 2D vector graphics that is appearing in an increasing number of
+ embedded devices.
- OpenVG is an application programming interface (API) for hardware-accelerated two-
- dimensional vector and raster graphics developed under the auspices of the Khronos
- Group (www.khronos.org). It provides a device-independent and vendor-neutral interface
- for sophisticated 2D graphical applications, while allowing device manufacturers to
- provide hardware acceleration where appropriate.
+ OpenVG is optimized for 2D vector operations, and closely matches
+ the functionality in QPainter. It can therefore be an excellent
+ substitute for the default raster-based QPaintEngine on hardware
+ that supports OpenVG.
- \endquotation
+ \section1 Building Qt with OpenVG support
- The specification, and a reference implementation of it are available from the
- \l{http://www.khronos.org/registry/vg/}{Khronos Group}.
+ OpenVG support can be enabled by passing the \c{-openvg} option
+ to configure. It is assumed that the following qmake variables
+ are set to appropriate values in the qmake.conf file for your
+ platform:
- \bold{Note:} Khronos and OpenVG are trademarks of The Khronos Group Inc. OpenGL is a
- registered trademark, and OpenGL ES is a trademark, of Silicon Graphics, Inc.
+ \list
+ \o QMAKE_INCDIR_OPENVG
+ \o QMAKE_LIBDIR_OPENVG
+ \o QMAKE_LIBS_OPENVG
+ \endlist
+ Most OpenVG implementations are based on EGL, so the following
+ variables may also need to be set:
- The Qt OpenVG module makes it easy to use OpenVG in Qt applications.
+ \list
+ \o QMAKE_INCDIR_EGL
+ \o QMAKE_LIBDIR_EGL
+ \o QMAKE_LIBS_EGL
+ \endlist
+
+ See \l{qmake Variable Reference} for more information on these variables.
+
+ Two kinds of OpenVG engines are currently supported: EGL based,
+ and engines built on top of OpenGL such as
+ \l{http://sourceforge.net/projects/shivavg}{ShivaVG}.
+ EGL based engines are preferred.
+
+ It is assumed that the EGL implementation has some way to turn a
+ QWidget::winId() into an EGL rendering surface with
+ \c{eglCreateWindowSurface()}. If this is not the case, then
+ modifications may be needed to the code under \c{src/gui/egl} and
+ \c{src/plugins/graphicssystems/openvg} to accomodate the EGL
+ implementation.
+
+ The ShivaVG graphics system under \c{src/plugins/graphicssystems/shivavg}
+ is an example of how to integrate a non-EGL implementation of
+ OpenVG into Qt. It is currently only supported with Qt/X11
+ and being an example only, the resulting screen output may not
+ be as good as with other OpenVG engines.
+
+ \section1 Using the OpenVG graphics system
+
+ Once the graphics system plugin has been built and installed,
+ applications can be run as follows to use the plugin:
+
+ \code
+ app -graphicssystem OpenVG
+ \endcode
+
+ If ShivaVG is being used, then substitute \c ShivaVG instead of
+ \c OpenVG in the line above.
+
+ If the plugin fails to load, try setting the \c QT_DEBUG_PLUGINS
+ environment variable to 1 and try again. Usually the plugin
+ cannot be loaded because Qt cannot locate it in the directory
+ \c{plugins/graphicssystems} within the Qt installation, or the
+ dynamic library path does not include the directory containing
+ the system's \c libOpenVG.so library.
+
+ \section1 Supported features
+
+ \section2 Context modes
+
+ The default configuration is "single-context" mode, where a single
+ EGLContext object is used for all drawing, regardless of the surface.
+ Multiple EGLSurfaces are created, one for each window surface or pixmap.
+ eglMakeCurrent() is called with the same EGLContext every time, but a
+ different EGLSurface.
+
+ Single-context mode is necessary for QPixmapData to be implemented in
+ terms of a VGImage. If single-context mode is not enabled, then QPixmapData
+ will use the fallback QRasterPixmapData implementation, which is less
+ efficient performance-wise.
+
+ Single-context mode can be disabled with the QVG_NO_SINGLE_CONTEXT define
+ if the OpenVG engine does not support one context with multiple surfaces.
+
+ \section2 Transformation matrices
+
+ All affine and projective transformation matrices are supported.
+
+ QVGPaintEngine will use the engine to accelerate affine transformation
+ matrices only. When a projective transformation matrix is used,
+ QVGPaintEngine will transform the coordinates before passing them
+ to the engine. This will probably incur a performance penalty.
+
+ Pixmaps and images are always transformed by the engine, because
+ OpenVG specifies that projective transformations must work for images.
+
+ It is recommended that client applications should avoid using projective
+ transformations for non-image elements in performance critical code.
+
+ \section2 Composition modes
+
+ The following composition modes are supported:
+
+ \list
+ \o QPainter::CompositionMode_SourceOver
+ \o QPainter::CompositionMode_DestinationOver
+ \o QPainter::CompositionMode_Source
+ \o QPainter::CompositionMode_SourceIn
+ \o QPainter::CompositionMode_DestinationIn
+ \o QPainter::CompositionMode_Plus
+ \o QPainter::CompositionMode_Multiply
+ \o QPainter::CompositionMode_Screen
+ \o QPainter::CompositionMode_Darken
+ \o QPainter::CompositionMode_Lighten
+ \endlist
+
+ The other members of QPainter::CompositionMode are not supported
+ because OpenVG 1.1 does not have an equivalent in its \c VGBlendMode
+ enumeration. Any attempt to set an unsupported mode will result in
+ the actual mode being set to QPainter::CompositionMode_SourceOver.
+ Client applications should avoid using unsupported modes.
+
+ \section2 Pens and brushes
+
+ All pen styles are supported, including cosmetic pens.
+
+ All brush styles are supported except for conical gradients, which are
+ not supported by OpenVG 1.1. Conical gradients will be converted into a
+ solid color brush corresponding to the first color in the gradient's
+ color ramp.
+
+ Affine matrices are supported for brush transforms, but not projective
+ matrices.
+
+ \section2 Rectangles, lines, and points
+
+ Rectangles and lines use cached VGPath objects to try to accelerate
+ drawing operations. vgModifyPathCoords() is used to modify the
+ co-ordinates in the cached VGPath object each time fillRect(),
+ drawRects(), or drawLines() is called.
+
+ If the engine does not implement vgModifyPathCoords() properly, then the
+ QVG_NO_MODIFY_PATH define can be set to disable path caching. This will
+ incur a performance penalty.
+
+ Points are implemented as lines from the point to itself. The cached
+ line drawing VGPath object is used when drawing points.
+
+ \section2 Polygons and Ellipses
+
+ Polygon and ellipse drawing creates a new VGPath object every time
+ drawPolygon() or drawEllipse() is called. If the client application is
+ making heavy use of these functions, the constant creation and destruction
+ of VGPath objects could have an impact on performance.
+
+ If a projective transformation is active, ellipses are converted into
+ cubic curves prior to transformation, which may further impact performance.
+
+ Client applications should avoid polygon and ellipse drawing in performance
+ critical code if possible.
+
+ \section2 Other Objects
+
+ Most other objects (arcs, pies, etc) use drawPath(), which takes a
+ QPainterPath argument. The default implementation in QPainterEngineEx
+ converts the QPainterPath into a QVectorPath and then calls draw(),
+ which in turn converts the QVectorPath into a VGPath for drawing.
+
+ To reduce the overhead, we have overridden drawPath() in QVGPaintEngine
+ to convert QPainterPath's directly into VGPath's. This should help improve
+ performance compared to the default implementation.
+
+ Client applications should try to avoid these types of objects in
+ performance critical code because of the QPainterPath to VGPath
+ conversion cost.
+
+ \section2 Clipping
+
+ Clipping with QRect, QRectF, and QRegion objects is supported on all
+ OpenVG engines with vgMask() if the transformation matrix is the identity
+ or a simple origin translation.
+
+ Clipping with an arbitrary QPainterPath, or setting the clip region when
+ the transformation matrix is simple, is supported only if the OpenVG engine
+ has the vgRenderToMask() function (OpenVG 1.1 and higher).
+
+ The QVG_NO_RENDER_TO_MASK define will disable the use of vgRenderToMask().
+
+ The QVG_SCISSOR_CLIP define will disable clipping with vgMask() or
+ vgRenderToMask() and instead use the scissor rectangle list to perform
+ clipping. Clipping with an arbitrary QPainterPath will not be supported.
+ The QVG_SCISSOR_CLIP define should only be used if the OpenVG engine
+ does not support vgMask() or vgRenderToMask().
+
+ \section2 Opacity
+
+ Opacity is supported for all drawing operations. Solid color pens,
+ solid color brushes, gradient brushes, and image drawing with drawPixmap()
+ and drawImage() will probably have the best performance compared to
+ other kinds of pens and brushes.
+
+ \section2 Text Drawing
+
+ If OpenVG 1.1 is used, the paint engine will use VG fonts to cache glyphs
+ while drawing. If the engine does not support VG fonts correctly,
+ QVG_NO_DRAW_GLYPHS can be defined to disable this mode. Text drawing
+ performance will suffer if VG fonts are not used.
+
+ By default, image-based glyphs are used. If QVG_NO_IMAGE_GLYPHS is defined,
+ then path-based glyphs will be used instead. QVG_NO_IMAGE_GLYPHS is ignored
+ if QVG_NO_DRAW_GLYPHS is defined.
+
+ If path-based glyphs are used, then the OpenVG engine will need to
+ support hinting to render text with good results. Image-based glyphs
+ avoids the need for hinting and will usually give better results than
+ path-based glyphs.
+
+ \section2 Pixmaps
+
+ In single-context mode, pixmaps will be implemented using VGImage
+ unless QVG_NO_PIXMAP_DATA is defined.
+
+ QVGPixmapData will convert QImage's into VGImage's when the application
+ calls drawPixmap(), and the pixmap will be kept in VGImage form for the
+ lifetime of the QVGPixmapData object. When the application tries to paint
+ into a QPixmap with QPainter, the data will be converted back into a
+ QImage and the raster paint engine will be used to render into the QImage.
+
+ This arrangement optimizes for the case of drawing the same static pixmap
+ over and over (e.g. for icons), but does not optimize the case of drawing
+ into pixmaps.
+
+ Bitmaps must use QRasterPixmapData. They are not accelerated with
+ VGImage at present.
+
+ \section2 Pixmap filters
+
+ Convolution, colorize, and drop shadow filters are accelerated using
+ OpenVG operations.
+
+ \section1 Known issues
+
+ Performance of copying the contents of an OpenVG-rendered window to the
+ screen needs platform-specific work in the QVGWindowSurface class.
+
+ Clipping with arbitrary non-rectangular paths only works on engines
+ that support vgRenderToMask(). Simple rectangular paths are supported
+ on all engines that correctly implement vgMask().
+
+ The paint engine is not yet thread-safe, so it is not recommended for
+ use in threaded Qt applications that draw from multiple threads.
+ Drawing should be limited to the main GUI thread.
+
+ Performance of projective matrices for non-image drawing is not as good
+ as for affine matrices.
+
+ QPixmap's are implemented as VGImage objects so that they can be quickly
+ rendered with drawPixmap(). Rendering into a QPixmap using QPainter
+ will use the default Qt raster paint engine on a QImage copy of the
+ QPixmap, and will not be accelerated. This issue may be addressed in
+ a future version of the engine.
+
+ ShivaVG support is highly experimental and limited to Qt/X11. It is
+ provided as an example of how to integrate a non-EGL engine.
*/
diff --git a/doc/src/qtscript.qdoc b/doc/src/qtscript.qdoc
index ac13ddf..f2ac6c9 100644
--- a/doc/src/qtscript.qdoc
+++ b/doc/src/qtscript.qdoc
@@ -44,7 +44,7 @@
\title QtScript Module
\since 4.3
\contentspage Qt's Modules
- \previouspage QtOpenGL
+ \previouspage QtOpenVG
\nextpage QtScriptTools
\ingroup modules
\ingroup scripting
diff --git a/doc/src/qtsql.qdoc b/doc/src/qtsql.qdoc
index ff58c62..54ea86a 100644
--- a/doc/src/qtsql.qdoc
+++ b/doc/src/qtsql.qdoc
@@ -212,6 +212,9 @@
QVariant::toString() and QVariant::toInt() to convert
variants to QString and \c int.
+ For an overview of the recommended types used with Qt supported
+ Databases, please refer to \l {QtSql Module - Recommended use of data types}{this table}.
+
You can iterate back and forth using QSqlQuery::next(),
QSqlQuery::previous(), QSqlQuery::first(), QSqlQuery::last(), and
QSqlQuery::seek(). The current row index is returned by
diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc
index 377cc9c..64e5377 100644
--- a/doc/src/snippets/code/doc_src_properties.qdoc
+++ b/doc/src/snippets/code/doc_src_properties.qdoc
@@ -7,7 +7,8 @@ Q_PROPERTY(type name
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
- [USER bool])
+ [USER bool]
+ [CONSTANT])
//! [0]
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp
index a9c55b3..46a2a5f 100644
--- a/doc/src/snippets/code/src_gui_qproxystyle.cpp
+++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp
@@ -3,7 +3,7 @@ class MyProxyStyle : public QProxyStyle
{
public:
- int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
{
if (hint == QStyle::SH_UnderlineShortcut)
@@ -18,7 +18,7 @@ public:
#include "textedit.h"
#include <QApplication>
#include <QProxyStyle>
-
+
class MyProxyStyle : public QProxyStyle
{
public:
@@ -30,16 +30,16 @@ class MyProxyStyle : public QProxyStyle
return QProxyStyle::styleHint(hint, option, widget, returnData);
}
};
-
+
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(textedit);
-
+
QApplication a(argc, argv);
a.setStyle(new MyProxyStyle);
TextEdit mw;
mw.resize(700, 800);
- mw.show();
+ mw.show();
//...
}
//! [1]
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index 2f6cec2..33832da 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -697,10 +697,11 @@
\snippet tutorials/addressbook/part5/finddialog.h FindDialog header
- We define a public function, \c getFindText() for use by classes that
- instantiate \c FindDialog, which allows them to obtain the text
- entered by the user. A public slot, \c findClicked(), is defined to
- handle the search string when the user clicks the \gui Find button.
+ We define a public function, \c getFindText(), to be used by classes that
+ instantiate \c FindDialog. This function allows these classes to obtain the
+ search string entered by the user. A public slot, \c findClicked(), is also
+ defined to handle the search string when the user clicks the \gui Find
+ button.
Lastly, we define the private variables, \c findButton, \c lineEdit
and \c findText, corresponding to the \gui Find button, the line edit
@@ -715,15 +716,15 @@
\snippet tutorials/addressbook/part5/finddialog.cpp constructor
- We set the layout and window title, as well as connect the signals
- to their respective slots. Notice that \c{findButton}'s
- \l{QPushButton::clicked()}{clicked()} signal is connected to to
- \c findClicked() and \l{QDialog::accept()}{accept()}. The
- \l{QDialog::accept()}{accept()} slot provided by QDialog hides
- the dialog and sets the result code to \l{QDialog::}{Accepted}.
- We use this function to help \c{AddressBook}'s \c findContact() function
- know when the \c FindDialog object has been closed. This will be
- further explained when discussing the \c findContact() function.
+ We set the layout and window title, as well as connect the signals to their
+ respective slots. Notice that \c{findButton}'s \l{QPushButton::clicked()}
+ {clicked()} signal is connected to to \c findClicked() and
+ \l{QDialog::accept()}{accept()}. The \l{QDialog::accept()}{accept()} slot
+ provided by QDialog hides the dialog and sets the result code to
+ \l{QDialog::}{Accepted}. We use this function to help \c{AddressBook}'s
+ \c findContact() function know when the \c FindDialog object has been
+ closed. We will explain this logic in further detail when discussing the
+ \c findContact() function.
\image addressbook-tutorial-part5-signals-and-slots.png
@@ -817,21 +818,23 @@
\image addressbook-tutorial-part6-screenshot.png
- Although browsing and searching for contacts are useful features, our address
- book is not really fully ready for use until we can saving existing contacts
- and load them again at a later time.
- Qt provides a number of classes for \l{Input/Output and Networking}{input and output},
- but we have chosen to use two which are simple to use in combination: QFile and
- QDataStream.
-
- A QFile object represents a file on disk that can be read from and written to.
- QFile is a subclass of the more general QIODevice class which represents many
- different kinds of devices.
-
- A QDataStream object is used to serialize binary data so that it can be stored
- in a QIODevice and retrieved again later. Reading from a QIODevice and writing
- to it is as simple as opening the stream - with the respective device as a
- parameter - and reading from or writing to it.
+ Although browsing and searching for contacts are useful features, our
+ address book is not ready for use until we can save existing contacts and
+ load them again at a later time.
+
+ Qt provides a number of classes for \l{Input/Output and Networking}
+ {input and output}, but we have chosen to use two which are simple to use
+ in combination: QFile and QDataStream.
+
+ A QFile object represents a file on disk that can be read from and written
+ to. QFile is a subclass of the more general QIODevice class which
+ represents many different kinds of devices.
+
+ A QDataStream object is used to serialize binary data so that it can be
+ stored in a QIODevice and retrieved again later. Reading from a QIODevice
+ and writing to it is as simple as opening the stream - with the respective
+ device as a parameter - and reading from or writing to it.
+
\section1 Defining the AddressBook Class