summaryrefslogtreecommitdiffstats
path: root/doc/src/getting-started
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/getting-started')
-rw-r--r--doc/src/getting-started/demos.qdoc18
-rw-r--r--doc/src/getting-started/examples.qdoc60
-rw-r--r--doc/src/getting-started/gettingstartedqml.qdoc1993
-rw-r--r--doc/src/getting-started/gettingstartedqt.qdoc6
-rw-r--r--doc/src/getting-started/installation.qdoc524
-rw-r--r--doc/src/getting-started/known-issues.qdoc129
6 files changed, 1284 insertions, 1446 deletions
diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc
index 4003988..f52fc92 100644
--- a/doc/src/getting-started/demos.qdoc
+++ b/doc/src/getting-started/demos.qdoc
@@ -46,7 +46,7 @@
\o \inlineimage qtdemo-small.png
\o If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's
widgets in action.
-
+
The \l{Qt Widget Gallery} also provides overviews of selected Qt
widgets in each of the styles used on various supported platforms.
\endtable
@@ -134,15 +134,23 @@
\section1 QtWebKit
\list
- \o \l{Web Browser} demonstrates how Qt's \l{WebKit in Qt}{WebKit module}
- can be used to implement a small Web browser.
+ \o \l{Web Browser} demonstrates how Qt's \l{QtWebKit} module can be used to
+ implement a small Web browser.
+ \endlist
+
+ \section1 Multimedia
+
+ \list
+ \o \l{demos/spectrum}{Spectrum Analyser} shows how the \l{QtMultimedia}
+ module can be used to manipulate audio as it is played.
\endlist
\section1 Phonon
\list
- \o \l{demos/qmediaplayer}{Media Player} demonstrates how the \l{Phonon Module} can be
- used to implement a basic media player application.
+ \o \l{demos/qmediaplayer}{Media Player} demonstrates how the
+ \l{Phonon Module}{Phonon module} can be used to implement a basic media player
+ application.
\endlist
\note The Phonon demos are currently not available for the MinGW platform.
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index 1bf86e5..596cc01 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -255,6 +255,7 @@
\o \l{graphicsview/flowlayout}{Flow Layout}
\o \l{graphicsview/simpleanchorlayout}{Simple Anchor Layout}
\o \l{graphicsview/weatheranchorlayout}{Weather Anchor Layout}
+ \o \l{graphicsview/basicgraphicslayouts}{Basic Graphics Layouts}
\endlist
Some examples demonstrate the use of graphics effects with canvas items.
@@ -272,7 +273,7 @@
\page examples-painting.html
\ingroup all-examples
\title Painting Examples
- \brief How to use the Qt painting system
+ \brief How to use the Qt painting system.
\image painting-examples.png
@@ -302,7 +303,7 @@
\page examples-richtext.html
\ingroup all-examples
\title Rich Text Examples
- \brief Using the document-oriented rich text engine
+ \brief Using the document-oriented rich text engine.
\image richtext-examples.png
@@ -323,7 +324,7 @@
\page examples-desktop.html
\ingroup all-examples
\title Desktop Examples
- \brief Integrating your Qt application with your favorite desktop
+ \brief Integrating your Qt application with your favorite desktop.
\image desktop-examples.png
@@ -343,8 +344,8 @@
/*!
\page examples-draganddrop.html
\ingroup all-examples
- \title Drag & Drop Examples
- \brief How to access your platform's native darg & drop functionality
+ \title Drag and Drop Examples
+ \brief How to access your platform's native drag and drop functionality.
\image draganddrop-examples.png
@@ -370,7 +371,7 @@
\page examples-threadandconcurrent.html
\ingroup all-examples
\title Threading and Concurrent Programming Examples
- \brief Threading and concurrent programming in Qt
+ \brief Threading and concurrent programming in Qt.
\image thread-examples.png
@@ -408,7 +409,7 @@
\page examples.tools.html
\ingroup all-examples
\title Tools Examples
- \brief Using Qt's containers, iterators, and other tool classes
+ \brief Using Qt's containers, iterators, and other tool classes.
\image tool-examples.png
@@ -444,7 +445,7 @@
\page examples-network.html
\ingroup all-examples
\title Network Examples
- \brief How to do network programming in Qt
+ \brief How to do network programming in Qt.
\image network-examples.png
@@ -471,6 +472,9 @@
\o \l{network/googlesuggest}{Google Suggest}
\o \l{network/bearercloud}{Bearer Cloud}\raisedaster
\o \l{network/bearermonitor}{Bearer Monitor}
+ \o \l{network/securesocketclient}{Secure Socket Client}
+ \o \l{network/multicastreceiver}{Multicast Receiver}
+ \o \l{network/multicastsender}{Multicast Sender}
\endlist
Examples marked with an asterisk (*) are fully documented.
@@ -480,7 +484,7 @@
\page examples-ipc.html
\ingroup all-examples
\title IPC Examples
- \brief Inter-Process Communication with Qt
+ \brief Inter-Process Communication with Qt.
\image ipc-examples.png
@@ -495,7 +499,7 @@
\page examples-opengl.html
\ingroup all-examples
\title OpenGL Examples
- \brief Accessing OpenGL from Qt
+ \brief Accessing OpenGL from Qt.
\image opengl-examples.png
@@ -527,7 +531,7 @@
\page examples-openvg.html
\ingroup all-examples
\title OpenVG Examples
- \brief Accessing OpenVG from Qt
+ \brief Accessing OpenVG from Qt.
\image opengl-examples.png
@@ -546,7 +550,7 @@
\page examples-multimedia.html
\ingroup all-examples
\title Multimedia Examples
- \brief Audio, video, and Phonon with Qt
+ \brief Audio, video, and Phonon with Qt.
\image phonon-examples.png
@@ -593,7 +597,7 @@
\page examples-sql.html
\ingroup all-examples
\title SQL Examples
- \brief Accessing your SQL database from Qt
+ \brief Accessing your SQL database from Qt.
\image sql-examples.png
@@ -609,6 +613,7 @@
\o \l{sql/querymodel}{Query Model}
\o \l{sql/relationaltablemodel}{Relational Table Model}
\o \l{sql/tablemodel}{Table Model}
+ \o \l{sql/masterdetail}{Master Detail}
\o \l{sql/sqlwidgetmapper}{SQL Widget Mapper}\raisedaster
\endlist
@@ -620,7 +625,7 @@
\page examples-xml.html
\ingroup all-examples
\title XML Examples
- \brief Using XML with Qt
+ \brief Using XML with Qt.
\image xml-examples.png XML
@@ -633,6 +638,7 @@
\o \l{xml/streambookmarks}{QXmlStream Bookmarks}\raisedaster
\o \l{xml/rsslisting}{RSS-Listing}
\o \l{xml/xmlstreamlint}{XML Stream Lint Example}\raisedaster
+ \o \l{xml/htmlinfo}{XML HTML Info}
\endlist
The XQuery/XPath and XML Schema engines in the QtXmlPatterns modules
@@ -654,7 +660,7 @@
\page examples-designer.html
\ingroup all-examples
\title Qt Designer Examples
- \brief Using Qt Designer to build your UI
+ \brief Using Qt Designer to build your UI.
\image designer-examples.png QtDesigner
@@ -677,7 +683,7 @@
\page examples-uitools.html
\ingroup all-examples
\title UiTools Examples
- \brief Using the QtUiTools module
+ \brief Using the QtUiTools module.
\image uitools-examples.png UiTools
@@ -691,7 +697,7 @@
\page examples-linguist.html
\ingroup all-examples
\title Qt Linguist Examples
- \brief Using Qt Linguist to internationalize your Qt application
+ \brief Using Qt Linguist to internationalize your Qt application.
\image linguist-examples.png
@@ -709,7 +715,7 @@
\page examples-script.html
\ingroup all-examples
\title Qt Script Examples
- \brief Using the Qt scripting environment
+ \brief Using the Qt scripting environment.
\image qtscript-examples.png QtScript
@@ -736,7 +742,7 @@
\page examples-webkit.html
\ingroup all-examples
\title WebKit Examples
- \brief Using WebKit in your Qt application
+ \brief Using WebKit in your Qt application.
\image webkit-examples.png WebKit
@@ -775,7 +781,7 @@
\page examples-helpsystem.html
\ingroup all-examples
\title Help System Examples
- \brief Adding interactive help to your Qt application
+ \brief Adding interactive help to your Qt application.
\image assistant-examples.png HelpSystem
@@ -796,7 +802,7 @@
\page examples-statemachine.html
\ingroup all-examples
\title State Machine Examples
- \brief Using Qt's finite state machine classes
+ \brief Using Qt's finite state machine classes.
\image statemachine-examples.png StateMachine
@@ -820,7 +826,7 @@
\page examples-animation.html
\ingroup all-examples
\title Animation Framework Examples
- \brief Doing animations with Qt
+ \brief Doing animations with Qt.
\image animation-examples.png Animation
@@ -840,7 +846,7 @@
\page examples-touch.html
\ingroup all-examples
\title Touch Input Examples
- \brief Using Qt's touch input capability
+ \brief Using Qt's touch input capability.
Support for touch input makes it possible for developers to create
extensible and intuitive user interfaces.
@@ -857,7 +863,7 @@
\page examples-gestures.html
\ingroup all-examples
\title Gestures Examples
- \brief Gesture programming examples
+ \brief Gesture programming examples.
The API of the gesture framework is not yet finalized and
still subject to change.
@@ -871,7 +877,7 @@
\page examples-dbus.html
\ingroup all-examples
\title D-Bus Examples
- \brief Using D-Bus from Qt applications
+ \brief Using D-Bus from Qt applications.
\list
\o \l{dbus/dbus-chat}{Chat}
@@ -888,7 +894,7 @@
\page examples-embeddedlinux.html
\ingroup all-examples
\title Qt for Embedded Linux Examples
- \brief Using Qt in Embedded Linux
+ \brief Using Qt in Embedded Linux.
\image qt-embedded-examples.png QtEmbedded
@@ -908,7 +914,7 @@
\page examples-activeqt.html
\ingroup all-examples
\title ActiveQt Examples
- \brief Using ActiveX from Qt applications
+ \brief Using ActiveX from Qt applications.
\image activeqt-examples.png ActiveQt
diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc
index 6c85776..a6159c3 100644
--- a/doc/src/getting-started/gettingstartedqml.qdoc
+++ b/doc/src/getting-started/gettingstartedqml.qdoc
@@ -26,1026 +26,973 @@
****************************************************************************/
/*!
- \page qml-textEditor.html
-
- \title Getting Started programming with QML
- \ingroup gettingStarted
-
- Welcome to the world of QML - the declarative UI language. In this Getting
- Started guide, we create a simple text editor application using QML.
- After reading this guide, you should be ready to start developing your own
- applications using QML and Qt C++.
-
- \example tutorials/gettingStarted/gsQml
-
- \section1 QML to Build User Interfaces
-
- Here we are building is a simple text editor that con load, save,
- and perform some text manipulation. This guide consists of two parts. The
- first part involves designing the application layout and behaviors using
- declarative language in QML. For the second part, file loading and saving is
- implemented using Qt C++.
- Using \l {The Meta-Object System}{Qt's Meta-Object System}, we can expose C++
- functions as properties that QML elements can use. By utilizing QML and Qt C++,
- we can efficiently decouple the interface logic from the application logic.
-
- \image qml-texteditor5_editmenu.png
-
- To run the QML example code, we merely provide the included \l{QML Viewer}{qmlviewer}
- tool with the QML file as the argument. The C++ portion of this tutorial assumes
- that the reader possesses basic knowledge of Qt's compilation procedures.
-
- \omit
- Tutorial chapters:
- \list 1
- \o \l {Defining a Button and a Menu}{Defining a Button and a Menu}
- \o \l {Implementing a Menu Bar}{Implementing a Menu Bar}
- \o \l {Building a Text Editor}{Building a Text Editor}
- \o \l {Decorating the Text Editor}{Decorating the Text Editor}
- \o \l {Extending QML using Qt C++}{Extending QML using Qt C++}
- \endlist
- \endomit
-
- \section1 Defining a Button and a Menu
-
- \section2 Basic Component - a Button
-
- We start our text editor by building a button. Functionally, a button has a mouse
- sensitive area and a label. Buttons perform actions when a user presses the button.
-
- In QML, the basic visual item is the \l {Rectangle}{Rectangle} element. The
- \c Rectangle element has properties to control the element's appearance and location.
-
- \code
- import Qt 4.7
- Rectangle {
- id: simplebutton
- color: "grey"
- width: 150; height: 75
-
- Text{
- id: buttonLabel
- anchors.centerIn: parent
- text: "button label"
- }
- }
- \endcode
-
- First, the \c { import Qt 4.7 } allows the qmlviewer tool to import the QML elements
- we will later use. This line must exist for every QML file. Notice that the version
- of Qt modules is included in the import statement.
-
- This simple rectangle has a unique identifier, \c simplebutton, which is bound to the
- id property. The \c Rectangle element's properties are bound to values by listing the
- property, followed by a colon, then the value. In the code sample, the color \c grey
- is bound to the the Rectangle's \c color property. Similarly, we bind the \c width
- and \c height of the Rectangle.
-
- The \l {Text}{Text} element is a non-editable text field. We name this \c Text element
- \c buttonLabel. To set the string content of the Text field, we bind a value to the
- \c text property. The label is contained within the Rectangle and in order to center
- it in the middle, we assign the \c anchors of the Text element to its parent, which
- is called \c simplebutton. Anchors may bind to other items' anchors, allowing layout
- assignments simpler.
-
- We save this code as \c SimpleButton.qml. Running qmlviewer with the file as the
- argument will display the grey rectangle with a text label.
-
- \image qml-texteditor1_simplebutton.png
-
- To implement the button click functionality, we can use QML's event handling. QML's event
- handling is very similar to \l {Signals & Slots}{Qt's signal and slot} mechanism. Signals
- are emitted and the connected slot is called.
-
- \code
- Rectangle{
- id:simplebutton
- ...
-
- MouseArea{
- id: buttonMouseArea
-
- anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors
- //onClicked handles valid mouse button clicks
- onClicked: console.log(buttonLabel.text + " clicked" )
- }
- }
- \endcode
-
- We include a \l{MouseArea} element in our simplebutton. \c MouseArea elements describe
- the interactive area where mouse movements are detected. For our button, we anchor the
- whole MouseArea to its parent, which is \c simplebutton. The \c anchors.fill syntax is
- one way of accessing a specific property called \c fill inside a group of properties
- called \c anchors. QML uses \l {Anchor-based Layout in QML}{anchor based layouts} where
- items can anchor to another item, creating robust layouts.
-
- The \c MouseArea has many signal handlers that are called during mouse movements within
- the specfied \c MouseArea boundaries. One of them is \c onClicked and it is called
- whenever the acceptable mouse button is clicked, the left click being the default. We
- can bind actions to the onClicked handler. In our example, \c console.log() outputs text
- whenever the mouse area is clicked. The function \c console.log() is a useful tool for
- debugging purposes and for outputting text.
-
- The code in \c SimpleButton.qml is sufficient to display a button on the screen and
- output text whenever it is clicked with a mouse.
-
- \code
- Rectangle {
- id:Button
- ...
-
- property color buttonColor: "lightblue"
- property color onHoverColor: "gold"
- property color borderColor: "white"
-
- signal buttonClick()
- onButtonClick: {
- console.log(buttonLabel.text + " clicked" )
- }
-
- MouseArea{
- onClicked: buttonClick()
- hoverEnabled: true
- onEntered: parent.border.color = onHoverColor
- onExited: parent.border.color = borderColor
- }
-
- //determines the color of the button by using the conditional operator
- color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
- }
- \endcode
-
- A fully functioning button is in \c Button.qml. The code snippets in this article
- have some code omitted, denoted by ellipses because they were either introduced
- earlier in the previous sections or irrelevant to the current code discussion.
-
- Custom properties are declared using the \c {property type name} syntax. In the
- code, the property \c buttonColor, of type \c color, is declared and bound to
- the value \c{"lightblue"}. The \c buttonColor is later used in a conditional
- operation to determine the buttons's fill color. Note that property value
- assignment is possible using the \c= equals sign, in addition to value binding
- using the \c : colon character. Custom properties allow internal items to be
- accessible outside of the Rectangle's scope. There are basic
- \l{QML Basic Types}{QML types} such as \c int, \c string, \c real, as well as
- a type called \c variant.
-
- By binding the \c onEntered and \c onExited signal handlers to colors, the
- button's border will turn yellow when the mouse hovers above the button and
- reverts the color when the mouse exits the mouse area.
-
- A \c buttonClick() signal is declared in \c Button.qml by placing the \c signal
- keyword in front of the signal name. All signals have their handlers automatically
- created, their names starting with \c on. As a result, the \c onButtonClick is
- \c buttonClick's handler. The \c onButtonClick is then assigned an action to
- perform. In our button example, the \c onClicked mouse handler will simply call
- \c onButtonClick, which displays a text. The \c onButtonClick enables outside
- objects to access the \c {Button}'s mouse area easily. For example, items may
- have more than one \c MouseArea declarations and a \c buttonClick signal can
- make the distinction between the several \c MouseArea signal handlers better.
-
- We now have the basic knowledge to implement items in QML that can handle
- basic mouse movements. We created a \c Text label inside a \c Rectangle,
- customized its properties, and implemented behaviors that respond to mouse
- movements. This idea of creating elements within elements is repeated
- throughout the text editor application.
-
- This button is not useful unless used as a component to perform an action.
- In the next section, we will soon create a menu containing several of these
- buttons.
-
- \image qml-texteditor1_button.png
-
- \section2 Creating a Menu Page
-
- Up to this stage, we covered how to create elements and assign behaviors inside
- a single QML file. In this section, we will cover how to import QML elements and how
- to reuse some of the created components to build other components.
-
- Menus display the contents of a list, each item having the ability to perform an action.
- In QML, we can create a menu in several ways. First, we will create a menu containing
- buttons which will eventually perform different actions. The menu code is in
- \c FileMenu.qml.
-
- \code
- import Qt 4.7 \\import the main Qt QML module
- import “folderName” \\import the contents of the folder
- import “Button.qml” \\import a QML file
- import “NewButton.qml” as ButtonModule \\import a QML file and give it a name
- import “script.js” as Script \\import a Javascript file and name it as Script
- \endcode
-
- To use the \c Button element in \c FileMenu.qml, we need to import \c Button.qml.
- The syntax shown above, shows how to use the \c import keyword. However, the
- \c {import Button.qml} is not necessary; qmlviewer will import all the contents
- of the current directory. We can directly create a \c Button element by declaring
- \c Button{}, similar to a \c Rectangle{} declaration.
-
- \code
- In FileMenu.qml:
-
- Row{
- anchors.centerIn: parent
- spacing: parent.width/6
-
- Button{
- id: loadButton
- buttonColor: "lightgrey"
- label: "Load"
- }
- Button{
- buttonColor: "grey"
- id: saveButton
- label: "Save"
- }
- Button{
- id: exitButton
- label: "Exit"
- buttonColor: "darkgrey"
-
- onButtonClick: Qt.quit()
- }
- }
- \endcode
-
- In \c FileMenu.qml, we declare three \c Button elements. They are declared
- inside a \l {Row}{Row} element, a positioner that will position its children
- along a vertical row. The \c Button declaration resides in Button.qml,
- which is the same as the \c Button.qml we used in the previous section.
- New property bindings can be declared within the newly created buttons,
- effectively overwriting the properties set in \c Button.qml. The button
- called \c exitButton will quit and close the window when it is clicked.
- Note that the signal handler \c onButtonClick in \c Button.qml will be
- called in addition to the \c onButtonClick handler in \c exitButton.
-
- \image qml-texteditor1_filemenu.png
-
- The \c Row declaration is declared in a \c Rectangle, creating a rectangle
- container for the row of buttons. This additional rectangle creates an indirect
- way of organizing the row of buttons inside a menu.
-
- The declaration of the edit menu is very similar at this stage. The menu has
- buttons that have the labels: \c Copy, \c Paste, and \c {Select All}.
-
- \image qml-texteditor1_editmenu.png
-
- Armed with our knowledge of importing and customizing previously made
- components, we may now combine these menu pages to create a menu bar,
- consisting of buttons to select the menu, and look at how we may structure
- data using QML.
-
- \section1 Implementing a Menu Bar
-
- Our text editor application will need a way to display menus using a menu bar.
- The menu bar will switch the different menus and the user can choose which menu
- to display. Menu switching implies that the menus need more structure than
- merely displaying them in a row. QML uses models and views to structure data
- and display the structured data.
-
- \section2 Using Data Models and Views
-
- QML has different \l {Data Models}{data views} that display
- \l {Data Models}{data models}. Our menu bar will display the menus in a list,
- with a header that displays a row of menu names. The list of menus are declared
- inside a \c VisualItemModel. The \l{VisualItemModel}{\c VisualItemModel}
- element contains items that already have views such as \c Rectangle elements
- and imported UI elements. Other model types such as the \l {ListModel}{\c ListModel}
- element need a delegate to display their data.
-
- We declare two visual items in the \c menuListModel, the \c FileMenu and the
- \c EditMenu. We customize the two menus and display them using a
- \l {ListView}{ListView}. The \c MenuBar.qml file contains the QML declarations
- and a simple edit menu is defined in \c EditMenu.qml.
-
- \code
- VisualItemModel{
- id: menuListModel
- FileMenu{
- width: menuListView.width
- height: menuBar.height
- color: fileColor
- }
- EditMenu{
- color: editColor
- width: menuListView.width
- height: menuBar.height
- }
- }
- \endcode
-
- The \l {ListView}{ListView} element will display a model according to a delegate.
- The delegate may declare the model items to display in a \c Row element or display
- the items in a grid. Our \c menuListModel already has visible items, therefore,
- we do not need to declare a delegate.
-
- \code
- ListView{
- id: menuListView
-
- //Anchors are set to react to window anchors
- anchors.fill:parent
- anchors.bottom: parent.bottom
- width:parent.width
- height: parent.height
-
- //the model contains the data
- model: menuListModel
-
- //control the movement of the menu switching
- snapMode: ListView.SnapOneItem
- orientation: ListView.Horizontal
- boundsBehavior: Flickable.StopAtBounds
- flickDeceleration: 5000
- highlightFollowsCurrentItem: true
- highlightMoveDuration:240
- highlightRangeMode: ListView.StrictlyEnforceRange
- }
- \endcode
-
- Additionally, \c ListView inherits from \l {Flickable}{\c Flickable}, making
- the list respond to mouse drags and other gestures. The last portion of the
- code above sets \c Flickable properties to create the desired flicking movement
- to our view. In particular,the property \c highlightMoveDuration changes the
- duration of the flick transition. A higher \c highlightMoveDuration value
- results in slower menu switching.
-
- The \c ListView maintains the model items through an \c index and each visual
- item in the model is accessible through the \c index, in the order of the
- declaration. Changing the \c currentIndex effectively changes the highlighted
- item in the \c ListView. The header of our menu bar exemplify this effect.
- There are two buttons in a row, both changing the current menu when clicked.
- The \c fileButton changes the current menu to the file menu when clicked,
- the \c index being \c 0 because \c FileMenu is declared first in the
- \c menuListModel. Similarly, the \c editButton will change the current
- menu to the \c EditMenu when clicked.
-
- The \c labelList rectangle has \c z value of \c 1, denoting that it is displayed
- at the front of the menu bar. Items with higher \c z values are displayed in front
- of items with lower \c z values. The default \c z value is \c 0.
-
- \code
- Rectangle{
- id: labelList
- ...
- z: 1
- Row{
- anchors.centerIn: parent
- spacing:40
- Button{
- label: "File"
- id: fileButton
- ...
- onButtonClick: menuListView.currentIndex = 0
- }
- Button{
- id: editButton
- label: "Edit"
- ...
- onButtonClick: menuListView.currentIndex = 1
- }
- }
- }
- \endcode
-
- The menu bar we just created can be flicked to access the menus or by clicking
- on the menu names at the top. Switching menu screens feel intuitive and responsive.
-
- \image qml-texteditor2_menubar.png
-
- \section1 Building a Text Editor
-
- \section2 Declaring a TextArea
-
- Our text editor is not a text editor if it didn't contain an editable text area.
- QML's \l {TextEdit}{TextEdit} element allows the declaration of a multi-line
- editable text area. \l {TextEdit}{TextEdit} is different from a \l {Text}{Text}
- element, which doesn't allow the user to directly edit the text.
-
- \code
- TextEdit{
- id: textEditor
- anchors.fill:parent
- width:parent.width; height:parent.height
- color:"midnightblue"
- focus: true
-
- wrapMode: TextEdit.Wrap
-
- onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
- }
- \endcode
-
- The editor has its font color property set and set to wrap the text. The
- \c TextEdit area is inside a flickable area that will scroll the text if the
- text cursor is outside the visible area. The function \c ensureVisible() will
- check if the cursor rectangle is outside the visible boundaries and move the
- text area accordingly. QML uses Javascript syntax for its scripts, and as previously
- mentioned, Javascript files can be imported and used within a QML file.
-
- \code
- function ensureVisible(r){
- if (contentX >= r.x)
- contentX = r.x;
- else if (contentX+width <= r.x+r.width)
- contentX = r.x+r.width-width;
- if (contentY >= r.y)
- contentY = r.y;
- else if (contentY+height <= r.y+r.height)
- contentY = r.y+r.height-height;
- }
- \endcode
-
- \section1 Combining Components for the Text Editor
-
- We are now ready to create the layout of our text editor using QML. The text
- editor has two components, the menu bar we created and the text area. QML allows
- us to reuse components, therefore making our code simpler, by importing components
- and customizing when necessary. Our text editor splits the window into two;
- one-third of the screen is dedicated to the menu bar and two-thirds of the screen
- displays the text area. The menu bar is displayed in front of any other elements.
-
- \code
- Rectangle{
-
- id: screen
- width: 1000; height: 1000
-
- //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar
- property int partition: height/3
-
- MenuBar{
- id:menuBar
- height: partition
- width:parent.width
- z: 1
- }
-
- TextArea{
- id:textArea
- anchors.bottom:parent.bottom
- y: partition
- color: "white"
- height: partition*2
- width:parent.width
- }
- }
- \endcode
-
- By importing reusable components, our \c TextEditor code looks much simpler.
- We can then customize the main application, without worrying about properties
- that already have defined behaviors. Using this approach, application layouts
- and UI components can be created easily.
-
- \image qml-texteditor3_texteditor.png
-
- \section1 Decorating the Text Editor
- \section2 Implementing a Drawer Interface
-
- Our text editor looks simple and we need to decorate it. Using QML, we can declare
- transitions and animate our text editor. Our menu bar is occupying one-third of the
- screen and it would be nice to have it only appear when we want it.
-
- We can add a drawer interface, that will contract or expand the menu bar when clicked.
- In our implementation, we have a thin rectangle that responds to mouse clicks. The
- \c drawer, as well as the application, has two sates: the "drawer is open" state and
- the "drawer is closed" state. The \c drawer item is a strip of rectangle with a small
- height. There is a nested \l {Image}{Image} element declaring that an arrow icon will
- be centered inside the drawer. The drawer assigns a state to the whole application,
- with the identifier \c screen, whenever a user clicks the mouse area.
-
- \code
- Rectangle{
- id:drawer
- height:15
-
- Image{
- id: arrowIcon
- source: "images/arrow.png"
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- MouseArea{
- id: drawerMouseArea
- anchors.fill:parent
- onClicked:{
- if (screen.state == "DRAWER_CLOSED"){
- screen.state = "DRAWER_OPEN"
- }
- else if (screen.state == "DRAWER_OPEN"){
- screen.state = "DRAWER_CLOSED"
- }
- }
- ...
- }
- }
- \endcode
-
- A state is simply a collection of configurations and it is declared in a
- \l{State}{State} element. A list of states can be listed and bound to the
- \c states property. In our application, the two states are called
- \c DRAWER_CLOSED and \c DRAWER_OPEN. Item configurations are declared in
- \l {PropertyChanges}{PropertyChanges} elements. In the \c DRAWER_OPEN state,
- there are four items that will receive property changes. The first target,
- \c menuBar, will change its \c y property to \c 0. Similarly, the \c textArea
- will lower to a new position when the state is \c DRAWER_OPEN. The \c textArea,
- the \c drawer, and the drawer's icon will undergo property changes to meet the
- current state.
-
- \code
-
- states:[
- State{
- name: "DRAWER_OPEN"
- PropertyChanges { target: menuBar; y:0}
- PropertyChanges { target: textArea; y: partition + drawer.height}
- PropertyChanges { target: drawer; y: partition}
- PropertyChanges { target: arrowIcon; rotation: 180}
- },
- State{
- name: "DRAWER_CLOSED"
- PropertyChanges { target: menuBar; y:-partition}
- PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height}
- PropertyChanges { target: drawer; y: 0}
- PropertyChanges { target: arrowIcon; rotation: 0}
- }
-
- ]
-
- \endcode
-
- State changes are abrupt and needs smoother transitions. Transitions between states
- are defined using the \l {Transition}{Transition} element, which can then bind to
- the item's \c transitions property. Our text editor has a state transition whenever
- the state changes to either \c DRAWER_OPEN or \c DRAWER_CLOSED. Importantly, the
- transition needs a \c from and a \c to state but for our transitions, we can use
- the wild card \c * symbol to denote that the transition applies to all state changes.
-
- During transitions, we can assign animations to the property changes. Our
- \c menuBar switches position from \c {y:0} to \c {y:-partition} and we can animate
- this transition using the \l {NumberAnimation}{NumberAnimation} element. We declare
- that the targets' properties will animate for a certain duration of time and using
- a certain easing curve. An easing curve controls the animation rates and
- interpolation behavior during state transitions. The easing curve we chose is
- \l{PropertyAnimation::easing.type}{Easing.OutQuint}, which slows the movement near
- the end of the animation. Pleae read \l {qdeclarativeanimation.html}{QML's Animation}
- article.
-
- \code
- transitions: [
- Transition{
- to: "*"
- NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type: Easing.OutQuint }
- NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutQuint }
- NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutQuint }
- }
- ]
- \endcode
-
- Another way of animating property changes is by declaring a \l {Behavior}{Behavior}
- element. A transition only works during state changes and \c Behavior can set an
- animation for a general property change. In the text editor, the arrow has a
- \c NumberAnimation animating its \c rotation property whenever the property changes.
-
- \code
- In TextEditor.qml:
-
- Behavior{
- NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }
- }
- \endcode
-
- Going back to our components with knowledge of states and animations, we can improve
- the appearances of the components. In \c Button.qml, we can add \c color and \c scale
- property changes when the button is clicked. Color types are animated using
- \l {ColorAnimation}{ColorAnimation} and numbers are animated using
- \l {NumberAnimation}{NumberAnimation}. The \c {on propertyName} syntax displayed below
- is helpful when targeting a single property.
-
- \code
- In Button.qml:
- ...
-
- color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
- Behavior on color { ColorAnimation{ duration: 55} }
-
- scale: buttonMouseArea.pressed ? 1.1 : 1.00
- Behavior on scale { NumberAnimation{ duration: 55} }
- \endcode
-
- Additionally, we can enhance the appearances of our QML components by adding color
- effects such as gradients and opacity effects. Declaring a \l {Gradient}{Gradient}
- element will override the \c color property of the element. You may declare a color
- in the gradient using the \l {GradientStop}{GradientStop} element. The gradient is
- positioned using a scale, between \c 0.0 and \c 1.0.
-
- \code
- In MenuBar.qml
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#8C8F8C" }
- GradientStop { position: 0.17; color: "#6A6D6A" }
- GradientStop { position: 0.98;color: "#3F3F3F" }
- GradientStop { position: 1.0; color: "#0e1B20" }
- }
- \endcode
-
- This gradient is used by the menu bar to display a gradient simulating depth.
- The first color starts at \c 0.0 and the last color is at \c 1.0.
-
-
- \section2 Where to Go from Here
-
- We are finished building the user interface of a very simple text editor.
- Going forward, the user interface is complete, and we can implement the
- application logic using regular Qt and C++. QML works nicely as a prototyping
- tool, separating the application logic away from the UI design.
-
- \image qml-texteditor4_texteditor.png
-
- \section1 Extending QML using Qt C++
-
- Now that we have our text editor layout, we may now implement the text editor
- functionalities in C++. Using QML with C++ enables us to create our application
- logic using Qt. We can create a QML context in a C++ application using the
- \l {Using QML in C++ Applications}{Qt's Declarative} classes and display the QML
- elements using a Graphics Scene. Alternatively, we can export our C++ code into
- a plugin that the \l {QML Viewer}{qmlviewer} tool can read. For our application,
- we shall implement the load and save functions in C++ and export it as a plugin.
- This way, we only need to load the QML file directly instead of running an executable.
-
- \section2 Exposing C++ Classes to QML
-
- We will be implementing file loading and saving using Qt and C++. C++ classes
- and functions can be used in QML by registering them. The class also needs to be
- compiled as a Qt plugin and the QML file will need to know where the plugin is located.
-
- For our application, we need to create the following items:
- \list 1
- \o \c Directory class that will handle directory related operations
- \o \c File class which is a QObject, simulating the list of files in a directory
- \o plugin class that will register the class to the QML context
- \o Qt project file that will compile the plugin
- \o A \c qmldir file telling the qmlviewer tool where to find the plugin
- \endlist
-
- \section2 Building a Qt Plugin
-
- To build a plugin, we need to set the following in a Qt project file. First,
- the necessary sources, headers, and Qt modules need to be added into our
- project file. All the C++ code and project files are in the \c filedialog
- directory.
-
- \code
- In cppPlugins.pro:
-
- TEMPLATE = lib
- CONFIG += qt plugin
- QT += declarative
-
- DESTDIR += ../plugins
- OBJECTS_DIR = tmp
- MOC_DIR = tmp
-
- TARGET = FileDialog
-
- HEADERS += directory.h \
- file.h \
- dialogPlugin.h
-
- SOURCES += directory.cpp \
- file.cpp \
- dialogPlugin.cpp
- \endcode
-
- In particular, we compile Qt with the \c declarative module and configure it as a
- \c plugin, needing a \c lib template. We shall put the compiled plugin into the
- parent's \c plugins directory.
-
-
- \section2 Registering a Class into QML
-
- \code
- In dialogPlugin.h:
-
- #include <QtDeclarative/QDeclarativeExtensionPlugin>
-
- class DialogPlugin : public QDeclarativeExtensionPlugin
- {
- Q_OBJECT
-
- public:
- void registerTypes(const char *uri);
-
- };
-
- \endcode
-
- Our plugin class, \c DialogPlugin is a subclass of \l
- {QDeclarativeExtensionPlugin}{QDeclarativeExtensionPlugin}. We
- need to implement the inherited function, \l
- {QDeclarativeExtensionPlugin::registerTypes()}{registerTypes}. The
- \c dialogPlugin.cpp file looks like this:
-
- \code
- DialogPlugin.cpp:
-
- #include "dialogPlugin.h"
- #include "directory.h"
- #include "file.h"
- #include <QtDeclarative/qdeclarative.h>
-
- void DialogPlugin::registerTypes(const char *uri){
-
- qmlRegisterType<Directory>(uri, 1, 0, "Directory");
- qmlRegisterType<File>(uri, 1, 0,"File");
- }
-
- Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
- \endcode
-
- The \l {QDeclarativeExtensionPlugin::registerTypes()}{registerTypes}
- function registers our File and Directory classes into QML. This function
- needs the class name for its template, a major version number, a minor version
- number, and a name for our classes.
-
- We need to export the plugin using the \l {Q_EXPORT_PLUGIN2}{Q_EXPORT_PLUGIN2}
- macro. Note that in our \c dialogPlugin.h file, we have the \l {Q_OBJECT}{Q_OBJECT}
- macro at the top of our class. As well, we need to run \c qmake on the project
- file to generate the necessary meta-object code.
-
-
- \section2 Creating QML Properties in a C++ class
-
- We can create QML elements and properties using C++ and
- \l {The Meta-Object System}{Qt's Meta-Object System}. We can implement
- properties using slots and signals, making Qt aware of these properties.
- These properties can then be used in QML.
-
- For the text editor, we need to be able to load and save files. Typically,
- these features are contained in a file dialog. Fortunately, we can use
- \l {QDir}{QDir}, \l {QFile}{QFile}, and \l {QTextStream}{QTextStream} to
- implement directory reading and input/output streams.
-
- \code
- class Directory : public QObject{
-
- Q_OBJECT
-
- Q_PROPERTY(int filesCount READ filesCount CONSTANT)
- Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
- Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
- Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
-
- ...
- \endcode
-
- The \c Directory class uses Qt's Meta-Object System to register properties it
- needs to accomplish file handling. The \c Directory class is exported as a plugin
- and is useable in QML as the \c Directory element. Each of the listed properties
- using the \l {Q_PROPERTY()}{Q_PROPERTY} macro is a QML property.
-
- The \l {Q_PROPERTY()} {Q_PROPERTY} declares a property as well as its read and
- write functions into Qt's Meta-Object System. For example, the \c filename
- property, of type \l {QString}{QString}, is readable using the \c filename()
- function and writable using the function \c setFilename(). Additionally, there
- is a signal associated to the filename property called \c filenameChanged(),
- which is emitted whenever the property changes. The read and write functions
- are declared as \c public in the header file.
-
- Similarly, we have the other properties declared according to their uses. The
- \c filesCount property indicates the number of files in a directory. The filename
- property is set to the currently selected file's name and the loaded/saved file
- content is stored in \c fileContent property.
-
- \code
- Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
- \endcode
-
- The \c files list property is a list of all the filtered files in a directory.
- The \c Directory class is implemented to filter out invalid text files; only
- files with a \c .txt extension are valid. Further, \l {QList}{QLists} can be
- used in QML files by declaring them as a \c QDeclarativeListProperty in C++.
- The templated object needs to inherit from a \l {QObject}{QObject}, therefore,
- the \c File class must also inherit from \c QObject. In the \c Directory class,
- the list of \c File objects is stored in a \c QList called \c m_fileList.
-
- \code
- class File : public QObject{
-
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
-
- ...
- };
- \endcode
-
- The properties can then be used in QML as part of the \c Directory element's
- properties. Note that we do not have to create an identifier \c id property
- in our C++ code.
-
- \code
- Directory{
- id: directory
-
- filesCount
- filename
- fileContent
- files
-
- files[0].name
- }
-
- \endcode
-
- Because QML uses Javascript's syntax and structure, we can iterate through
- the list of files and retrieve its properties. To retrieve the first file's
- name property, we can call \c { files[0].name }.
-
- Regular C++ functions are also accessible from QML. The file loading and saving
- functions are implemented in C++ and declared using the
- \l {Q_INVOKABLE}{Q_INVOKABLE} macro. Alternatively, we can declare the functions
- as a \c slot and the functions will be accessible from QML.
-
- \code
- In Directory.h:
-
- Q_INVOKABLE void saveFile();
- Q_INVOKABLE void loadFile();
- \endcode
-
- The \c Directory class also has to notify other objects whenever the directory
- contents change. This feature is performed using a \c signal. As previously
- mentioned, QML signals have a corresponding handler with their names prepended
- with \c on. The signal is called \c directoryChanged and it is emitted whenever
- there is a directory refresh. The refresh simply reloads the directory contents
- and updates the list of valid files in the directory. QML items can then be
- notified by attaching an action to the \c onDirectoryChanged signal handler.
-
- The \c list properties need to be explored further. This is because list
- properties use callbacks to access and modify the list contents. The list
- property is of type \c QDeclarativeListProperty<File>. Whenever the list
- is accessed, the accessor function needs to return a
- \c QDeclarativeListProperty<File>. The template type, \c File, needs to be a
- \c QObject derivative. Further, to create the
- \l {QDeclarativeListProperty}{QDeclarativeListProperty}, the list's accessor
- and modifiers need to be passed to the consructor as function pointers. The list,
- a \c QList in our case, also needs to be a list of \c File pointers.
-
- The constructor of \l {QDeclarativeListProperty}{QDeclarativeListProperty}
- constructor and the \c Directory implementation:
- \code
- QDeclarativeListProperty ( QObject * object, void * data, AppendFunction append, CountFunction count = 0, AtFunction at = 0, ClearFunction clear = 0 )
- QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
- \endcode
-
- The constructor passes pointers to functions that will append the list, count
- the list, retrieve the item using an index, and empty the list. Only the append
- function is mandatory. Note that the function pointers must match the definition
- of \l {QDeclarativeListProperty::AppendFunction}{AppendFunction},
- \l {QDeclarativeListProperty::CountFunction}{CountFunction},
- \l {QDeclarativeListProperty::AtFunction}{AtFunction}, or
- \l {QDeclarativeListProperty::ClearFunction}{ClearFunction}.
-
- \code
- void appendFiles(QDeclarativeListProperty<File> * property, File * file)
- File* fileAt(QDeclarativeListProperty<File> * property, int index)
- int filesSize(QDeclarativeListProperty<File> * property)
- void clearFilesPtr(QDeclarativeListProperty<File> *property)
- \endcode
-
- To simplify our file dialog, the \c Directory class filters out invalid text
- files, which are files that do not have a \c .txt extension. If a file name
- doesn't have the \c .txt extension, then it won't be seen in our file dialog.
- Also, the implementation makes sure that saved files have a \c .txt extension in
- the file name. \c Directory uses \l {QTextStream}{QTextStream} to read the file
- and to output the file contents to a file.
-
- With our \c Directory element, we can retrieve the files as a list, know how many
- text files is in the application directory, get the file's name and content as a
- string, and be notified whenever there are changes in the directory contents.
-
- To build the plugin, run \c qmake on the \c cppPlugins.pro project file, then run
- \c make to build and transfer the plugin to the \c plugins directory.
-
-
- \section2 Importing a Plugin in QML
-
- The qmlviewer tool imports files that are in the same directory as the
- application. We can also create a \c qmldir file containing the locations of
- QML files we wish to import. The \c qmldir file can also store locations of
- plugins and other resources.
-
- \code
- In qmldir:
-
- Button ./Button.qml
- FileDialog ./FileDialog.qml
- TextArea ./TextArea.qml
- TextEditor ./TextEditor.qml
- EditMenu ./EditMenu.qml
-
- plugin FileDialog plugins
- \endcode
-
- The plugin we just created is called \c FileDialog, as indicated by the
- \c TARGET field in the project file. The compiled plugin is in the \c plugins directory.
-
-
- \section2 Integrating a File Dialog into the File Menu
-
- Our \c FileMenu needs to display the \c FileDialog element, containing a list of
- the text files in a directory thus allowing the user to select the file by
- clicking on the list. We also need to assign the save, load, and new buttons
- to their respective actions. The FileMenu contains an editable text input to
- allow the user to type a file name using the keyboard.
-
- The \c Directory element is used in the \c FileMenu.qml file and it notifies the
- \c FileDialog element that the directory refreshed its contents. This notification
- is performed in the signal handler, \c onDirectoryChanged.
-
- \code
- In FileMenu.qml:
-
- Directory{
- id:directory
- filename: textInput.text
- onDirectoryChanged: fileDialog.notifyRefresh()
- }
- \endcode
-
- Keeping with the simplicity of our application, the file dialog will always be
- visible and will not display invalid text files, which do not have a \c .txt
- extension to their filenames.
-
- \code
- In FileDialog.qml:
-
- signal notifyRefresh()
- onNotifyRefresh: dirView.model = directory.files
- \endcode
-
- The \c FileDialog element will display the contents of a directory by reading its
- list property called \c files. The files are used as the model of a
- \l {GridView}{GridView} element, which displays data items in a grid according
- to a delegate. The delegate handles the appearance of the model and our file
- dialog will simply create a grid with text centered in the middle. Clicking on
- the file name will result in the appearance of a rectangle to highlight the file
- name. The \c FileDialog is notified whenever the \c notifyRefresh signal is emitted,
- reloading the files in the directory.
-
- \code
- In FileMenu.qml:
-
- Button{
- id: newButton
- label: "New"
- onButtonClick:{
- textArea.textContent = ""
- }
- }
- Button{
- id: loadButton
- label: "Load"
- onButtonClick:{
- directory.filename = textInput.text
- directory.loadFile()
- textArea.textContent = directory.fileContent
- }
- }
- Button{
- id: saveButton
- label: "Save"
- onButtonClick:{
- directory.fileContent = textArea.textContent
- directory.filename = textInput.text
- directory.saveFile()
- }
- }
- Button{
- id: exitButton
- label: "Exit"
- onButtonClick:{
- Qt.quit()
- }
- }
- \endcode
-
- Our \c FileMenu can now connect to their respective actions. The \c saveButton
- will transfer the text from the \c TextEdit onto the directory's \c fileContent
- property, then copy its file name from the editable text input. Finally, the button
- calls the \c saveFile() function, saving the file. The \c sloadButton has a similar
- execution. Also, the \c New action will empty the contents of the \c TextEdit.
-
- Further, the \c EditMenu buttons are connected to the \c TextEdit functions to copy,
- paste, and select all the text in the text editor.
-
- \image qml-texteditor5_filemenu.png
-
- \section1 Text Editor Completion
-
- \image qml-texteditor5_newfile.png
-
- The application can function as a simple text editor, able to accept text
- and save the text into a file. The text editor can also load from a file and
- perform text manipulation.
-
-
-*/ \ No newline at end of file
+ \page gettingstartedqml.html
+ \title Getting Started Programming with QML
+ \ingroup gettingStarted
+
+ Welcome to the world of QML, the declarative UI language. In this Getting
+ Started guide, we will create a simple text editor application using QML.
+ After reading this guide, you should be ready to develop your own applications
+ using QML and Qt C++.
+
+ \section1 QML to Build User Interfaces
+
+ The application we are building is a simple text editor that will load, save,
+ and perform some text manipulation. This guide will consist of two parts. The
+ first part will involve designing the application layout and behaviors using
+ declarative language in QML. For the second part, file loading and saving will
+ be implemented using Qt C++. Using
+ \l {The Meta-Object System}{Qt's Meta-Object System}, we can expose C++ functions
+ as properties that QML elements can use. Utilizing QML and Qt C++, we can
+ efficiently decouple the interface logic from the application logic.
+
+ \image qml-texteditor5_editmenu.png
+
+ To run the QML example code, merely provide the included \l{QML Viewer}{qmlviewer}
+ tool with the QML file as the argument. The C++ portion of this tutorial assumes
+ that the reader possesses basic knowledge of Qt's compilation procedures.
+
+ Tutorial chapters:
+ \list 1
+ \o \l {Defining a Button and a Menu}{Defining a Button and a Menu}
+ \o \l {Implementing a Menu Bar}{Implementing a Menu Bar}
+ \o \l {Building a Text Editor}{Building a Text Editor}
+ \o \l {Decorating the Text Editor}{Decorating the Text Editor}
+ \o \l {Extending QML using Qt C++}{Extending QML using Qt C++}
+ \endlist
+
+ \section1 Defining a Button and a Menu
+
+ \section2 Basic Component - a Button
+
+ We start our text editor by building a button. Functionally, a button has a mouse
+ sensitive area and a label. Buttons perform actions when a user presses the button.
+
+ In QML, the basic visual item is the \l {Rectangle}{Rectangle} element. The
+ \c Rectangle element has properties to control the element's appearance and location.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/part0/Button.qml document
+
+ First, the \c { import QtQuick 1.0 } allows the qmlviewer tool to import the QML elements
+ we will later use. This line must exist for every QML file. Notice that the version
+ of Qt modules is included in the import statement.
+
+ This simple rectangle has a unique identifier, \c simplebutton, which is bound to the
+ id property. The \c Rectangle element's properties are bound to values by listing the
+ property, followed by a colon, then the value. In the code sample, the color \c grey
+ is bound to the the Rectangle's \c color property. Similarly, we bind the \c width
+ and \c height of the Rectangle.
+
+ The \l {Text}{Text} element is a non-editable text field. We name this \c Text element
+ \c buttonLabel. To set the string content of the Text field, we bind a value to the
+ \c text property. The label is contained within the Rectangle and in order to center
+ it in the middle, we assign the \c anchors of the Text element to its parent, which
+ is called \c simplebutton. Anchors may bind to other items' anchors, allowing layout
+ assignments simpler.
+
+ We shall save this code as \c SimpleButton.qml. Running qmlviewer with the file as the
+ argument will display the grey rectangle with a text label.
+
+ \image qml-texteditor1_simplebutton.png
+
+ To implement the button click functionality, we can use QML's event handling. QML's event
+ handling is very similar to \l {Signals & Slots}{Qt's signal and slot} mechanism. Signals
+ are emitted and the connected slot is called.
+
+ \code
+ Rectangle{
+ id:simplebutton
+ ...
+
+ MouseArea{
+ id: buttonMouseArea
+
+ anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors
+ //onClicked handles valid mouse button clicks
+ onClicked: console.log(buttonLabel.text + " clicked" )
+ }
+ }
+ \endcode
+
+ We include a \l{MouseArea} element in our simplebutton. \c MouseArea elements describe
+ the interactive area where mouse movements are detected. For our button, we anchor the
+ whole MouseArea to its parent, which is \c simplebutton. The \c anchors.fill syntax is
+ one way of accessing a specific property called \c fill inside a group of properties
+ called \c anchors. QML uses \l {Anchor-based Layout in QML}{anchor based layouts} where
+ items can anchor to another item, creating robust layouts.
+
+ The \c MouseArea has many signal handlers that are called during mouse movements within
+ the specified \c MouseArea boundaries. One of them is \c onClicked and it is called
+ whenever the acceptable mouse button is clicked, the left click being the default. We
+ can bind actions to the onClicked handler. In our example, \c console.log() outputs text
+ whenever the mouse area is clicked. The function \c console.log() is a useful tool for
+ debugging purposes and for outputting text.
+
+ The code in \c SimpleButton.qml is sufficient to display a button on the screen and
+ output text whenever it is clicked with a mouse.
+
+ \code
+ Rectangle {
+ id:Button
+ ...
+
+ property color buttonColor: "lightblue"
+ property color onHoverColor: "gold"
+ property color borderColor: "white"
+
+ signal buttonClick()
+ onButtonClick: {
+ console.log(buttonLabel.text + " clicked" )
+ }
+
+ MouseArea{
+ onClicked: buttonClick()
+ hoverEnabled: true
+ onEntered: parent.border.color = onHoverColor
+ onExited: parent.border.color = borderColor
+ }
+
+ //determines the color of the button by using the conditional operator
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ }
+ \endcode
+
+ A fully functioning button is in \c Button.qml. The code snippets in this article
+ have some code omitted, denoted by ellipses because they were either introduced
+ earlier in the previous sections or irrelevant to the current code discussion.
+
+ Custom properties are declared using the \c {property type name} syntax. In the
+ code, the property \c buttonColor, of type \c color, is declared and bound to
+ the value \c{"lightblue"}. The \c buttonColor is later used in a conditional
+ operation to determine the buttons's fill color. Note that property value
+ assignment is possible using the \c= equals sign, in addition to value binding
+ using the \c : colon character. Custom properties allow internal items to be
+ accessible outside of the Rectangle's scope. There are basic
+ \l{QML Basic Types}{QML types} such as \c int, \c string, \c real, as well as
+ a type called \c variant.
+
+ By binding the \c onEntered and \c onExited signal handlers to colors, the
+ button's border will turn yellow when the mouse hovers above the button and
+ reverts the color when the mouse exits the mouse area.
+
+ A \c buttonClick() signal is declared in \c Button.qml by placing the \c signal
+ keyword in front of the signal name. All signals have their handlers automatically
+ created, their names starting with \c on. As a result, the \c onButtonClick is
+ \c buttonClick's handler. The \c onButtonClick is then assigned an action to
+ perform. In our button example, the \c onClicked mouse handler will simply call
+ \c onButtonClick, which displays a text. The \c onButtonClick enables outside
+ objects to access the \c {Button}'s mouse area easily. For example, items may
+ have more than one \c MouseArea declarations and a \c buttonClick signal can
+ make the distinction between the several \c MouseArea signal handlers better.
+
+ We now have the basic knowledge to implement items in QML that can handle
+ basic mouse movements. We created a \c Text label inside a \c Rectangle,
+ customized its properties, and implemented behaviors that respond to mouse
+ movements. This idea of creating elements within elements is repeated
+ throughout the text editor application.
+
+ This button is not useful unless used as a component to perform an action.
+ In the next section, we will soon create a menu containing several of these
+ buttons.
+
+ \image qml-texteditor1_button.png
+
+ \section2 Creating a Menu Page
+
+ Up to this stage, we covered how to create elements and assign behaviors inside
+ a single QML file. In this section, we will cover how to import QML elements and how
+ to reuse some of the created components to build other components.
+
+ Menus display the contents of a list, each item having the ability to perform an action.
+ In QML, we can create a menu in several ways. First, we will create a menu containing
+ buttons which will eventually perform different actions. The menu code is in
+ \c FileMenu.qml.
+
+ \code
+ import QtQuick 1.0 \\import the main Qt QML module
+ import "folderName" \\import the contents of the folder
+ import "script.js" as Script \\import a Javascript file and name it as Script
+ \endcode
+
+ The syntax shown above shows how to use the \c import keyword. This is required to
+ use JavaScript files, or QML files that are not within the same directory. Since
+ \c Button.qml is in the same directory as \c FileMenu.qml, we do not need to import
+ the \c Button.qml file to use it. We can directly create a \c Button element by declaring
+ \c Button{}, similar to a \c Rectangle{} declaration.
+
+ \code
+ In FileMenu.qml:
+
+ Row{
+ anchors.centerIn: parent
+ spacing: parent.width/6
+
+ Button{
+ id: loadButton
+ buttonColor: "lightgrey"
+ label: "Load"
+ }
+ Button{
+ buttonColor: "grey"
+ id: saveButton
+ label: "Save"
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ buttonColor: "darkgrey"
+
+ onButtonClick: Qt.quit()
+ }
+ }
+ \endcode
+
+ In \c FileMenu.qml, we declare three \c Button elements. They are declared
+ inside a \l {Row}{Row} element, a positioner that will position its children
+ along a vertical row. The \c Button declaration resides in Button.qml,
+ which is the same as the \c Button.qml we used in the previous section.
+ New property bindings can be declared within the newly created buttons,
+ effectively overwriting the properties set in \c Button.qml. The button
+ called \c exitButton will quit and close the window when it is clicked.
+ Note that the signal handler \c onButtonClick in \c Button.qml will be
+ called in addition to the \c onButtonClick handler in \c exitButton.
+
+ \image qml-texteditor1_filemenu.png
+
+ The \c Row declaration is declared in a \c Rectangle, creating a rectangle
+ container for the row of buttons. This additional rectangle creates an indirect
+ way of organizing the row of buttons inside a menu.
+
+ The declaration of the edit menu is very similar at this stage. The menu has
+ buttons that have the labels: \c Copy, \c Paste, and \c {Select All}.
+
+ \image qml-texteditor1_editmenu.png
+
+ Armed with our knowledge of importing and customizing previously made
+ components, we may now combine these menu pages to create a menu bar,
+ consisting of buttons to select the menu, and look at how we may structure
+ data using QML.
+
+ \section1 Implementing a Menu Bar
+
+ Our text editor application will need a way to display menus using a menu bar.
+ The menu bar will switch the different menus and the user can choose which menu
+ to display. Menu switching implies that the menus need more structure than
+ merely displaying them in a row. QML uses models and views to structure data
+ and display the structured data.
+
+ \section2 Using Data Models and Views
+
+ QML has different \l{QML Data Models}{data views} that display
+ \l{QML Data Models}{data models}. Our menu bar will display the menus in a list,
+ with a header that displays a row of menu names. The list of menus are declared
+ inside a \c VisualItemModel. The \l{VisualItemModel}{\c VisualItemModel}
+ element contains items that already have views such as \c Rectangle elements
+ and imported UI elements. Other model types such as the \l{ListModel}{\c ListModel}
+ element need a delegate to display their data.
+
+ We declare two visual items in the \c menuListModel, the \c FileMenu and the
+ \c EditMenu. We customize the two menus and display them using a
+ \l {ListView}{ListView}. The \c MenuBar.qml file contains the QML declarations
+ and a simple edit menu is defined in \c EditMenu.qml.
+
+ \code
+ VisualItemModel{
+ id: menuListModel
+ FileMenu{
+ width: menuListView.width
+ height: menuBar.height
+ color: fileColor
+ }
+ EditMenu{
+ color: editColor
+ width: menuListView.width
+ height: menuBar.height
+ }
+ }
+ \endcode
+
+ The \l {ListView}{ListView} element will display a model according to a delegate.
+ The delegate may declare the model items to display in a \c Row element or display
+ the items in a grid. Our \c menuListModel already has visible items, therefore,
+ we do not need to declare a delegate.
+
+ \code
+ ListView{
+ id: menuListView
+
+ //Anchors are set to react to window anchors
+ anchors.fill:parent
+ anchors.bottom: parent.bottom
+ width:parent.width
+ height: parent.height
+
+ //the model contains the data
+ model: menuListModel
+
+ //control the movement of the menu switching
+ snapMode: ListView.SnapOneItem
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickDeceleration: 5000
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration:240
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ }
+ \endcode
+
+ Additionally, \c ListView inherits from \l{Flickable}{\c Flickable}, making
+ the list respond to mouse drags and other gestures. The last portion of the
+ code above sets \c Flickable properties to create the desired flicking movement
+ to our view. In particular,the property \c highlightMoveDuration changes the
+ duration of the flick transition. A higher \c highlightMoveDuration value
+ results in slower menu switching.
+
+ The \c ListView maintains the model items through an \c index and each visual
+ item in the model is accessible through the \c index, in the order of the
+ declaration. Changing the \c currentIndex effectively changes the highlighted
+ item in the \c ListView. The header of our menu bar exemplify this effect.
+ There are two buttons in a row, both changing the current menu when clicked.
+ The \c fileButton changes the current menu to the file menu when clicked,
+ the \c index being \c 0 because \c FileMenu is declared first in the
+ \c menuListModel. Similarly, the \c editButton will change the current
+ menu to the \c EditMenu when clicked.
+
+ The \c labelList rectangle has \c z value of \c 1, denoting that it is displayed
+ at the front of the menu bar. Items with higher \c z values are displayed in front
+ of items with lower \c z values. The default \c z value is \c 0.
+
+ \code
+ Rectangle{
+ id: labelList
+ ...
+ z: 1
+ Row{
+ anchors.centerIn: parent
+ spacing:40
+ Button{
+ label: "File"
+ id: fileButton
+ ...
+ onButtonClick: menuListView.currentIndex = 0
+ }
+ Button{
+ id: editButton
+ label: "Edit"
+ ...
+ onButtonClick: menuListView.currentIndex = 1
+ }
+ }
+ }
+ \endcode
+
+ The menu bar we just created can be flicked to access the menus or by clicking
+ on the menu names at the top. Switching menu screens feel intuitive and responsive.
+
+ \image qml-texteditor2_menubar.png
+
+ \section1 Building a Text Editor
+
+ \section2 Declaring a TextArea
+
+ Our text editor is not a text editor if it didn't contain an editable text area.
+ QML's \l {TextEdit}{TextEdit} element allows the declaration of a multi-line
+ editable text area. \l {TextEdit}{TextEdit} is different from a \l {Text}{Text}
+ element, which doesn't allow the user to directly edit the text.
+
+ \code
+ TextEdit{
+ id: textEditor
+ anchors.fill:parent
+ width:parent.width; height:parent.height
+ color:"midnightblue"
+ focus: true
+
+ wrapMode: TextEdit.Wrap
+
+ onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle)
+ }
+ \endcode
+
+ The editor has its font color property set and set to wrap the text. The
+ \c TextEdit area is inside a flickable area that will scroll the text if the
+ text cursor is outside the visible area. The function \c ensureVisible() will
+ check if the cursor rectangle is outside the visible boundaries and move the
+ text area accordingly. QML uses Javascript syntax for its scripts, and as previously
+ mentioned, Javascript files can be imported and used within a QML file.
+
+ \code
+ function ensureVisible(r){
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
+ \endcode
+
+ \section2 Combining Components for the Text Editor
+
+ We are now ready to create the layout of our text editor using QML. The text
+ editor has two components, the menu bar we created and the text area. QML allows
+ us to reuse components, therefore making our code simpler, by importing components
+ and customizing when necessary. Our text editor splits the window into two;
+ one-third of the screen is dedicated to the menu bar and two-thirds of the screen
+ displays the text area. The menu bar is displayed in front of any other elements.
+
+ \code
+ Rectangle{
+
+ id: screen
+ width: 1000; height: 1000
+
+ //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar
+ property int partition: height/3
+
+ MenuBar{
+ id:menuBar
+ height: partition
+ width:parent.width
+ z: 1
+ }
+
+ TextArea{
+ id:textArea
+ anchors.bottom:parent.bottom
+ y: partition
+ color: "white"
+ height: partition*2
+ width:parent.width
+ }
+ }
+ \endcode
+
+ By importing reusable components, our \c TextEditor code looks much simpler.
+ We can then customize the main application, without worrying about properties
+ that already have defined behaviors. Using this approach, application layouts
+ and UI components can be created easily.
+
+ \image qml-texteditor3_texteditor.png
+
+ \section1 Decorating the Text Editor
+ \section2 Implementing a Drawer Interface
+
+ Our text editor looks simple and we need to decorate it. Using QML, we can declare
+ transitions and animate our text editor. Our menu bar is occupying one-third of the
+ screen and it would be nice to have it only appear when we want it.
+
+ We can add a drawer interface, that will contract or expand the menu bar when clicked.
+ In our implementation, we have a thin rectangle that responds to mouse clicks. The
+ \c drawer, as well as the application, has two sates: the "drawer is open" state and
+ the "drawer is closed" state. The \c drawer item is a strip of rectangle with a small
+ height. There is a nested \l {Image}{Image} element declaring that an arrow icon will
+ be centered inside the drawer. The drawer assigns a state to the whole application,
+ with the identifier \c screen, whenever a user clicks the mouse area.
+
+ \code
+ Rectangle{
+ id:drawer
+ height:15
+
+ Image{
+ id: arrowIcon
+ source: "images/arrow.png"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ MouseArea{
+ id: drawerMouseArea
+ anchors.fill:parent
+ onClicked:{
+ if (screen.state == "DRAWER_CLOSED"){
+ screen.state = "DRAWER_OPEN"
+ }
+ else if (screen.state == "DRAWER_OPEN"){
+ screen.state = "DRAWER_CLOSED"
+ }
+ }
+ ...
+ }
+ }
+ \endcode
+
+ A state is simply a collection of configurations and it is declared in a
+ \l{State}{State} element. A list of states can be listed and bound to the
+ \c states property. In our application, the two states are called
+ \c DRAWER_CLOSED and \c DRAWER_OPEN. Item configurations are declared in
+ \l {PropertyChanges}{PropertyChanges} elements. In the \c DRAWER_OPEN state,
+ there are four items that will receive property changes. The first target,
+ \c menuBar, will change its \c y property to \c 0. Similarly, the \c textArea
+ will lower to a new position when the state is \c DRAWER_OPEN. The \c textArea,
+ the \c drawer, and the drawer's icon will undergo property changes to meet the
+ current state.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml states
+
+ State changes are abrupt and needs smoother transitions. Transitions between states
+ are defined using the \l {Transition}{Transition} element, which can then bind to
+ the item's \c transitions property. Our text editor has a state transition whenever
+ the state changes to either \c DRAWER_OPEN or \c DRAWER_CLOSED. Importantly, the
+ transition needs a \c from and a \c to state but for our transitions, we can use
+ the wild card \c * symbol to denote that the transition applies to all state changes.
+
+ During transitions, we can assign animations to the property changes. Our
+ \c menuBar switches position from \c {y:0} to \c {y:-partition} and we can animate
+ this transition using the \l {NumberAnimation}{NumberAnimation} element. We declare
+ that the targets' properties will animate for a certain duration of time and using
+ a certain easing curve. An easing curve controls the animation rates and
+ interpolation behavior during state transitions. The easing curve we chose is
+ \l{PropertyAnimation::easing.type}{Easing.OutQuint}, which slows the movement near
+ the end of the animation. Please read \l {qdeclarativeanimation.html}{QML's Animation}
+ article.
+
+ \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml transitions
+
+ Another way of animating property changes is by declaring a \l {Behavior}{Behavior}
+ element. A transition only works during state changes and \c Behavior can set an
+ animation for a general property change. In the text editor, the arrow has a
+ \c NumberAnimation animating its \c rotation property whenever the property changes.
+
+ \code
+ In TextEditor.qml:
+
+ Behavior{
+ NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }
+ }
+ \endcode
+
+ Going back to our components with knowledge of states and animations, we can improve
+ the appearances of the components. In \c Button.qml, we can add \c color and \c scale
+ property changes when the button is clicked. Color types are animated using
+ \l {ColorAnimation}{ColorAnimation} and numbers are animated using
+ \l {NumberAnimation}{NumberAnimation}. The \c {on propertyName} syntax displayed below
+ is helpful when targeting a single property.
+
+ \code
+ In Button.qml:
+ ...
+
+ color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor
+ Behavior on color { ColorAnimation{ duration: 55} }
+
+ scale: buttonMouseArea.pressed ? 1.1 : 1.00
+ Behavior on scale { NumberAnimation{ duration: 55} }
+ \endcode
+
+ Additionally, we can enhance the appearances of our QML components by adding color
+ effects such as gradients and opacity effects. Declaring a \l {Gradient}{Gradient}
+ element will override the \c color property of the element. You may declare a color
+ in the gradient using the \l {GradientStop}{GradientStop} element. The gradient is
+ positioned using a scale, between \c 0.0 and \c 1.0.
+
+ \code
+ In MenuBar.qml
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.98;color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#0e1B20" }
+ }
+ \endcode
+
+ This gradient is used by the menu bar to display a gradient simulating depth.
+ The first color starts at \c 0.0 and the last color is at \c 1.0.
+
+
+ \section3 Where to Go from Here
+
+ We are finished building the user interface of a very simple text editor.
+ Going forward, the user interface is complete, and we can implement the
+ application logic using regular Qt and C++. QML works nicely as a prototyping
+ tool, separating the application logic away from the UI design.
+
+ \image qml-texteditor4_texteditor.png
+
+ \section2 Extending QML using Qt C++
+
+ Now that we have our text editor layout, we may now implement the text editor
+ functionalities in C++. Using QML with C++ enables us to create our application
+ logic using Qt. We can create a QML context in a C++ application using the
+ \l {Using QML in C++ Applications}{Qt's Declarative} classes and display the QML
+ elements using a Graphics Scene. Alternatively, we can export our C++ code into
+ a plugin that the \l {QML Viewer}{qmlviewer} tool can read. For our application,
+ we shall implement the load and save functions in C++ and export it as a plugin.
+ This way, we only need to load the QML file directly instead of running an executable.
+
+ \section3 Exposing C++ Classes to QML
+
+ We will be implementing file loading and saving using Qt and C++. C++ classes
+ and functions can be used in QML by registering them. The class also needs to be
+ compiled as a Qt plugin and the QML file will need to know where the plugin is located.
+
+ For our application, we need to create the following items:
+ \list 1
+ \o \c Directory class that will handle directory related operations
+ \o \c File class which is a QObject, simulating the list of files in a directory
+ \o plugin class that will register the class to the QML context
+ \o Qt project file that will compile the plugin
+ \o A \c qmldir file telling the qmlviewer tool where to find the plugin
+ \endlist
+
+ \section3 Building a Qt Plugin
+
+ To build a plugin, we need to set the following in a Qt project file. First,
+ the necessary sources, headers, and Qt modules need to be added into our
+ project file. All the C++ code and project files are in the \c filedialog
+ directory.
+
+ \code
+ In cppPlugins.pro:
+
+ TEMPLATE = lib
+ CONFIG += qt plugin
+ QT += declarative
+
+ DESTDIR += ../plugins
+ OBJECTS_DIR = tmp
+ MOC_DIR = tmp
+
+ TARGET = FileDialog
+
+ HEADERS += directory.h \
+ file.h \
+ dialogPlugin.h
+
+ SOURCES += directory.cpp \
+ file.cpp \
+ dialogPlugin.cpp
+ \endcode
+
+ In particular, we compile Qt with the \c declarative module and configure it as a
+ \c plugin, needing a \c lib template. We shall put the compiled plugin into the
+ parent's \c plugins directory.
+
+
+ \section3 Registering a Class into QML
+
+ \code
+ In dialogPlugin.h:
+
+ #include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+ class DialogPlugin : public QDeclarativeExtensionPlugin
+ {
+ Q_OBJECT
+
+ public:
+ void registerTypes(const char *uri);
+
+ };
+
+ \endcode
+
+ Our plugin class, \c DialogPlugin is a subclass of \l{QDeclarativeExtensionPlugin}.
+ We need to implement the inherited function, \l {QDeclarativeExtensionPlugin::}{registerTypes()}.
+ The \c dialogPlugin.cpp file looks like this:
+
+ \code
+ DialogPlugin.cpp:
+
+ #include "dialogPlugin.h"
+ #include "directory.h"
+ #include "file.h"
+ #include <QtDeclarative/qdeclarative.h>
+
+ void DialogPlugin::registerTypes(const char *uri){
+
+ qmlRegisterType<Directory>(uri, 1, 0, "Directory");
+ qmlRegisterType<File>(uri, 1, 0,"File");
+ }
+
+ Q_EXPORT_PLUGIN2(FileDialog, DialogPlugin);
+ \endcode
+
+ The \l{QDeclarativeExtensionPlugin::}{registerTypes()} function registers
+ our File and Directory classes into QML. This function needs the class name
+ for its template, a major version number, a minor version number, and a name
+ for our classes.
+
+ We need to export the plugin using the \l {Q_EXPORT_PLUGIN2}{Q_EXPORT_PLUGIN2}
+ macro. Note that in our \c dialogPlugin.h file, we have the \l {Q_OBJECT}{Q_OBJECT}
+ macro at the top of our class. As well, we need to run \c qmake on the project
+ file to generate the necessary meta-object code.
+
+
+ \section3 Creating QML Properties in a C++ class
+
+ We can create QML elements and properties using C++ and
+ \l {The Meta-Object System}{Qt's Meta-Object System}. We can implement
+ properties using slots and signals, making Qt aware of these properties.
+ These properties can then be used in QML.
+
+ For the text editor, we need to be able to load and save files. Typically,
+ these features are contained in a file dialog. Fortunately, we can use
+ \l {QDir}{QDir}, \l {QFile}{QFile}, and \l {QTextStream}{QTextStream} to
+ implement directory reading and input/output streams.
+
+ \code
+ class Directory : public QObject{
+
+ Q_OBJECT
+
+ Q_PROPERTY(int filesCount READ filesCount CONSTANT)
+ Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
+ Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+
+ ...
+ \endcode
+
+ The \c Directory class uses Qt's Meta-Object System to register properties it
+ needs to accomplish file handling. The \c Directory class is exported as a plugin
+ and is useable in QML as the \c Directory element. Each of the listed properties
+ using the \l {Q_PROPERTY()}{Q_PROPERTY} macro is a QML property.
+
+ The \l {Q_PROPERTY()} {Q_PROPERTY} declares a property as well as its read and
+ write functions into Qt's Meta-Object System. For example, the \c filename
+ property, of type \l {QString}{QString}, is readable using the \c filename()
+ function and writable using the function \c setFilename(). Additionally, there
+ is a signal associated to the filename property called \c filenameChanged(),
+ which is emitted whenever the property changes. The read and write functions
+ are declared as \c public in the header file.
+
+ Similarly, we have the other properties declared according to their uses. The
+ \c filesCount property indicates the number of files in a directory. The filename
+ property is set to the currently selected file's name and the loaded/saved file
+ content is stored in \c fileContent property.
+
+ \code
+ Q_PROPERTY(QDeclarativeListProperty<File> files READ files CONSTANT )
+ \endcode
+
+ The \c files list property is a list of all the filtered files in a directory.
+ The \c Directory class is implemented to filter out invalid text files; only
+ files with a \c .txt extension are valid. Further, \l{QList}s can be
+ used in QML files by declaring them as a QDeclarativeListProperty in C++.
+ The templated object needs to inherit from a QObject, therefore,
+ the \c File class must also inherit from QObject. In the \c Directory class,
+ the list of \c File objects is stored in a QList called \c m_fileList.
+
+ \code
+ class File : public QObject{
+
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+
+ ...
+ };
+ \endcode
+
+ The properties can then be used in QML as part of the \c Directory element's
+ properties. Note that we do not have to create an identifier \c id property
+ in our C++ code.
+
+ \code
+ Directory{
+ id: directory
+
+ filesCount
+ filename
+ fileContent
+ files
+
+ files[0].name
+ }
+
+ \endcode
+
+ Because QML uses Javascript's syntax and structure, we can iterate through
+ the list of files and retrieve its properties. To retrieve the first file's
+ name property, we can call \c { files[0].name }.
+
+ Regular C++ functions are also accessible from QML. The file loading and saving
+ functions are implemented in C++ and declared using the
+ \l {Q_INVOKABLE}{Q_INVOKABLE} macro. Alternatively, we can declare the functions
+ as a \c slot and the functions will be accessible from QML.
+
+ \code
+ In Directory.h:
+
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
+ \endcode
+
+ The \c Directory class also has to notify other objects whenever the directory
+ contents change. This feature is performed using a \c signal. As previously
+ mentioned, QML signals have a corresponding handler with their names prepended
+ with \c on. The signal is called \c directoryChanged and it is emitted whenever
+ there is a directory refresh. The refresh simply reloads the directory contents
+ and updates the list of valid files in the directory. QML items can then be
+ notified by attaching an action to the \c onDirectoryChanged signal handler.
+
+ The \c list properties need to be explored further. This is because list
+ properties use callbacks to access and modify the list contents. The list
+ property is of type \c QDeclarativeListProperty<File>. Whenever the list
+ is accessed, the accessor function needs to return a
+ \c QDeclarativeListProperty<File>. The template type, \c File, needs to be a
+ \c QObject derivative. Further, to create the
+ \l {QDeclarativeListProperty}{QDeclarativeListProperty}, the list's accessor
+ and modifiers need to be passed to the constructor as function pointers. The list,
+ a \c QList in our case, also needs to be a list of \c File pointers.
+
+ The constructor of \l {QDeclarativeListProperty}{QDeclarativeListProperty}
+ constructor and the \c Directory implementation:
+ \code
+ QDeclarativeListProperty ( QObject * object, void * data, AppendFunction append, CountFunction count = 0, AtFunction at = 0, ClearFunction clear = 0 )
+ QDeclarativeListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+ \endcode
+
+ The constructor passes pointers to functions that will append the list, count
+ the list, retrieve the item using an index, and empty the list. Only the append
+ function is mandatory. Note that the function pointers must match the definition
+ of \l {QDeclarativeListProperty::AppendFunction}{AppendFunction},
+ \l {QDeclarativeListProperty::CountFunction}{CountFunction},
+ \l {QDeclarativeListProperty::AtFunction}{AtFunction}, or
+ \l {QDeclarativeListProperty::ClearFunction}{ClearFunction}.
+
+ \code
+ void appendFiles(QDeclarativeListProperty<File> * property, File * file)
+ File* fileAt(QDeclarativeListProperty<File> * property, int index)
+ int filesSize(QDeclarativeListProperty<File> * property)
+ void clearFilesPtr(QDeclarativeListProperty<File> *property)
+ \endcode
+
+ To simplify our file dialog, the \c Directory class filters out invalid text
+ files, which are files that do not have a \c .txt extension. If a file name
+ doesn't have the \c .txt extension, then it won't be seen in our file dialog.
+ Also, the implementation makes sure that saved files have a \c .txt extension in
+ the file name. \c Directory uses \l {QTextStream}{QTextStream} to read the file
+ and to output the file contents to a file.
+
+ With our \c Directory element, we can retrieve the files as a list, know how many
+ text files is in the application directory, get the file's name and content as a
+ string, and be notified whenever there are changes in the directory contents.
+
+ To build the plugin, run \c qmake on the \c cppPlugins.pro project file, then run
+ \c make to build and transfer the plugin to the \c plugins directory.
+
+
+ \section3 Importing a Plugin in QML
+
+ The qmlviewer tool imports files that are in the same directory as the
+ application. We can also create a \c qmldir file containing the locations of
+ QML files we wish to import. The \c qmldir file can also store locations of
+ plugins and other resources.
+
+ \code
+ In qmldir:
+
+ Button ./Button.qml
+ FileDialog ./FileDialog.qml
+ TextArea ./TextArea.qml
+ TextEditor ./TextEditor.qml
+ EditMenu ./EditMenu.qml
+
+ plugin FileDialog plugins
+ \endcode
+
+ The plugin we just created is called \c FileDialog, as indicated by the
+ \c TARGET field in the project file. The compiled plugin is in the \c plugins directory.
+
+
+ \section3 Integrating a File Dialog into the File Menu
+
+ Our \c FileMenu needs to display the \c FileDialog element, containing a list of
+ the text files in a directory thus allowing the user to select the file by
+ clicking on the list. We also need to assign the save, load, and new buttons
+ to their respective actions. The FileMenu contains an editable text input to
+ allow the user to type a file name using the keyboard.
+
+ The \c Directory element is used in the \c FileMenu.qml file and it notifies the
+ \c FileDialog element that the directory refreshed its contents. This notification
+ is performed in the signal handler, \c onDirectoryChanged.
+
+ \code
+ In FileMenu.qml:
+
+ Directory{
+ id:directory
+ filename: textInput.text
+ onDirectoryChanged: fileDialog.notifyRefresh()
+ }
+ \endcode
+
+ Keeping with the simplicity of our application, the file dialog will always be
+ visible and will not display invalid text files, which do not have a \c .txt
+ extension to their filenames.
+
+ \code
+ In FileDialog.qml:
+
+ signal notifyRefresh()
+ onNotifyRefresh: dirView.model = directory.files
+ \endcode
+
+ The \c FileDialog element will display the contents of a directory by reading its
+ list property called \c files. The files are used as the model of a
+ \l {GridView}{GridView} element, which displays data items in a grid according
+ to a delegate. The delegate handles the appearance of the model and our file
+ dialog will simply create a grid with text centered in the middle. Clicking on
+ the file name will result in the appearance of a rectangle to highlight the file
+ name. The \c FileDialog is notified whenever the \c notifyRefresh signal is emitted,
+ reloading the files in the directory.
+
+ \code
+ In FileMenu.qml:
+
+ Button{
+ id: newButton
+ label: "New"
+ onButtonClick:{
+ textArea.textContent = ""
+ }
+ }
+ Button{
+ id: loadButton
+ label: "Load"
+ onButtonClick:{
+ directory.filename = textInput.text
+ directory.loadFile()
+ textArea.textContent = directory.fileContent
+ }
+ }
+ Button{
+ id: saveButton
+ label: "Save"
+ onButtonClick:{
+ directory.fileContent = textArea.textContent
+ directory.filename = textInput.text
+ directory.saveFile()
+ }
+ }
+ Button{
+ id: exitButton
+ label: "Exit"
+ onButtonClick:{
+ Qt.quit()
+ }
+ }
+ \endcode
+
+ Our \c FileMenu can now connect to their respective actions. The \c saveButton
+ will transfer the text from the \c TextEdit onto the directory's \c fileContent
+ property, then copy its file name from the editable text input. Finally, the button
+ calls the \c saveFile() function, saving the file. The \c loadButton has a similar
+ execution. Also, the \c New action will empty the contents of the \c TextEdit.
+
+ Further, the \c EditMenu buttons are connected to the \c TextEdit functions to copy,
+ paste, and select all the text in the text editor.
+
+ \image qml-texteditor5_filemenu.png
+
+ \section2 Text Editor Completion
+
+ \image qml-texteditor5_newfile.png
+
+ The application can function as a simple text editor, able to accept text
+ and save the text into a file. The text editor can also load from a file and
+ perform text manipulation.
+*/
diff --git a/doc/src/getting-started/gettingstartedqt.qdoc b/doc/src/getting-started/gettingstartedqt.qdoc
index 1b3770f..25d0ccd 100644
--- a/doc/src/getting-started/gettingstartedqt.qdoc
+++ b/doc/src/getting-started/gettingstartedqt.qdoc
@@ -28,8 +28,8 @@
/*!
\page gettingstartedqt.html
- \title Getting Started programming with Qt
- \ingroup gettingStarted
+ \title Getting Started Programming with Qt
+ \ingroup gettingStarted
Welcome to the world of Qt--the cross-platform GUI toolkit. In
this getting started guide, we teach basic Qt knowledge by
@@ -85,7 +85,7 @@
other widgets), it is possible to show a single widget in its own
window. Widgets are not visible by default; the function
\l{QWidget::}{show()} makes the widget visible.
-
+
Line 11 makes the QApplication enter its event loop. When a Qt
application is running, events are generated and sent to the
widgets of the application. Examples of events are mouse presses
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 629d8b7..bc0128c 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -45,16 +45,19 @@ for your platform from the following list.
\brief How to install Qt on platforms with X11.
\previouspage Installation
-\note Qt for X11 has some requirements that are given in more detail
-in the \l{Qt for X11 Requirements} document.
+\tableofcontents
-\list 1
-\o If you have the commercial edition of Qt, install your license
+ Qt for X11 has some requirements that are given in more detail
+ in the \l{Qt for X11 Requirements} document.
+
+\section1 Step 1: Installing the License File (commercial editions only)
+ If you have the commercial edition of Qt, install your license
file as \c{$HOME/.qt-license}.
For the open source version you do not need a license file.
-\o Unpack the archive if you have not done so already. For example,
+\section1 Step 2: Unpacking the Archive
+ Unpack the archive if you have not done so already. For example,
if you have the \c{qt-everywhere-opensource-src-%VERSION%.tar.gz}
package, type the following commands at a command line prompt:
@@ -64,7 +67,7 @@ in the \l{Qt for X11 Requirements} document.
containing the files from the archive. We only support the GNU version of
the tar archiving utility. Note that on some systems it is called gtar.
-\o Building
+\section1 Step 3: Building the Library
To configure the Qt library for your machine type, run the
\c{./configure} script in the package directory.
@@ -84,12 +87,10 @@ in the \l{Qt for X11 Requirements} document.
If \c{-prefix} is outside the build directory, you need to install
the library, demos, examples, tools, and tutorials in the appropriate
- place. To do this, type:
+ place. To do this (as root if necessary), type:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 3
-
- , as root if necessary.
-
+
Note that on some systems the make utility is named differently,
e.g. gmake. The configure script tells you which make utility to
use.
@@ -99,7 +100,7 @@ in the \l{Qt for X11 Requirements} document.
removed by entering the build directory and typing \c{make confclean}
before running \c configure again.
-\o Environment variables
+\section1 Step 4: Set the Environment Variables
In order to use Qt, some environment variables needs to be
extended.
@@ -125,7 +126,9 @@ in the \l{Qt for X11 Requirements} document.
\c{/usr/local/Trolltech/Qt-%VERSION%/lib}. On Linux with GCC this step
is not needed.
-\o That's all. Qt is now installed.
+\bold {That's all. Qt is now installed.}
+
+\section1 Qt Demos and Examples
If you are new to Qt, we suggest that you take a look at the demos
and examples to see Qt in action. Run the Qt Examples and Demos
@@ -141,7 +144,6 @@ in the \l{Qt for X11 Requirements} document.
\o \l{Developer Zone}
\o \l{Deploying Qt Applications}
\endlist
-\endlist
We hope you will enjoy using Qt. Good luck!
@@ -154,24 +156,22 @@ in the \l{Qt for X11 Requirements} document.
\brief How to install Qt on Windows.
\previouspage Installation
-\note Qt for Windows has some requirements that are given in more detail
-in the \l{Qt for Windows Requirements} document.
+\tableofcontents
-\table
-\row \o \bold{Notes:}
-\list
-\o If you have obtained a binary package for this platform,
-consult the installation instructions provided instead of the ones in
-this document.
-\o \l{Open Source Versions of Qt} is not officially supported for use with
-any version of Visual Studio. Integration with Visual Studio is available
-as part of the \l{Qt Commercial Edition}.
+ Qt for Windows has some requirements that are given in more detail
+ in the \l{Qt for Windows Requirements} document.
-\endlist
-\endtable
+ If you have obtained a binary package for this platform,
+ consult the installation instructions provided instead of the ones in
+ this document.
-\list 1
-\o If you have the commercial edition of Qt, copy the license file
+ Open Source Versions of Qt is not officially supported for use with
+ any version of Visual Studio. Integration with Visual Studio is available
+ as part of the \l{Qt Commercial Edition}.
+
+\section1 Step 1: Install the License File (commercial editions only)
+
+ If you have the commercial edition of Qt, copy the license file
from your account on dist.trolltech.com into your home directory
(this may be known as the \c userprofile environment variable) and
rename it to \c{.qt-license}. This renaming process must be done
@@ -181,13 +181,15 @@ as part of the \l{Qt Commercial Edition}.
For the open source version you do not need a license file.
-\o Uncompress the files into the directory you want Qt installed;
+\section1 Step 2: Unpack the Archive
+
+ Uncompress the files into the directory you want Qt installed;
e.g. \c{C:\Qt\%VERSION%}.
\note The install path must not contain any spaces or Windows specific
file system characters.
-\o Environment variables
+\section1 Step 3: Set the Environment variables
In order to build and use Qt, the \c PATH environment variable needs to be
extended:
@@ -203,12 +205,13 @@ as part of the \l{Qt Commercial Edition}.
other build tools are listed in the \c PATH variable. This will depend
on your choice of software development environment.
- \bold{Note}: If you don't use the configured shells, which is
+ \note If you don't use the configured shells, which is
available in the application menu, in the \l{Open Source Versions of Qt},
\c configure requires that \c sh.exe is not in the path
or that it is run from \c msys. This also goes for mingw32-make.
-\o Building
+\section1 Step 4: Build the Qt Library
+
To configure the Qt library for your machine, type the following command
in a \bold{Visual Studio} command prompt:
@@ -243,7 +246,9 @@ as part of the \l{Qt Commercial Edition}.
removed by entering the build directory and typing \c{nmake distclean}
before running \c configure again.
-\o That's all. Qt is now installed.
+\bold{That's all. Qt is now installed.}
+
+\section1 Qt Demos and Examples
If you are new to Qt, we suggest that you take a look at the demos
and examples to see Qt in action. Run the Qt Examples and Demos
@@ -259,8 +264,6 @@ as part of the \l{Qt Commercial Edition}.
\o \l{Deploying Qt Applications}
\endlist
-\endlist
-
We hope you will enjoy using Qt. Good luck!
*/
@@ -270,11 +273,14 @@ as part of the \l{Qt Commercial Edition}.
\ingroup installation
\brief How to install Qt on Mac OS X.
\previouspage Installation
+\tableofcontents
-\note Qt for Mac OS X has some requirements that are given in more detail
+Qt for Mac OS X has some requirements that are given in more detail
in the \l{Qt for Mac OS X Requirements} document.
-\bold{Note for the binary package}: If you have the binary package, simply double-click on the Qt.mpkg
+The following instructions describe how to install Qt from the source package.
+
+For the binary package, simply double-click on the Qt.mpkg
and follow the instructions to install Qt. You can later run the \c{uninstall-qt.py}
script to uninstall the binary package. The script is located in /Developer/Tools and
must be run as root.
@@ -283,15 +289,13 @@ must be run as root.
\l{http://openradar.appspot.com/7214991}
{iPhone simulator conflicts with the package installer}.
-The following instructions describe how to install Qt from the source package.
-
-\list 1
-\o If you have the commercial edition of Qt, install your license
+\section1 Step 1: Install the License File (commercial editions only)
+ If you have the commercial edition of Qt, install your license
file as \c{$HOME/.qt-license}.
For the open source version you do not need a license file.
-\o Unpack the archive if you have not done so already. For example,
+ Unpack the archive if you have not done so already. For example,
if you have the \c{qt-everywhere-opensource-src-%VERSION%.tar.gz}
package, type the following commands at a command line prompt:
@@ -300,7 +304,7 @@ The following instructions describe how to install Qt from the source package.
This creates the directory \c{/tmp/qt-everywhere-opensource-src-%VERSION%}
containing the files from the archive.
-\o Building
+\section1 Step 2: Build the Qt Library
To configure the Qt library for your machine type, run the
\c{./configure} script in the package directory.
@@ -335,18 +339,18 @@ The following instructions describe how to install Qt from the source package.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 14
- as root, if neccessary (note that this requires that you have administrator access
- to your machine).
+ This command requires that you have administrator access
+ on your machine.
- There is a potential race condition when running make install with multiple
+ \note There is a potential race condition when running make install with multiple
jobs. It is best to only run one make job (-j1) for the install.
- \bold{Note:} If you later need to reconfigure and rebuild Qt from the
+ If you later need to reconfigure and rebuild Qt from the
same location, ensure that all traces of the previous configuration are
removed by entering the build directory and typing \c{make confclean}
before running \c configure again.
-\o Environment variables
+\section1 Step 3: Set the Environment variables
In order to use Qt, some environment variables need to be
extended.
@@ -366,8 +370,9 @@ The following instructions describe how to install Qt from the source package.
If you use a different shell, please modify your environment
variables accordingly.
-\o That's all. Qt is now installed.
+\bold {That's all. Qt is now installed.}
+\section1 Qt Demos and Examples
If you are new to Qt, we suggest that you take a look at the demos
and examples to see Qt in action. Run the Qt Examples and Demos
either by typing \c qtdemo on the command line or through the
@@ -381,7 +386,6 @@ The following instructions describe how to install Qt from the source package.
\o \l{Developer Zone}
\o \l{Deploying Qt Applications}
\endlist
-\endlist
We hope you will enjoy using Qt. Good luck!
@@ -393,96 +397,96 @@ The following instructions describe how to install Qt from the source package.
\ingroup qtce
\brief How to install Qt on Windows CE.
\previouspage Installation
+\tableofcontents
-\note Qt for Windows CE has some requirements that are given in more detail
+Qt for Windows CE has some requirements that are given in more detail
in the \l{Qt for Windows CE Requirements} document.
-\list 1
- \o Uncompress the files into the directory you want to install Qt into;
- e.g., \c{C:\Qt\%VERSION%}.
-
- \note The install path must not contain any spaces.
+\section1 Step 1: Install the License File (commercial editions only)
+ Uncompress the files into the directory you want to install Qt into;
+ e.g., \c{C:\Qt\%VERSION%}.
- \o Environment variables
+ \note The install path must not contain any spaces.
- In order to build and use Qt, the \c PATH environment variable needs
- to be extended:
+\section1 Step 2: Set the Environment variables
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 18
+ In order to build and use Qt, the \c PATH environment variable needs
+ to be extended:
- This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 18
+ This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
- For newer versions of Windows, \c PATH can be extended through
- "Control Panel->System->Advanced->Environment variables" and for
- older versions by editing \c{c:\autoexec.bat}.
+ For newer versions of Windows, \c PATH can be extended through
+ "Control Panel->System->Advanced->Environment variables" and for
+ older versions by editing \c{c:\autoexec.bat}.
- Make sure the enviroment variables for your compiler are set.
- Visual Studio includes \c{vcvars32.bat} for that purpose - or simply
- use the "Visual Studio Command Prompt" from the Start menu.
+ Make sure the enviroment variables for your compiler are set.
+ Visual Studio includes \c{vcvars32.bat} for that purpose - or simply
+ use the "Visual Studio Command Prompt" from the Start menu.
- \o Configuring Qt
+\section1 Step 3: Configure Qt
- To configure Qt for Windows Mobile 5.0 for Pocket PC, type the
- following:
+ To configure Qt for Windows Mobile 5.0 for Pocket PC, type the
+ following:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 19
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 19
- If you want to configure Qt for another platform or with other
- options, type \c{configure -help} to get a list of all available
- options. See the \c README file for the list of supported platforms.
+ If you want to configure Qt for another platform or with other
+ options, type \c{configure -help} to get a list of all available
+ options. See the \c README file for the list of supported platforms.
+\section1 Step 4: Build Qt Library
- \o Building Qt
+ Now, to build Qt you first have to update your \c PATH, \c INCLUDE
+ and \c LIB paths to point to the correct resources for your target
+ platforms. For a default installation of the Windows Mobile 5.0
+ Pocket PC SDK, this is done with the following commands:
- Now, to build Qt you first have to update your \c PATH, \c INCLUDE
- and \c LIB paths to point to the correct resources for your target
- platforms. For a default installation of the Windows Mobile 5.0
- Pocket PC SDK, this is done with the following commands:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 20
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 20
+ We provide a convenience script for this purpose, called \c{setcepaths}.
+ Simply type:
- We provide a convenience script for this purpose, called \c{setcepaths}.
- Simply type:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 21
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 21
+ Then to build Qt type:
- Then to build Qt type:
+ \snippet doc/src/snippets/code/doc_src_installation.qdoc 22
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 22
+\bold{That's all. Qt is now installed.}
- \o That's all. Qt is now installed.
+\section1 Qt Demos and Examples
- To get started with Qt, you can check out the examples found in the
- \c{examples} directory of your Qt installation. The documentation can
- be found in \c{doc\html}.
+ To get started with Qt, you can check out the examples found in the
+ \c{examples} directory of your Qt installation. The documentation can
+ be found in \c{doc\html}.
- \bold{Remember:} If you reconfigure Qt for a different platform,
- make sure you start with a new clean console to get rid of the
- platform dependent include directories.
+ \note If you reconfigure Qt for a different platform,
+ make sure you start with a new clean console to get rid of the
+ platform dependent include directories.
- The links below provide further information for using Qt:
- \list
- \o \l{How to Learn Qt}
- \o \l{Tutorials}
- \o \l{Developer Zone}
- \o \l{Deploying Qt Applications}
- \endlist
+ The links below provide further information for using Qt:
+ \list
+ \o \l{How to Learn Qt}
+ \o \l{Tutorials}
+ \o \l{Developer Zone}
+ \o \l{Deploying Qt Applications}
+ \endlist
- You might also want to try the following Windows CE specific links:
- \list
- \o \l{Windows CE - Introduction to using Qt}
- \o \l{Windows CE - Working with Custom SDKs}
- \o \l{Windows CE - Using shadow builds}
- \o \l{Windows CE - Signing}
- \endlist
+ You might also want to try the following Windows CE specific links:
+ \list
+ \o \l{Windows CE - Introduction to using Qt}
+ \o \l{Windows CE - Working with Custom SDKs}
+ \o \l{Windows CE - Using shadow builds}
+ \o \l{Windows CE - Signing}
+ \endlist
- Information on feature and performance tuning for embedded builds can
- be found on the following pages:
- \list
- \o \l{Fine-Tuning Features in Qt}
- \o \l{Qt Performance Tuning}
- \endlist
-\endlist
+ Information on feature and performance tuning for embedded builds can
+ be found on the following pages:
+ \list
+ \o \l{Fine-Tuning Features in Qt}
+ \o \l{Qt Performance Tuning}
+ \endlist
We hope you will enjoy using Qt. Good luck!
*/
@@ -491,20 +495,22 @@ in the \l{Qt for Windows CE Requirements} document.
\title Installing Qt on the Symbian platform from a Binary Package
\ingroup qtsymbian
\brief How to install Qt on the Symbian platform from a binary package.
+\previouspage Installation
+
+\tableofcontents
-\note Qt for the Symbian platform has some requirements that are given in more detail
+Qt for the Symbian platform has some requirements that are given in more detail
in the \l{Qt for the Symbian platform Requirements} document.
-\list 1
- \o Install Qt
+\section1 Step 1: Install Qt
Run \c{qt-symbian-opensource-%VERSION%.exe} and follow the instructions.
\note Qt must be installed on the same drive as the Symbian SDK you are
using, and the install path must not contain any spaces.
- \o Install Qt into a device
+\section1 Step 2: Install Qt into a device
To run Qt applications on a device, \c{qt_installer.sis} found
in the Qt installation directory must be first installed into the device.
@@ -516,7 +522,7 @@ in the \l{Qt for the Symbian platform Requirements} document.
on the \c{qt_installer.sis} file, select "Install with Nokia Application
Installer" and follow the instructions.
- \o Running Qt demos
+\section1 Running Qt demos
We've included a subset of the Qt demos in this package for you
to try out. An excellent starting point is the "fluidlauncher"
@@ -540,9 +546,8 @@ in the \l{Qt for the Symbian platform Requirements} document.
Symbian platform,
see \l{The Symbian platform - Introduction to Qt}.
- We hope you will enjoy using Qt.
+\bold{We hope you will enjoy using Qt.}
-\endlist
*/
/*! \page install-Symbian.html
@@ -550,206 +555,200 @@ Symbian platform,
\ingroup installation
\ingroup qtsymbian
\brief How to install Qt on the Symbian platform.
+\previouspage Installation
+\tableofcontents
-\note Qt for the Symbian platform has some requirements that are given in more detail
+Qt for the Symbian platform has some requirements that are given in more detail
in the \l{Qt for the Symbian platform Requirements} document.
-\note \bold {This document describes how to install and configure Qt for
-the Symbian platform from scratch.
-If you are using pre-built binaries, follow the instructions given in the
-\l{Installing Qt on the Symbian platform from a Binary Package} document.}
+This document describes how to install and configure Qt for
+the Symbian platform from scratch. If you are using pre-built binaries, follow
+the instructions given in the \l{Installing Qt on the Symbian platform from a
+Binary Package} document.
-\list 1
+\section1 Step 1: Set Up the Development Environment
- \o Setup the development environment
+ Make sure your Symbian development environment is correctly installed
+ and patched as explained in the \l{Qt for the Symbian platform Requirements}
+ document.
- Make sure your Symbian development environment is correctly installed and
- patched as explained in the \l{Qt for the Symbian platform Requirements} document.
+ After you have finished the Symbian development environment setup, it is
+ good to verify that environment is functional for example by compiling one
+ of the pure Symbian examples for both emulator and HW. This can be done from
+ command prompt as follows:
- After you have finished the Symbian development environment setup, it is good
- to verify that environment is functional for example by compiling one
- of the pure Symbian examples for both emulator and HW. This can be done from
- command prompt as follows:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 32
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 32
+ If all steps pass without errors your Symbian development environment is
+ very likely installed correctly.
- If all steps pass without errors your Symbian development environment is
- very likely installed correctly.
+\section1 Step 2: Install Qt
- \o Install Qt
+ Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source
+ package into the directory you want Qt installed, e.g. \c{C:\Qt\%VERSION%}.
- Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source package into the
- directory you want Qt installed, e.g. \c{C:\Qt\%VERSION%}.
+ \note Qt must be installed on the same drive as the Symbian SDK you are
+ using, and the install path must not contain any spaces.
- \note Qt must be installed on the same drive as the Symbian SDK you are
- using, and the install path must not contain any spaces.
+\section1 Step 3: Set the Environment variables
- \o Environment variables
+ In order to build and use Qt, the \c PATH environment variable needs
+ to be extended:
- In order to build and use Qt, the \c PATH environment variable needs
- to be extended:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 18
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 18
+ This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
- This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable.
+ On Windows the\c PATH can be extended by navigating to
+ "Control Panel->System->Advanced->Environment variables".
- On Windows the PATH can be extended by navigating to
- "Control Panel->System->Advanced->Environment variables".
+ In addition, you must configure the environment for use with the Symbian
+ emulator. This is done by locating the Carbide.c++ submenu on the Start
+ menu, and choosing "Configure environment for WINSCW command line".
- In addition, you must configure the environment for use with the Symbian
- emulator. This is done by locating the Carbide.c++ submenu on the Start
- menu, and choosing "Configure environment for WINSCW command line".
+ If you are planning to use \c abld (the default build system that comes with
+ the S60 SDK) to build Qt, you will also need to set the following
+ environment variable:
- If you are planning to use abld (the default build system that comes with the S60 SDK)
- to build Qt, you will also need to set the following environment variable:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 33
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 33
+ This is not necessary for other applications, only when building Qt.
- This is not necessary for other applications, only when building Qt.
+\section1 Step 4: Configure Qt
- \o Configure Qt
+ To configure Qt for the Symbian platform, do:
- To configure Qt for the Symbian platform, do:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 23
+ (to build the tools using MinGW, and the libraries using abld)
+
+ \bold or
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 23
- to build the tools using MinGW, and the libraries using abld.
- or
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 31
- to build the tools using MinGW, and the libraries using SBSv2.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 31
+ (to build the tools using MinGW, and the libraries using SBSv2)
- SBSv2 (also known as \l{http://developer.symbian.org/wiki/index.php/Introduction_to_RAPTOR} {Raptor})
- is a next-generation Symbian build system. SBSv2 is not officially
- supported by any of the S60 SDKs currently available from Forum Nokia.
+ SBSv2 (also known as \l{http://developer.symbian.org/wiki/index.php/Introduction_to_RAPTOR} {Raptor})
+ is a next-generation Symbian build system. SBSv2 is not officially supported
+ by any of the S60 SDKs currently available from Forum Nokia.
- \o Build Qt
+\section1 Step 5: Build Qt
- To build Qt for the emulator, type:
+ To build Qt for the emulator, type:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 24
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 24
- To build Qt for the device, type:
+ To build Qt for the device, type:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 28
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 28
- Congratulations, Qt is now ready to use.
+ Congratulations, Qt is now ready to use.
- \o Installing Qt libraries on the device
+\section1 Step 7: Installing Qt Libraries on the Device
- To run the demo on a real device, you first have to install
- the Qt libraries on the device:
+ To run the demo on a real device, you first have to install
+ the Qt libraries on the device:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 29
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 29
- The Qt libraries are built with "All -Tcb" capability, so that
- they can support all types of application.
- If you don't have a suitable certificate, it is possible to patch
- the binaries as follows:
+ The Qt libraries are built with "All -Tcb" capability, so that
+ they can support all types of application.
+ If you don't have a suitable certificate, it is possible to patch
+ the binaries as follows:
- \list A
- \o Installing Qt without a certificate
+ If you have no certificate, build a self signed Qt:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 34
- If you have no certificate, build a self signed Qt:
+ If you have a symbian-signed developer certificate, specify the
+ capabilities you can sign for, for example:
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 35
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 34
+\section1 Running Qt demos
- \o Installing Qt with a Symbian developer certificate
+ We've included a subset of the Qt demos in this package for you
+ to try out. An excellent starting point is the "fluidlauncher"
+ demo.
- If you have a symbian-signed developer certificate, specify the
- capabilities you can sign for, for example:
+ Similarly, install fluidlauncher to the device:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 35
- \endlist
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 30
- \o Running Qt demos
+ This will create a self-signed \c fluidlauncher.sis and
+ install it to your device.
- We've included a subset of the Qt demos in this package for you
- to try out. An excellent starting point is the "fluidlauncher"
- demo.
-
- Similarly, install fluidlauncher to the device:
-
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 30
+ To run the demos on the emulator simply navigate to the directory of the demo
+ you want to see and run:
- This will create a self-signed \c fluidlauncher.sis and
- install it to your device.
-
- To run the demos on the emulator simply navigate to the directory of the demo
- you want to see and run:
-
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 27
-
- For more information about building and running Qt programs on the
- Symbian platform, see \l{The Symbian platform - Introduction to Qt}.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 27
+ For more information about building and running Qt programs on the
+ Symbian platform, see \l{The Symbian platform - Introduction to Qt}.
We hope you will enjoy using Qt.
-\endlist
-
*/
/*! \page install-Symbian-linux.html
\title Installing Qt on the Symbian platform using Linux (experimental)
\ingroup installation
\ingroup qtsymbian
\brief How to install Qt on the Symbian platform using Linux.
+\previouspage Installation
+\tableofcontents
-\note \bold {This document describes how to install and configure Qt for
+This document describes how to install and configure Qt for
the Symbian platform from scratch, using Linux as the build host.
Qt for Symbian binaries can be downloaded directly so development of
-applications using Qt for Symbian can start right away.}
-
-\list 1
-
- \o Setup the development environment
+applications using Qt for Symbian can start right away.
- \note Qt for the Symbian platform has some requirements on the development
- platform. The Symbian SDK for Linux as well as a cross compiler for the ARM
- processor used on Symbian devices should be present on the development machine.
- See {http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
+\section1 Step 1: Setup the development environment
- \o Install Qt
+ Qt for the Symbian platform has some requirements on the development
+ platform. The Symbian SDK for Linux as well as a cross compiler for the ARM
+ processor used on Symbian devices should be present on the development
+ machine.
+
+ See \l{http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
+\section1 Step 2: Unpack the Archive
- Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source package into the
+ Uncompress the \l{http://qt.nokia.com/downloads}{downloaded} source package into the
directory you want Qt installed, e.g. \c{/home/user/qt/%VERSION%}.
- \o Environment variables
+\section1 Step 3: Set the Environment Variables
- In order to build and use Qt, the \c PATH environment variable needs
- to be extended to fine Qt tools and also to find the Symbian platform tools:
+ In order to build and use Qt, the \c PATH environment variable needs
+ to be extended to fine Qt tools and also to find the Symbian platform tools:
- First you need to set the \c EPOCROOT environment variable to point to the location
- of your S60 SDK:
+ First you need to set the \c EPOCROOT environment variable to point to the
+ location of your S60 SDK:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 36
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 36
- Then you can update the PATH variable;
+ Then you can update the PATH variable;
\snippet doc/src/snippets/code/doc_src_installation.qdoc 37
- \o Configure Qt
+\section1 Step 4: Configure Qt
- To configure Qt for the Symbian platform, do:
+ To configure Qt for the Symbian platform, do:
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 38
- to build the libraries using RVCT or
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 39
- to build the libraries using GCCE.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 38
+ to build the libraries using RVCT or
- \o Build Qt
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 39
+ to build the libraries using GCCE.
- To build Qt for the device, type:
+\section1 Step 5: Build Qt
- \snippet doc/src/snippets/code/doc_src_installation.qdoc 40
+ To build Qt for the device, type:
- Congratulations, Qt is now ready to use.
+\snippet doc/src/snippets/code/doc_src_installation.qdoc 40
- \o Building Qt packages for the device
+ Congratulations, Qt is now ready to use.
- To run any application or demo on a real device, you need to install it
- on the device. To do this you first have to create a a package for the
- device, containing the libraries:
+\section1 Step 6: Building Qt packages for the Device
- \list A
- \o Building a Qt package without a certificate
+ To run any application or demo on a real device, you need to install it
+ on the device. To do this you first have to create a a package for the
+ device, containing the libraries:
+
+ \bold{Building a Qt package without a certificate}
If you have no certificate, build a self signed Qt:
@@ -760,15 +759,14 @@ applications using Qt for Symbian can start right away.}
capabilities are automatically lowered if you make a self-signed
package.
- \o Building a Qt package with a Symbian developer certificate
+ \bold{Building a Qt package with a Symbian developer certificate}
If you have a symbian-signed developer certificate, specify the
capabilities you can sign for, for example:
\snippet doc/src/snippets/code/doc_src_installation.qdoc 42
- \endlist
-
- \o Installing Qt packages to the device.
+
+ \section2 Installing Qt packages to the device.
It is possible to install packages to a phone in Linux by putting
the package on the phone memory card and then installing manually
@@ -776,8 +774,7 @@ applications using Qt for Symbian can start right away.}
on phones without a memory card, so the method recommended by Qt is
to use the App TRK tool.
- \list a
- \o Obtaining the App TRK package.
+ \section3 Obtaining the App TRK package.
Download the package from the following location.
@@ -793,7 +790,7 @@ applications using Qt for Symbian can start right away.}
menu, or using a Windows PC for doing the install. However,
the installation only has to be done once.
- \o Configuring App TRK on the phone.
+ \section3 Configuring App TRK on the phone.
When App TRK is installed, connect the phone to the PC using
the USB cable. Select "PCSuite" as connection type. Then run
@@ -802,7 +799,7 @@ applications using Qt for Symbian can start right away.}
the \c Settings menu entry. If necessary, choose \c Connect
from the menu.
- \o Configuring the USB serial driver on the Linux system.
+ \section3 Configuring the USB serial driver on the Linux system.
On Linux, phone should appear as the \c /dev/ttyUSB1 device,
however if you are running an old kernel, you may need to
@@ -821,7 +818,7 @@ applications using Qt for Symbian can start right away.}
The \c rmmod step may fail if the module is not already
loaded, but that is harmless.
- \o Building the \c runonphone tool.
+ \section3 Building the \c runonphone tool.
Note that building the \c runonphone tool requires a separate
installation of Qt for Linux. If there is a version of Qt
@@ -846,7 +843,7 @@ applications using Qt for Symbian can start right away.}
Copy the resulting executable to a folder which is in your
\c PATH environment variable.
- \o Installing the built package onto the phone.
+ \section3 Installing the built package onto the phone.
Return to the root of the Qt tree configured for Symbian. Then
install the Qt libraries by running the following:
@@ -863,9 +860,7 @@ applications using Qt for Symbian can start right away.}
\snippet doc/src/snippets/code/doc_src_installation.qdoc 50
- \endlist
-
- \o Running Qt demos
+\section1 Running Qt demos
We've included a subset of the Qt demos in this package for you
to try out. An excellent starting point is the "fluidlauncher"
@@ -883,10 +878,8 @@ applications using Qt for Symbian can start right away.}
Symbian platform, see \l{The Symbian platform - Introduction to Qt}.
We hope you will enjoy using Qt.
-
-\endlist
-
*/
+
/*!
\page requirements.html
\title General Qt Requirements
@@ -958,6 +951,9 @@ applications using Qt for Symbian can start right away.}
\brief Setting up the Mac OS X environment for Qt.
\previouspage General Qt Requirements
+ Qt requires Xcode to be installed on the system. Xcode should be
+ available on the Mac installation CD.
+
\sa {Known Issues}
*/
@@ -1211,9 +1207,9 @@ applications using Qt for Symbian can start right away.}
Qt for the Symbian platform requires the following software installed on your development PC:
\list
- \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher}
+ \o \l{http://www.forum.nokia.com/Library/Tools_and_downloads/Other/Carbide.c++/}{Carbide.c++ v2.3.0 or higher recommended}.
\list
- \o \bold{Note:} It may be necessary to update the Carbide compiler.
+ \o \bold{Note:} It may be necessary to update the Carbide compiler depending on Carbide version.
See \l{http://pepper.troll.no/s60prereleases/patches/}{here} for instructions how to check your
compiler version and how to patch it, if needed.
\endlist
@@ -1223,18 +1219,18 @@ applications using Qt for Symbian can start right away.}
but that version is no longer available from ActiveState. However, Qt for Symbian has been successfully
compiled using both 5.8.x and 5.10.x versions.
\endlist
- \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher}
+ \o \l{http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html}{S60 Platform SDK 3rd Edition FP1 or higher}
\list
\o \bold{Note:} Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special update. The update can be found
\l{http://pepper.troll.no/s60prereleases/patches/}{here}.
\endlist
- \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}.
+ \o \l{http://www.forum.nokia.com/info/sw.nokia.com/id/91d89929-fb8c-4d66-bea0-227e42df9053/Open_C_SDK_Plug-In.html}{Open C/C++ v1.7.5 or higher}.
Install this to all Symbian SDKs you plan to use Qt with.
\o Building Qt tools from scratch requires \l{http://www.mingw.org/}{MinGW 3.4.5 or higher}, or another windows compiler.
\list
\o \bold{Note:} This is not required if you are using pre-built binary package.
\endlist
- \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} version 2.2 (build 686 or later),
+ \o Building Qt libraries requires \l{http://www.arm.com/products/tools/software-development-tools.php}{RVCT} version 2.2 (build 686 or later),
which is not available free of charge. Usage of later versions of RVCT, including the 3.x and 4.x series, is not supported
in this release.
\endlist
diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc
index 0fa23f6..942c41d 100644
--- a/doc/src/getting-started/known-issues.qdoc
+++ b/doc/src/getting-started/known-issues.qdoc
@@ -29,131 +29,12 @@
\page known-issues.html
\title Known Issues
\ingroup platform-specific
- \brief A summary of known issues in this Qt version at the time of release.
+ \brief Links to online resources stating known issues in this Qt version at the time of release.
- An up-to-date list of known issues can be found at
- \l{http://bugreports.qt.nokia.com/}{Qt Bug Tracker}.
-
- For a list list of known bugs, see the \l{Task Tracker} at the Qt
- website.
-
- An overview of known issues may also be found at:
- \l{http://qt.gitorious.org/qt/pages/QtKnownIssues}
+ \list
+ \o An up-to-date list of known issues can be found at \l{http://bugreports.qt.nokia.com/}{Qt Bug Tracker}.
+ \o For a list list of known bugs, see the \l{Task Tracker} at the Qt website.
+ \o An overview of known issues may also be found at: \l{http://qt.gitorious.org/qt/pages/QtKnownIssues}
{Known Issues Wiki}.
-
- \section1 Installation Issues
-
- \section2 Installing the Source Package on Unix systems
-
- \list
-
- \o If you download a Zip source package, you will need to convert
- Windows-style line endings (CR/LF) to Unix-style line-endings (LF) when
- you uncompress the package. To do this, give the "-a" option when you
- run the "unzip' command.
-
- \o If you fail to supply the "-a" option when unzipping the package, you
- will see the following error message when you attempt to execute the
- configure command:
- "bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory"
-
- \endlist
-
- \section2 Installing on Mac OS X 10.6 "Snow Leopard"
-
- \list
-
- \o Performing a new install of the Qt 4.6 beta on Snow Leopard
- triggers a bug in the installer that causes the install to fail.
- Updating an existing Qt installation works fine.
-
- \o There are two workarounds, either disable spotlight for the target
- drive during the install, or do a custom install where you deselect
- documentation and examples. Run the installer again as a full
- install to get the documentation and examples installed.
-
- \endlist
-
- \section1 Issues with Third Party Software
-
- \section2 X11
-
- \list
- \o There is a bug in the 169.xx NVIDIA drivers on certain GeForce 8 series
- cards that is triggered by the OpenGL paint engine when using QPainter
- on a QGLWidget to draw paths and polygons. Some other painting
- operations that end up in the path fallback are affected as well. The
- bug causes the whole X server to repeatedly hang for several seconds at
- a time.
- \o There is an issue with NVIDIA's 9xxx driver series on X11 that causes a
- crash in cases where there are several \l{QGLContext}s and the extended
- composition modes are used (the composition modes between and including
- QPainter::CompositionMode_Multiply and
- QPainter::CompositionMode_Exclusion). This affects the composition mode
- demo in Qt 4.5, for example. The crash does not occur in newer versions
- of the drivers.
- \endlist
-
- \section2 Windows
-
- \list
-
- \o When using version 6.14.11.6921 of the NVIDIA drivers for the GeForce
- 6600 GT under Windows XP, Qt applications which use drag and drop will
- display reduced size drag and drop icons when run alongside
- applications that use OpenGL. This problem can be worked around by
- reducing the level of graphics acceleration provided by the driver, or
- by disabling hardware acceleration completely.
-
- \o With NVIDIA GeForce 7950 GT (driver version 6.14.11.7824), a fullscreen
- QGLWidget flickers when child widgets are shown/hidden. The workaround
- for this is to use \l{QWidget::}{setGeometry()} with a width/height 1
- pixel bigger than your geometry and call \l{QWidget::}{show()}.
-
- \o A bug in the Firebird database can cause an application to crash when
- \c{fbembed.dll} is unloaded. The bug is fixed in version 2.5.
-
- \o On Windows 7, resizing windows is slower than on Vista/Xp. This is because
- the gesture initialization process (required for native gesture support)
- currently calls winId() on widgets, which causes whole widget hierarchies
- to use native window handles. This slows down resizing.
-
- \o Compile errors with Intel C++ Compiler.\br
- There seems to be a bug in the Intel compiler with respect to
- over-agressive inlining of code.
- The problem will manifest itself during the link phase of QtGui where
- it fails with the error that it cannot find QObjectData::~QObjectData().
- See \l{http://bugreports.qt.nokia.com/browse/QTBUG-5145} for updates on this
- bug.
- Also, due to some bugs in WebKit, the QtScript and QtWebKit modules
- will not compile.
- See \l{http://bugreports.qt.nokia.com/browse/QTBUG-6297} for a
- workaround for QtScript.
-
- \o Compile errors with Microsoft Visual C++ compiler. \br
- There seems to be a bug in the Microsoft compiler when compiling with O2
- optimization level in 64 bit.
- This problem will result in crashes in QAbstractItemView::viewOptions().
- See \l{http://bugreports.qt.nokia.com/browse/QTBUG-11445} for updates on this
- bug.
-
-
- \endlist
-
- \section2 Mac OS X
-
- \list
-
- \o If a sheet is opened for a given window, clicking the title bar of that
- window will cause it to flash. This behavior has been reported to Apple
- (bug number 5827676).
-
- \endlist
-
- \section2 Symbian
-
- \list
- \o Check known issues for Symbian at
- \l{http://qt.gitorious.org/qt/pages/QtKnownIssues} {Known Issues Wiki}.
\endlist
*/