summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-06-18 13:10:26 +0200
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-06-18 13:10:26 +0200
commita3fd00796dafe52d4ff138b271564daf70d1adee (patch)
tree77ca481c06c1b2c3c7822a4cd5864702e341b680 /doc
parent793d1ed8d3a03eefdd487facdacf66ba575e1a07 (diff)
parent6aa50af000f85cc4497749fcf0860c8ed244a60e (diff)
downloadqt4-tools-a3fd00796dafe52d4ff138b271564daf70d1adee.tar.gz
Merge remote branch 'qt/4.7' into lighthouse
Conflicts: configure mkspecs/common/qws.conf src/corelib/io/qresource.cpp src/gui/image/qpixmapdata_p.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication_p.h src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontdatabase.cpp src/opengl/qgl_p.h src/plugins/mediaservices/gstreamer/gstreamer.pro
Diffstat (limited to 'doc')
-rw-r--r--doc/doc.pri21
-rw-r--r--doc/src/classes.qdoc6
-rw-r--r--doc/src/declarative/advtutorial.qdoc56
-rw-r--r--doc/src/declarative/animation.qdoc149
-rw-r--r--doc/src/declarative/basictypes.qdoc472
-rw-r--r--doc/src/declarative/codingconventions.qdoc7
-rw-r--r--doc/src/declarative/declarativeui.qdoc69
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc199
-rw-r--r--doc/src/declarative/elements.qdoc24
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc20
-rw-r--r--doc/src/declarative/examples.qdoc157
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc8
-rw-r--r--doc/src/declarative/extending.qdoc64
-rw-r--r--doc/src/declarative/focus.qdoc30
-rw-r--r--doc/src/declarative/globalobject.qdoc245
-rw-r--r--doc/src/declarative/integrating.qdoc52
-rw-r--r--doc/src/declarative/pics/anchorchanges.pngbin0 -> 566 bytes
-rw-r--r--doc/src/declarative/pics/gridview-highlight.pngbin0 -> 11806 bytes
-rw-r--r--doc/src/declarative/pics/gridview-simple.pngbin0 -> 10149 bytes
-rw-r--r--doc/src/declarative/pics/gridview.pngbin10564 -> 0 bytes
-rw-r--r--doc/src/declarative/pics/listmodel-nested.pngbin0 -> 7493 bytes
-rw-r--r--doc/src/declarative/pics/listmodel.pngbin0 -> 3407 bytes
-rw-r--r--doc/src/declarative/pics/listview-highlight.png (renamed from doc/src/declarative/pics/trivialListView.png)bin5918 -> 5918 bytes
-rw-r--r--doc/src/declarative/pics/listview-simple.pngbin0 -> 5351 bytes
-rw-r--r--doc/src/declarative/pics/parentchange.pngbin0 -> 509 bytes
-rw-r--r--doc/src/declarative/pics/rect-border-width.pngbin0 -> 356 bytes
-rw-r--r--doc/src/declarative/pics/repeater-modeldata.pngbin0 -> 3394 bytes
-rw-r--r--doc/src/declarative/pics/repeater-simple.pngbin0 -> 404 bytes
-rw-r--r--doc/src/declarative/pics/translate.pngbin0 -> 398 bytes
-rw-r--r--doc/src/declarative/pics/visualitemmodel.pngbin0 -> 347 bytes
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc31
-rw-r--r--doc/src/declarative/qdeclarativedocument.qdoc18
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc5
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc56
-rw-r--r--doc/src/declarative/qdeclarativeperformance.qdoc120
-rw-r--r--doc/src/declarative/qdeclarativestates.qdoc52
-rw-r--r--doc/src/declarative/qml-intro.qdoc967
-rw-r--r--doc/src/declarative/qmlruntime.qdoc82
-rw-r--r--doc/src/declarative/qtbinding.qdoc31
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc6
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro13
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/main.qml32
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/qmldir1
-rw-r--r--doc/src/declarative/snippets/qtbinding/contextproperties/main.qml15
-rw-r--r--doc/src/declarative/snippets/qtbinding/custompalette/main.qml22
-rw-r--r--doc/src/declarative/snippets/qtbinding/resources/main.qml7
-rw-r--r--doc/src/declarative/snippets/qtbinding/stopwatch/main.qml18
-rw-r--r--doc/src/declarative/tutorial.qdoc29
-rw-r--r--doc/src/demos/boxes.qdoc2
-rw-r--r--doc/src/deployment/deployment.qdoc26
-rw-r--r--doc/src/development/assistant-manual.qdoc2
-rw-r--r--doc/src/development/developing-on-mac.qdoc5
-rw-r--r--doc/src/development/qmake-manual.qdoc1
-rw-r--r--doc/src/development/rcc.qdoc40
-rw-r--r--doc/src/diagrams/modelview-move-rows-1.sk271
-rw-r--r--doc/src/diagrams/modelview-move-rows-2.sk271
-rw-r--r--doc/src/diagrams/modelview-move-rows-3.sk136
-rw-r--r--doc/src/diagrams/modelview-move-rows-4.sk136
-rw-r--r--doc/src/examples/diagramscene.qdoc12
-rw-r--r--doc/src/examples/drilldown.qdoc12
-rw-r--r--doc/src/examples/elasticnodes.qdoc124
-rw-r--r--doc/src/examples/fingerpaint.qdoc2
-rw-r--r--doc/src/examples/mandelbrot.qdoc2
-rw-r--r--doc/src/examples/padnavigator.qdoc552
-rw-r--r--doc/src/examples/pinchzoom.qdoc2
-rw-r--r--doc/src/examples/pixelator.qdoc6
-rw-r--r--doc/src/examples/qml-examples.qdoc356
-rw-r--r--doc/src/examples/qml-extending.qdoc (renamed from doc/src/declarative/extending-examples.qdoc)58
-rw-r--r--doc/src/examples/qml-flickr.qdoc2
-rw-r--r--doc/src/examples/qml-folderlistmodel.qdoc144
-rw-r--r--doc/src/examples/qml-minehunt.qdoc5
-rw-r--r--doc/src/examples/qml-photoviewer.qdoc2
-rw-r--r--doc/src/examples/qml-rssnews.qdoc (renamed from doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h)21
-rw-r--r--doc/src/examples/qml-samegame.qdoc5
-rw-r--r--doc/src/examples/qml-snake.qdoc5
-rw-r--r--doc/src/examples/qml-twitter.qdoc50
-rw-r--r--doc/src/examples/transformations.qdoc4
-rw-r--r--doc/src/examples/undoframework.qdoc2
-rw-r--r--doc/src/examples/waitconditions.qdoc2
-rw-r--r--doc/src/external-resources.qdoc5
-rw-r--r--doc/src/files-and-resources/datastreamformat.qdoc3
-rw-r--r--doc/src/files-and-resources/resources.qdoc2
-rw-r--r--doc/src/frameworks-technologies/accessible.qdoc6
-rw-r--r--doc/src/frameworks-technologies/activeqt-container.qdoc7
-rw-r--r--doc/src/frameworks-technologies/activeqt-server.qdoc6
-rw-r--r--doc/src/frameworks-technologies/activeqt.qdoc12
-rw-r--r--doc/src/frameworks-technologies/animation.qdoc1
-rw-r--r--doc/src/frameworks-technologies/containers.qdoc2
-rw-r--r--doc/src/frameworks-technologies/dbus-adaptors.qdoc2
-rw-r--r--doc/src/frameworks-technologies/dbus-intro.qdoc2
-rw-r--r--doc/src/frameworks-technologies/desktop-integration.qdoc6
-rw-r--r--doc/src/frameworks-technologies/dnd.qdoc16
-rw-r--r--doc/src/frameworks-technologies/eventsandfilters.qdoc3
-rw-r--r--doc/src/frameworks-technologies/gestures.qdoc7
-rw-r--r--doc/src/frameworks-technologies/graphicsview.qdoc23
-rw-r--r--doc/src/frameworks-technologies/implicit-sharing.qdoc2
-rw-r--r--doc/src/frameworks-technologies/ipc.qdoc3
-rw-r--r--doc/src/frameworks-technologies/model-view-programming.qdoc463
-rw-r--r--doc/src/frameworks-technologies/phonon.qdoc6
-rw-r--r--doc/src/frameworks-technologies/threads.qdoc1
-rw-r--r--doc/src/frameworks-technologies/unicode.qdoc2
-rw-r--r--doc/src/getting-started/demos.qdoc26
-rw-r--r--doc/src/getting-started/examples.qdoc631
-rw-r--r--doc/src/getting-started/how-to-learn-qt.qdoc10
-rw-r--r--doc/src/getting-started/installation.qdoc30
-rw-r--r--doc/src/getting-started/known-issues.qdoc10
-rw-r--r--doc/src/howtos/HWacceleration.qdoc15
-rw-r--r--doc/src/howtos/accelerators.qdoc1
-rw-r--r--doc/src/howtos/appicon.qdoc1
-rw-r--r--doc/src/howtos/guibooks.qdoc3
-rw-r--r--doc/src/howtos/openvg.qdoc26
-rw-r--r--doc/src/howtos/qtdesigner.qdoc1
-rw-r--r--doc/src/howtos/restoring-geometry.qdoc2
-rw-r--r--doc/src/howtos/session.qdoc2
-rw-r--r--doc/src/howtos/sharedlibrary.qdoc2
-rw-r--r--doc/src/howtos/timers.qdoc2
-rw-r--r--doc/src/images/declarative-folderlistmodel.pngbin0 -> 17764 bytes
-rw-r--r--doc/src/images/declarative-image_fillMode.gifbin79561 -> 0 bytes
-rw-r--r--doc/src/images/declarative-integrating-graphicswidgets.pngbin1061 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectcrop.pngbin0 -> 6440 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectfit.pngbin0 -> 4076 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-stretch.pngbin0 -> 5584 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tile.pngbin0 -> 3940 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilehorizontally.pngbin0 -> 5544 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilevertically.pngbin0 -> 6288 bytes
-rw-r--r--doc/src/images/declarative-qtlogo.png (renamed from doc/src/images/declarative-qtlogo1.png)bin3436 -> 3436 bytes
-rw-r--r--doc/src/images/declarative-qtlogo2.pngbin11023 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo3.pngbin4783 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo4.pngbin11241 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo5.pngbin3553 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo6.pngbin4763 -> 0 bytes
-rw-r--r--doc/src/images/modelview-move-rows-1.pngbin0 -> 19709 bytes
-rw-r--r--doc/src/images/modelview-move-rows-2.pngbin0 -> 19385 bytes
-rw-r--r--doc/src/images/modelview-move-rows-3.pngbin0 -> 9281 bytes
-rw-r--r--doc/src/images/modelview-move-rows-4.pngbin0 -> 9381 bytes
-rw-r--r--doc/src/images/multitouch-fingerpaint-example.pngbin0 -> 17026 bytes
-rw-r--r--doc/src/images/qml-clocks-example.pngbin0 -> 40742 bytes
-rw-r--r--doc/src/images/qml-corkboards-example.pngbin0 -> 179625 bytes
-rw-r--r--doc/src/images/qml-dial.pngbin0 -> 43754 bytes
-rw-r--r--doc/src/images/qml-dialcontrol-example.pngbin0 -> 33569 bytes
-rw-r--r--doc/src/images/qml-dynamicscene-example.pngbin0 -> 65247 bytes
-rw-r--r--doc/src/images/qml-flickr-demo.png (renamed from doc/src/images/qml-flickr-example.png)bin280730 -> 280730 bytes
-rw-r--r--doc/src/images/qml-flipable-example.pngbin0 -> 13301 bytes
-rw-r--r--doc/src/images/qml-image-example.pngbin0 -> 58184 bytes
-rw-r--r--doc/src/images/qml-intro-anchors1.pngbin0 -> 15198 bytes
-rw-r--r--doc/src/images/qml-intro-anchors2.pngbin0 -> 15343 bytes
-rw-r--r--doc/src/images/qml-intro-anchors3.pngbin0 -> 16745 bytes
-rw-r--r--doc/src/images/qml-intro-helloa.pngbin0 -> 18246 bytes
-rw-r--r--doc/src/images/qml-minehunt-demo.png (renamed from doc/src/images/qml-minehunt-example.png)bin170648 -> 170648 bytes
-rw-r--r--doc/src/images/qml-photoviewer-demo.png (renamed from doc/src/images/qml-photoviewer-example.png)bin473306 -> 473306 bytes
-rw-r--r--doc/src/images/qml-progressbar-example.pngbin0 -> 15188 bytes
-rw-r--r--doc/src/images/qml-rssnews-demo.pngbin0 -> 143314 bytes
-rw-r--r--doc/src/images/qml-samegame-demo.png (renamed from doc/src/images/qml-samegame-example.png)bin285415 -> 285415 bytes
-rw-r--r--doc/src/images/qml-searchbox-example.pngbin0 -> 8170 bytes
-rw-r--r--doc/src/images/qml-slideswitch-example.pngbin0 -> 8298 bytes
-rw-r--r--doc/src/images/qml-snake-demo.png (renamed from doc/src/images/qml-snake-example.png)bin105053 -> 105053 bytes
-rw-r--r--doc/src/images/qml-spinner-example.pngbin0 -> 5637 bytes
-rw-r--r--doc/src/images/qml-tabwidget-example.pngbin0 -> 6487 bytes
-rw-r--r--doc/src/images/qml-tic-tac-toe-example.pngbin0 -> 24275 bytes
-rw-r--r--doc/src/images/qml-tvtennis-example.pngbin0 -> 2070 bytes
-rw-r--r--doc/src/images/qml-twitter-demo.pngbin0 -> 95812 bytes
-rw-r--r--doc/src/index.qdoc60
-rw-r--r--doc/src/internationalization/linguist-manual.qdoc9
-rw-r--r--doc/src/ja_JP/development/designer-manual.qdoc175
-rw-r--r--doc/src/ja_JP/development/qmake-manual.qdoc212
-rw-r--r--doc/src/ja_JP/development/qtestlib.qdoc432
-rw-r--r--doc/src/ja_JP/examples/arrowpad.qdoc248
-rw-r--r--doc/src/ja_JP/examples/hellotr.qdoc200
-rw-r--r--doc/src/ja_JP/examples/trollprint.qdoc286
-rw-r--r--doc/src/ja_JP/getting-started/tutorials.qdoc101
-rw-r--r--doc/src/ja_JP/images/linguist-hellotr_en.pngbin0 -> 4424 bytes
-rw-r--r--doc/src/ja_JP/images/linguist-hellotr_ja.pngbin0 -> 5624 bytes
-rw-r--r--doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc72
-rw-r--r--doc/src/ja_JP/tutorials/addressbook.qdoc1070
-rw-r--r--doc/src/ja_JP/tutorials/widgets-tutorial.qdoc257
-rw-r--r--doc/src/legal/opensourceedition.qdoc16
-rw-r--r--doc/src/modules.qdoc46
-rw-r--r--doc/src/network-programming/bearermanagement.qdoc9
-rw-r--r--doc/src/network-programming/qtnetwork.qdoc1
-rw-r--r--doc/src/network-programming/ssl.qdoc6
-rw-r--r--doc/src/objectmodel/metaobjects.qdoc4
-rw-r--r--doc/src/objectmodel/object.qdoc11
-rw-r--r--doc/src/objectmodel/objecttrees.qdoc3
-rw-r--r--doc/src/objectmodel/properties.qdoc4
-rw-r--r--doc/src/objectmodel/signalsandslots.qdoc3
-rw-r--r--doc/src/overviews.qdoc87
-rw-r--r--doc/src/painting-and-printing/coordsys.qdoc7
-rw-r--r--doc/src/painting-and-printing/paintsystem.qdoc16
-rw-r--r--doc/src/painting-and-printing/printing.qdoc1
-rw-r--r--doc/src/platforms/emb-openvg.qdocinc25
-rw-r--r--doc/src/platforms/emb-qvfb.qdoc10
-rw-r--r--doc/src/platforms/platform-notes.qdoc2
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc7
-rw-r--r--doc/src/porting/porting4-canvas.qdoc2
-rw-r--r--doc/src/porting/porting4.qdoc4
-rw-r--r--doc/src/scripting/scripting.qdoc8
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp20
-rw-r--r--doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp6
-rw-r--r--doc/src/snippets/declarative/Sprite.qml46
-rw-r--r--doc/src/snippets/declarative/anchorchanges.qml69
-rw-r--r--doc/src/snippets/declarative/animation.qml181
-rw-r--r--doc/src/snippets/declarative/border-image.qml29
-rw-r--r--doc/src/snippets/declarative/borderimage.qml70
-rw-r--r--doc/src/snippets/declarative/codingconventions/dotproperties.qml41
-rw-r--r--doc/src/snippets/declarative/codingconventions/javascript-imports.qml41
-rw-r--r--doc/src/snippets/declarative/codingconventions/javascript.qml41
-rw-r--r--doc/src/snippets/declarative/codingconventions/lists.qml41
-rw-r--r--doc/src/snippets/declarative/codingconventions/photo.qml41
-rw-r--r--doc/src/snippets/declarative/comments.qml41
-rw-r--r--doc/src/snippets/declarative/componentCreation.js47
-rw-r--r--doc/src/snippets/declarative/createComponent.qml52
-rw-r--r--doc/src/snippets/declarative/createQmlObject.qml (renamed from doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h)32
-rw-r--r--doc/src/snippets/declarative/drag.qml18
-rw-r--r--doc/src/snippets/declarative/dynamicObjects.qml70
-rw-r--r--doc/src/snippets/declarative/flickableScrollbar.qml67
-rw-r--r--doc/src/snippets/declarative/flipable.qml41
-rw-r--r--doc/src/snippets/declarative/focusscopes.qml68
-rw-r--r--doc/src/snippets/declarative/folderlistmodel.qml58
-rw-r--r--doc/src/snippets/declarative/gradient.qml43
-rw-r--r--doc/src/snippets/declarative/gridview/ContactModel.qml64
-rw-r--r--doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml25
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml151
-rw-r--r--doc/src/snippets/declarative/listmodel-modify.qml97
-rw-r--r--doc/src/snippets/declarative/listmodel-nested.qml103
-rw-r--r--doc/src/snippets/declarative/listmodel-simple.qml80
-rw-r--r--doc/src/snippets/declarative/listmodel.qml60
-rw-r--r--doc/src/snippets/declarative/listview/ContactModel.qml59
-rw-r--r--doc/src/snippets/declarative/listview/dummydata/ContactModel.qml17
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml63
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml157
-rw-r--r--doc/src/snippets/declarative/mousearea.qml119
-rw-r--r--doc/src/snippets/declarative/mouseregion.qml26
-rw-r--r--doc/src/snippets/declarative/parentchange.qml69
-rw-r--r--doc/src/snippets/declarative/pathview/ContactModel.qml59
-rw-r--r--doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml17
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml54
-rw-r--r--doc/src/snippets/declarative/pathview/pathview.qml63
-rw-r--r--doc/src/snippets/declarative/pathview/pics/qtlogo.png (renamed from doc/src/snippets/declarative/pathview/pics/qtlogo-64.png)bin2991 -> 2991 bytes
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro (renamed from doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/main.qml56
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h (renamed from doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro (renamed from doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/custompalette/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/main.qml63
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/example.qrc (renamed from doc/src/declarative/snippets/qtbinding/resources/example.qrc)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/images/background.png (renamed from doc/src/declarative/snippets/qtbinding/resources/images/background.png)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/resources/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.qml48
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/resources.pro (renamed from doc/src/declarative/snippets/qtbinding/resources/resources.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/main.qml59
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro)0
-rw-r--r--doc/src/snippets/declarative/rect-border-width.qml60
-rw-r--r--doc/src/snippets/declarative/repeater-index.qml15
-rw-r--r--doc/src/snippets/declarative/repeater.qml94
-rw-r--r--doc/src/snippets/declarative/rotation.qml95
-rw-r--r--doc/src/snippets/declarative/state.qml69
-rw-r--r--doc/src/snippets/declarative/states.qml81
-rw-r--r--doc/src/snippets/declarative/systempalette.qml55
-rw-r--r--doc/src/snippets/declarative/texteditor.qml73
-rw-r--r--doc/src/snippets/declarative/visualdatamodel.qml65
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp63
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml (renamed from doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp)37
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro4
-rw-r--r--doc/src/snippets/declarative/workerscript.qml41
-rw-r--r--doc/src/snippets/declarative/xmlrole.qml81
-rw-r--r--doc/src/snippets/declarative/xmlrole.xml14
-rw-r--r--doc/src/snippets/qxmlschema/main.cpp5
-rw-r--r--doc/src/sql-programming/qsqldatatype-table.qdoc21
-rw-r--r--doc/src/sql-programming/sql-driver.qdoc2
-rw-r--r--doc/src/sql-programming/sql-programming.qdoc13
-rwxr-xr-xdoc/src/template/images/api_examples.pngbin1302 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/api_lookup.pngbin1879 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/api_topics.pngbin1216 -> 0 bytes
-rw-r--r--doc/src/template/images/arrow_down.pngbin0 -> 177 bytes
-rwxr-xr-xdoc/src/template/images/bg_l.pngbin139 -> 100 bytes
-rwxr-xr-xdoc/src/template/images/bg_l_blank.pngbin123 -> 84 bytes
-rwxr-xr-xdoc/src/template/images/bg_ll.pngbin514 -> 0 bytes
-rw-r--r--[-rwxr-xr-x]doc/src/template/images/bg_ll_blank.pngbin320 -> 320 bytes
-rwxr-xr-xdoc/src/template/images/bg_lr.pngbin458 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_r.pngbin136 -> 96 bytes
-rwxr-xr-xdoc/src/template/images/bg_ul.pngbin516 -> 0 bytes
-rw-r--r--[-rwxr-xr-x]doc/src/template/images/bg_ul_blank.pngbin304 -> 304 bytes
-rwxr-xr-xdoc/src/template/images/bg_ur.pngbin437 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_ur_blank.pngbin437 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/box_bg.pngbin129 -> 89 bytes
-rwxr-xr-xdoc/src/template/images/breadcrumb.pngbin195 -> 134 bytes
-rwxr-xr-xdoc/src/template/images/bullet_gt.pngbin185 -> 124 bytes
-rwxr-xr-xdoc/src/template/images/bullet_sq.pngbin117 -> 74 bytes
-rwxr-xr-xdoc/src/template/images/content_bg.pngbin1498 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/form_bg.pngbin390 -> 0 bytes
-rw-r--r--doc/src/template/images/header.pngbin2600 -> 0 bytes
-rw-r--r--doc/src/template/images/header_bg.pngbin0 -> 114 bytes
-rw-r--r--doc/src/template/images/page.pngbin0 -> 3102 bytes
-rwxr-xr-xdoc/src/template/images/page_bg.pngbin126 -> 84 bytes
-rwxr-xr-xdoc/src/template/images/print.pngbin575 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_guide.pngbin12685 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_icon.pngbin4775 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_ref_doc.pngbin2600 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_tools.pngbin17508 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/sep.pngbin120 -> 0 bytes
-rw-r--r--doc/src/template/images/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xdoc/src/template/images/sprites-combined.pngbin18070 -> 62534 bytes
-rwxr-xr-xdoc/src/template/scripts/functions.js183
-rw-r--r--doc/src/template/scripts/narrow.js78
-rw-r--r--doc/src/template/scripts/superfish.js121
-rw-r--r--doc/src/template/style/OfflineStyle.css819
-rw-r--r--doc/src/template/style/narrow.css250
-rwxr-xr-xdoc/src/template/style/style.css946
-rw-r--r--doc/src/template/style/superfish.css51
-rw-r--r--doc/src/template/style/superfish_skin.css83
-rw-r--r--doc/src/tutorials/addressbook-fr.qdoc30
-rw-r--r--doc/src/tutorials/addressbook.qdoc235
-rw-r--r--doc/src/tutorials/widgets-tutorial.qdoc141
-rw-r--r--doc/src/widgets-and-layouts/focus.qdoc2
-rw-r--r--doc/src/widgets-and-layouts/layout.qdoc1
-rw-r--r--doc/src/widgets-and-layouts/styles.qdoc13
-rw-r--r--doc/src/widgets-and-layouts/widgets.qdoc199
-rw-r--r--doc/src/windows-and-dialogs/dialogs.qdoc1
-rw-r--r--doc/src/windows-and-dialogs/mainwindow.qdoc18
323 files changed, 13226 insertions, 3583 deletions
diff --git a/doc/doc.pri b/doc/doc.pri
index 3d04049287..f748f3d7d9 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -5,9 +5,9 @@
DOCS_GENERATION_DEFINES =
GENERATOR = $$QT_BUILD_TREE/bin/qhelpgenerator
-win32:!win32-g++ {
+win32:!win32-g++* {
unixstyle = false
-} else :win32-g++:isEmpty(QMAKE_SH) {
+} else :win32-g++*:isEmpty(QMAKE_SH) {
unixstyle = false
} else {
unixstyle = true
@@ -36,9 +36,15 @@ QT_ZH_CN_DOCUMENTATION = ($$QDOC qt-api-only_zh_CN.qdocconf) && \
$$GENERATOR doc-build/html-qt_zh_CN/qt.qhp -o doc/qch/qt_zh_CN.qch \
)
-win32-g++:isEmpty(QMAKE_SH) {
+QT_JA_JP_DOCUMENTATION = ($$QDOC qt-api-only_ja_JP.qdocconf) && \
+ (cd $$QT_BUILD_TREE && \
+ $$GENERATOR doc-build/html-qt_ja_JP/qt.qhp -o doc/qch/qt_ja_JP.qch \
+ )
+
+win32-g++*:isEmpty(QMAKE_SH) {
QT_DOCUMENTATION = $$replace(QT_DOCUMENTATION, "/", "\\\\")
QT_ZH_CN_DOCUMENTATION = $$replace(QT_ZH_CN_DOCUMENTATION, "/", "\\\\")
+ QT_JA_JP_DOCUMENTATION = $$replace(QT_JA_JP_DOCUMENTATION, "/", "\\\\")
}
# Build rules:
@@ -52,14 +58,17 @@ docs.depends = sub-qdoc3 adp_docs qch_docs
docs_zh_CN.depends = docs
docs_zh_CN.commands = $$QT_ZH_CN_DOCUMENTATION
+docs_ja_JP.depends = docs
+docs_ja_JP.commands = $$QT_JA_JP_DOCUMENTATION
+
# Install rules
htmldocs.files = $$QT_BUILD_TREE/doc/html
htmldocs.path = $$[QT_INSTALL_DOCS]
-htmldocs.CONFIG += no_check_exist
+htmldocs.CONFIG += no_check_exist directory
qchdocs.files= $$QT_BUILD_TREE/doc/qch
qchdocs.path = $$[QT_INSTALL_DOCS]
-qchdocs.CONFIG += no_check_exist
+qchdocs.CONFIG += no_check_exist directory
docimages.files = $$QT_BUILD_TREE/doc/src/images
docimages.path = $$[QT_INSTALL_DOCS]/src
@@ -67,5 +76,5 @@ docimages.path = $$[QT_INSTALL_DOCS]/src
sub-qdoc3.depends = sub-corelib sub-xml
sub-qdoc3.commands += (cd tools/qdoc3 && $(MAKE))
-QMAKE_EXTRA_TARGETS += sub-qdoc3 adp_docs qch_docs docs docs_zh_CN
+QMAKE_EXTRA_TARGETS += sub-qdoc3 adp_docs qch_docs docs docs_zh_CN docs_ja_JP
INSTALLS += htmldocs qchdocs docimages
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 1552f567c9..594c1fe65f 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -59,7 +59,7 @@
/*!
\page classes.html
- \title All Qt Classes
+ \title All Classes
\ingroup classlists
\brief If you know the name of the class you want, find it here.
@@ -71,7 +71,7 @@
\generatelist classes
- \sa {Qt3 Support Classes}, {All Qt Modules}, {Obsolete Classes}
+ \sa {Qt3 Support Classes}, {All Modules}, {Obsolete Classes}
*/
/*!
@@ -162,7 +162,7 @@
/*!
\page namespaces.html
- \title All Qt Namespaces
+ \title All Namespaces
\ingroup classlists
\brief A Qt namespace contains enum types, functions, and sometimes classes.
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index 2d05850c6e..116c4e4aba 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -105,16 +105,20 @@ is the \l SystemPalette item. This provides access to the Qt system palette
and is used to give the button a more native look-and-feel.
Notice the anchors for the \c Item, \c Button and \c Text elements are set using
-\l {codingconventions.html#Grouped-properties}{group notation} for readability.
+\l {qdeclarativeintroduction.html#dot-properties}{group notation} for readability.
\section2 Adding \c Button and \c Block components
-The \c Button item in the code above is defined in a separate file named \c Button.qml.
+The \c Button item in the code above is defined in a separate component file named \c Button.qml.
To create a functional button, we use the QML elements \l Text and \l MouseArea inside a \l Rectangle.
Here is the \c Button.qml code:
\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+This essentially defines a rectangle that contains text and can be clicked. The \l MouseArea
+has an \c onClicked() handler that is implemented to emit the \c clicked() signal of the
+\c container when the area is clicked.
+
In Same Game, the screen is filled with small blocks when the game begins.
Each block is just an item that contains an image. The block
code is defined in a separate \c Block.qml file:
@@ -174,7 +178,7 @@ The \c createBlock() function creates a block from the \c Block.qml file
and moves the new block to its position on the game canvas. This involves several steps:
\list
-\o \l {createComponent(url file)}{createComponent()} is called to generate an element from \c Block.qml.
+\o \l {Qt::createComponent()}{Qt.createComponent()} is called to generate an element from \c Block.qml.
If the component is ready, we can call \c createObject() to create an instance of the \c Block item.
\o If \c createObject() returned null (i.e. if there was an error while
loading the object), print the error information.
@@ -226,14 +230,14 @@ until it is won or lost.
To do this, we have added the following functions to \c samegame.js:
\list
-\o function \c{handleClick(x,y)}
-\o function \c{floodFill(xIdx,yIdx,type)}
-\o function \c{shuffleDown()}
-\o function \c{victoryCheck()}
-\o function \c{floodMoveCheck(xIdx, yIdx, type)}
+\o \c{handleClick(x,y)}
+\o \c{floodFill(xIdx,yIdx,type)}
+\o \c{shuffleDown()}
+\o \c{victoryCheck()}
+\o \c{floodMoveCheck(xIdx, yIdx, type)}
\endlist
-As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to JavaScript.
+As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to QML.
\section3 Enabling mouse click interaction
@@ -269,6 +273,8 @@ And this is how it is used in the main \c samegame.qml file:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
+We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on top of our other components. The default \c z value for an item is 0.
+
\section3 A dash of color
@@ -383,15 +389,41 @@ The theme change here is produced simply by replacing the block images. This can
Another feature we might want to add to the game is a method of storing and retrieving high scores.
-In \c samegame.qml we now pop up a dialog when the game is over and requests the player's name so it can be added to a High Scores table. The dialog is created using \c Dialog.qml:
+To do this, we will show a dialog when the game is over to request the player's name and add it to a High Scores table.
+This requires a few changes to \c Dialog.qml. In addition to a \c Text element, it now has a
+\c TextInput child item for receiving keyboard text input:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 2
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+We'll also add a \c showWithInput() function. The text input will only be visible if this function
+is called instead of \c show(). When the dialog is closed, it emits a \c closed() signal, and
+other elements can retrieve the text entered by the user through an \c inputText property:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 1
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+Now the dialog can be used in \c samegame.qml:
\snippet declarative/tutorials/samegame/samegame4/samegame.qml 0
-When the dialog is closed, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+When the dialog emits the \c closed signal, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+The \c nameInputDialog is activated in the \c victoryCheck() function in \c samegame.js:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 3
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 4
\section3 Storing high scores offline
+Now we need to implement the functionality to actually save the High Scores table.
+
Here is the \c saveHighScore() function in \c samegame.js:
\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 2
@@ -436,6 +468,6 @@ By following this tutorial you've seen how you can write a fully functional appl
\endlist
There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the
-demos and examples and the \l {Declarative UI (QML)}{documentation} to find out all the things you can do with QML!
+demos and examples and the \l {Qt Quick}{documentation} to see all the things you can do with QML!
*/
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index 88aca1b30c..c320898330 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -46,14 +46,14 @@
Animation in QML is done by animating properties of objects. Properties of type
real, int, color, rect, point, size, and vector3d can all be animated.
-QML supports three main forms of animation - basic property animation,
+QML supports three main forms of animation: basic property animation,
transitions, and property behaviors.
\tableofcontents
\section1 Basic Property Animation
-The simplest form of animation is directly using \l PropertyAnimation, which can animate all of the property
+The simplest form of animation is a \l PropertyAnimation, which can animate all of the property
types listed above. If the property you are animating is a number or color, you can alternatively use
NumberAnimation or ColorAnimation. These elements don't add any additional functionality,
but will help enforce type correctness and are slightly more efficient.
@@ -62,61 +62,23 @@ A property animation can be specified as a value source using the \e Animation \
for repeating animations.
The following example creates a bouncing effect:
-\qml
-Rectangle {
- id: rect
- width: 120; height: 200;
- Image {
- id: img
- source: "qt-logo.png"
- x: 60-img.width/2
- y: 0
- SequentialAnimation on y {
- loops: Animation.Infinite
- NumberAnimation { to: 200-img.height; easing.type: "OutBounce"; duration: 2000 }
- PauseAnimation { duration: 1000 }
- NumberAnimation { to: 0; easing.type: "OutQuad"; duration: 1000 }
- }
- }
-}
-\endqml
+\snippet doc/src/snippets/declarative/animation.qml property-anim-1
\image propanim.gif
When you assign an animation as a value source, you do not need to specify \c property
-or \c target; they are automatically selected for you. You do, however, need to specify \c to.
+or \c target values; they are automatically selected for you. You do, however, need to specify a \c to value.
An animation specified as a value source will be \c running by default.
-\qml
-Rectangle {
- id: rect
- width: 200; height: 200;
- Rectangle {
- color: "red"
- width: 50; height: 50
- NumberAnimation on x { to: 50 }
- }
-}
-\endqml
+For example, here is a rectangle that uses a \l NumberAnimation value source to animate the movement
+from its current position to an \c x value of 50. The animation starts immediately, and only the \c to
+property is required:
+
+\snippet doc/src/snippets/declarative/animation.qml property-anim-2
A property animation can also be specified as a resource that is manipulated from script.
-\qml
-PropertyAnimation {
- id: animation
- target: image
- property: "scale"
- from: 1; to: .5
-}
-Image {
- id: image
- source: "image.png"
- MouseArea {
- anchors.fill: parent
- onPressed: animation.start()
- }
-}
-\endqml
+\snippet doc/src/snippets/declarative/animation.qml property-anim-3
As can be seen, when an animation is used like this (as opposed to as a value source) you will need
to explicitly set the \c target and \c property to animate.
@@ -131,50 +93,20 @@ can only be triggered by a state change.
For example, a transition could describe how an item moves from its initial position to its new position:
-\code
-transitions: [
- Transition {
- NumberAnimation {
- properties: "x,y"
- easing.type: "OutBounce"
- duration: 200
- }
- }
-]
-\endcode
+\snippet doc/src/snippets/declarative/animation.qml transitions-1
As can be seen, transitions make use of the same basic animation classes introduced above.
In the above example we have specified that we want to animate the \c x and \c y properties, but have not
-specified the objects to animate or the \c to values. By default these values are supplied by the framework --
+specified the objects to animate or the \c to values. By default these values are supplied by the framework;
the animation will animate any \c targets whose \c x and \c y have changed, and the \c to values will be those
defined in the end state. You can always supply explicit values to override these implicit values when needed.
-\code
-Transition {
- from: "*"
- to: "MyState"
- reversible: true
- SequentialAnimation {
- NumberAnimation {
- duration: 1000
- easing.type: "OutBounce"
- // animate myItem's x and y if they have changed in the state
- target: myItem
- properties: "x,y"
- }
- NumberAnimation {
- duration: 1000
- // animate myItem2's y to 200, regardless of what happens in the state
- target: myItem2
- property: "y"
- to: 200
- }
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/animation.qml transitions-2
QML transitions have selectors to determine which state changes a transition should apply to.
The following transition will only be triggered when we enter into the \c "details" state.
+(The "*" value is a wildcard value that specifies the transition should be applied when changing
+from \e any state to the "details" state.)
\code
Transition {
@@ -188,30 +120,7 @@ Transitions can happen in parallel, in sequence, or in any combination of the tw
animations in a transition will happen in parallel. The following example shows a rather complex transition
making use of both sequential and parallel animations:
-\code
-Transition {
- from: "*"
- to: "MyState"
- reversible: true
- SequentialAnimation {
- ColorAnimation { duration: 1000 }
- PauseAnimation { duration: 1000 }
- ParallelAnimation {
- NumberAnimation {
- duration: 1000
- easing.type: "OutBounce"
- targets: box1
- properties: "x,y"
- }
- NumberAnimation {
- duration: 1000
- targets: box2
- properties: "x,y"
- }
- }
- }
-}
-\endcode
+\snippet doc/src/snippets/declarative/animation.qml transitions-3
\section1 Property Behaviors
@@ -219,24 +128,15 @@ A \l{Behavior}{property behavior} specifies a default animation to run whenever
of what caused the change. The \c enabled property can be used to force a \l Behavior
to only apply under certain circumstances.
-In the following snippet, we specify that we want the x position of redRect to be animated
-whenever it changes. The animation will last 300 milliseconds and use an InOutQuad easing curve.
+In the following snippet, we specify that we want the \c x position of \c redRect to be animated
+whenever it changes. The animation will last 300 milliseconds and use an \l{PropertyAnimation::easing.type}{Easing.InOutQuad} easing curve.
-\qml
-Rectangle {
- id: redRect
- color: "red"
- width: 100; height: 100
- Behavior on x { NumberAnimation { duration: 300; easing.type: "InOutQuad" } }
-}
-\endqml
+\snippet doc/src/snippets/declarative/animation.qml behavior
Like using an animation as a value source, when used in a Behavior and animation does not need to specify
a \c target or \c property.
-To trigger this behavior, we could:
-\list
-\o Enter a state that changes x
+To trigger this behavior, we could enter a state that changes \c x:
\qml
State {
@@ -249,7 +149,7 @@ State {
}
\endqml
-\o Update x from a script
+Or, update \c x from a script:
\qml
MouseArea {
@@ -257,11 +157,10 @@ MouseArea {
onClicked: redRect.x = 24;
}
\endqml
-\endlist
-If x were bound to another property, triggering the binding would also trigger the behavior.
+If \c x were bound to another property, triggering the binding would also trigger the behavior.
-If a state change has a transition animation matching a property with a Behavior, the transition animation
-will override the Behavior for that state change.
+If a state change has a transition animation matching a property with a \l Behavior, the transition animation
+will override the \l Behavior for that state change.
*/
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 6901947811..87dab81077 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -40,319 +40,377 @@
****************************************************************************/
/*!
- \page qdeclarativebasictypes.html
- \title QML Basic Types
+ \page qdeclarativebasictypes.html
+ \title QML Basic Types
- QML uses a set of property types, which are primitive within QML.
- These basic types are referenced throughout the documentation of the
- QML elements. Almost all of them are exactly what you would expect.
+ QML has a set of primitive types, as listed below, that are used throughout
+ the \l {QML Elements}.
- \annotatedlist qmlbasictypes
+ Some of these types can also be used for defining
+ \c property values in QML. See \l{Extending types from QML} for the
+ list of types that can be used for \c property values.
+
+ \annotatedlist qmlbasictypes
*/
/*!
- \qmlbasictype int
- \ingroup qmlbasictypes
+ \qmlbasictype int
+ \ingroup qmlbasictypes
- \brief An integer is a whole number, e.g. 0, 10, or -20.
+ \brief An integer is a whole number, e.g. 0, 10, or -20.
- An integer is a whole number, e.g. 0, 10, or -20. The possible \c
- int values range from around -2000000000 to around 2000000000,
- although most elements will only accept a reduced range (which they
- mention in their documentation).
+ An integer is a whole number, e.g. 0, 10, or -20. The possible \c
+ int values range from around -2000000000 to around 2000000000,
+ although most elements will only accept a reduced range (which they
+ mention in their documentation).
- Example:
- \qml
- Item { width: 100; height: 200 }
- \endqml
+ Example:
+ \qml
+ Item { width: 100; height: 200 }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype bool
- \ingroup qmlbasictypes
+ \qmlbasictype bool
+ \ingroup qmlbasictypes
- \brief A boolean is a binary true/false value.
+ \brief A boolean is a binary true/false value.
- A boolean is a binary true/false value.
+ A boolean is a binary true/false value.
- Example:
- \qml
- Item { focus: true; clip: false }
- \endqml
+ Example:
+ \qml
+ Item { focus: true; clip: false }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype real
- \ingroup qmlbasictypes
+ \qmlbasictype real
+ \ingroup qmlbasictypes
- \brief A real number has a decimal point, e.g. 1.2 or -29.8.
+ \brief A real number has a decimal point, e.g. 1.2 or -29.8.
- A real number has a decimal point, e.g. 1.2 or -29.8.
+ A real number has a decimal point, e.g. 1.2 or -29.8.
- Example:
- \qml
- Item { width: 100.45; height: 150.82 }
- \endqml
+ Example:
+ \qml
+ Item { width: 100.45; height: 150.82 }
+ \endqml
- \note In QML all reals are stored in single precision, \l
- {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
- format.
+ \note In QML all reals are stored in single precision, \l
+ {http://en.wikipedia.org/wiki/IEEE_754} {IEEE floating point}
+ format.
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype string
- \ingroup qmlbasictypes
+ \qmlbasictype string
+ \ingroup qmlbasictypes
- \brief A string is a free form text in quotes, e.g. "Hello world!".
+ \brief A string is a free form text in quotes, e.g. "Hello world!".
- A string is a free form text in quotes, e.g. "Hello world!".
+ A string is a free form text in quotes, e.g. "Hello world!".
- Example:
- \qml
- Text { text: "Hello world!" }
- \endqml
+ Example:
+ \qml
+ Text { text: "Hello world!" }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype url
- \ingroup qmlbasictypes
+ \qmlbasictype url
+ \ingroup qmlbasictypes
- \brief A URL is a resource locator, like a file name.
+ \brief A URL is a resource locator, like a file name.
- A URL is a resource locator, like a file name. It can be either
- absolute, e.g. "http://qt.nokia.com", or relative, e.g.
- "pics/logo.png". A relative URL is resolved relative to the URL of
- the component where the URL is converted from a JavaScript string
- expression to a url property value.
+ A URL is a resource locator, like a file name. It can be either
+ absolute, e.g. "http://qt.nokia.com", or relative, e.g.
+ "pics/logo.png". A relative URL is resolved relative to the URL of
+ the component where the URL is converted from a JavaScript string
+ expression to a url property value.
- Example:
- \qml
- Image { source: "pics/logo.png" }
- \endqml
+ Example:
+ \qml
+ Image { source: "pics/logo.png" }
+ \endqml
- \raw HTML
- \endraw
+ \raw HTML
+ \endraw
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype color
- \ingroup qmlbasictypes
-
- \brief A color is a standard color name in quotes.
-
- A color is a standard color name in quotes. It is normally specified
- as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords} {SVG
- color name}. These names include colors like "red", "green" and
- "lightsteelblue".
-
- If the color you want isn't part of this list, colors can also be
- specified in hexidecimal triplets or quads that take the form \c
- "#RRGGBB" and \c "#AARRGGBB" respectively. For example, the color
- red corresponds to a triplet of \c "#FF0000" and a slightly
- transparent blue to a quad of \c "#800000FF".
-
- Example:
- \qml
- Rectangle { color: "steelblue" }
- Rectangle { color: "#FF0000" }
- Rectangle { color: "#800000FF" }
- \endqml
-
- \sa {QML Basic Types}
+ \qmlbasictype color
+ \ingroup qmlbasictypes
+
+ \brief A color is a standard color name in quotes.
+
+ A color is a standard color name in quotes. It is normally specified
+ as an \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords} {SVG
+ color name}. These names include colors like "red", "green" and
+ "lightsteelblue".
+
+ If the color you want isn't part of this list, colors can also be
+ specified in hexidecimal triplets or quads that take the form \c
+ "#RRGGBB" and \c "#AARRGGBB" respectively. For example, the color
+ red corresponds to a triplet of \c "#FF0000" and a slightly
+ transparent blue to a quad of \c "#800000FF".
+
+ Example:
+ \qml
+ Rectangle { color: "steelblue" }
+ Rectangle { color: "#FF0000" }
+ Rectangle { color: "#800000FF" }
+ \endqml
+
+ Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
+ \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
+
+ \qml
+ Rectangle { color: Qt.rgba(255, 0, 0, 1) }
+ \endqml
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype point
- \ingroup qmlbasictypes
+ \qmlbasictype point
+ \ingroup qmlbasictypes
+
+ \brief A point type has x and y attributes.
- \brief A point is specified as "x,y".
+ A \c point type has \c x and \c y attributes.
- A point is specified as "x,y".
+ To create a \c point value, specify it as a "x,y" string:
- Example:
- \qml
- Widget { pos: "0,20" }
- \endqml
+ \qml
+ CustomObject { myPointProperty: "0,20" }
+ \endqml
- \sa {QML Basic Types}
+ Or use the \l{Qt::point()}{Qt.point()} function:
+
+ \qml
+ CustomObject { myPointProperty: Qt.point(0, 20) }
+ \endqml
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype size
- \ingroup qmlbasictypes
+ \qmlbasictype size
+ \ingroup qmlbasictypes
+
+ \brief A size type has width and height attributes
+
+ A \c size type has \c width and \c height attributes.
- \brief A size is specified as "width x height".
+ For example, to read the \l {Image::sourceSize} \c size property:
- A size is specified as "width x height".
+ \qml
+ Column {
+ Image { id: image; source: "logo.png" }
+ Text { text: image.sourceSize.width + "," + image.sourceSize.height }
+ }
+ \endqml
- Example:
- \qml
- Widget { size: "150x50" }
- \endqml
+ To create a \c size value, specify it as a "width x height" string:
- \sa {QML Basic Types}
+ \qml
+ LayoutItem { preferredSize: "150x50" }
+ \endqml
+
+ Or use the \l{Qt::size()}{Qt.size()} function:
+
+ \qml
+ LayoutItem { preferredSize: Qt.size(150, 50) }
+ \endqml
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype rect
- \ingroup qmlbasictypes
+ \qmlbasictype rect
+ \ingroup qmlbasictypes
+
+ \brief A rect type has x, y, width and height attributes.
+
+ A \c rect type has \c x, \c y, \c width and \c height attributes.
+
+ For example, to read the \l {Item::childrenRect.x}{Item::childrenRect} \c rect property:
+ \qml
+ Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
- \brief A rect is specified as "x, y, width x height".
+ Rectangle { width: 100; height: 100 }
+ }
+ \endqml
- A rect is specified as "x, y, width x height".
+ To create a \c rect value, specify it as a "x, y, width x height" string:
- Example:
- \qml
- Widget { geometry: "50,50,100x100" }
- \endqml
+ \qml
+ CustomObject { myRectProperty: "50,50,100x100" }
+ \endqml
- \sa {QML Basic Types}
+ Or use the \l{Qt::rect()}{Qt.rect()} function:
+
+ \qml
+ CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
+ \endqml
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype date
- \ingroup qmlbasictypes
+ \qmlbasictype date
+ \ingroup qmlbasictypes
+
+ \brief A date is specified as "YYYY-MM-DD".
- \brief A date is specified as "YYYY-MM-DD".
+ To create a \c date value, specify it as a "YYYY-MM-DD" string:
- A date is specified as "YYYY-MM-DD".
+ Example:
+ \qml
+ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
+ \endqml
- Example:
- \qml
- DatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
- \endqml
+ To read a date value returned from a C++ extension class, use
+ \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype time
- \ingroup qmlbasictypes
+ \qmlbasictype time
+ \ingroup qmlbasictypes
- \brief A time is specified as "hh:mm:ss".
+ \brief A time is specified as "hh:mm:ss".
- A time is specified as "hh:mm:ss".
+ A time is specified as "hh:mm:ss".
- Example:
- \qml
- TimePicker { time: "14:22:15" }
- \endqml
+ Example:
+ \qml
+ MyTimePicker { time: "14:22:15" }
+ \endqml
- \sa {QML Basic Types}
+ To read a time value returned from a C++ extension class, use
+ \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype font
- \ingroup qmlbasictypes
+ \qmlbasictype font
+ \ingroup qmlbasictypes
- \brief A font type has the properties of a QFont.
+ \brief A font type has the properties of a QFont.
- A font type has the properties of a QFont. The properties are:
+ A font type has the properties of a QFont. The properties are:
- \list
- \o \c string font.family
- \o \c bool font.bold
- \o \c bool font.italic
- \o \c bool font.underline
- \o \c real font.pointSize
- \o \c int font.pixelSize
- \endlist
+ \list
+ \o \c string font.family
+ \o \c bool font.bold
+ \o \c bool font.italic
+ \o \c bool font.underline
+ \o \c real font.pointSize
+ \o \c int font.pixelSize
+ \endlist
- Example:
- \qml
- Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
- \endqml
+ Example:
+ \qml
+ Text { font.family: "Helvetica"; font.pointSize: 13; font.bold: true }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype action
- \ingroup qmlbasictypes
+ \qmlbasictype action
+ \ingroup qmlbasictypes
- \brief The action type has all the properties of QAction.
+ \brief The action type has all the properties of QAction.
- The action type has all the properties of QAction. The properties
- are:
+ The action type has all the properties of QAction. The properties
+ are:
- \list
- \o \c slot action.trigger - invoke the action
- \o \c bool action.enabled - true if the action is enabled
- \o \c string action.text - the text associated with the action
- \endlist
+ \list
+ \o \c slot action.trigger - invoke the action
+ \o \c bool action.enabled - true if the action is enabled
+ \o \c string action.text - the text associated with the action
+ \endlist
- Actions are used like this:
+ Actions are used like this:
- \qml
- MouseArea { onClicked: MyItem.myaction.trigger() }
- State { name: "enabled"; when: MyItem.myaction.enabled == true }
- Text { text: MyItem.someaction.text }
- \endqml
+ \qml
+ MouseArea { onClicked: myaction.trigger() }
+ State { name: "enabled"; when: myaction.enabled == true }
+ Text { text: someaction.text }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype list
- \ingroup qmlbasictypes
-
- \brief A list of objects.
-
- A list of objects. While not technically a basic type, QML also
- supports lists of object types. When used from QML, the engine
- automatically appends each value to the list.
-
- For example, the \l Item class contains a list property named
- children that can be used like this:
-
- \qml
- Item {
- children: [
- Item { id: child1 },
- Rectangle { id: child2 },
- Text { id: child3 }
- ]
- }
- \endqml
- \c Child1, \c Child2 and \c Child3 will all be added to the children list
- in the order in which they appear.
-
- \sa {QML Basic Types}
+ \qmlbasictype list
+ \ingroup qmlbasictypes
+
+ \brief A list of objects.
+
+ A list of objects. While not technically a basic type, QML also
+ supports lists of object types. When used from QML, the engine
+ automatically appends each value to the list.
+
+ For example, the \l Item class contains a list property named
+ children that can be used like this:
+
+ \qml
+ Item {
+ children: [
+ Item { id: child1 },
+ Rectangle { id: child2 },
+ Text { id: child3 }
+ ]
+ }
+ \endqml
+ \c child1, \c child2 and \c child3 will all be added to the children list
+ in the order in which they appear.
+
+ \sa {QML Basic Types}
*/
/*!
- \qmlbasictype vector3d
- \ingroup qmlbasictypes
+ \qmlbasictype vector3d
+ \ingroup qmlbasictypes
+
+ \brief A vector3d type has x, y, and z attributes.
- \brief A vector3d is specified as "x,y,z".
+ A \c vector3d type has \c x, \c y, and \c z attributes.
- A vector3d is specified as "x,y,z".
+ To create a \c vector3d value, specify it as a "x,y,z" string:
- \qml
- Rotation { angle: 60; axis: "0,1,0" }
- \endqml
+ \qml
+ Rotation { angle: 60; axis: "0,1,0" }
+ \endqml
- or with the \c{Qt.vector3d()} helper function:
+ or with the \l{Qt::vector3d()}{Qt.vector3d()} function:
- \qml
- Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
- \endqml
+ \qml
+ Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
+ \endqml
- or as separate \c x, \c y, and \c z components:
+ or as separate \c x, \c y, and \c z components:
- \qml
- Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
- \endqml
+ \qml
+ Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }
+ \endqml
- \sa {QML Basic Types}
+ \sa {QML Basic Types}
*/
diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc
index 7ca206b713..4fa7d0c871 100644
--- a/doc/src/declarative/codingconventions.qdoc
+++ b/doc/src/declarative/codingconventions.qdoc
@@ -57,7 +57,7 @@ Through our documentation and examples, QML objects are always structured in the
\o id
\o property declarations
\o signal declarations
-\o javascript functions
+\o JavaScript functions
\o object properties
\o child objects
\o states
@@ -72,7 +72,6 @@ For example, a hypothetical \e photo QML object would look like this:
\snippet doc/src/snippets/declarative/codingconventions/photo.qml 0
-\target Grouped properties
\section1 Grouped properties
If using multiple properties from a group of properties,
@@ -102,7 +101,7 @@ we will write this:
\snippet doc/src/snippets/declarative/codingconventions/lists.qml 1
-\section1 Javascript code
+\section1 JavaScript code
If the script is a single expression, we recommend writing it inline:
@@ -116,7 +115,7 @@ If the script is more than a couple of lines long or can be used by different ob
\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 2
-For long scripts, we will put the functions in their own javascript file and import it like this:
+For long scripts, we will put the functions in their own JavaScript file and import it like this:
\snippet doc/src/snippets/declarative/codingconventions/javascript-imports.qml 0
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index d79c4d238e..7a49d0a9cb 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -40,46 +40,42 @@
****************************************************************************/
/*!
-\title Declarative UI Using QML
+\title Qt Quick
\page declarativeui.html
-\brief The Qt Declarative module provides a declarative framework for building
-highly dynamic, custom user interfaces.
+\brief Qt Quick provides a declarative framework for building highly
+dynamic, custom user interfaces.
-\section1 \l{QML Elements}{Fast QML Elements Reference Page}
+Qt Quick provides a declarative framework for building highly dynamic,
+custom user interfaces from a rich set of \l {QML Elements}{QML elements}.
+Qt Quick helps programmers and designers collaborate to
+build the fluid user interfaces that are becoming common in portable
+consumer devices, such as mobile phones, media players, set-top boxes
+and netbooks.
-\raw HTML
-<br>
-\endraw
+QML is an extension to \l
+{http://www.ecma-international.org/publications/standards/Ecma-262.htm}
+{JavaScript}, that provides a mechanism to declaratively build an
+object tree of \l {QML Elements}{QML elements}. QML improves the
+integration between JavaScript and Qt's existing QObject based type
+system, adds support for automatic \l {Property Binding}{property
+bindings} and provides \l {Network Transparency}{network transparency}
+at the language level.
-\section1 Preamble
+The \l {QML Elements}{QML elements} are a sophisticated set of
+graphical and behavioral building blocks. These different elements
+are combined together in \l {QML Documents}{QML documents} to build
+components ranging in complexity from simple buttons and sliders, to
+complete internet-enabled applications like a \l
+{http://www.flickr.com}{Flickr} photo browser.
-Qt Declarative UI provides a declarative framework for building highly dynamic, custom
-user interfaces. Declarative UI helps programmers and designers collaborate to build
-the animation rich, fluid user interfaces that are becoming common in portable
-consumer devices, such as mobile phones, media players, set-top boxes and netbooks.
+Qt Quick builds on \l {QML for Qt programmers}{Qt's existing
+strengths}. QML can be be used to incrementally extend an existing
+application or to build completely new applications. QML is fully \l
+{Extending QML in C++}{extensible from C++}.
-The Qt Declarative module provides an engine for interpreting the declarative
-QML language, and a rich set of \bold { \l {QML Elements}{QML elements} }
-that can be used from QML.
+\section1 Getting Started
-QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm}
-{JavaScript}, that provides a mechanism to declaratively build an object tree
-of QML elements. QML improves the integration between JavaScript and Qt's
-existing QObject based type system, adds support for automatic
-\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language
-level.
-
-The QML elements are a sophisticated set of graphical and behavioral building
-blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components
-ranging in complexity from simple buttons and sliders, to complete
-internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser.
-
-Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}.
-QML can be be used to incrementally extend an existing application or to build
-completely new applications. QML is fully \l {Extending QML in C++}{extensible from C++}.
-
-\section1 Getting Started:
\list
\o \l {Introduction to the QML language}
\o \l {QML Tutorial}{Tutorial: 'Hello World'}
@@ -88,7 +84,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {QML for Qt programmers}
\endlist
-\section1 Core QML Features:
+\section1 Core QML Features
\list
\o \l {QML Documents}
\o \l {Property Binding}
@@ -102,11 +98,11 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {qdeclarativemodules.html}{Modules}
\o \l {qdeclarativefocus.html}{Keyboard Focus}
\o \l {Extending types from QML}
-\o \l {Dynamic Object Creation}
+\o \l {qdeclarativedynamicobjects.html}{Dynamic Object Creation}
\o \l {qmlruntime.html}{The Qt Declarative Runtime}
\endlist
-\section1 Using QML with C++:
+\section1 Using QML with C++
\list
\o \l {Tutorial: Writing QML extensions with C++}
\o \l {Extending QML in C++}
@@ -114,7 +110,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {Integrating QML with existing Qt UI code}
\endlist
-\section1 Reference:
+\section1 Reference
\list
\o \l {QML Elements}
\o \l {QML Global Object}
@@ -122,6 +118,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {QML Security}
\o \l {QtDeclarative Module}
\o \l {Debugging QML}
+\o \l {QML Performance}
\o \l {QML Coding Conventions}
\endlist
*/
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 4cb51982e4..5e606f468d 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -43,84 +43,68 @@
\page qdeclarativedynamicobjects.html
\title Dynamic Object Management
-QML has some support for dynamically loading and managing QML objects from
-within Javascript blocks. It is preferable to use the existing QML elements for
-dynamic object management wherever possible; these are \l{Loader},
-\l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView}. It is also possible
-to dynamically create and manage objects from C++, and this is preferable for
-hybrid QML/C++ applications - see \l{Using QML in C++ Applications}.
-Dynamically creating and managing objects from
-within Javascript blocks is intended for when none of the existing QML elements
-fit the needs of your application, and you do not desire for your application
-to involve C++ code.
+QML provides a number of ways to dynamically create and manage QML objects.
+The \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView} elements
+all support dynamic object management. Objects can also be created and managed
+from C++, and this is the preferred method for hybrid QML/C++ applications
+(see \l{Using QML in C++ Applications}).
+
+QML also supports the dynamic creation of objects from within JavaScript
+code. This is useful if the existing QML elements do not fit the needs of your
+application, and there are no C++ components involved.
+
\section1 Creating Objects Dynamically
-There are two ways of creating objects dynamically. You can either create
-a component which instantiates items, or create an item from a string of QML.
-Creating a component is better for the situation where you have a predefined
-item which you want to manage dynamic instances of, and creating an item from
-a string of QML is intended for when the QML itself is generated at runtime.
+There are two ways to create objects dynamically from JavaScript. You can either call
+\l {Qt::createComponent()}{Qt.createComponent()} to create
+a component which instantiates items, or use \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+to create an item from a string of QML.
+Creating a component is better if you have a predefined
+item, and you want to create dynamic instances of that item; creating an item from
+a string of QML is useful when the item QML itself is generated at runtime.
If you have a component specified in a QML file, you can dynamically load it with
-the \l {createComponent(url file)}{createComponent()} function on the \l{QML Global Object}.
+the \l {Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
This function takes the URL of the QML file as its only argument and returns
a component object which can be used to create and load that QML file.
-Once you have a component you can use its \c createObject() method to create an instance of
-the component. Example QML script is below. Remember that QML files that might be loaded
- over the network cannot be expected to be ready immediately.
- \code
- var component;
- var sprite;
- function finishCreation() {
- if(component.isReady()) {
- sprite = component.createObject();
- if(sprite == 0) {
- // Error Handling
- } else {
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- } else if(component.isError()) {
- // Error Handling
- }
- }
-
- component = createComponent("Sprite.qml");
- if(component.isReady()) {
- finishCreation();
- } else {
- component.statusChanged.connect(finishCreation);
- }
- \endcode
-
- If you are certain the files will be local, you could simplify to
-
- \code
- component = createComponent("Sprite.qml");
- sprite = component.createObject();
- if(sprite == 0) {
- // Error Handling
- console.log(component.errorsString());
- } else {
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- \endcode
-
-After creating the item, remember to set its parent to an item within the scene.
-Otherwise your dynamically created item will not appear in the scene. When using files with relative paths, the path should
-be relative to the file where \c createComponent() is executed.
-
-If the QML does not exist until runtime, you can create a QML item from
-a string of QML using the \l{createQmlObject(string qml, object parent, string filepath)}{createQmlObject()} function, as in the following example:
-
- \code
- newObject = createQmlObject('import Qt 4.7; Rectangle { color: "red"; width: 20; height: 20 }',
- targetItem, "dynamicSnippet1");
- \endcode
+Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of
+the component. This function takes exactly one argument, which is the parent for the new item. Since graphical items will
+not appear on the scene without a parent, it is recommended that you set the parent this way. However, if you wish to set
+the parent later you can safely pass null to this function.
+
+Here is an example. Here is a \c Sprite.qml, which defines a simple QML component:
+
+\snippet doc/src/snippets/declarative/Sprite.qml 0
+
+Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file
+that will create \c Sprite objects:
+
+\snippet doc/src/snippets/declarative/createComponent.qml 0
+
+Here is \c componentCreation.js. Remember that QML files that might be loaded
+over the network cannot be expected to be ready immediately:
+
+\snippet doc/src/snippets/declarative/componentCreation.js 0
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js 1
+
+If you are certain the files will be local, you could simplify to:
+
+\snippet doc/src/snippets/declarative/componentCreation.js 2
+
+Notice that once a \c Sprite object is created, its parent is set to \c appWindow (defined
+in \c main.qml). After creating an item, you must set its parent to an item within the scene.
+Otherwise your dynamically created item will not appear in the scene.
+
+When using files with relative paths, the path should
+be relative to the file where \l {Qt::createComponent()}{Qt.createComponent()} is executed.
+
+If the QML component does not exist until runtime, you can create a QML item from
+a string of QML using the \l{Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+
The first argument is the string of QML to create. Just like in a new file, you will need to
import any types you wish to use. For importing files with relative paths, the path should
be relative to the file where the item in the second argument is defined. Remember to set the parent after
@@ -130,47 +114,44 @@ item, which is used for error reporting.
\section1 Maintaining Dynamically Created Objects
-Dynamically created objects may be used the same as other objects, however they
-will not have an id in QML.
+When managing dynamically created items, you must ensure the creation context
+outlives the created item. Otherwise, if the creation context is destroyed first,
+the bindings in the dynamic item will no longer work.
+
+The actual creation context depends on how an item is created:
+
+\list
+\o If \l {Qt::createComponent()}{Qt.createComponent()} is used, the creation context
+ is the QDeclarativeContext in which this method is called
+\o If \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+ if called, it is the context of the item used as the second argument to this method
+\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
+ is called on that item, it is the context in which the \c Component is defined
+\endlist
+
+Also, note that while dynamically created objects may be used the same as other objects, they
+do not have an id in QML.
-A restriction which you need to manage with dynamically created items,
-is that the creation context must outlive the
-created item. The creation context is the QDeclarativeContext in which \c createComponent()
-was called, or the context in which the Component element, or the item used as the
-second argument to \c createQmlObject(), was specified. If the creation
-context is destroyed before the dynamic item is, then bindings in the dynamic item will
-fail to work.
\section1 Deleting Objects Dynamically
-You should generally avoid dynamically deleting objects that you did not
-dynamically create. In many UIs, it is sufficient to set the opacity to 0 or
-to move the item off of the edge of the screen. If you have lots of dynamically
-created items however, deleting them when they are no longer used will provide
-a worthwhile performance benefit. Note that you should never manually delete
-items which were dynamically created by QML Elements such as \l{Loader}.
-
-To manually delete a QML item, call its destroy method. This method has one
-argument, which is an approximate delay in ms and which defaults to zero. This
-allows you to wait until the completion of an animation or transition. An example:
-
-\code
- Component {
- id: fadesOut
- Rectangle{
- id: rect
- width: 40; height: 40;
- NumberAnimation on opacity { from:1; to:0; duration: 1000 }
- Component.onCompleted: rect.destroy(1000);
- }
- }
- function createFadesOut(parentItem)
- {
- var object = fadesOut.createObject();
- object.parent = parentItem;
- }
-\endcode
-In the above example, the dynamically created rectangle calls destroy as soon as it's created,
- but delays long enough for its fade out animation to play.
+In many user interfaces, it is sufficient to set an item's opacity to 0 or
+to move the item off the screen instead of deleting the item. If you have
+lots of dynamically created items, however, you may receive a worthwhile
+performance benefit if unused items are deleted.
+
+Note that you should never manually delete items that were dynamically created
+by QML elements (such as \l Loader). Also, you should generally avoid deleting
+items that you did not dynamically create yourself.
+
+Items can be deleted using the \c destroy() method. This method has an optional
+argument (which defaults to 0) that specifies the approximate delay in milliseconds
+before the object is to be destroyed. This allows you to wait until the completion of
+an animation or transition. An example:
+
+\snippet doc/src/snippets/declarative/dynamicObjects.qml 0
+
+Here, \c Rectangle objects are destroyed one second after they are created, which is long
+enough for the \c NumberAnimation to be played before the object is destroyed.
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 79fe90996d..31fa948b43 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -59,8 +59,8 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l State
\o \l PropertyChanges
\o \l StateGroup
+\o \l StateChangeScript
\o \l ParentChange (Item-specific)
-\o \l StateChangeScript (Item-specific)
\o \l AnchorChanges (Item-specific)
\endlist
@@ -76,6 +76,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l ParentAnimation
\o \l AnchorAnimation
\o \l SmoothedAnimation
+\o \l Vector3dAnimation
\o \l PropertyAction
\o \l ScriptAction
\o \l Transition
@@ -120,11 +121,22 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\list
\o \l Item
\o \l Rectangle
+ \list
+ \o \l Gradient
+ \list
+ \o \l GradientStop
+ \endlist
+ \endlist
\o \l Image
\o \l BorderImage
\o \l AnimatedImage
\o \l Text
\o \l TextInput
+ \list
+ \o \l IntValidator
+ \o \l DoubleValidator
+ \o \l RegExpValidator
+ \endlist
\o \l TextEdit
\endlist
@@ -142,6 +154,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l Loader
\o \l Repeater
\o \l SystemPalette
+\o \l FontLoader
\o \l LayoutItem
\endlist
@@ -155,8 +168,8 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\header
\o \bold {Views}
\o \bold {Positioners}
-\o \bold {Media}
\o \bold {Effects}
+\o
\row
\o
@@ -189,13 +202,6 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o
\list
-\o \l SoundEffect
-\o \l Audio
-\o \l Video
-\endlist
-
-\o
-\list
\o \l Particles (experimental)
\list
\o \l ParticleMotionLinear
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
index c14208e74d..27b7f3814f 100644
--- a/doc/src/declarative/example-slideswitch.qdoc
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -45,7 +45,7 @@
This example shows how to create a reusable switch component in QML.
-The code for this example can be found in the \c $QTDIR/examples/declarative/slideswitch directory.
+The code for this example can be found in the \c $QTDIR/examples/declarative/ui-components/slideswitch directory.
\section1 Overview
@@ -61,12 +61,12 @@ The elements that composed the switch are:
\endlist
\section1 Switch.qml
-\snippet examples/declarative/slideswitch/content/Switch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet examples/declarative/slideswitch/content/Switch.qml 1
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 1
This property is the interface of the switch. By default, the switch is off and this property is \c false.
It can be used to activate/disactivate the switch or to query its current state.
@@ -81,14 +81,14 @@ Text { text: "The switch is on"; visible: mySwitch.on == true }
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet examples/declarative/slideswitch/content/Switch.qml 4
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 4
First, we create the background image of the switch.
In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
\c toggle() function. We will see what this function does in a moment.
-\snippet examples/declarative/slideswitch/content/Switch.qml 5
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 5
Then, we place the image of the knob on top of the background.
The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
@@ -96,7 +96,7 @@ property of the \c MouseArea is for. We also want to toggle the switch if the kn
in the \c dorelease() function that is called in the \c onReleased property.
\section2 States
-\snippet examples/declarative/slideswitch/content/Switch.qml 6
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -110,13 +110,13 @@ For more information on states see \l{qmlstates}{QML States}.
We add two JavaScript functions to our switch:
-\snippet examples/declarative/slideswitch/content/Switch.qml 2
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 2
This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
states (\e on and \e off).
-\snippet examples/declarative/slideswitch/content/Switch.qml 3
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 3
This second function is called when the knob is released and we want to make sure that the knob does not end up between states
(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
@@ -124,7 +124,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{Integrating JavaScript}.
\section2 Transition
-\snippet examples/declarative/slideswitch/content/Switch.qml 7
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -133,5 +133,5 @@ For more information on transitions see \l{state-transitions}{QML Transitions}.
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet examples/declarative/slideswitch/slideswitch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index e01459f690..ad8c10ccf1 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -40,12 +40,10 @@
****************************************************************************/
/*!
-\page qdeclarativeexamples.html
-\title QML Examples and Demos
-
-\previouspage Graphics View Examples
-\contentspage Qt Examples
-\nextpage Painting Examples
+ \page qdeclarativeexamples.html
+ \title QML Examples and Demos
+ \brief Building UI's with QML
+ \ingroup all-examples
\section1 Running the examples
@@ -55,74 +53,133 @@ sub-directory that show how to use various aspects of QML. In addition, the
applications. These demos are intended to show integrated functionality
rather than being instructive on specific elements.
-To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qml}
+To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qmlviewer}
command-line application. It has some useful options, revealed by:
\code
- bin/qml -help
+ bin/qmlviewer -help
\endcode
For example, from your build directory, run:
\code
- bin/qml $QTDIR/demos/declarative/samegame/samegame.qml
+ bin/qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml
\endcode
\section1 Examples
+\section2 Animation
+\list
+\o \l{declarative/animation/basics}{Basics}
+\o \l{declarative/animation/behaviors}{Behaviors}
+\o \l{declarative/animation/easing}{Easing types}
+\o \l{declarative/animation/states}{States}
+\endlist
+
+\section2 Image Elements
+\list
+\o \l{declarative/imageelements/borderimage}{BorderImage}
+\o \l{declarative/imageelements/image}{Image}
+\endlist
+
+\section2 Positioners
+\list
+\o \l{declarative/positioners}{Example}
+\endlist
+
+\section2 Key Interaction
+\list
+\o \l{declarative/keyinteraction/focus}{Focus}
+\endlist
+
+\section2 Touch Interaction
+\list
+\o \l{declarative/touchinteraction/gestures}{Gestures}
+\o \l{declarative/touchinteraction/mousearea}{MouseArea}
+\endlist
+
+\section2 UI Components
+\list
+\o \l{declarative/ui-components/dialcontrol}{Dial control}
+\o \l{declarative/ui-components/flipable}{Flipable}
+\o \l{declarative/ui-components/progressbar}{Progress bar}
+\o \l{declarative/ui-components/scrollbar}{Scroll bar}
+\o \l{declarative/ui-components/searchbox}{Search box}
+\o \l{declarative/ui-components/slideswitch}{Slide switch}
+\o \l{declarative/ui-components/spinner}{Spinner}
+\o \l{declarative/ui-components/tabwidget}{Tab widget}
+\endlist
+
+\section2 Models and Views
+\list
+\o \l{declarative/modelviews/gridview}{GridView}
+\o \l{declarative/modelviews/listview}{ListView}
+\o \l{declarative/modelviews/objectlistmodel}{Object ListModel}
+\o \l{declarative/modelviews/package}{Package}
+\o \l{declarative/modelviews/parallax}{Parallax}
+\o \l{declarative/modelviews/stringlistmodel}{String ListModel}
+\o \l{declarative/modelviews/visualitemmodel}{VisualItemModel}
+\o \l{declarative/modelviews/webview}{WebView}
+\endlist
+
+\section2 XML
\list
-\o \l{declarative/animations}{Animations}
-\o \l{declarative/aspectratio}{Aspect Ratio}
-\o \l{declarative/behaviors}{Behaviors}
-\o \l{declarative/border-image}{Border Image}
-\o \l{declarative/clocks}{Clocks}
-\o \l{declarative/connections}{Connections}
-\o \l{declarative/dial}{Dial}
-\o \l{declarative/dynamic}{Dynamic}
-\o \l{declarative/extending}{Extending}
-\o \l{declarative/fillmode}{Fillmode}
-\o \l{declarative/flipable}{Flipable}
-\o \l{declarative/focus}{Focus}
-\o \l{declarative/fonts}{Fonts}
-\o \l{declarative/gridview}{GridView}
-\o \l{declarative/imageprovider}{Image Provider}
-\o \l{declarative/images}{Images}
-\o \l{declarative/layouts}{Layouts}
-\o \l{declarative/listmodel-threaded}{ListModel Threaded}
-\o \l{declarative/listview}{ListView}
-\o \l{declarative/mousearea}{Mouse Area}
-\o \l{declarative/objectlistmodel}{Object ListModel}
-\o \l{declarative/package}{Package}
-\o \l{declarative/parallax}{Parallax}
-\o \l{declarative/plugins}{Plugins}
-\o \l{declarative/progressbar}{Progress Bars}
-\o \l{declarative/proxywidgets}{Proxy Widgets}
-\o \l{declarative/scrollbar}{Scrollbar}
-\o \l{declarative/searchbox}{Search Box}
-\o \l{declarative/slideswitch}{Slide Switch}
-\o \l{declarative/sql}{SQL}
-\o \l{declarative/states}{States}
-\o \l{declarative/stringlistmodel}{String ListModel}
-\o \l{declarative/tabwidget}{Tab Widget}
-\o \l{declarative/tic-tac-toe}{Tic-Tac-Toe}
-\o \l{declarative/tvtennis}{TV Tennis}
-\o \l{declarative/velocity}{Velocity}
-\o \l{declarative/webview}{WebView}
-\o \l{declarative/workerscript}{WorkerScript}
-\o \l{declarative/xmldata}{XML Data}
-\o \l{declarative/xmlhttprequest}{XMLHttpRequest}
+\o \l{declarative/xml/xmlhttprequest}{XmlHttpRequest}
+\endlist
+
+\section2 Internationalization (i18n)
+\list
+\o \l{declarative/i18n}{Example}
+\endlist
+
+\section2 Threading
+\list
+\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
+\o \l{declarative/threading/workerscript}{WorkerScript}
+\endlist
+
+\section2 SQL Local Storage
+\list
+\o \l{declarative/sqllocalstorage}{Example}
+\endlist
+
+\section2 C++ Extensions
+\list
+\o \l{declarative-cppextensions-reference.html}{Reference examples}
+\o \l{declarative/cppextensions/plugins}{Plugins}
+\o \l{declarative-cppextensions-qgraphicslayouts.html}{QGraphicsLayouts}
+\o \l{declarative/cppextensions/qwidgets}{QWidgets}
+\o \l{declarative/cppextensions/imageprovider}{Image provider}
+\o \l{declarative/cppextensions/networkaccessmanagerfactory}{Network access manager factory}
+\endlist
+\section2 Toys
+\list
+\o \l{declarative/toys/clocks}{Clocks}
+\o \l{declarative/toys/corkboards}{Corkboards}
+\o \l{declarative/toys/dynamicscene}{Dynamic Scene}
+\o \l{declarative/toys/tic-tac-toe}{Tic Tac Toe}
+\o \l{declarative/toys/tvtennis}{TV Tennis}
\endlist
+
\section1 Demos
\list
\o \l{demos/declarative/calculator}{Calculator}
+\o \l{demos/declarative/flickr}{Flickr Mobile}
\o \l{demos/declarative/minehunt}{Minehunt}
\o \l{demos/declarative/photoviewer}{Photo Viewer}
-\o \l{demos/declarative/flickr}{Flickr Mobile}
+\o \l{demos/declarative/rssnews}{RSS News Reader}
\o \l{demos/declarative/samegame}{Same Game}
\o \l{demos/declarative/snake}{Snake}
\endlist
+\section1 Labs
+
+\list
+\o \l{src/imports/folderlistmodel}{Folder List Model} - a C++ model plugin
+\endlist
+
*/
+
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index f00b858098..7ec9087350 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -107,7 +107,7 @@ The class implementation in \c musician.cpp simply sets and returns the \c m_nam
Our QML file, \c app.qml, creates a \c Musician item and display the musician's details
using a standard QML \l Text item:
-\quotefile declarative/tutorials/extending/chapter1-basics/app.qml
+\snippet declarative/tutorials/extending/chapter1-basics/app.qml 0
We'll also create a C++ application that uses a QDeclarativeView to run and
display \c app.qml. The application must register the \c Musician type
@@ -147,7 +147,7 @@ to the console and then emits a "performanceEnded" signal.
Other elements would be able to call \c perform() and receive
\c performanceEnded() signals like this:
-\quotefile declarative/tutorials/extending/chapter2-methods/app.qml
+\snippet declarative/tutorials/extending/chapter2-methods/app.qml 0
To do this, we add a \c perform() method and a \c performanceEnded() signal
to our C++ class:
@@ -193,7 +193,7 @@ other elements' values when property values change.
Let's enable property bindings for the \c instrument property. That means
if we have code like this:
-\quotefile declarative/tutorials/extending/chapter3-bindings/app.qml
+\snippet declarative/tutorials/extending/chapter3-bindings/app.qml 0
The "instrument: reddy.instrument" statement binds the \c instrument value of
\c craig to the \c instrument of \c reddy.
@@ -275,7 +275,7 @@ For example, let's change the type of the \c instrument property from a string t
new type called "Instrument". Instead of assigning a string value to \c instrument,
we assign an \c Instrument value:
-\quotefile declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
Like \c Musician, this new \c Instrument type has to inherit from QObject and declare
its properties with Q_PROPERTY():
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 1c159e401c..03c0ec4ac5 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -56,13 +56,16 @@ QML for their own independent use.
\section1 Adding Types
\target adding-types
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
The QML snippet shown above instantiates one \c Person instance and sets
the \c name and \c shoeSize properties on it. Everything in QML ultimately comes down
to either instantiating an object instance, or assigning a property a value.
+
QML relies heavily on Qt's meta object system and can only instantiate classes
-that derive from QObject.
+that derive from QObject. For visual element types, this will usually mean a subclass
+of QDeclarativeItem; for models used with the view elements, a subclass of QAbstractItemModel;
+and for abitrary objects with properties, a direct subclass of QObject.
The QML engine has no intrinsic knowledge of any class types. Instead the
programmer must register the C++ types with their corresponding QML names.
@@ -121,7 +124,7 @@ the \c Person type.
\section1 Object and List Property Types
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's
\c host property, and assigns three \c Person objects to the guests property.
@@ -136,7 +139,7 @@ Properties that are pointers to objects or Qt interfaces are declared with the
Q_PROPERTY() macro, just like other properties. The \c host property
declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
As long as the property type, in this case \c Person, is registered with QML the
property can be assigned.
@@ -165,14 +168,14 @@ As with object properties, the type \a T must be registered with QML.
The \c guest property declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
\l {Extending QML - Object and List Property Types Example} shows the complete
code used to create the \c BirthdayParty type.
\section1 Inheritance and Coercion
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's
\c host property, and assigns three other objects to the \c guests property.
@@ -214,7 +217,7 @@ code used to create the \c Boy and \c Girl types.
\section1 Default Property
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
The QML snippet shown above assigns a collection of objects to the
\c BirthdayParty's default property.
@@ -246,7 +249,7 @@ specify a default property.
\section1 Grouped Properties
-\snippet examples/declarative/extending/grouped/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml 1
The QML snippet shown above assigns a number of properties to the \c Boy object,
including four properties using the grouped property syntax.
@@ -259,7 +262,7 @@ different types through implementation reuse.
A grouped property block is implemented as a read-only object property. The
\c shoe property shown is declared like this:
-\snippet examples/declarative/extending/grouped/person.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1
The \c ShoeDescription type declares the properties available to the grouped
property block - in this case the \c size, \c color, \c brand and \c price properties.
@@ -271,7 +274,7 @@ implement the \c shoe property grouping.
\section1 Attached Properties
-\snippet examples/declarative/extending/attached/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1
The QML snippet shown above assigns a date to the \c rsvp property using the attached
property syntax.
@@ -393,8 +396,8 @@ this situation, but it must not crash.
\section1 Signal Support
-\snippet examples/declarative/extending/signal/example.qml 0
-\snippet examples/declarative/extending/signal/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 1
The QML snippet shown above associates the evaluation of a JavaScript expression
with the emission of a Qt signal.
@@ -406,7 +409,7 @@ signal name: "on" is prepended, and the first letter of the signal name upper
cased. For example, the signal used in the example above has the following
C++ signature:
-\snippet examples/declarative/extending/signal/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0
In classes with multiple signals with the same name, only the final signal
is accessible as a signal property. Note that signals with the same name
@@ -422,10 +425,13 @@ value will not be accessible from script.
\l {Extending QML - Signal Support Example} shows the complete code used to
implement the onPartyStarted signal property.
+If you want to use signals from items not created in QML, you can access their
+signals with the \l {Connections} element.
+
\section1 Property Value Sources
-\snippet examples/declarative/extending/valuesource/example.qml 0
-\snippet examples/declarative/extending/valuesource/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
The QML snippet shown above applies a property value source to the \c announcment property.
A property value source generates a value for a property that changes over time.
@@ -440,7 +446,7 @@ The example shown here is rather contrived: the \c announcment property of the
the \c HappyBirthdaySong value source generates the lyrics of the song
"Happy Birthday".
-\snippet examples/declarative/extending/valuesource/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
Normally, assigning an object to a string property would not be allowed. In
the case of a property value source, rather than assigning the object instance
@@ -453,9 +459,9 @@ QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when
associating the property value source with a property. The relevant part of
the \c HappyBirthdaySong type declaration looks like this:
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 0
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 1
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
In all other respects, property value sources are regular QML types. They must
be registered with the QML engine using the same macros as other types, and can
@@ -471,8 +477,8 @@ implement the \c HappyBirthdaySong property value source.
\section1 Property Binding
-\snippet examples/declarative/extending/binding/example.qml 0
-\snippet examples/declarative/extending/binding/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 1
The QML snippet shown above uses a property binding to ensure the
\c HappyBirthdaySong's \c name property remains up to date with the \c host.
@@ -492,7 +498,7 @@ the property's value. QML relies on the presence of a
Here is the \c host property declaration:
-\snippet examples/declarative/extending/binding/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0
The NOTIFY attribute is followed by a signal name. It is the responsibility of
the class implementer to ensure that whenever the property's value changes, the
@@ -531,7 +537,7 @@ subsequently change. The most common case of this is when a type uses
only freed when the object is deleted. In these cases, the CONSTANT attribute
may be added to the property declaration instead of a NOTIFY signal.
-\snippet examples/declarative/extending/binding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0
Extreme care must be taken here or applications using your type may misbehave.
The CONSTANT attribute should only be used for properties whose value is set,
@@ -543,7 +549,7 @@ include NOTIFY signals for use in binding.
\section1 Extension Objects
-\snippet examples/declarative/extending/extended/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0
The QML snippet shown above adds a new property to an existing C++ type without
modifying its source code.
@@ -893,9 +899,13 @@ in other projects without the use of C++. Components can also help to reduce
duplication inside one project by limiting the need for large numbers of
copy-and-pasted blocks.
-Any snippet of QML code can become a component, just by placing it in the file
-"<Name>.qml" where <Name> is the new element name, and begins with an uppercase
-letter. These QML files automatically become available as new QML element types
+Any snippet of QML code can become a component, just by placing it in the file "<Name>.qml"
+where <Name> is the new element name, and begins with an uppercase letter. Note that
+the case of all characters in the <Name> are significant on some filesystems, notably
+UNIX filesystems. It is recommended that the case of the filename matches the case of
+the component name in QML exactly, regardless of the platform the QML will be deployed to.
+
+These QML files automatically become available as new QML element types
to other QML components and applications in the same directory.
For example, here we show how a component named "Box" is defined and used
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index e5c1d328e4..4c4a31771c 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -67,7 +67,12 @@ item and thus subsequently be \l {QEvent::ignore()}{ignored}.
\code
Item {
Item {
- Keys.onPressed: if (event.key == Qt.Key_A) { console.log('Key A was pressed'); event.accepted = true }
+ Keys.onPressed: {
+ if (event.key == Qt.Key_A) {
+ console.log('Key A was pressed');
+ event.accepted = true;
+ }
+ }
Rectangle {}
}
}
@@ -291,28 +296,7 @@ print the name of the current list item.
\table
\row
-\o \code
-Rectangle {
- color: "lightsteelblue"; width: 240; height: 320
-
- ListView {
- id: myView; anchors.fill: parent; focus: true
- model: ListModel {
- ListElement { name: "Bob" }
- ListElement { name: "John" }
- ListElement { name: "Michael" }
- }
- delegate: FocusScope {
- width: contents.width; height: contents.height
- Text {
- focus: true
- text: name
- Keys.onReturnPressed: console.log(name)
- }
- }
- }
-}
-\endcode
+\o \snippet doc/src/snippets/declarative/focusscopes.qml 0
\o \image declarative-qmlfocus4.png
\endtable
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index 57eaae7717..3121e9532f 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -49,250 +49,9 @@ Contains all the properties of the JavaScript global object, plus:
\section1 Qt Object
-The Qt object provides useful enums and functions from Qt, for use in all QML
+The \l{Qt}{Qt object} provides useful enums and functions from Qt, for use in all QML
files.
-\section2 Enums
-The Qt object contains all enums in the Qt namespace. For example, you can
-access the AlignLeft member of the Qt::AlignmentFlag enum with \c Qt.AlignLeft.
-
-For a full list of enums, see the \l{Qt Namespace} documentation.
-
-\section2 Types
-The Qt object also contains helper functions for creating objects of specific
-data types. This is primarily useful when setting the properties of an item
-when the property has one of the following types:
-
-\list
-\o Color
-\o Rect
-\o Point
-\o Size
-\o Vector3D
-\endlist
-
-There are also string based constructors for these types, see \l{qdeclarativebasictypes.html}{Qml Types}.
-
-\section3 Qt.rgba(qreal red, qreal green, qreal blue, qreal alpha)
-This function returns a Color with the specified \c red, \c green, \c blue and \c alpha components. All components should be in the range 0-1 inclusive.
-
-\section3 Qt.hsla(qreal hue, qreal saturation, qreal lightness, qreal alpha)
-This function returns a Color with the specified \c hue, \c saturation, \c lightness and \c alpha components. All components should be in the range 0-1 inclusive.
-
-\section3 Qt.rect(int x, int y, int width, int height)
-This function returns a Rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
-\section3 Qt.point(int x, int y)
-This function returns a Point with the specified \c x and \c y coordinates.
-\section3 Qt.size(int width, int height)
-This function returns as Size with the specified \c width and \c height.
-\section3 Qt.vector3d(real x, real y, real z)
-This function returns a Vector3D with the specified \c x, \c y and \c z.
-
-\section2 Formatters
-The Qt object contains several functions for formatting dates and times.
-
-\section3 Qt.formatDate(datetime date, variant format)
-This function returns the string representation of \c date, formatted according to \c format.
-\section3 Qt.formatTime(datetime time, variant format)
-This function returns the string representation of \c time, formatted according to \c format.
-\section3 Qt.formatDateTime(datetime dateTime, variant format)
-This function returns the string representation of \c dateTime, formatted according to \c format.
-
-\c format for the above formatting functions can be specified as follows.
-
- These expressions may be used for the date:
-
- \table
- \header \i Expression \i Output
- \row \i d \i the day as number without a leading zero (1 to 31)
- \row \i dd \i the day as number with a leading zero (01 to 31)
- \row \i ddd
- \i the abbreviated localized day name (e.g. 'Mon' to 'Sun').
- Uses QDate::shortDayName().
- \row \i dddd
- \i the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
- Uses QDate::longDayName().
- \row \i M \i the month as number without a leading zero (1-12)
- \row \i MM \i the month as number with a leading zero (01-12)
- \row \i MMM
- \i the abbreviated localized month name (e.g. 'Jan' to 'Dec').
- Uses QDate::shortMonthName().
- \row \i MMMM
- \i the long localized month name (e.g. 'January' to 'December').
- Uses QDate::longMonthName().
- \row \i yy \i the year as two digit number (00-99)
- \row \i yyyy \i the year as four digit number
- \endtable
-
- These expressions may be used for the time:
-
- \table
- \header \i Expression \i Output
- \row \i h
- \i the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
- \row \i hh
- \i the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
- \row \i m \i the minute without a leading zero (0 to 59)
- \row \i mm \i the minute with a leading zero (00 to 59)
- \row \i s \i the second without a leading zero (0 to 59)
- \row \i ss \i the second with a leading zero (00 to 59)
- \row \i z \i the milliseconds without leading zeroes (0 to 999)
- \row \i zzz \i the milliseconds with leading zeroes (000 to 999)
- \row \i AP
- \i use AM/PM display. \e AP will be replaced by either "AM" or "PM".
- \row \i ap
- \i use am/pm display. \e ap will be replaced by either "am" or "pm".
- \endtable
-
- All other input characters will be ignored. Any sequence of characters that
- are enclosed in singlequotes will be treated as text and not be used as an
- expression. Two consecutive singlequotes ("''") are replaced by a singlequote
- in the output.
-
- Example format strings (assumed that the date and time is 21 May 2001
- 14:13:09):
-
- \table
- \header \i Format \i Result
- \row \i dd.MM.yyyy \i 21.05.2001
- \row \i ddd MMMM d yy \i Tue May 21 01
- \row \i hh:mm:ss.zzz \i 14:13:09.042
- \row \i h:m:s ap \i 2:13:9 pm
- \endtable
-
-If no format is specified the locale's short format is used. Alternatively, you can specify
-\c Qt.DefaultLocaleLongDate to get the locale's long format.
-
-\section2 Functions
-The Qt object also contains the following miscellaneous functions which expose Qt functionality for use in QML.
-
-\section3 Qt.lighter(color baseColor)
-This function returns a color 50% lighter than \c baseColor. See QColor::lighter() for further details.
-\section3 Qt.darker(color baseColor)
-This function returns a color 50% darker than \c baseColor. See QColor::darker() for further details.
-\section3 Qt.tint(color baseColor, color tintColor)
- This function allows tinting one color with another.
-
- The tint color should usually be mostly transparent, or you will not be able to see the underlying color. The below example provides a slight red tint by having the tint color be pure red which is only 1/16th opaque.
-
- \qml
- Rectangle { x: 0; width: 80; height: 80; color: "lightsteelblue" }
- Rectangle { x: 100; width: 80; height: 80; color: Qt.tint("lightsteelblue", "#10FF0000") }
- \endqml
- \image declarative-rect_tint.png
-
- Tint is most useful when a subtle change is intended to be conveyed due to some event; you can then use tinting to more effectively tune the visible color.
-
-\section3 Qt.openUrlExternally(url target)
-This function attempts to open the specified \c target url in an external application, based on the user's desktop preferences. It will return true if it succeeds, and false otherwise.
-
-\section3 Qt.md5(data)
-This function returns a hex string of the md5 hash of \c data.
-
-\section3 Qt.btoa(data)
-Binary to ASCII - this function returns a base64 encoding of \c data.
-
-\section3 Qt.atob(data)
-ASCII to binary - this function returns a base64 decoding of \c data.
-
-\section3 Qt.quit()
-This function causes the QML engine to emit the quit signal, which in
-\l {Qt Declarative UI Runtime}{qml} causes the runtime to quit.
-
-\section3 Qt.resolvedUrl(url)
-This function returns \c url resolved relative to the URL of the
-caller.
-
-\section3 Qt.isQtObject(object)
-Returns true if \c object is a valid reference to a Qt or QML object, otherwise false.
-
-\section1 Dynamic Object Creation
-The following functions on the global object allow you to dynamically create QML
-items from files or strings. See \l{Dynamic Object Management} for an overview
-of their use.
-
-\section2 createComponent(url file)
- This function takes the URL of a QML file as its only argument. It returns
- a component object which can be used to create and load that QML file.
-
- Example QML script is below. Remember that QML files that might be loaded
- over the network cannot be expected to be ready immediately.
- \code
- var component;
- var sprite;
- function finishCreation(){
- if(component.isReady()){
- sprite = component.createObject();
- if(sprite == null){
- // Error Handling
- }else{
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- }else if(component.isError()){
- // Error Handling
- }
- }
-
- component = createComponent("Sprite.qml");
- if(component.isReady()){
- finishCreation();
- }else{
- component.statusChanged.connect(finishCreation);
- }
- \endcode
-
- If you are certain the files will be local, you could simplify to
-
- \code
- component = createComponent("Sprite.qml");
- sprite = component.createObject();
- if(sprite == null){
- // Error Handling
- console.log(component.errorsString());
- }else{
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- \endcode
-
- The methods and properties of the Component element are defined in its own
- page, but when using it dynamically only two methods are usually used.
- Component.createObject() returns the created object or null if there is an error.
- If there is an error, Component.errorsString() describes what the error was.
-
- If you want to just create an arbitrary string of QML, instead of
- loading a QML file, consider the createQmlObject() function.
-
-\section2 createQmlObject(string qml, object parent, string filepath)
- Creates a new object from the specified string of QML. It requires a
- second argument, which is the id of an existing QML object to use as
- the new object's parent. If a third argument is provided, this is used
- for error reporting as the filepath that the QML came from.
-
- Example (where targetItem is the id of an existing QML item):
- \code
- newObject = createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
- targetItem, "dynamicSnippet1");
- \endcode
-
- This function is intended for use inside QML only. It is intended to behave
- similarly to eval, but for creating QML elements.
-
- Returns the created object, or null if there is an error. In the case of an
- error, a QtScript Error object is thrown. This object has the additional property,
- qmlErrors, which is an array of all the errors encountered when trying to execute the
- QML. Each object in the array has the members: lineNumber, columnNumber, fileName and message.
-
- Note that this function returns immediately, and therefore may not work if
- the QML loads new components. If you are trying to load a new component,
- for example from a QML file, consider the createComponent() function
- instead. 'New components' refers to external QML files that have not yet
- been loaded, and so it is safe to use createQmlObject to load built-in
- components.
-
\section1 XMLHttpRequest
\target XMLHttpRequest
@@ -382,7 +141,7 @@ of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases.
The API can be used from JavaScript functions in your QML:
-\quotefile declarative/sql/hello.qml
+\snippet declarative/sqllocalstorage/hello.qml 0
The API conforms to the Synchronous API of the HTML5 Web Database API,
\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index 0051f091bc..728eb1389a 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -81,7 +81,7 @@ of simple and dynamic elements.
\section2 Adding QML widgets to a QGraphicsScene
-If you have an existing UI based on the \l{The Graphics View Framework}{Graphics View Framework},
+If you have an existing UI based on the \l{Graphics View Framework},
you can integrate QML widgets directly into your QGraphicsScene. Use
QDeclarativeComponent to create a QGraphicsObject from a QML file, and
place the graphics object into your scene using \l{QGraphicsScene::addItem()}, or
@@ -110,51 +110,11 @@ of QML UIs:
\section2 Loading QGraphicsWidget objects in QML
An alternative approach is to expose your existing QGraphicsWidget objects to
-QML and construct your scene in QML instead. To do this, you need to register
-any custom C++ types and create a plugin that registers the custom types
-so that they can be used from your QML file.
+QML and construct your scene in QML instead. See the \l {declarative-cppextensions-qgraphicslayouts.html}{graphics layouts example}
+which shows how to expose Qt's graphics layout classes to QML in order
+to use QGraphicsWidget with classes like QGraphicsLinearLayout and QGraphicsGridLayout.
-Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle,
-that both inherit from QGraphicsWidget:
-
-\c [graphicswidgets/redsquare.h]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h 0
-
-\c [graphicswidgets/bluecircle.h]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h 0
-
-Then, create a plugin by subclassing QDeclarativeExtensionPlugin, and register the
-types by calling qmlRegisterType(). Also export the plugin with Q_EXPORT_PLUGIN2.
-
-\c [graphicswidgets/shapesplugin.cpp]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp 0
-
-Now write a project file that creates the plugin:
-
-\c [graphicswidgets/graphicswidgets.pro]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
-
-And add a \c qmldir file that includes the \c graphicswidgets plugin from the \c lib
-subdirectory (as defined in the project file):
-
-\c [graphicswidgets/qmldir]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
-
-Now, we can write a QML file that uses the \c RedSquare and \c BlueCircle widgets.
-(As an example, we can also create \c QGraphicsWidget items if we import the \c Qt.widgets
-module.)
-
-\c [main.qml]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
-
-Here is a screenshot of the result:
-
-\image declarative-integrating-graphicswidgets.png
-
-
-Note this approach of creating your graphics objects from QML does not work
-with QGraphicsItems that are not QGraphicsObject-based, since they are not QObjects.
-
-See \l{Extending QML in C++} for further information on using C++ types.
+To expose your existing QGraphicsWidget classes to QML, use \l {qmlRegisterType()}.
+See \l{Extending QML in C++} for further information on using C++ types in QML.
*/
diff --git a/doc/src/declarative/pics/anchorchanges.png b/doc/src/declarative/pics/anchorchanges.png
new file mode 100644
index 0000000000..4973e4e9aa
--- /dev/null
+++ b/doc/src/declarative/pics/anchorchanges.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview-highlight.png b/doc/src/declarative/pics/gridview-highlight.png
new file mode 100644
index 0000000000..b54af37f93
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-highlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview-simple.png b/doc/src/declarative/pics/gridview-simple.png
new file mode 100644
index 0000000000..a102939f2b
--- /dev/null
+++ b/doc/src/declarative/pics/gridview-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/gridview.png b/doc/src/declarative/pics/gridview.png
deleted file mode 100644
index 37268932d3..0000000000
--- a/doc/src/declarative/pics/gridview.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/declarative/pics/listmodel-nested.png b/doc/src/declarative/pics/listmodel-nested.png
new file mode 100644
index 0000000000..ee7ffba67a
--- /dev/null
+++ b/doc/src/declarative/pics/listmodel-nested.png
Binary files differ
diff --git a/doc/src/declarative/pics/listmodel.png b/doc/src/declarative/pics/listmodel.png
new file mode 100644
index 0000000000..7ab1771f15
--- /dev/null
+++ b/doc/src/declarative/pics/listmodel.png
Binary files differ
diff --git a/doc/src/declarative/pics/trivialListView.png b/doc/src/declarative/pics/listview-highlight.png
index dc5c6b3b57..dc5c6b3b57 100644
--- a/doc/src/declarative/pics/trivialListView.png
+++ b/doc/src/declarative/pics/listview-highlight.png
Binary files differ
diff --git a/doc/src/declarative/pics/listview-simple.png b/doc/src/declarative/pics/listview-simple.png
new file mode 100644
index 0000000000..71a1c5172f
--- /dev/null
+++ b/doc/src/declarative/pics/listview-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/parentchange.png b/doc/src/declarative/pics/parentchange.png
new file mode 100644
index 0000000000..93206fbbb2
--- /dev/null
+++ b/doc/src/declarative/pics/parentchange.png
Binary files differ
diff --git a/doc/src/declarative/pics/rect-border-width.png b/doc/src/declarative/pics/rect-border-width.png
new file mode 100644
index 0000000000..c3c6c2ccb9
--- /dev/null
+++ b/doc/src/declarative/pics/rect-border-width.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater-modeldata.png b/doc/src/declarative/pics/repeater-modeldata.png
new file mode 100644
index 0000000000..6d8df0d9d5
--- /dev/null
+++ b/doc/src/declarative/pics/repeater-modeldata.png
Binary files differ
diff --git a/doc/src/declarative/pics/repeater-simple.png b/doc/src/declarative/pics/repeater-simple.png
new file mode 100644
index 0000000000..6da62951dc
--- /dev/null
+++ b/doc/src/declarative/pics/repeater-simple.png
Binary files differ
diff --git a/doc/src/declarative/pics/translate.png b/doc/src/declarative/pics/translate.png
new file mode 100644
index 0000000000..baf58b0eb6
--- /dev/null
+++ b/doc/src/declarative/pics/translate.png
Binary files differ
diff --git a/doc/src/declarative/pics/visualitemmodel.png b/doc/src/declarative/pics/visualitemmodel.png
new file mode 100644
index 0000000000..5e6d1325b2
--- /dev/null
+++ b/doc/src/declarative/pics/visualitemmodel.png
Binary files differ
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
index 4ff7fdebdb..99dd2d2887 100644
--- a/doc/src/declarative/qdeclarativedebugging.qdoc
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -60,8 +60,35 @@ Rectangle {
\section1 Debugging Transitions
When a transition doesn't look quite right, it can be helpful to view it in slow
-motion to see what is happening more clearly. The \l {Qt Declarative UI Runtime}{qml} tool provides a
-"Slow Down Animations" menu option to facilitate this.
+motion to see what is happening more clearly. This functionality is supported
+in the \l {Qt Declarative UI Runtime}{qmlviewer} tool: to enable this,
+click on the "Debugging" menu, then "Slow Down Animations".
+
+
+\section1 Debugging module imports
+
+The \c QML_IMPORT_TRACE environment variable can be set to enable debug output
+from QML's import loading mechanisms.
+
+For example, for a simple QML file like this:
+
+\qml
+import Qt 4.7
+
+Rectangle { width: 100; height: 100 }
+\endqml
+
+If you set \c {QML_IMPORT_TRACE=1} before running the \l {Qt Declarative UI Runtime}{qmlviewer}
+(or your QML C++ application), you will see output similar to this:
+
+\code
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/imports"
+QDeclarativeImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
+QDeclarativeImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
+QDeclarativeImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
+QDeclarativeImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
+\endcode
+
\section1 Debugging with Qt Creator
diff --git a/doc/src/declarative/qdeclarativedocument.qdoc b/doc/src/declarative/qdeclarativedocument.qdoc
index bc099ced80..833651243f 100644
--- a/doc/src/declarative/qdeclarativedocument.qdoc
+++ b/doc/src/declarative/qdeclarativedocument.qdoc
@@ -96,9 +96,6 @@ Once created, instances are not dependent on the component that created them, so
operate on independent data. Here is an example of a simple "Button" component that is
instantiated four times, each with a different value for its \c text property.
-\table
-\row
-\o
\raw HTML
<table><tr><td>
\endraw
@@ -125,10 +122,19 @@ BorderImage {
\raw HTML
</td> </tr> </table>
\endraw
-\endtable
-In addition to the top-level component that all QML documents define, documents may also
-include additional \e inline components. Inline components are declared using the
+Any snippet of QML code can become a component, just by placing it in the file "<Name>.qml"
+where <Name> is the new element name, and begins with an uppercase letter. Note that
+the case of all characters in the <Name> are significant on some filesystems, notably
+UNIX filesystems. It is recommended that the case of the filename matches the case of
+the component name in QML exactly, regardless of the platform the QML will be deployed to.
+
+These QML files automatically become available as new QML element types
+to other QML components and applications in the same directory.
+
+In addition to the top-level component that all QML documents define, and any reusable
+components placed in separate files, documents may also
+include \e inline components. Inline components are declared using the
\l Component element, as can be seen in the first example above. Inline components share
all the characteristics of regular top-level components and use the same \c import list as their
containing QML document. Components are one of the most basic building blocks in QML, and are
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index a98c9e17cb..acf4ec91ac 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -60,10 +60,13 @@ technologies like HTML and CSS, but it's not required.
QML looks like this:
\code
+import Qt 4.7
+
Rectangle {
width: 200
height: 200
- color: "white"
+ color: "blue"
+
Image {
source: "pics/logo.png"
anchors.centerIn: parent
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index 91acb3c8e2..109d390e70 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -99,7 +99,8 @@ There are a number of QML elements that operate using data models:
\endlist
QML supports several types of data model, which may be provided by QML
-or C++ (via QDeclarativeContext::setContextProperty(), for example).
+or C++ (via QDeclarativeContext::setContextProperty() or as plugin types,
+for example).
\section1 QML Data Models
@@ -143,6 +144,28 @@ ListView {
}
\endcode
+It is also possible to manipulate the ListModel directly via JavaScript.
+In this case, the first item inserted will determine the roles available
+to any views using the model. For example, if an empty ListModel is
+created and populated via JavaScript the roles provided by the first
+insertion are the only roles that will be shown in the view:
+
+\code
+Item {
+ ListModel {
+ id: fruitModel
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
+ }
+}
+\endcode
+
+When the MouseArea is clicked fruitModel will have two roles, "cost" and "name".
+Even if subsequent roles are added, only the first two will be handled by views
+using the model.
+
\section2 XmlListModel
@@ -188,8 +211,13 @@ will be positioned by the view.
\section1 C++ Data Models
+Models defined in C++ can be made available to QML either from a C++ application or from a
+\l{QDeclarativeExtensionPlugin}{QML C++ plugin}.
+
\section2 QAbstractItemModel
+A model can be defined by subclassing QAbstractItemModel.
+
QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNames() method.
The default role names set by Qt are:
@@ -205,7 +233,18 @@ The default role names set by Qt are:
\o decoration
\endtable
-QAbstractItemModel presents a heirachy of tables. Views currently provided by QML
+The model could be made available to QML either directly:
+
+\code
+QDeclarativeContext *ctxt = view.rootContext();
+MyModel *model = new MyModel; // subclass of QAbstractItemModel
+ctxt->setContextProperty("myModel", model);
+\endcode
+
+or by registering the subclass as a new QML type in
+a \l{QDeclarativeExtensionPlugin}{QML C++ plugin}.
+
+QAbstractItemModel presents a heirachy of tables, but views currently provided by QML
can only display list data.
In order to display child lists of a heirachical model
the VisualDataModel element provides several properties and functions for use
@@ -220,7 +259,7 @@ with models of type QAbstractItemModel:
\section2 QStringList
-QStringList provides the contents of the list via the \e modelData role:
+A model may be a simple QStringList, which provides the contents of the list via the \e modelData role:
\table
\row
@@ -283,7 +322,9 @@ QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
\endcode
-The properties of the object may then be accessed in the delegate:
+The QObject* is available as the \c modelData property. As a convenience,
+the properties of the object are also made available directly in the
+delegate's context:
\code
ListView {
@@ -295,13 +336,18 @@ ListView {
Rectangle {
height: 25
width: 100
- color: model.color
+ color: model.modelData.color
Text { text: name }
}
}
}
\endcode
+Note the use of the fully qualified access to the \c color property.
+The properties of the object are not replicated in the \c model
+object, since they are easily available via the modelData
+object.
+
Note: There is no way for the view to know that the contents of a QList
have changed. If the QList is changed, it will be necessary to reset
the model by calling QDeclarativeContext::setContextProperty() again.
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc
new file mode 100644
index 0000000000..b535e4bb06
--- /dev/null
+++ b/doc/src/declarative/qdeclarativeperformance.qdoc
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qdeclarativeperformance.html
+\title QML Performance
+
+\section1 Opaque Items
+
+Items hidden behind an opaque item incur a cost. If an item will be enitrely
+obscured by an opaque item, set its opacity to 0. One common example of
+this is when a "details" page is shown over the main application view.
+
+\section1 Clipping
+
+\e clip is set to false by default. Enable clipping only when necessary.
+
+\section1 Anchors vs. Binding
+
+It is more efficient to use anchors rather than bindings to position items
+relative to each other. Consider this use of bindings to position rect2
+relative to rect1:
+
+\code
+Rectangle {
+ id: rect1
+ x: 20
+ width: 200; height: 200
+}
+Rectange {
+ id: rect2
+ x: rect1.x
+ y: rect1.y + rect1.height
+ width: rect1.width - 20
+ height: 200
+}
+\endcode
+
+This is achieved more efficiently using anchors:
+
+\code
+Rectangle {
+ id: rect1
+ x: 20
+ width: 200; height: 200
+}
+Rectange {
+ id: rect2
+ height: 200
+ anchors.left: rect1.left
+ anchors.top: rect1.bottom
+ anchors.right: rect1.right
+ anchors.rightMargin: 20
+}
+\endcode
+
+\section1 Images
+
+Images consume a great deal of memory and may also be costly to load. In order
+to deal with large images efficiently it is recommended that the Image::sourceSize
+property be set to a size no greater than that necessary to render it. Beware that
+changing the sourceSize will cause the image to be reloaded.
+
+Images on the local filesystem are usually loaded synchronously. This is usually
+the desired behavior for user interface elements, however for large images that
+do not necessarily need to be visible immediately, set the Image::asynchronous
+property to true. This will load the image in a low priority thread.
+
+\section1 View Delegates
+
+Delegates must be created quickly as the view is flicked. There are two important
+aspects to maintaining a smooth view:
+
+\list
+\o Small delegates - keep the amount of QML to a minimum. Have just enough
+QML in the delegate to display the necessary information. Any additional functionality
+that is only needed when the delegate is clicked, for example, should be created by
+a Loader as needed.
+\o Fast data access - ensure the data model is as fast as possible.
+\endlist
+
+*/
diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc
index fd0c677728..43b5c31746 100644
--- a/doc/src/declarative/qdeclarativestates.qdoc
+++ b/doc/src/declarative/qdeclarativestates.qdoc
@@ -70,58 +70,30 @@ In QML:
\o A state can affect the properties of other objects, not just the object owning the state (and not just that object's children).
\endlist
+To define a state for an item, add a \l State element to the \l{Item::states}{states} property. To
+change the current state of an \l Item, set the \l{Item::state}{state} property to the name
+of the required state.
+
Here is an example of using states. In the default state \c myRect is positioned at 0,0. In the 'moved' state it is positioned at 50,50. Clicking within the mouse area changes the state from the default state to the 'moved' state, thus moving the rectangle.
-\qml
-Item {
- id: myItem
-
- Rectangle {
- id: myRect
- width: 100
- height: 100
- color: "red"
- }
-
- states: [
- State {
- name: "moved"
- PropertyChanges {
- target: myRect
- x: 50
- y: 50
- }
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onClicked: myItem.state = 'moved'
- }
-}
-\endqml
+\snippet doc/src/snippets/declarative/states.qml 0
+\snippet doc/src/snippets/declarative/states.qml 1
State changes can be animated using \l{state-transitions}{Transitions}.
-For example, adding this code to the above \c {Item {}} element animates the transition to the "moved" state:
+For example, adding this code to the above \c Item element animates the transition to the "moved" state:
-\qml
- transitions: [
- Transition {
- NumberAnimation { properties: "x,y"; duration: 500 }
- }
- ]
-\endqml
+\snippet doc/src/snippets/declarative/states.qml transitions
See \l{state-transitions}{Transitions} for more information.
Other things you can do in a state change:
\list
-\o override signal handlers with PropertyChanges
-\o change an item's visual parent with ParentChange
-\o change an item's anchors with AnchorChanges
-\o run some script with StateChangeScript
+\o Override signal handlers with PropertyChanges
+\o Change an item's visual parent with ParentChange
+\o Change an item's anchors with AnchorChanges
+\o Run some script with StateChangeScript
\endlist
*/
diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc
new file mode 100644
index 0000000000..848e094cbc
--- /dev/null
+++ b/doc/src/declarative/qml-intro.qdoc
@@ -0,0 +1,967 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+
+/*!
+
+\page qml-intro.html
+\title Beginning Qt Quick
+
+
+\section1 Overview
+
+
+QML is a high level, scripted language. Its commands, more correctly \e elements,
+leverage the power and efficiency of the Qt libraries to make easy to use
+commands that perform intuitive functions. Draw a rectangle, display an image at
+a position and so on. Behind these elements are complex C++ libraries that
+efficiently perform the action. As with any graphical application, always
+consider that this ability to easily build graphically rich applications means
+that some care may be needed to prevent performance problems.
+
+The language also allows more flexibility of these commands by using
+Javascript rather than C++ to add new layers of logic to your application.
+Javascript is easier to learn than C++ and can be embedded into the QML
+files or imported from a separate file.
+
+\bold{In QML the types of various 'objects' are referred to as \l {QML
+Elements}{ elements}}.
+
+An element usually has various \e properties that help define the element. For
+example, if we created an element called Circle then the radius of the circle
+would be a property.
+
+
+\section1 A First Look
+
+The basic syntax of an \l {QML Elements}{element} is
+
+ \code
+ SomeElement {
+ id: myObject
+ ... some other things here ...
+ }
+ \endcode
+
+Here we are defining a new object. We specify its 'type' first as SomeElement.
+Then within matching braces { ... } we specify the various parts of our
+element.
+
+The \c id is a unique identifier for the element, it must start with a lower
+case letter and only contain letters, numbers and underscores. It is this
+particular object's name. If this SomeElement \l {QML Elements}{element} was
+a Rectangle instead and it was one of many then the \e optional unique id
+would allow us to manipulate each element individually.
+
+Each visual element is ultimately based on, or inherits from, an element
+called \l Item. \l Item has certain properties and actions that may be
+useful. The properties have default values so you need only specify the
+ones you will need.
+
+Take a simple element such as a \l Rectangle. It has an \c id, we will call
+it \e myRectangle, it has a \c width and a \c height. Imagine that we
+want a rectangle that is 500 pixels by 400 pixels in the x and y directions
+(horizontal by vertical).
+
+We can implement this \l Rectangle with these properties this way
+
+ \code
+ import Qt 4.7
+
+ // This is a comment. And below myRectangle is defined.
+ Rectangle {
+ id: myRectangle
+ width: 500
+ height: 400
+ }
+ \endcode
+
+This is a valid QML script. To run it, copy it and save it to a file, say
+myexample.qml, and on the command line run the command
+
+ \code
+ qml myexample.qml
+ \endcode
+
+It will create a very boring rectangle in its own window.
+
+
+
+\section1 Hello World!
+
+We can now add some color and text to make a Hello World QML program.
+
+\l Rectangle has the property \l {Rectangle::color}{color} to produce a
+background color.
+
+Text is handled by a different element called \l Text. We need to create a
+\l Text object inside the \l Rectangle and set its \l {Text::text}{text}
+property to "Hello World!". So to set the text to 'Hello world' and the
+background colour to light gray,
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: myRectangle
+ width: 500
+ height: 400
+
+ Text { text: "Hello World!" }
+
+ color: "lightgray"
+ }
+ \endcode
+
+
+\section1 Hello World Again
+
+From now on we will not always show the import statement for Qt but it
+should still be there when you create your QML scripts.
+
+To make our Hello World example a little nicer set the position of the text
+to be at pixel position x = 100, y = 100 within the displayed window. This
+position belongs to the \l Text element so we set the position inside its
+definition. Note that we separate different QML statements on the same line
+with a semi-colon, or we could have simply put each statement on a new line
+
+ \code
+ Text {
+ text: "<h2>Hello World</h2>"; color: "darkgreen"
+ x: 100; y:100
+ }
+ \endcode
+
+Not only did we reposition the text, but the text was altered by adding
+HTML tags to change the font size. The text color was also changed from the
+default black to dark green by using a standard string for the color's SVG
+name.
+
+We could also have used a hexadecimal string for the RGB (red-green-blue, as
+#rrggbb) values of the color similar to the method used in HTML. For
+example, mostly blue with a green tint,
+
+ \code
+ Text {
+ text: "<h1>Hello world again</h1>"
+ color: "#002288"
+ x: 100; y: 100
+ }
+ \endcode
+
+All of these changes occurred within the \l Text object which is the scope
+of these property changes.
+
+Other objects may use the information but it belongs to the element where
+the property has been defined.
+
+
+\section1 Images
+
+To add an image to our little application we use the \l Image element. An
+\l Image uses a path to an image file, and has properties to control
+the aspect ratio, the image size, to tile the area amongst others. The
+source of the image, the path to the file, is a URL. Therefore the file can
+be local: \e {mydir/myimage1.png}. Or it can be remote:
+\e {"http://www.example.com/images/myimage1.png"}.
+
+ \code
+ Image {
+ source: "images/qt-logo.png"
+ }
+ \endcode
+
+This displays the image, as we would expect, at the top left of the window.
+The position of the default x = 0, y = 0 coordinate. The example here uses
+a PNG file, but it could have been one of various supported formats,
+including JPG and GIF.
+
+Let us reposition the image and enlarge it. Place it at the same 'x' offset
+as the "Hello world again" text, but put it another 50 pixels below the
+text, also make it 150 by 150 pixels in size,
+
+ \code
+ Image {
+ source: "images/qt-logo.png"
+ x: 100; y: 150
+ width: 150; height: 150
+ }
+ \endcode
+
+Adding the Hello World example, with the text and the image example we can
+write a simple piece of QML that starts to look a bit better.
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: myRectangle
+ width: 500
+ height: 400
+
+ // A light gray background
+ color: "lightgray"
+
+ // Position and color some text
+ Text {
+ text: "<h1>Hello world again</h1>"
+ color: "darkgreen"
+ x: 100; y: 100
+ }
+
+ // Using the opportunity to resize the image.
+ Image {
+ source: "images/qt-logo.png"
+ x: 100; y: 150
+ width: 150; height: 150
+ }
+
+ }
+ \endcode
+
+The result is still quite simple
+
+\image qml-intro-helloa.png
+
+
+\section1 Anchors: Aligning Elements
+
+Using absolute positioning, such as saying x = 100 and y = 150, works well
+until the user or developer stretches or increases the size of the window.
+Then the positions need to be recalculated. What would be nice would be a
+relative means of positioning of objects in a window or rectangle. For
+example, we want to place an image at the bottom of a rectangle, we would
+like to specify the image's location as the 'bottom of the window', not a
+specific coordinate. We can do this with the anchors property, which
+objects inherit from Item.
+
+The anchors property is really a property group. It is a collection of
+related properties. It has properties within it which can be used by means
+of the dot notation.
+
+The dot notation uses object \c{id}s and property names to use a particular
+object or property. Say I have a rectangle r1, which contains a rectangle
+r2, which contains an Item item1, which has an 'x' property I want to
+change. I just use the dot notation to identify it: r1.r2.item1.x
+
+If we want to position an image at the bottom of the rectangle it is
+inside. I have to specify that the bottom of the image is also at the
+bottom of the rectangle
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: myWin
+ width: 500
+ height: 400
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ width: 150; height: 150
+ anchors.bottom: myWin.bottom
+ }
+ }
+ \endcode
+
+This places the logo at the bottom left of the window.
+
+\image qml-intro-anchors1.png "A simple anchor"
+
+We would like it centered and not touching the bottom of the window, for
+aesthetic reasons. For the centering we use the horizontalCenter property,
+and to prevent the touching of the image to the bottom of the rectangle,
+the bottomMargin property is used. So the new actions for the script are
+
+ \list
+ \o set the bottom of the image (anchors.bottom) to be the bottom of the window
+ \o move the image to be in the horizontal center of the window
+ \o set a margin of 10 pixels so that the image does not touch the bottom window border
+ \endlist
+
+Encoded into QML the script becomes
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: myWin
+ width: 500
+ height: 400
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ width: 150; height: 150
+ anchors.bottom: myWin.bottom
+ anchors.horizontalCenter: myWin.horizontalCenter
+ anchors.bottomMargin: 10
+ }
+ }
+ \endcode
+
+
+Run this and resize the window. You will see that now the position of the
+image adjusts during the resize.
+
+\image qml-intro-anchors2.png "Image Centered at the Bottom"
+
+You can also add another object say a block of descriptive text and place
+it above or below the image or to the side. This code places some text just
+above the image
+
+ \code
+ Text {
+ text: "<h2>The Qt Logo</h2>"
+ anchors.bottom: image1.top
+ anchors.horizontalCenter: myWin.horizontalCenter
+ anchors.bottomMargin: 15
+ }
+ \endcode
+
+\image qml-intro-anchors3.png
+
+\note \e anchors is a property group, to be used within the object. When
+referencing these properties from another object we use the property
+directly, instead of saying:
+
+ \code
+ myRectangle.anchors.top // Wrong
+ \endcode
+
+we use
+
+ \code
+ myRectangle.top // Correct
+ \endcode
+
+
+
+
+\section1 Transformations
+
+We can transform a graphical object to get additional effects. Rotate a
+piece of text by 180 degrees to display upside-down text. Rotate an image
+by 90 degrees to lay it on its side. These transformations require
+additonal information.
+
+For rotation, the additional information includes: the origin relative to
+the object being rotated, the axis of rotation, and the angle in degrees to
+rotate the image through in a clockwise direction. The axis does not have
+to be the z-axis, the line between your eyes and the image, it could be
+along the vertical y-axis or the horizontal x-axis. We have three
+dimensions to play with. For simplicity in this example we will rotate
+about the z-axis by 90 degrees in a negative direction, anti-clockwise.
+
+Rotation of text was also suggested. It could also be useful to scale the
+text. We can do both. The \l {Item::transform}{transform} property is a
+\e list of \l Transform elements, so using the list syntax
+
+ \code
+ myList: [ listElement1, listElement2, ... } ]
+ \endcode
+
+we can produce a list of transformations.
+
+The text will be rotated by 45 degrees anti-clockwise and scaled
+vertically by a factor of 1.5 and by 1.2 horizontally.
+
+Using the example above as the basis for this we have,
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: myWin
+ width: 500
+ height: 400
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ width: 150; height: 150
+ anchors.bottom: myWin.bottom
+ anchors.horizontalCenter: myWin.horizontalCenter
+ anchors.bottomMargin: 10
+
+ transform: Rotation {
+ origin.x: 75; origin.y: 75
+ axis{ x: 0; y: 0; z:1 } angle: -90
+ }
+
+ }
+
+ Text {
+ text: "<h2>The Qt Logo -- taking it easy</h2>"
+ anchors.bottom: image1.top
+ anchors.horizontalCenter: myWin.horizontalCenter
+ anchors.bottomMargin: 15
+
+ transform: [
+ Scale { xScale: 1.5; yScale: 1.2 } ,
+
+ Rotation {
+ origin.x: 75; origin.y: 75
+ axis{ x: 0; y: 0; z:1 } angle: -45
+ }
+ ]
+ }
+ }
+ \endcode
+
+The code block in \c image1 starting with \c transform specifies that the
+\l {Item::transform}{transform} property will be a Rotation through -90
+degrees, which is anti-clockwise, about the z-axis running through the
+center of the image at (75,75), since the image is 150 x 150 pixels.
+
+The other transformation available is \l Translate. This produces a change
+in position of the item.
+
+\note In a list of transformations the order of the transformations is
+important. In the above example try swapping around the Scale transform with
+the Rotation transform, remember to remove or add the comma. The results are
+acceptable for our little test but not the same.
+
+
+\section1 Animations
+
+Animation in QML is done by animating properties of objects. Properties
+that are numbers, colors, Rectangles, points and directions. In QML these
+are \l {QML Basic Types} named as real, int, color, rect, point, size, and
+vector3d. There are a number of different ways to do animation. Here we
+will look at a few of them.
+
+\section2 Number Animation
+
+Previously we have used a rotation transformation to change the orientation
+of an image. We could easily animate this rotation so that instead of a
+straight rotation counter-clockwise of 90 degrees we could rotate the image
+through a full 360 degrees in an animation. The axis of rotation wont
+change, the position of the center of the image will not change, only the
+angle will change. Therefore, a NumberAnimation of a rotation's angle should
+be enough for the task. If we wish for a simple rotation about the center
+of the image then we can use the \c rotation property that is inherited
+from \l Item. The rotation property is a real number that specifies the
+angle in a clockwise direction for the rotation of the object. Here is the
+code for our animated rotating image.
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: mainRec
+ width: 600
+ height: 400
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ x: 200; y: 100
+ width: 100; height: 100
+
+ // Animate a rotation
+ transformOrigin: Item.Center
+ NumberAnimation on rotation {
+ from: 0; to: 360
+ duration: 2000
+ loops: Animation.Infinite
+ }
+ }
+ }
+ \endcode
+
+The \c {transformOrigin: Item.Center} is redundant since this is the default
+axis of rotation anyway. But if you change \c Center to \c BottomRight you
+will see an interesting variation.
+
+Also if instead the \l Rotation transformation had been used then we would have
+more control over the various parameters. We could vary the axis, to be not
+just a different offset from the z-axis but along the y-axis, x-axis or
+combination. For example, if the task had been to animate the rotation
+about the y-axis passing through the center of the image then the following
+code would do it.
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: mainRec
+ width: 600
+ height: 400
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ x: 200; y: 100
+ width: 100; height: 100
+
+ // Animate a rotation
+ transform: Rotation {
+ origin.x: 50; origin.y: 50; axis {x:0; y:1; z:0} angle:0
+ NumberAnimation on angle {
+ from: 0; to: 360;
+ duration: 3000;
+ loops: Animation.Infinite
+ }
+ }
+ }
+ }
+ \endcode
+
+Here there is a rectangle 600 by 400 pixels. Placed within that rectangle
+is an image 100 by 100 pixels. It is rotated about the center of the image
+about the y-axis so that it looks as if it is rotating about an invisible
+vertical string holding it up. The time it takes to complete the rotation is 3
+seconds (3,000 milliseconds). The NumberAnimation is applied to the angle
+taking it from 0 (no change) to 360 degrees, back where it started.
+Strictly speaking it isn't necessary to go from 0 to 360 since the same
+location is duplicated, but it makes it easier to read in this example and
+it has no visible effect on the animation. The number of loops that the
+animation will execute is set to \c {Animation.Infinite} which means that the
+animation is in an endless loop.
+
+To see an interesting variation. Change the axis to \c {axis { x:1; y:1; z:1
+}}. This is a line coming from the center of the image downwards to the
+right and out of the screen. Although the change is simple the rotation
+seems complex.
+
+\section2 Sequential Animation
+
+For a more complex animation we will need two images. The first image will
+be placed at the center of a window (Rectangle) and the second image will
+be at the upper left of the window. The animation will move the second
+image from the top left of the window to the bottom right. In doing so we
+will be animating the position and the size of the image.
+
+First create two images
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: mainRec
+ width: 600
+ height: 400
+ z: 0
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ x: 20; y: 20 ; z: 1
+ width: 100; height: 100
+ }
+
+ Image {
+ id: image2
+ source: "images/qt-logo.png"
+ width: 100; height: 100
+ x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2
+ z: 2
+ }
+ }
+ \endcode
+
+We will add to 'image1' a SequentialAnimation from x = 20 to the target of
+x = 450. The 'from' values will be used because we will be repeating the
+animation, so the object needs to know where the original position is, both
+x and y. The SequentialAnimation of x will set it to repeat by indicating
+that the number of animation loops is infinite, meaning that the 'loop'
+counter will be set to a value Animation.Infinite that indicates an endless
+cycle. Also there will be a NumberAnimation to vary the numeric property
+between the x values and over a given duration. After the NumberAnimation
+there will be a PauseAnimation that will pause the animation for 500
+milliseconds (half a second) simply for the visual effect.
+
+ \code
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation { from: 20; to: 450; easing.type: "InOutQuad";
+duration: 2000 }
+ PauseAnimation { duration: 500 }
+ }
+ \endcode
+
+A similar block of code is written for the animation of the 'y' value of
+the position.
+
+We will also animate the scale of the object, so as it goes from top left
+to bottom right of the window it will become smaller until about midway,
+and then become larger. To complete the animation we will set the 'z'
+values of the images. 'z' is the stacking order, the z-axis effectively
+points out from the screen to your eyes with the default value of 'z' being
+0. So if we set the Rectangle to have z with value zero, just to be sure,
+and image1 to 1 and image2 to 2 then image2 will be in the foreground and
+image1 in the background. When image1 passes image2 it will pass behind it.
+The completed code looks like
+
+ \code
+ Rectangle {
+ id: mainRec
+ width: 600
+ height: 400
+ z: 0
+
+ Image {
+ id: image2
+ source: "images/qt-logo.png"
+ width: 100; height: 100
+ x: (mainRec.width - 100)/2; y: (mainRec.height - 100)/2
+ z: 2
+ }
+
+ Image {
+ id: image1
+ source: "images/qt-logo.png"
+ x: 20; y: 20 ; z: 1
+ width: 100; height: 100
+
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 20; to: 450
+ easing.type: "InOutQuad"; duration: 2000
+ }
+ PauseAnimation { duration: 500 }
+ }
+
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 20; to: 250
+ easing.type: "InOutQuad"; duration: 2000
+ }
+ PauseAnimation { duration: 500 }
+ }
+
+ SequentialAnimation on scale {
+ loops: Animation.Infinite
+ NumberAnimation { from: 1; to: 0.5; duration: 1000 }
+ NumberAnimation { from: 0.5; to: 1; duration: 1000 }
+ PauseAnimation { duration: 500 }
+ }
+ }
+ }
+ \endcode
+
+The \c {easing.type} has many options, expressed as a string. It specifies the
+kind of equation that describes the acceleration of the property value, not
+necessarily position, over time.
+
+For example, \e InOutQuad means that at the start and the end of the animation the
+'velocity' is low but the acceleration or deceleration is high. Much like a car
+accelerating from stop, and decelerating to stop at the end of a journey,
+with the maximum speed being in the middle. Examine the \l {PropertyAnimation::easing.type}
+{easing} documentation and the various graphs that show the effect. The horizontal
+axis, 'progress', can be thought of as time. The vertical axis is the value
+of the particular property.
+
+In discussing animation we need to describe three objects: State, MouseArea
+and Signals. Although independent of the animation elements, animation
+delivers some of the best examples that illustrate these new elements.
+
+
+
+\section2 Animation Summary
+
+\table
+ \header
+ \o Name
+ \o Description
+ \row
+ \o PropertyAnimation
+ \o a property value on a target object is varied to a specified value over a given time.
+
+ \row
+ \o NumberAnimation
+ \o animate a numeric property from one value to another over a given time.
+
+ \row
+ \o PauseAnimation
+ \o results in the task waiting for the specified duration, in milliseconds.
+
+ \row
+ \o SequentialAnimation
+ \o allows us to list in order the animation events we want to occur, first A then B then C and so on.
+
+ \row
+ \o ParallelAnimation
+ \o enables us to run different animations at the same time instead of sequentially.
+
+\endtable
+
+
+
+
+
+\section1 Using States
+
+A state is a defined set of values in the configuration of an object and
+often depends on the previous state. For example, a glass could be in a
+state we call 'HalfFull' if it is being filled with a liquid and has
+reached half of its total capacity. We could also have a state called
+HalfEmpty which is the state that occurs when the amount of liquid drops to
+half of the glass's capacity. Both states represent the same amount of
+liquid, but we consider them different. Likewise, states in a program
+represent not just values but may include how the current values were
+reached.
+
+When a state changes a \e transition occurs. This is an opportunity to make
+changes or take actions that depend on the movement to the new state. For
+example, if we had a scene in the country where the state variable has two
+states "daylight" and "night". Then when the state changes to "night" at
+this transition the sky would be made dark, stars would be shown, the
+countryside would be darkened. And when the state changes to "daylight" the
+opposite changes would be made: the sky is now blue, the scenery is green,
+there is a sun in the sky.
+
+Here is a simple QML program that shows the change of state in the above
+example. We have two rectangles, the top one is the 'sky' and the bottom
+one is the 'ground'. We will animate the change from daylight to night.
+There will be two states, but we only need to define one since 'daylight'
+will be the default state. We will just go to 'night' by clicking and
+holding the left mouse button down, releasing the mouse button will reverse
+the process
+
+ \code
+ import Qt 4.7
+
+ Rectangle {
+ id: mainRectangle
+ width: 600
+ height: 400
+ color: "black"
+
+ Rectangle {
+ id: sky
+ width: 600
+ height: 200
+ y: 0
+ color: "lightblue"
+ }
+
+ Rectangle {
+ id: ground
+ width: 600; height: 200
+ y: 200
+ color: "green"
+ }
+
+ MouseArea {
+ id: mousearea
+ anchors.fill: mainRectangle
+ }
+
+ states: [ State {
+ name: "night"
+ when: mousearea.pressed == true
+ PropertyChanges { target: sky; color: "darkblue" }
+ PropertyChanges { target: ground; color: "black" }
+ },
+ State {
+ name: "daylight"
+ when: mousearea.pressed == false
+ PropertyChanges { target: sky; color: "lightblue" }
+ PropertyChanges { target: ground; color: "green" }
+ }
+ ]
+
+ transitions: [ Transition {
+ from: "daylight"; to: "night"
+ ColorAnimation { duration: 1000 }
+ },
+ Transition {
+ from: "night"; to: "daylight"
+ ColorAnimation { duration: 500 }
+ }
+ ]
+ }
+ \endcode
+
+Several new things appear in this sample. Firstly, we use a \l MouseArea
+element to detect mouse clicks in the \e mainRectangle. Secondly, we use
+the list notation [ thing1 , thing2, ... ] to build a list of states and a
+list of transitions.
+
+\l MouseArea defines a region that will respond to mouse clicks. In this case
+we are only concerned with when the mouse is pressed or not pressed, not
+the particular button or other details. The area of the MouseArea is the
+entire main window, mainRectangle, so that clicking anywhere in this region
+will start the animation. Since we are using the 'pressed' mouse state,
+then the animation will move from 'daylight' to 'night' only while the mouse
+button remains pressed.
+
+When the button is released the 'daylight' state is entered and the
+transition from 'night' to 'daylight' is triggered causing the animation to
+run. The transition specifies the duration in milliseconds of the
+ColorAnimation, while the state specifies the color of the new state.
+
+The PropertyChanges command is the way that we nominate which properties
+will change in a change of state, and what new value the property will
+take. Since, for example, we want the 'sky' region to turn to dark blue and
+the 'ground' region to turn to black for the 'night' state, then the
+rectangles for those regions are the 'target' and the property in the target
+is 'color'.
+
+
+\section1 Signals
+
+Signals are simply events that can be hooked up to actions we want performed.
+In QML they are usually preceded by the word 'on', for example in the animation
+using a MouseArea the signal was \l {MouseArea::onPressed}{onPressed}. If
+you look at the C++ documentation you will see a lot of talk about
+\l {Signals & Slots}{Signals and Slots}. Signals are connected to Slots. The
+signal represents an event and the Slot is the function that does something
+based on that event. You can also have Signals connected to other Signals, so
+that one Signal (event) triggers another Signal (event), and so forth. It is
+nice to know this is what happens beneath the QML layer but not essential for
+using QML.
+
+Most elements do not have Signals associated with them. However, a few like
+the \l Audio element have many signals. Some of the \l Audio signals are
+used to represent events such as when the audio is stopped, play is pressed,
+paused, and reaching the end of the media. They allow the developer to connect,
+ for example, the press of a user interface button (perhaps a MouseArea) to
+ some QML that will handle this event.
+
+
+\section1 Analyzing An Example: Dial Control
+
+In the Qt \e {examples/declarative/ui-components} folder you will find a folder
+\e {dialcontrol} which contains the \e dialcontrol example.
+
+\image qml-dial.png "QML Dial example with Slider"
+
+In essence this small application has a sliding bar that you can slide using
+a mouse, and a graphical dial that responds to the position of the slider.
+
+The code for the example is in two parts: Dial.qml and dialcontrol.qml.
+
+\e {Dial.qml} can be found in the \e content sub-directory. It defines a \c Dial
+component similar to an odometer. Eventually, the example will hook up a slider
+component so that moving the slider will change the position of a needle on the
+dial.
+
+The code for the \c Dial, identified by the name of the file, contains four images
+in overlapping order: the background (numbers and divisions), the shadow of the
+needle, the needle itself, and finally the 'glass' overlay (containing
+transparent layers).
+
+The \c needle_shadow.png image has a \l Rotation assigned to the \e transform
+attribute of the \l Image. The rotation is set to match the angle of the needle
+image angle value \e {needleRotation.angle}. Both the needle and the
+needle_shadow have the same default \e x and \e y values but the rotation origin
+for the needle is slightly different so that a shadow will be evident as the
+needle moves.
+
+\snippet ../../examples/declarative/ui-components/dialcontrol/content/Dial.qml needle_shadow
+
+And the needle
+
+\snippet ../../examples/declarative/ui-components/dialcontrol/content/Dial.qml needle
+
+The final image is the overlay which simply has a position defined.
+
+\snippet ../../examples/declarative/ui-components/dialcontrol/content/Dial.qml overlay
+
+\e {dialcontrol.qml} in the \e {examples/declarative/ui-components/dialcontrol} directory is the
+main file of the example. It defines the visual environment that the Dial
+will fit into. Because the \e Dial component and the images live in the \e
+content sub-directory we will have to import this into \e dialcontrol.qml. So the
+start of the file looks like
+
+ \code
+ import Qt 4.7
+ import "content"
+ \endcode
+
+The visual space is bound by a 300 by 300 pixel \l Rectangle which is given
+a gray color. Inside this rectangle is our component \e Dial and a \l Rectangle.
+Inside the rectangle called 'container' is another rectangle with the
+interesting name 'slider'.
+
+\snippet ../../examples/declarative/ui-components/dialcontrol/dialcontrol.qml 0
+
+The Dial component, named 'dial, is \e anchored to the center of the main
+rectangle. The \c value attribute of 'dial' is set to a value based on the
+'slider' horizontal position and the 'container' width. So changes to the
+'slider' position will change the Dial \c value which is used in Dial to compute
+the rotation of the needle image. Notice this piece of code in Dial where
+the change in \c value modifies the position of the needle.
+
+ \code
+ SpringFollow on angle {
+ spring: 1.4
+ damping: .15
+ to: Math.min(Math.max(-130, root.value*2.6 - 130), 133)
+ }
+ \endcode
+
+This is part of the \c needleRotation that rotates the needle and causes the
+rotation of its shadow. \l SpringFollow is an element that modifies the value
+of that rotation angle \e to and mimics the oscillatory behavior of a spring,
+with the appropriate \e spring constant to control the acceleration and the \e
+damping to control how quickly the effect dies away.
+
+The 'container' is light gray with a color gradient defined using
+\l GradientStop. The gradient is applied vertically. If you need a horizontal
+gradient then you could apply the vertical gradient and then rotate the item
+by 90 degrees.
+
+The 'slider' is dark gray and also has a vertical color gradient. The most
+important thing about the 'slider' is that it has a MouseArea defined, which
+specifies a \c {drag.target} on itself along the X-axis. With minimum
+and maximum values on the X-axis defined. So we can click on the 'slider' and
+drag it left and right within the confines of the 'container'. The motion of
+the 'slider' will then change the \c value attribute in \e Dial as discussed
+already.
+
+Also notice the use of a \c radius value for a rectangle. This produces rounded
+corners. That is how the 'container' and 'slider' are displayed with a
+pleasant rounded look.
+
+
+
+*/
+
+
+
diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc
index a724c7d1e0..66b4b2bf76 100644
--- a/doc/src/declarative/qmlruntime.qdoc
+++ b/doc/src/declarative/qmlruntime.qdoc
@@ -42,19 +42,18 @@
/*!
\page qmlruntime.html
\title Qt Declarative UI Runtime
- \keyword qml runtime
+ \keyword QML Viewer
\ingroup qttools
This page documents the \e{Declarative UI Runtime} for the Qt GUI
- toolkit, and the \c qml executable which can be used to run apps
- written for the runtime. The \c qml executable reads a declarative user interface definition
- (\c .qml) file and displays the user interface it describes.
+ toolkit, and the \QQV which can be used to run apps
+ written for the runtime. The \QQV reads a declarative
+ user interface definition (\c .qml) file and displays the user interface it describes.
- QML is a runtime, as you can run plain qml files which pull in their required modules.
+ QML is a runtime, as you can run plain QML files which pull in their required modules.
To run apps with the QML runtime, you can either start the runtime
- from your own application (using a QDeclarativeView) or with the simple \c qml application.
- The \c qml application can be
- installed in a production environment, assuming that it is not already
+ from your own application (using a QDeclarativeView) or with the simple \QQV.
+ The launcher can be installed in a production environment, assuming that it is not already
present in the system. It is generally packaged alongside Qt.
To deploy an application using the QML runtime, you have two options:
@@ -62,18 +61,18 @@
\list
\o Write your own Qt application including a QDeclarative view and deploy it the same as
any other Qt application (not discussed further on this page), or
- \o Write a main QML file for your application, and run your application using the included \c qml tool.
+ \o Write a main QML file for your application, and run your application using the included \QQV.
\endlist
- To run an application with the \c qml tool, pass the filename as an argument:
+ To run an application with the \QQV, pass the filename as an argument:
\code
- qml myQmlFile.qml
+ qmlviewer myQmlFile.qml
\endcode
- Deploying a QML application via the \c qml executable allows for QML only deployments, but can also
+ Deploying a QML application via the \QQV allows for QML only deployments, but can also
include custom C++ modules just as easily. Below is an example of how you might structure
- a complex application deployed via the qml runtime, it is a listing of the files that would
+ a complex application deployed via the QML runtime, it is a listing of the files that would
be included in the deployment package.
\code
@@ -93,8 +92,8 @@
as the appropriate module file is chosen based on platform naming conventions. The C++
modules must contain a QDeclarativeExtentionPlugin subclass.
- The application would be executed either with your own application, the command 'qml MyApp.qml' or by
- opening the qml file if your system has the \c qml executable registered as the handler for qml files. The MyApp.qml file would have access
+ The application would be executed either with your own application, the command 'qmlviewer MyApp.qml' or by
+ opening the file if your system has the \QQV registered as the handler for QML files. The MyApp.qml file would have access
to all of the deployed types using the import statements such as the following:
\code
@@ -102,19 +101,36 @@
import "OtherModule" 1.0 as Other
\endcode
- \section1 \c qml application functionality
- The \c qml application implements some additional functionality to help it serve the role of a launcher
- for myriad applications. If you implement your own launcher application, you may also wish to reimplement
+ \section1 Qt QML Viewer functionality
+ The \QQV implements some additional functionality to help it supporting
+ myriad applications. If you implement your own application, you may also wish to reimplement
some or all of this functionality. However, much of this functionality is intended to aid the prototyping of
- qml applications and may not be necessary for a deployed application.
+ QML applications and may not be necessary for a deployed application.
\section2 Options
- When run with the \c -help option, qml shows available options.
+ When run with the \c -help option, \c qmlviewer shows available options.
+
+ \section2 Translations
+
+ When the launcher loads an initial QML file, it will install a translation file from
+ a "i18n" subdirectory relative to that initial QML file. The actual translation file
+ loaded will be according to the system locale and have the form
+ "qml_<language>.qm", where <language> is a two-letter ISO 639 language,
+ such as "qml_fr.qm", optionally followed by an underscore and an uppercase two-letter ISO 3166 country
+ code, such as "qml_fr_FR.qm" or "qml_fr_CA.qm".
+
+ Such files can be created using \l{Qt Linguist}.
+
+ See the \l{scripting.html#internationalization}{Qt Internationalization} documentation for information about how to make
+ the JavaScript in QML files use translatable strings.
+
+ Additionally, the launcher will load translation files specified on the
+ command line via the \c -translation option.
\section2 Dummy Data
- The secondary use of the qml runtime is to allow QML files to be viewed with
+ The secondary use of the launcher is to allow QML files to be viewed with
dummy data. This is useful when prototyping the UI, as the dummy data can
be later replaced with actual data and bindings from a C++ plugin.
To provide dummy data: create a directory called "dummydata" in the same directory as
@@ -136,19 +152,27 @@
\section2 Runtime Object
- All applications using the qmlruntime will have access to the 'runtime'
+ All applications using the launcher will have access to the \c runtime
property on the root context. This property contains several pieces of
information about the runtime environment of the application.
\section3 Screen Orientation
- A special piece of dummy data which is integrated into the runtime is
+ A special piece of dummy data which is integrated into the launcher is
a simple orientation property. The orientation can be set via the
- settings menu in the application, or by pressing Ctrl+T to toggle it.
+ settings menu in the application, or by pressing Ctrl+T to rotate it.
+
+ To use this from within your QML file, access \c runtime.orientation,
+ which can be one of the following values:
+
+ \list
+ \o \c Orientation.Portrait
+ \o \c Orientation.Landscape
+ \o \c Orientation.PortraitInverted (Portrait orientation, upside-down)
+ \o \c Orientation.LandscapeInverted (Landscape orientation, upside-down)
+ \endlist
- To use this from within your QML file, access runtime.orientation,
- which can be either Orientation.Landscape or Orientation.Portrait and which can be bound to in your
- application. An example is below:
+ These values can be bound to in your application. For example:
\code
Item {
@@ -156,13 +180,13 @@
}
\endcode
- This allows your application to respond to the orientation of the screen changing. The runtime
+ This allows your application to respond to changes in the screen's orientation. The launcher
will automatically update this on some platforms (currently the N900 only) to match the physical
screen's orientation. On other plaforms orientation changes will only happen when explictly asked for.
\section3 Window Active
- The runtime.isActiveWindow property tells whether the main window of the qml runtime is currently active
+ The \c runtime.isActiveWindow property tells whether the main window of the launcher is currently active
or not. This is especially useful for embedded devices when you want to pause parts of your application,
including animations, when your application loses focus or goes to the background.
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index d024ff24fa..784c59ad88 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -97,17 +97,17 @@ The following example shows how to expose a background color to a QML file throu
\row
\o
\c {// main.cpp}
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 0
\o
\c {// main.qml}
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.qml 0
\endtable
Or, if you want \c main.cpp to create the component without showing it in a QDeclarativeView, you could create an instance of QDeclarativeContext using QDeclarativeEngine::rootContext() instead:
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp 1
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 1
Context properties work just like normal properties in QML bindings - if the \c backgroundColor
context property in this example was changed to red, the component object instances would
@@ -135,15 +135,15 @@ allow QML to set values.
The following example creates a \c CustomPalette object, and sets it as the \c palette context
property.
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h 0
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.cpp 0
The QML that follows references the palette object, and its properties, to set the appropriate
background and text colors. When the window is clicked, the palette's text color is changed, and
the window text will update accordingly.
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.qml 0
To detect when a C++ property value - in this case the \c CustomPalette's \c text property -
changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal
@@ -185,12 +185,12 @@ This example toggles the "Stopwatch" object on/off when the MouseArea is clicked
\row
\o
\c {// main.cpp}
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h 0
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp 0
\o
\c {// main.qml}
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.qml 0
\endtable
@@ -258,16 +258,21 @@ QML content can be loaded from \l {The Qt Resource System} using the \e qrc: URL
For example:
\c [project/example.qrc]
-\quotefile doc/src/declarative/snippets/qtbinding/resources/example.qrc
+\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
\c [project/project.pro]
-\quotefile doc/src/declarative/snippets/qtbinding/resources/resources.pro
+\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
\c [project/main.cpp]
-\snippet doc/src/declarative/snippets/qtbinding/resources/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.cpp 0
\c [project/main.qml]
-\snippet doc/src/declarative/snippets/qtbinding/resources/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
+Note that the resource system cannot be accessed from QML directly. If the main QML file is
+loaded as a resource, all files specifed as relative paths in QML will also be loaded from
+the resource system. Using the resource system is completely transparent to the QML layer.
+This also means that if the main QML file is not loaded as a resource then files in the resource
+system cannot be accessed from QML.
*/
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 670a218425..f7cb722209 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -62,7 +62,7 @@
\endcode
For more information on the Qt Declarative module, see the
- \l{declarativeui.html}{Declarative UI} documentation.
+ \l{declarativeui.html}{Qt Quick} documentation.
*/
@@ -112,7 +112,7 @@
Returns the QML type id.
- \sa qmlRegisterTypeNotAvailable
+ \sa qmlRegisterTypeNotAvailable()
*/
/*!
@@ -147,7 +147,7 @@ fun.qml: Get back to work, slacker!
Without this, a generic "Game is not a type" message would be given.
- \sa qmlRegisterUncreatableType
+ \sa qmlRegisterUncreatableType()
*/
/*!
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro b/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
deleted file mode 100644
index 21c8a37f13..0000000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = lib
-CONFIG += qt plugin
-QT += declarative
-
-HEADERS += redsquare.h \
- bluecircle.h
-
-SOURCES += shapesplugin.cpp
-
-DESTDIR = lib
-OBJECTS_DIR = tmp
-MOC_DIR = tmp
-
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml b/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
deleted file mode 100644
index ffcf79de31..0000000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import Qt 4.7
-import Qt.widgets 4.7
-
-Rectangle {
- width: 200
- height: 200
-
- RedSquare {
- id: square
- width: 80
- height: 80
- }
-
- BlueCircle {
- anchors.left: square.right
- width: 80
- height: 80
- }
-
- QGraphicsWidget {
- anchors.top: square.bottom
- size.width: 80
- size.height: 80
- layout: QGraphicsLinearLayout {
- LayoutItem {
- preferredSize: "100x100"
- Rectangle { color: "yellow"; anchors.fill: parent }
- }
- }
- }
-}
-
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir b/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
deleted file mode 100644
index f94dad2a65..0000000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin graphicswidgets lib
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/main.qml b/doc/src/declarative/snippets/qtbinding/contextproperties/main.qml
deleted file mode 100644
index 1053f7337d..0000000000
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/main.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-//![0]
-import Qt 4.7
-
-Rectangle {
- width: 300
- height: 300
-
- color: backgroundColor
-
- Text {
- anchors.centerIn: parent
- text: "Hello Yellow World!"
- }
-}
-//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/main.qml b/doc/src/declarative/snippets/qtbinding/custompalette/main.qml
deleted file mode 100644
index f1a3b4f8c0..0000000000
--- a/doc/src/declarative/snippets/qtbinding/custompalette/main.qml
+++ /dev/null
@@ -1,22 +0,0 @@
-//![0]
-import Qt 4.7
-
-Rectangle {
- width: 240
- height: 320
- color: palette.background
-
- Text {
- anchors.centerIn: parent
- color: palette.text
- text: "Click me to change color!"
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- palette.text = "blue";
- }
- }
-}
-//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/resources/main.qml b/doc/src/declarative/snippets/qtbinding/resources/main.qml
deleted file mode 100644
index dfe923f84a..0000000000
--- a/doc/src/declarative/snippets/qtbinding/resources/main.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-//![0]
-import Qt 4.7
-
-Image {
- source: "images/background.png"
-}
-//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/main.qml b/doc/src/declarative/snippets/qtbinding/stopwatch/main.qml
deleted file mode 100644
index 2efa542d78..0000000000
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/main.qml
+++ /dev/null
@@ -1,18 +0,0 @@
-//![0]
-import Qt 4.7
-
-Rectangle {
- width: 300
- height: 300
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (stopwatch.isRunning())
- stopwatch.stop()
- else
- stopwatch.start();
- }
- }
-}
-//![0]
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 1a93d05b45..75c0f851ab 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -57,10 +57,10 @@ The tutorial's source code is located in the $QTDIR/examples/declarative/tutoria
Tutorial chapters:
-\list
-\o \l {QML Tutorial 1 - Basic Types}
-\o \l {QML Tutorial 2 - QML Component}
-\o \l {QML Tutorial 3 - States and Transitions}
+\list 1
+\o \l {QML Tutorial 1 - Basic Types}{Basic Types}
+\o \l {QML Tutorial 2 - QML Components}{QML Components}
+\o \l {QML Tutorial 3 - States and Transitions}{States and Transitions}
\endlist
*/
@@ -86,7 +86,7 @@ Here is the QML code for the application:
\section2 Import
First, we need to import the types that we need for this example. Most QML files will import the built-in QML
-types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with:
+types (like \l{Rectangle}, \l{Image}, ...) that come with Qt, using:
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 3
@@ -95,7 +95,7 @@ types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with:
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 1
We declare a root element of type \l{Rectangle}. It is one of the basic building blocks you can use to create an application in QML.
-We give it an \c{id} to be able to refer to it later. In this case, we call it \e page.
+We give it an \c{id} to be able to refer to it later. In this case, we call it "page".
We also set the \c width, \c height and \c color properties.
The \l{Rectangle} element contains many other properties (such as \c x and \c y), but these are left at their default values.
@@ -103,15 +103,16 @@ The \l{Rectangle} element contains many other properties (such as \c x and \c y)
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 2
-We add a \l Text element as a child of our root element that will display the text 'Hello world!'.
+We add a \l Text element as a child of the root Rectangle element that displays the text 'Hello world!'.
The \c y property is used to position the text vertically at 30 pixels from the top of its parent.
-The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}.
-
The \c anchors.horizontalCenter property refers to the horizontal center of an element.
In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-based Layout}).
+The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}.
+
+
\section2 Viewing the example
To view what you have created, run the \l{Qt Declarative UI Runtime}{qml} tool (located in the \c bin directory) with your filename as the first argument.
@@ -124,7 +125,7 @@ bin/qml $QTDIR/examples/declarative/tutorials/helloworld/tutorial1.qml
/*!
\page qml-tutorial2.html
-\title QML Tutorial 2 - QML Component
+\title QML Tutorial 2 - QML Components
\contentspage QML Tutorial
\previouspage QML Tutorial 1 - Basic Types
\nextpage QML Tutorial 3 - States and Transitions
@@ -134,10 +135,10 @@ This chapter adds a color picker to change the color of the text.
\image declarative-tutorial2.png
Our color picker is made of six cells with different colors.
-To avoid writing the same code multiple times, we first create a new \c Cell component.
+To avoid writing the same code multiple times for each cell, we create a new \c Cell component.
A component provides a way of defining a new type that we can re-use in other QML files.
-A QML component is like a black-box and interacts with the outside world through properties, signals and slots and is generally
-defined in its own QML file (for more details, see \l {Defining new Components}).
+A QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally
+defined in its own QML file. (For more details, see \l {Defining new Components}).
The component's filename must always start with a capital letter.
Here is the QML code for \c Cell.qml:
@@ -157,7 +158,7 @@ An \l Item is the most basic visual element in QML and is often used as a contai
We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us
to instantiate the cells with different colors.
-This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{intro-properties}{Properties}).
+This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{Adding new properties}).
\snippet examples/declarative/tutorials/helloworld/Cell.qml 5
diff --git a/doc/src/demos/boxes.qdoc b/doc/src/demos/boxes.qdoc
index aeb2513cec..367eb52eb0 100644
--- a/doc/src/demos/boxes.qdoc
+++ b/doc/src/demos/boxes.qdoc
@@ -44,7 +44,7 @@
\title Boxes
This demo shows Qt's ability to combine advanced OpenGL rendering with the
- the \l{The Graphics View Framework}{Graphics View} framework.
+ the \l{Graphics View Framework}.
\image boxes-demo.png
diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc
index 16718f35e2..51974afeac 100644
--- a/doc/src/deployment/deployment.qdoc
+++ b/doc/src/deployment/deployment.qdoc
@@ -775,24 +775,8 @@
assemblies at the
\l {http://msdn.microsoft.com/en-us/library/aa376307.aspx}{MSDN website}.
- There are two ways to include the run time libraries: by bundling them
- directly with your application or by installing them on the end-user's
- system.
-
- To bundle the run time libraries with your application, copy the directory
-
- \snippet doc/src/snippets/code/doc_src_deployment.qdoc 22
-
- into the folder where your executable is, so that you are including a
- \c Microsoft.VC80.CRT directory alongside your application's executable. If
- you are bundling the runtimes and need to deploy plugins as well, you have
- to remove the manifest from the plugins (embedded as a resource) by adding
- the following line to the \c{.pro} file of the plugins you are compiling:
-
- \snippet doc/src/snippets/code/doc_src_deployment.qdoc 23
-
- \warning If you skip the step above, the plugins will not load on some
- systems.
+ The correct way to include the runtime libraries with your application
+ is to ensure that they are installed on the end-user's system.
To install the runtime libraries on the end-user's system, you need to
include the appropriate Visual C++ Redistributable Package (VCRedist)
@@ -823,11 +807,11 @@
In brief the steps are
\list 1
-
+
\o create a folder structure on the development computer that will match the target USB stick directory structure, for example '\\app' and for your dlls, '\\app\\lib'.
-
+
\o on the development computer, from the appropriate 'redist' folder copy over Microsoft.VC80.CRT and Microsoft.VC80.MFC to the directories '\\app' and '\\app\\lib' on the development PC.
-
+
\o xcopy the \\app folder to the target USB stick.
\endlist
diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc
index 7d56ea1c22..afc636136a 100644
--- a/doc/src/development/assistant-manual.qdoc
+++ b/doc/src/development/assistant-manual.qdoc
@@ -359,7 +359,7 @@
The \menu{Options} page lets you specify the homepage \QA will display when
you click the \gui{Home} button in \QA's main user interface. You can specify
- the hompage by typing it here or clicking on one of the buttons below the
+ the homepage by typing it here or clicking on one of the buttons below the
textbox. \gui{Current Page} sets the currently displayed page as your home
page while \gui{Restore to default} will reset your home page to the default
home page.
diff --git a/doc/src/development/developing-on-mac.qdoc b/doc/src/development/developing-on-mac.qdoc
index 785858f6be..0c0af797e6 100644
--- a/doc/src/development/developing-on-mac.qdoc
+++ b/doc/src/development/developing-on-mac.qdoc
@@ -41,9 +41,8 @@
/*!
\page developing-on-mac.html
- \title Developing Qt Applications on Mac OS X
- \brief A overview of items to be aware of when developing Qt applications
- on Mac OS X
+ \title Developing Qt Applications for Mac OS X
+ \brief Information for developing Qt applications for Mac OS X
\ingroup platform-specific
\tableofcontents
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 688122b974..c63e96cbc1 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -347,6 +347,7 @@
\row \o vcapp \o Creates a Visual Studio Project file to build
an application.
\row \o vclib \o Creates a Visual Studio Project file to build a library.
+ \row \o vcsubdirs \o Creates a Visual Studio Solution file to build projects in sub-directories.
\endtable
See the \l{qmake Tutorial} for advice on writing project files for
diff --git a/doc/src/development/rcc.qdoc b/doc/src/development/rcc.qdoc
index 1541e1112b..999408b1a2 100644
--- a/doc/src/development/rcc.qdoc
+++ b/doc/src/development/rcc.qdoc
@@ -60,28 +60,30 @@
\row \o \c{-o} \o \c{file} \o Write output to \c{file} rather than to stdout.
\row \o \c{-name} \o \c{name} \o Create an external initialization
- function with \c{name}.
-
- \row \o \c{-threshold} \o \c{level} \o Specifies a threshold \c{level} (in
- bytes) to use when deciding whether
- to compress a file. If the file is
- smaller than the threshold \c{level},
- it is not compressed. The default
- threshold level is 70 bytes.
-
+ function with \c{name}.
+
+ \row \o \c{-threshold} \o \c{level} \o Specifies a threshold \c{level} (as a
+ percentage) to use when deciding whether to compress
+ a file. If the reduction in the file size is greater than
+ the threshold \c{level}, it is compressed; otherwise,
+ the uncompressed data is stored instead. The default
+ threshold level is 70%, meaning that compressed files
+ which are 30% or less of their original size are
+ stored as compressed data.
+
\row \o \c{-compress} \o \c{level} \o Compress input files to the given
- compression \c{level}, which is an
- integer in the range 1 to 9. Level 1
- does the least compression but is
- fastest. Level 9 does the most
- compression but is slowest. To turn
- off compression, use \c{-no-compress}.
- The default value for \c{level} is -1,
- which means use zlib's default
- compression level.
+ compression \c{level}, which is an
+ integer in the range 1 to 9. Level 1
+ does the least compression but is
+ fastest. Level 9 does the most
+ compression but is slowest. To turn
+ off compression, use \c{-no-compress}.
+ The default value for \c{level} is -1,
+ which means use zlib's default
+ compression level.
\row \o \c{-root} \o \c{path} \o Prefix the resource access path with \c{path}.
- The default is no prefix.
+ The default is no prefix.
\row \o \c{-no-compress} \o \o Disable compression.
diff --git a/doc/src/diagrams/modelview-move-rows-1.sk b/doc/src/diagrams/modelview-move-rows-1.sk
new file mode 100644
index 0000000000..dc90cfb770
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-1.sk
@@ -0,0 +1,271 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+ld((5, 5))
+r(30,0,0,-30,220,515)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,665)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,664.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,337.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,515.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,485.177)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,575)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,335)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,545)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.262,220,305.262)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,307.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,455.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,545.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.956,415.038,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,367.5)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,605)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,365)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,605)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,635)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,635)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,673.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.478,672.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.44,345.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,643.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.478,642.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.44,315.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,613.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.478,523.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(286.94,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,583.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.478,493.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(286.94,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,553.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.478,463.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(286.94,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.133,283.402))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,285.64))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.478,433.317))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(277.5,635,0)
+bs(252.5,635,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(292.5,380,0)
+bs(292.5,542.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(290,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-2.sk b/doc/src/diagrams/modelview-move-rows-2.sk
new file mode 100644
index 0000000000..7ddb95e8a6
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-2.sk
@@ -0,0 +1,271 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+ld((5, 5))
+r(30,0,0,-30,220,515)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,665)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,664.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,337.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,575)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,455)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,335)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,545)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,545)
+fp((1,1,1))
+lw(1)
+r(29.6927,0,0,-30,220,305.262)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,307.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,694.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,367.5)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,485)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,365)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,485)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,515)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,515)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,673.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.478,672.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.44,345.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,643.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.478,642.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.44,315.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(284.44,493.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,493.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(284.44,463.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,463.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(284.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.133,283.402))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,285.64))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(275,515,0)
+bs(252.5,515,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(292.5,380,0)
+bs(292.5,422.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(290,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-3.sk b/doc/src/diagrams/modelview-move-rows-3.sk
new file mode 100644
index 0000000000..6c28bb905b
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-3.sk
@@ -0,0 +1,136 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+G()
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,211.449,486.649)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.446,461.649)
+lw(1)
+r(30,0,0,-30,211.449,396.649)
+lw(1)
+r(30,0,0,-30,336.449,401.388)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,211.449,366.911)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.449,371.649)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,211.449,516.649)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.446,491.649)
+lw(1)
+r(30,0,0,-30,211.449,426.649)
+lw(1)
+r(30,0,0,-30,336.449,431.388)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,263.949,516.649)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,336.449,521.649)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,211.449,456.649)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(220.889,494.789))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(345.886,469.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(220.889,464.789))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(345.886,439.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(273.389,494.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(345.889,499.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(220.889,434.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(220.889,404.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(345.889,409.528))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(220.889,374.789))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(345.889,379.528))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(220.582,345.051))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(346.498,349.789))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(263.949,516.649,0)
+bs(243.949,516.649,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(278.949,441.649,0)
+bs(278.949,484.149,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(241.449,441.649,0)
+bs(276.449,441.649,0)
+G_()
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-4.sk b/doc/src/diagrams/modelview-move-rows-4.sk
new file mode 100644
index 0000000000..c74fd286c5
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-4.sk
@@ -0,0 +1,136 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+G()
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,211.449,482.601)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.449,487.601)
+lw(1)
+r(30,0,0,-30,211.449,392.781)
+lw(1)
+r(30,0,0,-30,336.449,397.34)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.442,211.449,363.043)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.449,367.601)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,211.449,512.601)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,336.449,517.601)
+lw(1)
+r(30,0,0,-30,211.449,422.601)
+lw(1)
+r(30,0,0,-30,336.449,457.601)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,263.949,392.601)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,336.449,427.601)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,211.449,452.601)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(220.889,490.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(345.889,495.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(220.889,460.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(345.889,465.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(273.389,370.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(345.889,405.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(220.889,430.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(220.889,400.741))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(345.889,435.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(220.889,370.741))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(345.889,375.48))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(220.889,341.183))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(345.889,345.741))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(263.949,392.601,0)
+bs(243.949,392.601,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(278.949,437.601,0)
+bs(278.949,395.101,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(241.449,437.601,0)
+bs(276.449,437.601,0)
+G_()
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc
index 87c973a888..a39f89a7e7 100644
--- a/doc/src/examples/diagramscene.qdoc
+++ b/doc/src/examples/diagramscene.qdoc
@@ -54,13 +54,13 @@
colors, and it is possible to change the font, style, and
underline of the text.
- The Qt graphics view framework is designed to manage and
- display custom 2D graphics items. The main classes of the
- framework are QGraphicsItem, QGraphicsScene and QGraphicsView. The
- graphics scene manages the items and provides a surface for them.
+ The Qt graphics view framework is designed to manage and display
+ custom 2D graphics items. The main classes of the framework are
+ QGraphicsItem, QGraphicsScene and QGraphicsView. The graphics
+ scene manages the items and provides a surface for them.
QGraphicsView is a widget that is used to render a scene on the
- screen. See the \l{The Graphics View Framework}{overview document}
- for a more detailed description of the framework.
+ screen. See the \l{Graphics View Framework} for a more detailed
+ description of the framework.
In this example we show how to create such custom graphics
scenes and items by implementing classes that inherit
diff --git a/doc/src/examples/drilldown.qdoc b/doc/src/examples/drilldown.qdoc
index ca994e8e4d..2b87840bee 100644
--- a/doc/src/examples/drilldown.qdoc
+++ b/doc/src/examples/drilldown.qdoc
@@ -292,7 +292,7 @@
\codeline
\snippet examples/sql/drilldown/view.h 1
- The QGraphicsView class is part of the \l {The Graphics View
+ The QGraphicsView class is part of the \l {Graphics View
Framework} which we will use to display the images of Nokia's
Qt offices. To be able to respond to user interaction;
i.e., showing the
@@ -388,8 +388,8 @@
reason we must create a custom item class is that we want to catch
the item's hover events, animating the item when the mouse cursor
is hovering over the image (by default, no items accept hover
- events). Please see the \l{The Graphics View Framework}
- documentation and the \l{Graphics View Examples} for more details.
+ events). Please see the \l{Graphics View Framework} documentation
+ and the \l{Graphics View Examples} for more details.
\snippet examples/sql/drilldown/view.cpp 5
@@ -399,7 +399,7 @@
function calls the private \c showInformation() function to pop up
the associated information window.
- \l {The Graphics View Framework} provides the qgraphicsitem_cast()
+ The \l {Graphics View Framework} provides the qgraphicsitem_cast()
function to determine whether the given QGraphicsItem instance is
of a given type. Note that if the event is not related to any of
our image items, we pass it on to the base class implementation.
@@ -456,7 +456,7 @@
borders.
Finally, we store the location ID that this particular record is
- associated with as well as a z-value. In the \l {The Graphics View
+ associated with as well as a z-value. In the \l {Graphics View
Framework}, an item's z-value determines its position in the item
stack. An item of high Z-value will be drawn on top of an item
with a lower z-value if they share the same parent item. We also
@@ -477,7 +477,7 @@
there is no current mouse grabber item. They are sent when the
mouse cursor enters an item, when it moves around inside the item,
and when the cursor leaves an item. As we mentioned earlier, none
- of the \l {The Graphics View Framework}'s items accept hover
+ of the \l {Graphics View Framework}'s items accept hover
event's by default.
The QTimeLine class provides a timeline for controlling
diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc
index edc62d85c0..e6e6594156 100644
--- a/doc/src/examples/elasticnodes.qdoc
+++ b/doc/src/examples/elasticnodes.qdoc
@@ -83,7 +83,7 @@
also reimplements \l{QGraphicsItem::shape()}{shape()} to ensure its hit
area has an elliptic shape (as opposed to the default bounding rectangle).
- For edge management purposes the node provides a simple API for adding
+ For edge management purposes, the node provides a simple API for adding
edges to a node, and for listing all connected edges.
The \l{QGraphicsItem::advance()}{advance()} reimplementation is called
@@ -126,16 +126,21 @@
\snippet examples/graphicsview/elasticnodes/node.cpp 2
- The \e calculateForces() function implements the elastic forces effect that
- pulls and pushes on nodes in the grid. In addition to this algorithm, the
- user can move one node around with the mouse. Because we do not want the
- two to interfere, we start by checking if this \c Node is the current mouse
- grabber item (i.e., QGraphicsScene::mouseGrabberItem()). Because we need to
- find all neighboring (but not necessarily connected) nodes, we also make
- sure the item is part of a scene in the first place.
+ There are two ways to move a node. The \c calculateForces() function
+ implements the elastic effect that pulls and pushes on nodes in the grid.
+ In addition, the user can directly move one node around with the mouse.
+ Because we do not want the two approaches to operate at the same time on
+ the same node, we start \c calculateForces() by checking if this \c Node is
+ the current mouse grabber item (i.e., QGraphicsScene::mouseGrabberItem()).
+ Because we need to find all neighboring (but not necessarily connected)
+ nodes, we also make sure the item is part of a scene in the first place.
\snippet examples/graphicsview/elasticnodes/node.cpp 3
+ The "elastic" effect comes from an algorithm that applies pushing and
+ pulling forces. The effect is impressive, and surprisingly simple to
+ implement.
+
The algorithm has two steps: the first is to calculate the forces that push
the nodes apart, and the second is to subtract the forces that pull the
nodes together. First we need to find all the nodes in the graph. We call
@@ -143,19 +148,20 @@
qgraphicsitem_cast() to look for \c Node instances.
We make use of \l{QGraphicsItem::mapFromItem()}{mapFromItem()} to create a
- vector pointing from this node to each other node, in \l{The Graphics View
- Coordinate System}{local coordinates}. We use the decomposed components of
- this vector to determine the direction and strength of force that apply to
- the node. The forces are added up for each node, and weighted so that the
- closest nodes are given the strongest force. The sum of all forces are
- stored in \e xvel (X-velocity) and \e yvel (Y-velocity).
+ temporary vector pointing from this node to each other node, in \l{The
+ Graphics View Coordinate System}{local coordinates}. We use the decomposed
+ components of this vector to determine the direction and strength of force
+ that should apply to the node. The forces accumulate for each node, and are
+ then adjusted so that the closest nodes are given the strongest force, with
+ rapid degradation when distance increases. The sum of all forces is stored
+ in \c xvel (X-velocity) and \c yvel (Y-velocity).
\snippet examples/graphicsview/elasticnodes/node.cpp 4
- The edges between the nodes represent the forces that pull the nodes
- together. By visiting each edge that is connected to this node, we can use
- a similar approach as above to find the direction and strength of all
- forces. These forces are subtracted from \e xvel and \e yvel.
+ The edges between the nodes represent forces that pull the nodes together.
+ By visiting each edge that is connected to this node, we can use a similar
+ approach as above to find the direction and strength of all pulling forces.
+ These forces are subtracted from \c xvel and \c yvel.
\snippet examples/graphicsview/elasticnodes/node.cpp 5
@@ -166,20 +172,20 @@
\snippet examples/graphicsview/elasticnodes/node.cpp 6
- The final step of \e calculateForces() determines the node's new position.
+ The final step of \c calculateForces() determines the node's new position.
We add the force to the node's current position. We also make sure the new
position stays inside of our defined boundaries. We don't actually move the
- item in this function; that's done in a separate step, from \e advance().
+ item in this function; that's done in a separate step, from \c advance().
\snippet examples/graphicsview/elasticnodes/node.cpp 7
- The \e advance() function updates the item's current position. It is called
- from \e GraphWidget::timerEvent(). If the node's position changed, the
+ The \c advance() function updates the item's current position. It is called
+ from \c GraphWidget::timerEvent(). If the node's position changed, the
function returns true; otherwise false is returned.
\snippet examples/graphicsview/elasticnodes/node.cpp 8
- The \e Node's bounding rectangle is a 20x20 sized rectangle centered around
+ The \c Node's bounding rectangle is a 20x20 sized rectangle centered around
its origin (0, 0), adjusted by 2 units in all directions to compensate for
the node's outline stroke, and by 3 units down and to the right to make
room for a simple drop shadow.
@@ -188,8 +194,8 @@
The shape is a simple ellipse. This ensures that you must click inside the
node's elliptic shape in order to drag it around. You can test this effect
- by running the example, and zooming far enough in so that the nodes become
- very large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the
+ by running the example, and zooming far in so that the nodes are very
+ large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the
item's hit area would be identical to its bounding rectangle (i.e.,
rectangular).
@@ -197,7 +203,7 @@
This function implements the node's painting. We start by drawing a simple
dark gray elliptic drop shadow at (-7, -7), that is, (3, 3) units down and
- to the right.
+ to the right from the top-left corner (-10, -10) of the ellipse.
We then draw an ellipse with a radial gradient fill. This fill is either
Qt::yellow to Qt::darkYellow when raised, or the opposite when sunken. In
@@ -217,8 +223,8 @@
calculations.
This notification is the only reason why the nodes need to keep a pointer
- back to the \e GraphWidget. Another approach could be to provide such
- notification using a signal; in such case, \e Node would need to inherit
+ back to the \c GraphWidget. Another approach could be to provide such
+ notification using a signal; in such case, \c Node would need to inherit
from QGraphicsObject.
\snippet examples/graphicsview/elasticnodes/node.cpp 12
@@ -226,14 +232,14 @@
Because we have set the \l{QGraphicsItem::ItemIsMovable}{ItemIsMovable}
flag, we don't need to implement the logic that moves the node according to
mouse input; this is already provided for us. We still need to reimplement
- the mouse press and release handlers though, to update the nodes' visual
+ the mouse press and release handlers, though, to update the nodes' visual
appearance (i.e., sunken or raised).
\section1 Edge Class Definition
- The \e Edge class represents the arrow-lines between the nodes in this
+ The \c Edge class represents the arrow-lines between the nodes in this
example. The class is very simple: it maintains a source- and destination
- node pointer, and provides an \e adjust() function that makes sure the line
+ node pointer, and provides an \c adjust() function that makes sure the line
starts at the position of the source, and ends at the position of the
destination. The edges are the only items that change continuously as
forces pull and push on the nodes.
@@ -242,13 +248,13 @@
\snippet examples/graphicsview/elasticnodes/edge.h 0
- \e Edge inherits from QGraphicsItem, as it's a simple class that has no use
+ \c Edge inherits from QGraphicsItem, as it's a simple class that has no use
for signals, slots, and properties (compare to QGraphicsObject).
The constructor takes two node pointers as input. Both pointers are
mandatory in this example. We also provide get-functions for each node.
- The \e adjust() function repositions the edge, and the item also implements
+ The \c adjust() function repositions the edge, and the item also implements
\l{QGraphicsItem::boundingRect()}{boundingRect()} and
\{QGraphicsItem::paint()}{paint()}.
@@ -256,7 +262,7 @@
\snippet examples/graphicsview/elasticnodes/edge.cpp 0
- The \e Edge constructor initializes its arrowSize data member to 10 units;
+ The \c Edge constructor initializes its \c arrowSize data member to 10 units;
this determines the size of the arrow which is drawn in
\l{QGraphicsItem::paint()}{paint()}.
@@ -265,7 +271,7 @@
This ensures that the edge items are not considered for mouse input at all
(i.e., you cannot click the edges). Then, the source and destination
pointers are updated, this edge is registered with each node, and we call
- \e adjust() to update this edge's start end end position.
+ \c adjust() to update this edge's start end end position.
\snippet examples/graphicsview/elasticnodes/edge.cpp 1
@@ -274,7 +280,7 @@
\snippet examples/graphicsview/elasticnodes/edge.cpp 2
- In \e adjust(), we define two points: \e sourcePoint, and \e destPoint,
+ In \c adjust(), we define two points: \c sourcePoint, and \c destPoint,
pointing at the source and destination nodes' origins respectively. Each
point is calculated using \l{The Graphics View Coordinate System}{local
coordinates}.
@@ -295,7 +301,7 @@
It's important to notice that we call
\l{QGraphicsItem::prepareGeometryChange()}{prepareGeometryChange()} in this
- function. The reason is that the variables \e sourcePoint and \e destPoint
+ function. The reason is that the variables \c sourcePoint and \c destPoint
are used directly when painting, and they are returned from the
\l{QGraphicsItem::boundingRect()}{boundingRect()} reimplementation. We must
always call
@@ -338,26 +344,26 @@
\section1 GraphWidget Class Definition
- \e GraphWidget is a subclass of QGraphicsView, which provides the main
+ \c GraphWidget is a subclass of QGraphicsView, which provides the main
window with scrollbars.
\snippet examples/graphicsview/elasticnodes/graphwidget.h 0
- It provides a basic constructor that initializes the scene, an \e
+ The class provides a basic constructor that initializes the scene, an \c
itemMoved() function to notify changes in the scene's node graph, a few
event handlers, a reimplementation of
\l{QGraphicsView::drawBackground()}{drawBackground()}, and a helper
- function for scaling the view by mouse or keyboard.
+ function for scaling the view by using the mouse wheel or keyboard.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 0
- \e GraphicsWidget's constructor creates the scene, and because most items
- move around most of the time, it sets QGraphicsScene::NoIndex. Then the
- scene gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}.
- The scene is then assigned to the \e GraphWidget view.
+ \c GraphicsWidget's constructor creates the scene, and because most items
+ move around most of the time, it sets QGraphicsScene::NoIndex. The scene
+ then gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}, and is
+ assigned to the \c GraphWidget view.
The view enables QGraphicsView::CacheBackground to cache rendering of its
- static and somewhat complex background. Because the graph renders a close
+ static, and somewhat complex, background. Because the graph renders a close
collection of small items that all move around, it's unnecessary for
Graphics View to waste time finding accurate update regions, so we set the
QGraphicsView::BoundingRectViewportUpdate viewport update mode. The default
@@ -381,15 +387,15 @@
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 2
- \e GraphWidget is notified of node movement through this \e itemMoved()
+ \c GraphWidget is notified of node movement through this \c itemMoved()
function. Its job is simply to restart the main timer in case it's not
running already. The timer is designed to stop when the graph stabilizes,
and start once it's unstable again.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 3
- This is \e GraphWidget's key event handler. The arrow keys move the center
- node around, the '+' and '-' keys zoom in and out by calling \e
+ This is \c GraphWidget's key event handler. The arrow keys move the center
+ node around, the '+' and '-' keys zoom in and out by calling \c
scaleView(), and the enter and space keys randomize the positions of the
nodes. All other key events (e.g., page up and page down) are handled by
QGraphicsView's default implementation.
@@ -398,16 +404,16 @@
The timer event handler's job is to run the whole force calculation
machinery as a smooth animation. Each time the timer is triggered, the
- handler will find all nodes in the scene, and call \e
+ handler will find all nodes in the scene, and call \c
Node::calculateForces() on each node, one at a time. Then, in a final step
- it will call \e Node::advance() to move all nodes to their new positions.
- By checking the return value of \e advance(), we can decide if the grid
+ it will call \c Node::advance() to move all nodes to their new positions.
+ By checking the return value of \c advance(), we can decide if the grid
stabilized (i.e., no nodes moved). If so, we can stop the timer.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 5
In the wheel event handler, we convert the mouse wheel delta to a scale
- factor, and pass this factor to \e scaleView(). This approach takes into
+ factor, and pass this factor to \c scaleView(). This approach takes into
account the speed that the wheel is rolled. The faster you roll the mouse
wheel, the faster the view will zoom.
@@ -415,24 +421,24 @@
The view's background is rendered in a reimplementation of
QGraphicsView::drawBackground(). We draw a large rectangle filled with a
- linear gradient, with a drop shadow, and then render text in top. The text
- is rendered twice to give a similar simple drop-shadow effect.
+ linear gradient, add a drop shadow, and then render text on top. The text
+ is rendered twice for a simple drop-shadow effect.
This background rendering is quite expensive; this is why the view enables
QGraphicsView::CacheBackground.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 7
- The \e scaleView() helper function checks that the scale factor stays
+ The \c scaleView() helper function checks that the scale factor stays
within certain limits (i.e., you cannot zoom too far in nor too far out),
- and then applies this scale.
+ and then applies this scale to the view.
\section1 The main() Function
- In contrast to the complexity of the rest of this example, the \e main()
+ In contrast to the complexity of the rest of this example, the \c main()
function is very simple: We create a QApplication instance, seed the
- randomizer using qsrand(), and then create and show an instance of \e
- GraphWidget. Because all nodes in the grid are moved initially, the \e
+ randomizer using qsrand(), and then create and show an instance of \c
+ GraphWidget. Because all nodes in the grid are moved initially, the \c
GraphWidget timer will start immediately after control has returned to the
event loop.
*/
diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc
index e5eb4ef926..7eb1512d7b 100644
--- a/doc/src/examples/fingerpaint.qdoc
+++ b/doc/src/examples/fingerpaint.qdoc
@@ -46,5 +46,5 @@
The Finger Paint example shows the use of multi-touch with a custom widget
to create a simple painting application.
- \image multitouch-fingerpaint.png
+ \image multitouch-fingerpaint-example.png
*/
diff --git a/doc/src/examples/mandelbrot.qdoc b/doc/src/examples/mandelbrot.qdoc
index 7a3c1cd4df..11173a8173 100644
--- a/doc/src/examples/mandelbrot.qdoc
+++ b/doc/src/examples/mandelbrot.qdoc
@@ -285,7 +285,7 @@
\snippet examples/threads/mandelbrot/mandelbrotwidget.cpp 8
If the pixmap has the right scale factor, we draw the pixmap directly onto
- the widget. Otherwise, we scale and translate the \l{The Coordinate
+ the widget. Otherwise, we scale and translate the \l{Coordinate
System}{coordinate system} before we draw the pixmap. By reverse mapping
the widget's rectangle using the scaled painter matrix, we also make sure
that only the exposed areas of the pixmap are drawn. The calls to
diff --git a/doc/src/examples/padnavigator.qdoc b/doc/src/examples/padnavigator.qdoc
index 70e131ed6c..e29a3b2ee8 100644
--- a/doc/src/examples/padnavigator.qdoc
+++ b/doc/src/examples/padnavigator.qdoc
@@ -43,9 +43,555 @@
\example graphicsview/padnavigator
\title Pad Navigator Example
- The Pad Navigator Example shows how you can use Graphics View
- together with embedded widgets to create a simple but useful
- dynamic user interface for embedded devices.
+ The Pad Navigator Example shows how you can use Graphics View together with
+ embedded widgets and Qt's \l{State Machine Framework} to create a simple
+ but useful, dynamic, animated user interface.
\image padnavigator-example.png
+
+ The interface consists of a flippable, rotating pad with icons that can be
+ selected using the arrow keys on your keyboard or keypad. Pressing enter
+ will flip the pad around and reveal its back side, which has a form
+ embedded into a QGraphicsProxyWidget. You can interact with the form, and
+ press the enter key to flip back to the front side of the pad at any time.
+
+ Graphics View provides the QGraphicsScene class for managing and
+ interacting with a large number of custom-made 2D graphical items derived
+ from the QGraphicsItem class, and a QGraphicsView widget for visualizing
+ the items, with support for zooming and rotation.
+
+ This example consists of a \c RoundRectItem class, a \c FlippablePad class,
+ a \c PadNavigator class, a \c SplashItem class, and a \c main() function.
+
+ \section1 RoundRectItem Class Definition
+
+ The \c RoundRectItem class is used by itself to diplay the icons on the
+ pad, and as a base class for \c FlippablePad, the class for the pad itself.
+ The role of the class is to paint a round rectangle of a specified size and
+ gradient color, and optionally to paint a pixmap icon on top. To support \c
+ FlippablePad it also allows filling its contents with a plain window
+ background color.
+
+ Let's start by reviewing the \c RoundRectItem class declaration.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.h 0
+
+ \c RoundRectItem inherits QGraphicsObject, which makes it easy to control
+ its properties using QPropertyAnimation. Its constructor takes a rectangle
+ to determine its bounds, and a color.
+
+ Besides implementing the mandatory \l{QGraphicsItem::paint()}{paint()} and
+ \l{QGraphicsItem::boundingRect()}{boundingRect()} pure virtual functions,
+ it also provides the \c pixmap and \c fill properties.
+
+ The \c pixmap property sets an optional pixmap that is drawn on top of the
+ round rectangle. The \c fill property will, when true, fill the round
+ rectangle contents with a fixed QPalette::Window background color.
+ Otherwise the contents are filled using a gradient based on the color
+ passed to \c RoundRectItem's constructor.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.h 1
+
+ The private data members are:
+
+ \list
+ \o \c pix: The optional pixmap that is drawn on top of the rectangle.
+ \o \c fillRect: Corresponds to the \c fill property.
+ \o \c color: The configurable gradient color fill of the rectangle.
+ \o \c bounds: The bounds of the rectangle.
+ \o \c gradient: A precalculated gradient used to fill the rectangle.
+ \endlist
+
+ We will now review the \c RoundRectItem implementation. Let's start by
+ looking at its constructor:
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 0
+
+ The constructor initializes its member variables and forwards the \c parent
+ argument to QGraphicsObject's constructor. It then constructs the linear
+ gradient that is used in \l{QGraphicsItem::paint()}{paint()} to draw the
+ round rectangle's gradient background. The linear gradient's starting point
+ is at the top-left corner of the bounds, and the end is at the bottom-left
+ corner. The start color is identical to the color passed as an argument,
+ and a slightly darker color is chosen for the final stop.
+
+ We store this gradient as a member variable to avoid having to recreate the
+ gradient every time the item is repainted.
+
+ Finally we set the cache mode
+ \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache}. This mode
+ causes the item's rendering to be cached into an off-screen pixmap that
+ remains persistent as we move and transform the item. This mode is ideal
+ for this example, and works particularily well with OpenGL and OpenGL ES.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 1
+
+ The \c pixmap property implementation simple returns the member pixmap, or
+ sets it and then calls \l{QGraphicsItem::update()}{update()}.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 2
+
+ As the \l{QGraphicsItem::paint()}{paint()} implementation below draws a
+ simple drop shadow down and to the right of the item, we return a slightly
+ adjusted rectangle from \l{QGraphicsItem::boundingRect()}{boundingRect()}.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 3
+
+ The \l{QGraphicsItem::paint()}{paint()} implementation starts by rendering
+ a semi transparent black round rectangle drop shadow, two units down and to
+ the right of the main item.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 4
+
+ We then draw the "foreground" round rectangle itself. The fill depends on
+ the \c fill property; if true, we will with a plain QPalette::Window color.
+ We get the corrent brush from QApplication::palette(). We assign a single
+ unit wide pen for the stroke, assign the brush, and then draw the
+ rectangle.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 5
+
+ If a pixmap has been assigned to the \e pixmap property, we draw this
+ pixmap in the center of the rectangle item. The pixmaps are scaled to match
+ the size of the icons; in arguably a better approach would have been to
+ store the icons with the right size in the first places.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 6
+
+ Finally, for completeness we include the \c fill property implementation.
+ It returns the \c fill member variable's value, and when assigned to, it
+ calls \l{QGraphicsItem::update()}{update()}.
+
+ As mentioned already, \c RoundRectItem is the base class for \c
+ FlippablePad, which is the class representing the tilting pad itself. We
+ will proceed to reviewing \c FlippablePad.
+
+ \section1 FlippablePad Class Definition
+
+ \c FlippablePad is, in addition to its inherited \c RoundRectItem
+ responsibilities, responsible for creating and managing a grid of icons.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.h 0
+
+ Its declaration is very simple: It inherits \c RoundRectItem and does not
+ need any special polymorphic behavior. It's suitable to declare its own
+ constructor, and a getter-function that allows \c PadNavigator to access
+ the icons in the grid by (row, column).
+
+ The example has no "real" behavior or logic of any kind, and because of
+ that, the icons do not need to provide any \e behavior or special
+ interactions management. In a real application, however, it would be
+ natural for the \c FlippablePad and its icons to handle more of the
+ navigation logic. In this example, we have chosen to leave this to
+ the \c PadNavigator class, which we will get back to below.
+
+ We will now review the \c FlippablePad implementation. This implementation
+ starts with two helper functions: \c boundsFromSize() and \c
+ posForLocation():
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 0
+
+ \c boundsForSize() takes a QSize argument, and returns the bounding
+ rectangle of the flippable pad item. The QSize determines how many rows and
+ columns the icon grid should have. Each icon is given 150x150 units of
+ space, and this determines the bounds.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 1
+
+ \c posForLocation() returns the position of an icon given its row and
+ column position. Like \c boundsForSize(), the function assumes each icon is
+ given 150x150 units of space, and that all icons are centered around the
+ flippable pad item's origin (0, 0).
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 2
+
+ The \c FlippablePad constructor passes suitable bounds (using \c
+ boundsForSize()) and specific color to \c RoundRectItem's constructor.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 3
+
+ It then loads pixmaps from compiled-in resources to use for its icons.
+ QDirIterator is very useful in this context, as it allows us to fetch all
+ resource "*.png" files inside the \c :/images directory without explicitly
+ naming the files.
+
+ We also make sure not to load more pixmaps than we need.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 4
+
+ Now that we have the pixmaps, we can create icons, position then and assign
+ pixmaps. We start by finding a suitable size and color for the icons, and
+ initializing a convenient grid structure for storing the icons. This \c
+ iconGrid is also used later to find the icon for a specific (column, row)
+ location.
+
+ For each row and column in our grid, we proceed to constructing each icon
+ as an instance of \c RoundRectItem. The item is placed by using the \c
+ posForLocation() helper function. To make room for the slip-behind
+ selection item, we give each icon a \l{QGraphicsItem::zValue()}{Z-value} of
+ 1. The pixmaps are distributed to the icons in round-robin fasion.
+
+ Again, this approach is only suitable for example purposes. In a real-life
+ application where each icon represents a specific action, it would be more
+ natural to assign the pixmaps directly, or that the icons themselves
+ provide suitable pixmaps.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 5
+
+ Finally, the \c iconAt() function returns a pointer to the icon at a
+ specific row and column. It makes a somewhat bold assumption that the input
+ is valid, which is fair because the \c PadNavigator class only calls this
+ function with correct input.
+
+ We will now review the \c SplashItem class.
+
+ \section1 SplashItem Class Definition
+
+ The \c SplashItem class represents the "splash window", a semitransparent
+ white overlay with text that appears immediately after the application has
+ started, and disappears after pressing any key. The animation is controlled
+ by \c PadNavigator; this class is very simple by itself.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.h 0
+
+ The class declaration shows that \c SplashItem inherits QGraphicsObject to
+ allow it to be controlled by QPropertyAnimation. It reimplements the
+ mandatory \l{QGraphicsItem::paint()}{paint()} and
+ \l{QGraphicsItem::boundingRect()}{boundingRect()} pure virtual functions,
+ and keeps a \c text member variable which will contain the information text
+ displayed on this splash item.
+
+ Let's look at its implementation.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 0
+
+ The constructor forwards to QGraphicsObject as expected, assigns a text
+ message to the \c text member variable, and enables
+ \l{QGraphicsItem::DeviceCoordinateCache}{DeviceCoordinateCache}. This cache
+ mode is suitable because the splash item only moves and is never
+ transformed, and because it contains text, it's important that it has a
+ pixel perfect visual appearance (in constrast to
+ \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache}, where the
+ visual appearance is not as good).
+
+ We use caching to avoid having to relayout and rerender the text for each
+ frame. An alterative approach would be to use the new QStaticText class.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 1
+
+ \c SplashItem's bounding rectangle is fixed at (400x175).
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 2
+
+ The \l{QGraphicsItem::paint()}{paint()} implementation draws a clipped
+ round rectangle with a thick 2-unit border and a semi-transparent white
+ background. It proceeds to finding a suitable text area by adjusting the
+ splash item's bounding rectangle with 10 units in each side. The text is
+ rendered inside this rectangle, with top-left alignment, and with word
+ wrapping enabled.
+
+ The main class now remains. We will proceed to reviewing \c PadNavigator.
+
+ \section1 PadNavigator Class Definition
+
+ \c PadNavigator represents the main window of our Pad Navigator Example
+ application. It creates and controls a somewhat complex state machine, and
+ several animations. Its class declaration is very simple:
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.h 0
+
+ It inherits QGraphicsView and reimplements only one function:
+ \l{QGraphicsView::resizeEvent()}{resizeEvent()}, to ensure the scene is
+ scaled to fit inside the view when resizing the main window.
+
+ The \c PadNavigator constructor takes a QSize argument that determines the
+ number or rows and columns in the grid.
+
+ It also keeps a private member instance, \c form, which is the generated
+ code for the pad's back side item's QGraphicsProxyWidget-embedded form.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 0
+
+ \c PadNavigator's constructor is a bit long. In short, its job is to create
+ all items, including the \c FlippablePad, the \c SplashItem and the
+ QGraphicsProxyWidget \c backItem, and then to set up all animations, states
+ and transitions that control the behavior of the application.
+
+ It starts out simple, by forwarding to QGraphicsView's constructor.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 1
+
+ The first item to be created is \c SplashItem. This is going to be a top-level
+ item in the scene, next to \c FlippablePad, and stacked on top of it, so we
+ assign it a \l{QGraphicsItem::zValue()}{Z-value} of 1.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 2
+
+ Now we construct the \c FlippablePad item, passing its column-row count to
+ its constructor.
+
+ The pad is constrolled by three transformations, and we create one
+ QGraphicsRotation object for each of these.
+
+ \list
+ \o \c flipRotation: Rotates the grid around its Qt::YAxis. This rotation is
+ animated from 0 to 180, and eventually back, when enter is pressed on the
+ keyboard, flipping the pad around.
+ \o \c xRotation: Rotates the grid around its Qt::XAxis. This is used to
+ tilt the pad vertically corresponding to which item is currently selected.
+ This way, the selected item is always kept in front.
+ \o \c yRotation: Rotates the grid around its Qt::YAxis. This is used to
+ tilt the pad horizontally corresponding to which item is selected. This
+ way, the selected item is always kept in front.
+ \endlist
+
+ The combination of all three rotations is assigned via
+ QGraphicsItem::setTransformations().
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 3
+
+ Now we construct the QGraphicsProxyWidget-embedded \c backItem. The proxy
+ widget is created as a child of the pad. We create a new QWidget and
+ populate it with the \c form member. To ensure the \c hostName line edit is
+ the first to receive input focus when this item is shown, we call
+ \l{QWidget::setFocus()}{setFocus()} immediately. This will not give the
+ widget focus right away; it will only prepare the item to automatically
+ receive focus once it is shown.
+
+ The QWidget based form is embedded into the proxy widget. The proxy is
+ hidden initially; we only want to show it when the pad is rotated at least
+ 90 degrees, and we also rotate the proxy itself by 180 degrees. This way we
+ give the impression that the proxy widget is "behind" the flipped pad, when
+ in fact, it's actually \e{on top of it}.
+
+ We enable \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache} to
+ ensure the flip animation can run smoothly.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 4
+
+ We now create the selection item. This is simply another instance of \c
+ RoundRectItem that is slightly larger than the icons on the pad. We create
+ it as an immediate child of the \c FlippablePad, so the selection item is a
+ sibling to all the icons. By giving it a
+ \l{QGraphicsItem::zValue()}{Z-value} of 0.5 we ensure it will slide beteen
+ the pad and its icons.
+
+ What follows now is a series of animation initializations.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 5
+
+ We begin with the animations that apply to the splash item. The first
+ animation, \c smoothSplashMove, ensures that the "y" property of \c splash
+ will be animated with a 250-millisecond duration
+ \l{QEasingCurve::InQuad}{InQuad} easing function. \c smoothSplashOpacity
+ ensures the opacity of \c splash eases in and out in 250 milliseconds.
+
+ The values are assigned by \c PadNavigator's state machine, which is
+ created later.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 6
+
+ These are the animations that control the selection item's movement and the
+ \c xRotation and \c yRotation QGraphicsRotation objects that tilt the pad.
+ All animations have a duration of 125 milliseconds, and they all use the
+ \l{QEasingCurve::InOutQuad}{InOutQuad} easing function.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 7
+
+ We now create the animations that control the flip-effect when you press
+ the enter key. The main goal is to rotate the pad by 180 degrees or back,
+ but we also need to make sure the selection item's tilt rotations are reset
+ back to 0 when the pad is flipped, and restored back to their original
+ values when flipped back:
+
+ \list
+ \o \c smoothFlipRotation: Animates the main 180 degree rotation of the pad.
+ \o \c smoothFlipScale: Scales the pad out and then in again while the pad is rotating.
+ \o \c smoothFlipXRotation: Animates the selection item's X-tilt to 0 and back.
+ \o \c smoothFlipYRotation: Animates the selection item's Y-tilt to 0 and back.
+ \o \c flipAnimation: A parallel animation group that ensures all the above animations are run in parallel.
+ \endlist
+
+ All animations are given a 500 millisecond duration and an
+ \l{QEasingCurve::InOutQuad}{InOutQuad} easing function.
+
+ It's worth taking a close look at \c smoothFlipScale. This animation's
+ start and end values are both 1.0, but at animation step 0.5 the
+ animation's value is 0.7. This means that after 50% of the animation's
+ duration, or 250 milliseconds, the pad will be scaled down to 0.7x of its
+ original size, which gives a great visual effect while flipping.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 8
+
+ This section uses a trick to ensure that certain properties are assigned
+ precisely when the flip animation passes 50%, or 90 degrees, rotation. In
+ short, the pad's icons and selection item are all hidden, the pad's \c fill
+ property is enabled, and \c backItem is shown when flipping over. When
+ flipping back, the reverse properties are applied.
+
+ The way this is achieved is by running a sequential animation in parallel
+ to the other animations. This sequence, dubbed \c setVariablesSequence,
+ starts with a 250 millisecond pause, and then executes several animations
+ with a duration of 0. Each animation will ensure that properties are set
+ immediate at this point.
+
+ This approach can also be used to call functions or set any other
+ properties at a specific time while an animation is running.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 9
+
+ We will now create the state machine. The whole \c PadNavigator state
+ machinery is controlled by one single state machine that has a
+ straight-forward state structure. The state engine itself is created
+ as a child of the \c PadNavigator itself. We then create three top level
+ states:
+
+ \list
+ \o \c splashState: The initial state where the splash item is visible.
+ \o \c frontState: The base state where the splash is gone and we can see
+ the front side of the pad, and navigate the selection item.
+ \o \c backState: The flipped state where the \c backItem is visible, and we
+ can interact with the QGraphicsProxyWidget-embedded form.
+ \endlist
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 10
+
+ Each state assigns specific properties to objects on entry. Most
+ interesting perhaps is the assignment of the value 0.0 to the pad's \c
+ flipRotation angle property when in \c frontState, and 180.0 when in \c
+ backState. At the end of this section we register default animations with
+ the state engine; these animations will apply to their respective objects
+ and properties for any state transition. Otherwise it's common to assign
+ animations to specific transitions.
+
+ The \c splashState state is set as the initial state. This is required
+ before we start the state engine. We proceed with creating some
+ transitions.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 11
+
+ QEventTransition defines a very flexible transition type. You can use this
+ class to trigger a transition based on an object receiving an event of a
+ specific type. In this case, we would like to transition from \c
+ splashState into \c frontState if \c PadNavigator receives any key press
+ event (QEvent::KeyPress).
+
+ We register the \c splashItem's animations to this transition to ensure they
+ are used to animate the item's movement and opacity.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 12
+
+ We use QKeyEventTransition to capture specific key events. In this case, we
+ detect that the user presses Qt::Key_Return or Qt::Key_Enter, and use this
+ to trigger transitions between \c frontState and backState. We register \c
+ flipAnimation, our complex parallel animation group, with these
+ transitions.
+
+ We continue by defining the states for each of the icons in the grid.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 13
+
+ We will use state groups to control transitions between icons. Each icon
+ represents a \e substate of \c frontState. We will then define transitions
+ between the states by detecting key presses, using QKeyEventTransition.
+
+ We start by creating all the substates, and at the same time we create a
+ temporary grid structure for the states to make it easier to find which
+ states represents icons that are up, down, left and to the right each
+ other.
+
+ Once the first substate is known, we set this up as the initial substate of
+ \c frontState. We will use the (0, 0), or top-left, icon for the initial
+ substate. We initialze the selection item's position to be exactly where
+ the top-left icon is.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 14
+
+ We can now create four transitions for each icon. Each transition ensures
+ that we move to the state corresponding to which arrow key has been
+ pressed. It's clear from this techinique that we could design any other
+ specific transitions to and from each of the sub states depending on these
+ and other keys.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 15
+
+ Also, for each of the icons, we assign suitable values to the \c xRotation
+ and \c yRotation objects' "angle"-properties. If you recall, these
+ properties "tilt" the pad corresponding to which item is currently
+ selected. We ensure each icon is invisible when the pad is flipped, and
+ visible when the pad is not flipped. To ensure the visible property is
+ assigned at the right time, we add property-controlling animations to the
+ \c setVariableSequence animation defined earlier.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 16
+
+ We are now finished with all states, transitions, and animations. We now
+ create the scene that will contain all our items. The scene gets a defined
+ background pixmap, and we disable item indexing (as most items in this
+ scene are animated). We add our \c pad item to the scene, and use its
+ bounding rectangle to fixate the scene rectangle. This rectangle is used by
+ the view to find a suitable size for the application window.
+
+ Then the scene is assigned to the view, or in our case, \c PadNavigator
+ itself.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 17
+
+ Now that the scene has received its final size, we can position the splash
+ item at the very top, find its fade-out position, and add it to the scene.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 18
+
+ The view toggles a few necessary properties:
+
+ \list
+ \o It disables its scroll bars - this application has no use for scroll bars.
+ \o It assigns a minimum size. This is necessary to avoid numerical errors
+ in our fit-in-view \c resizeEvent() implementation.
+ \o It sets \l{QGraphicsView::FullViewportUpdate}{FullViewportUpdate}, to
+ ensure QGraphicsView doesn't spend time figuring out precisely what needs
+ to be redrawn. This application is very simple - if anything changes,
+ everything is updated.
+ \o It enables background caching - this makes no performance difference
+ with OpenGL, but without OpenGL it avoids unnecessary re-scaling of the
+ background pixmap.
+ \o It sets render hints that increase rendering quality.
+ \o If OpenGL is supported, a QGLWidget viewport is assigned to the view.
+ \endlist
+
+ Finally, we start the state engine.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 19
+
+ The \l{QGraphicsView::resizeEvent()}{resizeEvent()} implementation calls
+ the base implementation, and then calls QGraphicsView::fitInView() to scale
+ the scene so that it fits perfectly inside the view.
+
+ By resizing the main application window, you can see this effect yourself.
+ The scene contents grow when you make the window larger, and shrink when
+ you make it smaller, while keeping the aspect ratio intact.
+
+ \section1 The main() Function
+
+ \snippet examples/graphicsview/padnavigator/main.cpp 0
+
+ The \c main function creates the QApplication instance, uses
+ Q_INIT_RESOURCE to ensure our compiled-in resources aren't removed by the
+ linker, and then creates a 3x3 \c PadNavigator instance and shows it.
+
+ Our flippable pad shows up with a suitable splash item once control returns
+ to the event loop.
+
+ \section1 Performance Notes
+
+ The example uses OpenGL if this is available, to achieve optimal
+ performance; otherwise perspective tranformations can be quite costly.
+
+ Although this example does use QGraphicsProxyWidget to demonstrate
+ integration of Qt widget components integrated into Graphics View, using
+ QGraphicsProxyWidget comes with a performance penalty, and is therefore not
+ recommended for embedded development.
+
+ This example uses extensive item caching to avoid rerendering of static
+ elements, at the expense of graphics memory.
*/
diff --git a/doc/src/examples/pinchzoom.qdoc b/doc/src/examples/pinchzoom.qdoc
index 726b1b3311..867b2b3a8a 100644
--- a/doc/src/examples/pinchzoom.qdoc
+++ b/doc/src/examples/pinchzoom.qdoc
@@ -46,5 +46,5 @@
The Pinch Zoom example shows how to use low-level multi-touch information
to recognize a gesture.
- \image multitouch-pinchzoom.png
+ \image multitouch-pinchzoom-example.png
*/
diff --git a/doc/src/examples/pixelator.qdoc b/doc/src/examples/pixelator.qdoc
index 09ae3e8d09..95099e14d9 100644
--- a/doc/src/examples/pixelator.qdoc
+++ b/doc/src/examples/pixelator.qdoc
@@ -80,8 +80,6 @@
functions to indicate the dimensions of the image and supply data to other
components.
- For convenience, the image to be used is passed in the constructor.
-
\section1 ImageModel Class Implementation
The constructor is trivial:
@@ -89,7 +87,7 @@
\snippet examples/itemviews/pixelator/imagemodel.cpp 0
The \c setImage() function sets the image that will be used by the model:
-
+
\snippet examples/itemviews/pixelator/imagemodel.cpp 1
The QAbstractItemModel::reset() call tells the view(s) that the model
@@ -233,7 +231,7 @@
This enables the items to be drawn without any gaps between them. Removing
the headers also prevents the user from adjusting the sizes of individual
rows and columns.
-
+
We also set the minimum section size to 1 on the headers. If we
didn't, the headers would default to a larger size, preventing
us from displaying really small items (which can be specified
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 93e4a4689d..b6069f20d8 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -40,79 +40,162 @@
****************************************************************************/
/*!
- \title Animations
- \example declarative/animations
+ \title Animation: Basics
+ \example declarative/animation/basics
- This example shows how to use animations in QML.
+ This example shows how to create \l{QML Animation}{animations} in QML.
*/
/*!
- \title AspectRatio
- \example declarative/aspectratio
+ \title Animation: Behaviors
+ \example declarative/animation/behaviors
- This example shows how to implement different aspect ratios in QML.
+ This example shows how to use QML behaviors.
*/
/*!
- \example declarative/behaviors
- \title Behaviors
+ \title Animation: Easing types
+ \example declarative/animation/easing
+
+ This example shows the different easing modes available for \l{QML Animation}{animations}.
+*/
+
+/*!
+ \title Animation: States
+ \example declarative/animation/states
+
+ This example shows how to use \l{States}{states} and \l{Transitions}{transitions}.
+*/
+
+/*!
+ \title Image Elements: Border Image
+ \example declarative/imageelements/borderimage
+
+ This example shows how to use the BorderImage element.
+*/
+
+/*!
+ \title Image Elements: Image
+ \example declarative/imageelements/image
+
+ This example shows how to use the Image element and its \l{Image::fillMode}{fillModes}.
+
+ \image qml-image-example.png
+*/
+
+/*!
+ \page declarative-cppextensions-reference.html
+ \title C++ Extensions: Reference examples
+
+ These examples show how QML can be extended from C++ in various ways.
+
+ The code for these examples is used throughout the \l {Extending QML in C++} reference
+ documentation, which highlights the main principles demonstrated in each example.
+
+ Furthermore, here are additional pages that discuss each example in detail:
+
+ \list
+ \o \l {declarative/cppextensions/referenceexamples/adding}{Adding Types}
+ \o \l {declarative/cppextensions/referenceexamples/properties}{Object and List Property Types}
+ \o \l {declarative/cppextensions/referenceexamples/coercion}{Inheritance and Coercion}
+ \o \l {declarative/cppextensions/referenceexamples/default}{Default Property}
+ \o \l {declarative/cppextensions/referenceexamples/grouped}{Grouped Properties}
+ \o \l {declarative/cppextensions/referenceexamples/attached}{Attached Properties}
+ \o \l {declarative/cppextensions/referenceexamples/signal}{Signal Support}
+ \o \l {declarative/cppextensions/referenceexamples/valuesource}{Property Value Source}
+ \o \l {declarative/cppextensions/referenceexamples/binding}{Binding}
+ \endlist
+
+ \note These examples all print information to the console to demonstrate the concepts presented.
+ Ensure that you are able to view the application output when running these examples.
+ For example, the dbgView tool on Windows can be used to display application output.
*/
/*!
- \title Border Image
- \example declarative/border-image
+ \title C++ Extensions: Plugins
+ \example declarative/cppextensions/plugins
- This example shows how to use a BorderImage in QML.
+ This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin.
*/
/*!
- \title Clocks
- \example declarative/clocks
+ \title LayoutItem
+ \example declarative/cppextensions/qgraphicslayouts/layoutitem
- This example shows how to create a Clock component and reuse it in a grid.
+ This example show how to use the LayoutItem element to integrate QML items into an existing
+ \l{Graphics View Framework}{Graphics View}-based application.
*/
+/*!
+ \title QGraphicsGridLayout
+ \example declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout
+ This example shows how to use QGraphicsGridLayout to lay out QML items. This is
+ useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
+ QML.
+*/
/*!
- \title Connections
- \example declarative/connections
+ \title QGraphicsLinearLayout
+ \example declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout
+
+ This example shows how to use QGraphicsLinearLayout to lay out QML items. This is
+ useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
+ QML.
+*/
+/*!
+ \page declarative-cppextensions-qgraphicslayouts.html
+ \title C++ Extensions: QGraphicsLayouts
+
+ These examples show how to integrate \l{Graphics View Framework}{Graphics View}
+ layout components with QML:
- This example shows how to use a Connection element in QML.
+ \list
+ \o \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem}
+ \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout}{QGraphicsGridLayout}
+ \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout}{QGraphicsLinearLayout}
+ \endlist
*/
/*!
- \title Dial
- \example declarative/dial
+ \title C++ Extensions: QWidgets
+ \example declarative/cppextensions/qwidgets
- This example shows how to implement a dial in QML.
+ This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget.
*/
/*!
- \title Dynamic
- \example declarative/dynamic
+ \title C++ Extensions: Image Provider
+ \example declarative/cppextensions/imageprovider
- This example shows how to create dynamic objects QML.
+ This examples shows how to use QDeclarativeImageProvider to serve images asynchronously
+ into a QML item.
*/
/*!
- \example declarative/extending
- \title Extending
+ \title C++ Extensions: Network access manager
+ \example declarative/cppextensions/networkaccessmanagerfactory
+
+ This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager
+ with a proxy.
*/
/*!
- \example declarative/fillmode
- \title Fillmode
+ \title Internationlization
+ \example declarative/i18n
+
+ This example shows how to enable text translation in QML.
*/
/*!
- \title Flipable
- \example declarative/flipable
+ \title Positioners
+ \example declarative/positioners
- This example shows how to use a Flipable element in QML.
+ This example shows how to use positioner elements such as Row, Column,
+ Grid and Flow.
*/
/*!
- \title Focus
- \example declarative/focus
+ \title Key Interaction: Focus
+ \example declarative/keyinteraction/focus
This example shows how to handle keys and focus in QML.
@@ -120,141 +203,238 @@
*/
/*!
- \example declarative/fonts
- \title Fonts
+ \title Models and Views: GridView
+ \example declarative/modelviews/gridview
+
+ This example shows how to use the GridView element.
*/
/*!
- \example declarative/gridview
- \title GridView
+ \title Models and Views: ListView
+ \example declarative/modelviews/listview
+
+ This example shows how to use the ListView element.
*/
/*!
- \example declarative/imageprovider
- \title Image Provider
+ \title Models and Views: Object ListModel
+ \example declarative/modelviews/objectlistmodel
+
+ This example shows how to create a C++ extension that exposes a
+ QList<QObject*> as a model in QML.
*/
/*!
- \example declarative/images
- \title Images
+ \title Models and Views: Package
+ \example declarative/modelviews/package
+
+ This example shows how to use the Package element.
*/
/*!
- \example declarative/layouts
- \title Layouts
+ \title Models and Views: Parallax
+ \example declarative/modelviews/parallax
+
+ This example shows how to combine and switch between views.
*/
/*!
- \example declarative/listmodel-threaded
- \title ListModel Threaded
+ \title Models and Views: String ListModel
+ \example declarative/modelviews/stringlistmodel
+
+ This example shows how to create a C++ extension that exposes a
+ QStringList as a model in QML.
*/
/*!
- \example declarative/listview
- \title ListView
+ \title Models and Views: VisualItemModel
+ \example declarative/modelviews/visualitemmodel
+
+ This example shows how to use the VisualItemModel element.
*/
/*!
- \example declarative/mousearea
- \title Mouse Area
+ \title Models and Views: WebView
+ \example declarative/modelviews/webview
+
+ This example shows how to use the WebView element.
*/
/*!
- \example declarative/objectlistmodel
- \title Object ListModel
+ \title SQL Local Storage
+ \example declarative/sqllocalstorage
+
+ This example shows how to use the SQL Local Storage API in QML.
*/
/*!
- \example declarative/package
- \title Package
+ \title Text: Fonts
+ \example declarative/text/fonts
+
+ This example shows how to discover available fonts from QML and use
+ fonts in different ways.
*/
/*!
- \example declarative/parallax
- \title Parallax
+ \title Threading: Threaded ListModel
+ \example declarative/threading/threadedlistmodel
+
+ This example shows how to use a ListModel from multiple threads using
+ WorkerScript.
*/
/*!
- \example declarative/plugins
- \title Plugins
+ \title Threading: WorkerScript
+ \example declarative/threading/workerscript
+
+ This example shows how to use the WorkerScript element for threading in QML.
*/
/*!
- \example declarative/progressbar
- \title Progress Bars
+ \title Toys: Clocks
+ \example declarative/toys/clocks
+
+ This example displays a set of clocks with different times for different cities.
+ Each clock is created by combining \l Image elements with \l Rotation transforms
+ and \l SpringFollow animations.
+
+ \image qml-clocks-example.png
*/
/*!
- \example declarative/proxywidgets
- \title Proxy Widgets
+ \title Toys: Corkboards
+ \example declarative/toys/corkboards
+
+ This example presents a flickable set of interactive corkboards. It is created
+ through a combination of elements like \l ListModel, \l Repeater and \l TextEdit
+ together with rotation and scaling transforms, animation and mouse interaction.
+
+ \image qml-corkboards-example.png
*/
/*!
- \example declarative/scrollbar
- \title Scrollbar
+ \title Toys: Dynamic Scene
+ \example declarative/toys/dynamicscene
+
+ This example presents an interactive drag-and-drop scene. It demonstrates
+ how to use QML's \l{Dynamic Object Creation} support to dynamically create and
+ destroy objects.
+
+ \image qml-dynamicscene-example.png
*/
/*!
- \example declarative/searchbox
- \title Search Box
+ \title Toys: Tic-Tac-Toe
+ \example declarative/toys/tic-tac-toe
+
+ This example presents a simple implementation of Tic Tac Toe.
+
+ \image qml-tic-tac-toe-example.png
*/
/*!
- \example declarative/slideswitch
- \title Slide Switch
+ \title Toys: TV Tennis
+ \example declarative/toys/tvtennis
+
+ This example shows how to use animation components such as \l SpringFollow,
+ \l SequentialAnimation and \l PropertyAction to create a game of TV tennis.
+
+ \image qml-tvtennis-example.png
*/
/*!
- \example declarative/sql
- \title SQL
+ \title Touch Interaction: Gestures
+ \example declarative/touchinteraction/gestures
+
+ This example shows how to use the GestureArea element.
*/
/*!
- \example declarative/states
- \title States
+ \title Touch Interaction: Mouse Area
+ \example declarative/touchinteraction/mousearea
+
+ This example shows how to use the MouseArea element.
*/
/*!
- \example declarative/stringlistmodel
- \title String ListModel
+ \title UI Components: Dial
+ \example declarative/ui-components/dialcontrol
+
+ This example presents an interactive speedometer-type dial by combining
+ \l Image elements with \l Rotation transforms and \l SpringFollow animations.
+
+ \image qml-dialcontrol-example.png
*/
+
/*!
- \example declarative/tabwidget
- \title Tab Widget
+ \title UI Components: Flipable
+ \example declarative/ui-components/flipable
+
+ This example shows how to use the Flipable element.
+
+ \image qml-flipable-example.png
*/
/*!
- \example declarative/tic-tac-toe
- \title Tic-Tac-Toe
+ \title UI Components: Progress Bars
+ \example declarative/ui-components/progressbar
+
+ This example shows how to create a progress bar.
+
+ \image qml-progressbar-example.png
*/
/*!
- \example declarative/tvtennis
- \title TV Tennis
+ \title UI Components: Scroll Bar
+ \example declarative/ui-components/scrollbar
+
+ This example shows how to create scroll bars for a Flickable element
+ using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea}
+ properties.
+
+ \image qml-scrollbar-example.png
*/
/*!
- \example declarative/velocity
- \title Velocity
+ \title UI Components: Search Box
+ \example declarative/ui-components/searchbox
+
+ This example shows how to create a search box.
+
+ \image qml-searchbox-example.png
*/
/*!
- \example declarative/webview
- \title WebView
+ \title UI Components: Slide Switch
+ \example declarative/ui-components/slideswitch
+
+ This example shows how to create a slide switch.
+
+ \image qml-slideswitch-example.png
*/
/*!
- \example declarative/workerscript
- \title WorkerScript
+ \title UI Components: Spinner
+ \example declarative/ui-components/spinner
+
+ This example shows how to create a spinner-type component.
+
+ \image qml-spinner-example.png
*/
/*!
- \example declarative/xmldata
- \title XML Data
+ \title UI Components: Tab Widget
+ \example declarative/ui-components/tabwidget
+
+ This example shows how to create a tab widget.
+
+ \image qml-tabwidget-example.png
*/
/*!
- \example declarative/xmlhttprequest
- \title XMLHttpRequest
+ \title XML: XMLHttpRequest
+ \example declarative/xml/xmlhttprequest
+
+ This example shows how to use \l XmlHttpRequest in QML.
*/
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/examples/qml-extending.qdoc
index 307162ef30..09108d667e 100644
--- a/doc/src/declarative/extending-examples.qdoc
+++ b/doc/src/examples/qml-extending.qdoc
@@ -40,13 +40,13 @@
****************************************************************************/
/*!
-\example declarative/extending/adding
+\example declarative/cppextensions/referenceexamples/adding
\title Extending QML - Adding Types Example
The Adding Types Example shows how to add a new element type, \c Person, to QML.
The \c Person type can be used from QML like this:
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
\section1 Declare the Person class
@@ -55,17 +55,17 @@ with the two properties we want accessible on the QML type - name and shoeSize.
Although in this example we use the same name for the C++ class as the QML
element, the C++ class can be named differently, or appear in a namespace.
-\snippet examples/declarative/extending/adding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.h 0
\section1 Define the Person class
-\snippet examples/declarative/extending/adding/person.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
-The implementation must also be registered using the QML_REGISTER_TYPE() macro. This macro
-registers the Person class with QML as a type in the People library version 1.0,
+The \c main.cpp file also calls the \c qmlRegisterType() function to
+register the \c Person type with QML as a type in the People library version 1.0,
and defines the mapping between the C++ and QML class names.
\section1 Running the example
@@ -75,7 +75,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/properties
+\example declarative/cppextensions/referenceexamples/properties
\title Extending QML - Object and List Property Types Example
This example builds on:
@@ -88,16 +88,16 @@ properties in QML. This example adds a BirthdayParty element that specifies
a birthday party, consisting of a celebrant and a list of guests. People are
specified using the People QML type built in the previous example.
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty
The BirthdayParty class is declared like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 0
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
-\snippet examples/declarative/extending/properties/birthdayparty.h 3
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a
QList<Person *> member.
@@ -114,7 +114,7 @@ scenarios.
The implementation of BirthdayParty property accessors is straight forward.
-\snippet examples/declarative/extending/properties/birthdayparty.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example
@@ -123,7 +123,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/coercion
+\example declarative/cppextensions/referenceexamples/coercion
\title Extending QML - Inheritance and Coercion Example
This example builds on:
@@ -136,11 +136,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
elements of more than one type to a property. It specializes the Person element
developed in the previous examples into two elements - a \c Boy and a \c Girl.
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl
-\snippet examples/declarative/extending/coercion/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.h 0
The Person class remains unaltered in this example and the Boy and Girl C++
classes are trivial extensions of it. As an example, the inheritance used here
@@ -155,19 +155,17 @@ previous example. However, as we have repurposed the People class as a common
base for Boy and Girl, we want to prevent it from being instantiated from QML
directly - an explicit Boy or Girl should be instantiated instead.
-\snippet examples/declarative/extending/coercion/main.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0
While we want to disallow instantiating Person from within QML, it still needs
to be registered with the QML engine, so that it can be used as a property type
-and other types can be coerced to it. To register a type, without defining a
-named mapping into QML, we call the QML_REGISTER_NOCREATE_TYPE() macro instead of
-the QML_REGISTER_TYPE() macro used previously.
+and other types can be coerced to it.
\section2 Define Boy and Girl
The implementation of Boy and Girl are trivial.
-\snippet examples/declarative/extending/coercion/person.cpp 1
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.cpp 1
All that is necessary is to implement the constructor, and to register the types
and their QML name with the QML engine.
@@ -177,7 +175,7 @@ and their QML name with the QML engine.
The BirthdayParty element has not changed since the previous example. The
celebrant and guests property still use the People type.
-\snippet examples/declarative/extending/coercion/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h 0
However, as all three types, Person, Boy and Girl, have been registered with the
QML system, on assignment QML automatically (and type-safely) converts the Boy
@@ -188,7 +186,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/default
+\example declarative/cppextensions/referenceexamples/default
\title Extending QML - Default Property Example
This example builds on:
@@ -202,14 +200,14 @@ The Default Property Example is a minor modification of the
\l {Extending QML - Inheritance and Coercion Example} that simplifies the
specification of a BirthdayParty through the use of a default property.
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
\section1 Declaring the BirthdayParty class
The only difference between this example and the last, is the addition of the
\c DefaultProperty class info annotation.
-\snippet examples/declarative/extending/default/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h 0
The default property specifies the property to assign to whenever an explicit
property is not specified, in the case of the BirthdayParty element the guest
@@ -224,7 +222,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/grouped
\title Extending QML - Grouped Properties Example
This example builds on:
@@ -238,7 +236,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/attached
\title Extending QML - Attached Properties Example
This example builds on:
@@ -253,7 +251,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/signal
+\example declarative/cppextensions/referenceexamples/signal
\title Extending QML - Signal Support Example
This example builds on:
@@ -269,7 +267,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/valuesource
+\example declarative/cppextensions/referenceexamples/valuesource
\title Extending QML - Property Value Source Example
This example builds on:
@@ -286,7 +284,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/binding
+\example declarative/cppextensions/referenceexamples/binding
\title Extending QML - Binding Example
This example builds on:
diff --git a/doc/src/examples/qml-flickr.qdoc b/doc/src/examples/qml-flickr.qdoc
index ebf3250f0b..43fcf1f6cf 100644
--- a/doc/src/examples/qml-flickr.qdoc
+++ b/doc/src/examples/qml-flickr.qdoc
@@ -45,5 +45,5 @@
This demo shows how to write a mobile Flickr browser application in QML.
- \image qml-flickr-example.png
+ \image qml-flickr-demo.png
*/
diff --git a/doc/src/examples/qml-folderlistmodel.qdoc b/doc/src/examples/qml-folderlistmodel.qdoc
new file mode 100644
index 0000000000..b820528c9c
--- /dev/null
+++ b/doc/src/examples/qml-folderlistmodel.qdoc
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\title FolderListModel - a C++ model plugin
+\example src/imports/folderlistmodel
+
+This plugin shows how to make a C++ model available to QML. It presents
+a simple file list for a single folder (directory) and allows the presented
+folder to be changed.
+
+\image declarative-folderlistmodel.png The FolderListModel used to choose a QML file
+
+We do not explain the model implementation in detail, but rather focus on the mechanics of
+making the model available to QML.
+
+\section1 Usage from QML
+
+The type we are creating can be used from QML like this:
+
+\snippet doc/src/snippets/declarative/folderlistmodel.qml 0
+
+\section1 Defining the Model
+
+We are subclassing QAbstractListModel which will allow us to give data to QML and
+send notifications when the data changes:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class begin
+
+As you see, we also inherit the QDeclarativeParserStatus interface, so that we
+can delay initial processing until we have all properties set (via componentComplete() below).
+
+The first thing to do when devising a new type for QML is to define the properties
+you want the type to have:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class props
+
+The purposes of each of these should be pretty obvious - in QML we will set the folder
+to display (a file: URL), and the kinds of files we want to show in the view of the model.
+
+Next are the constructor, destructor, and standard QAbstractListModel subclassing requirements:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h abslistmodel
+
+The data() function is where we provide model values. The rowCount() function
+is also a standard part of the QAbstractListModel interface, but we also want to provide
+a simpler count property:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h count
+
+Then we have the functions for the remaining properties which we defined above:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h prop funcs
+
+Imperative actions upon the model are made available to QML via a Q_INVOKABLE tag on
+a normal member function. The isFolder(index) function says whether the value at \e index
+is a folder:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h isfolder
+
+Then we have the QDeclarativeParserStatus interface:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h parserstatus
+
+Then the NOTIFY function for the folders property. The implementation will emit this
+when the folder property is changed.
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h notifier
+
+The class ends with some implementation details:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h class end
+
+Lastly, the boilerplare to declare the type for QML use:
+
+\snippet src/imports/folderlistmodel/qdeclarativefolderlistmodel.h qml decl
+
+\section1 Connecting the Model to QML
+
+To make this class available to QML, we only need to make a simple subclass of QDeclarativeExtensionPlugin:
+
+\snippet src/imports/folderlistmodel/plugin.cpp class decl
+
+and then use the standard Qt plugin export macro:
+
+\snippet src/imports/folderlistmodel/plugin.cpp plugin export decl
+
+Finally, in order for QML to connect the "import" statement to our plugin, we list it in the qmldir file:
+
+\l{src/imports/folderlistmodel/qmldir}
+
+This qmldir file and the compiled plugin will be installed in \c $QTDIR/imports/Qt/labs/folderlistmodel/ where
+the QML engine will find it (since \c $QTDIR/imports is the value of QLibraryInf::libraryPath()).
+
+\section1 Implementing the Model
+
+We'll not discuss the model implementation in detail, as it is not specific to QML - any Qt C++ model
+can be interfaced to QML.
+This implementation is basically just takes the krufty old QDirModel,
+which is a tree with lots of detailed roles and re-presents it as a simpler list model where
+each item is just a fileName and a filePath (as a file: URL rather than a plain file, since QML
+works with URLs for all content).
+
+\l{src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp}
+*/
diff --git a/doc/src/examples/qml-minehunt.qdoc b/doc/src/examples/qml-minehunt.qdoc
index 773f21646d..b2c662d91f 100644
--- a/doc/src/examples/qml-minehunt.qdoc
+++ b/doc/src/examples/qml-minehunt.qdoc
@@ -43,7 +43,8 @@
\title Minehunt
\example demos/declarative/minehunt
- This demo shows how to create a simple Minehunt game with QML and C++.
+ This demo shows how to create a simple Minehunt game, using QML for the
+ UI and a C++ plugin for the game logic.
- \image qml-minehunt-example.png
+ \image qml-minehunt-demo.png
*/
diff --git a/doc/src/examples/qml-photoviewer.qdoc b/doc/src/examples/qml-photoviewer.qdoc
index d1c3da287e..d2114b90f9 100644
--- a/doc/src/examples/qml-photoviewer.qdoc
+++ b/doc/src/examples/qml-photoviewer.qdoc
@@ -45,5 +45,5 @@
This demo shows how to write a Flickr photo viewer application in QML.
- \image qml-photoviewer-example.png
+ \image qml-photoviewer-demo.png
*/
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h b/doc/src/examples/qml-rssnews.qdoc
index 3050662544..801efd9ab1 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h
+++ b/doc/src/examples/qml-rssnews.qdoc
@@ -38,17 +38,12 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
-#include <QGraphicsWidget>
-#include <QPainter>
-class RedSquare : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
- {
- painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red));
- }
-};
-//![0]
+/*!
+ \title RSS News
+ \example demos/declarative/rssnews
+
+ This demo shows how to write a RSS news reader in QML.
+
+ \image qml-rssnews-demo.png
+*/
diff --git a/doc/src/examples/qml-samegame.qdoc b/doc/src/examples/qml-samegame.qdoc
index d9a9c7c433..5b78b0cf42 100644
--- a/doc/src/examples/qml-samegame.qdoc
+++ b/doc/src/examples/qml-samegame.qdoc
@@ -43,7 +43,8 @@
\title Same Game
\example demos/declarative/samegame
- This demo shows how to write a Same Game in QML.
+ This demo shows how to write a 'Same Game' game in QML, using Javascript
+ for all the game logic.
- \image qml-samegame-example.png
+ \image qml-samegame-demo.png
*/
diff --git a/doc/src/examples/qml-snake.qdoc b/doc/src/examples/qml-snake.qdoc
index 373ca133af..3125f2d939 100644
--- a/doc/src/examples/qml-snake.qdoc
+++ b/doc/src/examples/qml-snake.qdoc
@@ -43,7 +43,8 @@
\title Snake
\example demos/declarative/snake
- This demo shows how to write a Snake game in QML.
+ This demo shows how to write a Snake game in QML, controlled by the
+ keyboard as well as the mouse.
- \image qml-snake-example.png
+ \image qml-snake-demo.png
*/
diff --git a/doc/src/examples/qml-twitter.qdoc b/doc/src/examples/qml-twitter.qdoc
new file mode 100644
index 0000000000..0e663606f0
--- /dev/null
+++ b/doc/src/examples/qml-twitter.qdoc
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Twitter Mobile
+ \example demos/declarative/twitter
+
+ This demo shows how to write a mobile Twitter client in QML. Use it to
+ tweet us(@qtbynokia) how much you like our demos!
+
+ \image qml-twitter-demo.png
+*/
diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc
index 0d8de1d4d0..0c246cb72a 100644
--- a/doc/src/examples/transformations.qdoc
+++ b/doc/src/examples/transformations.qdoc
@@ -87,7 +87,7 @@
tranformation matrix that you can retrieve using the
QPainter::worldTransform() function. A matrix transforms a point in the
plane to another point. For more information about the
- transformation matrix, see the \l {The Coordinate System} and
+ transformation matrix, see the \l {Coordinate System} and
QTransform documentation.
\snippet examples/painting/transformations/renderarea.h 0
@@ -374,7 +374,7 @@
All the tranformation operations operate on QPainter's
tranformation matrix. For more information about the
- transformation matrix, see the \l {The Coordinate System} and
+ transformation matrix, see the \l {Coordinate System} and
QTransform documentation.
The Qt reference documentation provides several painting
diff --git a/doc/src/examples/undoframework.qdoc b/doc/src/examples/undoframework.qdoc
index adb38b6c2c..aab25fa499 100644
--- a/doc/src/examples/undoframework.qdoc
+++ b/doc/src/examples/undoframework.qdoc
@@ -67,7 +67,7 @@
available through the edit menu. The user can also select a command
from the undo view.
- We use the \l{The Graphics View Framework}{graphics view
+ We use the \l{Graphics View Framework}{graphics view
framework} to implement the diagram. We only treat the related
code briefly as the framework has examples of its own (e.g., the
\l{Diagram Scene Example}).
diff --git a/doc/src/examples/waitconditions.qdoc b/doc/src/examples/waitconditions.qdoc
index 1d3ff849e3..d4f680e4e5 100644
--- a/doc/src/examples/waitconditions.qdoc
+++ b/doc/src/examples/waitconditions.qdoc
@@ -92,7 +92,7 @@
Together, the wait conditions, the mutex, and the \c numUsedBytes
counter ensure that the producer is never more than \c BufferSize
bytes ahead of the consumer, and that the consumer never reads
- data that the consumer hasn't generated yet.
+ data that the producer hasn't generated yet.
\section1 Producer Class
diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc
index 3ca50b4b99..249c10a14e 100644
--- a/doc/src/external-resources.qdoc
+++ b/doc/src/external-resources.qdoc
@@ -422,3 +422,8 @@
\externalpage http://www.w3.org/XML/Schema
\title XML Schema
*/
+
+/*!
+ \externalpage http://opensource.org/licenses/bsd-license.php
+ \title New and Modified BSD Licenses
+*/
diff --git a/doc/src/files-and-resources/datastreamformat.qdoc b/doc/src/files-and-resources/datastreamformat.qdoc
index bab2c2c3e0..c4be7bbd59 100644
--- a/doc/src/files-and-resources/datastreamformat.qdoc
+++ b/doc/src/files-and-resources/datastreamformat.qdoc
@@ -41,7 +41,8 @@
/*!
\page datastreamformat.html
- \title Format of the QDataStream Operators
+ \title Serializing Qt Data Types
+ \ingroup qt-network
\brief Representations of data types that can be serialized by QDataStream.
The \l QDataStream allows you to serialize some of the Qt data types.
diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc
index 00646ac5ca..83d74a3d93 100644
--- a/doc/src/files-and-resources/resources.qdoc
+++ b/doc/src/files-and-resources/resources.qdoc
@@ -54,6 +54,8 @@
/*!
\page resources.html
\title The Qt Resource System
+ \ingroup qt-network
+ \brief A platform-independent mechanism for storing binary files in an application.
\keyword resource system
diff --git a/doc/src/frameworks-technologies/accessible.qdoc b/doc/src/frameworks-technologies/accessible.qdoc
index 101d22a4ae..0aff214a21 100644
--- a/doc/src/frameworks-technologies/accessible.qdoc
+++ b/doc/src/frameworks-technologies/accessible.qdoc
@@ -47,8 +47,10 @@
/*!
\page accessible.html
\title Accessibility
-
- \ingroup frameworks-technologies
+ \brief How to make your applications accessible to those with disabilities.
+
+ \ingroup technology-apis
+ \ingroup best-practices
\tableofcontents
diff --git a/doc/src/frameworks-technologies/activeqt-container.qdoc b/doc/src/frameworks-technologies/activeqt-container.qdoc
index c1c09479f7..03cfa8f3f6 100644
--- a/doc/src/frameworks-technologies/activeqt-container.qdoc
+++ b/doc/src/frameworks-technologies/activeqt-container.qdoc
@@ -41,10 +41,11 @@
/*!
\page activeqt-container.html
- \title Using ActiveX controls and COM objects in Qt
+ \title Using ActiveX controls and COM in Qt
+ \ingroup qt-activex
- \brief The QAxContainer module is a Windows-only extension for
- accessing ActiveX controls and COM objects.
+ \brief A Windows-only extension for accessing ActiveX controls and
+ COM objects.
The QAxContainer module is part of the \l ActiveQt framework. It
provides a library implementing a QWidget subclass, QAxWidget,
diff --git a/doc/src/frameworks-technologies/activeqt-server.qdoc b/doc/src/frameworks-technologies/activeqt-server.qdoc
index 4afcee1114..900953a311 100644
--- a/doc/src/frameworks-technologies/activeqt-server.qdoc
+++ b/doc/src/frameworks-technologies/activeqt-server.qdoc
@@ -41,10 +41,10 @@
/*!
\page activeqt-server.html
- \title Building ActiveX servers and controls with Qt
+ \title Building ActiveX servers in Qt
+ \ingroup qt-activex
- \brief The QAxServer module is a Windows-only static library that
- you can use to turn a standard Qt binary into a COM server.
+ \brief A Windows-only static library for turning a Qt binary into a COM server.
The QAxServer module is part of the \l ActiveQt framework. It
consists of three classes:
diff --git a/doc/src/frameworks-technologies/activeqt.qdoc b/doc/src/frameworks-technologies/activeqt.qdoc
index b752122dad..5a3b23ebeb 100644
--- a/doc/src/frameworks-technologies/activeqt.qdoc
+++ b/doc/src/frameworks-technologies/activeqt.qdoc
@@ -53,12 +53,12 @@
/*!
\page activeqt.html
- \title ActiveQt Framework
+ \title Qt's ActiveX Framework (ActiveQt)
\brief An overview of Qt's ActiveX and COM integration on Windows.
- \ingroup platform-specific
- \ingroup frameworks-technologies
+ \ingroup qt-activex
\keyword ActiveQt
+ \target ActiveQt Framework
Qt's ActiveX and COM support allows Qt for Windows developers to:
@@ -71,16 +71,16 @@
\endlist
For more information about using ActiveX with Qt, see
- \l{Building ActiveX servers and controls with Qt}.
+ \l{Building ActiveX servers in Qt}.
The ActiveQt framework consists of two modules:
\list
- \o The \l{Using ActiveX controls and COM objects in Qt}{QAxContainer}
+ \o The \l{Using ActiveX controls and COM in Qt}{QAxContainer}
module is a static library implementing QObject and QWidget subclasses,
QAxObject and QAxWidget, that act as containers for COM objects and
ActiveX controls.
- \o The \l{Building ActiveX servers and controls with Qt}{QAxServer}
+ \o The \l{Building ActiveX servers in Qt}{QAxServer}
module is a static library that implements
functionality for in-process and executable COM servers. This
module provides the QAxAggregated, QAxBindable and QAxFactory
diff --git a/doc/src/frameworks-technologies/animation.qdoc b/doc/src/frameworks-technologies/animation.qdoc
index 5548b57590..dc705ba85d 100644
--- a/doc/src/frameworks-technologies/animation.qdoc
+++ b/doc/src/frameworks-technologies/animation.qdoc
@@ -47,6 +47,7 @@
/*!
\page animation-overview.html
\title The Animation Framework
+ \ingroup qt-gui-concepts
\brief An overview of the Animation Framework
diff --git a/doc/src/frameworks-technologies/containers.qdoc b/doc/src/frameworks-technologies/containers.qdoc
index 505b65c987..5b184fa519 100644
--- a/doc/src/frameworks-technologies/containers.qdoc
+++ b/doc/src/frameworks-technologies/containers.qdoc
@@ -58,7 +58,7 @@
/*!
\page containers.html
\title Generic Containers
- \ingroup frameworks-technologies
+ \ingroup technology-apis
\ingroup groups
\keyword container class
\keyword container classes
diff --git a/doc/src/frameworks-technologies/dbus-adaptors.qdoc b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
index 5fc7a7930f..3dd0e4dea6 100644
--- a/doc/src/frameworks-technologies/dbus-adaptors.qdoc
+++ b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
@@ -42,7 +42,9 @@
/*!
\page usingadaptors.html
\title Using QtDBus Adaptors
+ \brief How to create and use DBus adaptors in Qt.
+ \ingroup technology-apis
\ingroup best-practices
Adaptors are special classes that are attached to any QObject-derived class
diff --git a/doc/src/frameworks-technologies/dbus-intro.qdoc b/doc/src/frameworks-technologies/dbus-intro.qdoc
index 1fe2ed2810..10726e5e7a 100644
--- a/doc/src/frameworks-technologies/dbus-intro.qdoc
+++ b/doc/src/frameworks-technologies/dbus-intro.qdoc
@@ -45,7 +45,7 @@
\brief An introduction to Inter-Process Communication and Remote Procedure Calling with D-Bus.
\keyword QtDBus
- \ingroup frameworks-technologies
+ \ingroup technology-apis
\section1 Introduction
diff --git a/doc/src/frameworks-technologies/desktop-integration.qdoc b/doc/src/frameworks-technologies/desktop-integration.qdoc
index 7f01ae337d..59b2570e80 100644
--- a/doc/src/frameworks-technologies/desktop-integration.qdoc
+++ b/doc/src/frameworks-technologies/desktop-integration.qdoc
@@ -40,16 +40,12 @@
****************************************************************************/
/*!
- \group desktop
- \title Desktop Integration Classes
-*/
-
-/*!
\page desktop-integration.html
\title Desktop Integration
\brief Integrating with the user's desktop environment.
\ingroup best-practices
+ \ingroup qt-gui-concepts
Qt applications behave well in the user's desktop environment, but certain
integrations require additional, and sometimes platform specific, techniques.
diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc
index 49468de308..f728972b2a 100644
--- a/doc/src/frameworks-technologies/dnd.qdoc
+++ b/doc/src/frameworks-technologies/dnd.qdoc
@@ -40,18 +40,12 @@
****************************************************************************/
/*!
- \group draganddrop
- \title Drag And Drop Classes
-
- \brief Classes dealing with drag and drop and mime type encoding and decoding.
-*/
-
-/*!
\page dnd.html
\title Drag and Drop
\brief An overview of the drag and drop system provided by Qt.
- \ingroup frameworks-technologies
+ \ingroup technology-apis
+ \ingroup qt-gui-concepts
Drag and drop provides a simple visual mechanism which users can use
to transfer information between and within applications. (In the
@@ -64,9 +58,9 @@
This document describes the basic drag and drop mechanism and
outlines the approach used to enable it in custom widgets. Drag
and drop operations are also supported by Qt's item views and by
- the graphics view framework; more information is available in the
- \l{Using Drag and Drop with Item Views} and \l{The Graphics View
- Framework} documents.
+ the graphics view framework. More information is available in
+ \l{Using Drag and Drop with Item Views} and \l{Graphics View
+ Framework}.
\section1 Drag and Drop Classes
diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc
index 96ee18c818..0cd60b8440 100644
--- a/doc/src/frameworks-technologies/eventsandfilters.qdoc
+++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc
@@ -54,7 +54,8 @@
/*!
\page eventsandfilters.html
- \title Events and Event Filters
+ \title The Event System
+ \ingroup qt-basic-concepts
\brief A guide to event handling in Qt.
\ingroup frameworks-technologies
diff --git a/doc/src/frameworks-technologies/gestures.qdoc b/doc/src/frameworks-technologies/gestures.qdoc
index 1b395b0e45..c999fa6e46 100644
--- a/doc/src/frameworks-technologies/gestures.qdoc
+++ b/doc/src/frameworks-technologies/gestures.qdoc
@@ -42,12 +42,13 @@
/*!
\page gestures-overview.html
\title Gestures Programming
- \ingroup frameworks-technologies
\startpage index.html Qt Reference Documentation
+ \ingroup technology-apis
+ \ingroup qt-gui-concepts
- \brief An overview of the Qt support for Gesture programming.
+ \brief An overview of Qt support for Gesture programming.
- Qt includes a framework for gesture programming that gives has the ability
+ Qt includes a framework for gesture programming that has the ability
to form gestures from a series of events, independently of the input methods
used. A gesture could be a particular movement of a mouse, a touch screen
action, or a series of events from some other source. The nature of the input,
diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc
index 6844aed680..b13f98e67f 100644
--- a/doc/src/frameworks-technologies/graphicsview.qdoc
+++ b/doc/src/frameworks-technologies/graphicsview.qdoc
@@ -46,12 +46,11 @@
/*!
\page graphicsview.html
- \title The Graphics View Framework
+ \title Graphics View Framework
+ \ingroup qt-graphics
\brief An overview of the Graphics View framework for interactive 2D
graphics.
- \ingroup frameworks-technologies
-
\keyword Graphics View
\keyword GraphicsView
\keyword Graphics
@@ -221,9 +220,10 @@
allow you to map between the three coordinate systems.
When rendering, Graphics View's scene coordinates correspond to
- QPainter's \e logical coordinates, and view coordinates are the same as
- \e device coordinates. In \l{The Coordinate System}, you can read about
- the relationship between logical coordinates and device coordinates.
+ QPainter's \e logical coordinates, and view coordinates are the
+ same as \e device coordinates. In the \l{Coordinate System}
+ documentation, you can read about the relationship between
+ logical coordinates and device coordinates.
\img graphicsview-parentchild.png
@@ -436,11 +436,12 @@
\section2 Animation
- Graphics View supports animation at several levels. You can easily
- assemble animation by using the Animation Framework. For that you'll
- need your items to inherit from QGraphicsObject and associate
- QPropertyAnimation with them. QPropertyAnimation allows to animate any
- QObject property.
+ Graphics View supports animation at several levels. You can
+ easily assemble animation by using the Animation Framework.
+ For that you'll need your items to inherit from
+ QGraphicsObject and associate QPropertyAnimation with
+ them. QPropertyAnimation allows to animate any QObject
+ property.
Another option is to create a custom item that inherits from QObject
and QGraphicsItem. The item can the set up its own timers, and control
diff --git a/doc/src/frameworks-technologies/implicit-sharing.qdoc b/doc/src/frameworks-technologies/implicit-sharing.qdoc
index e4d6f65d33..f42ec93766 100644
--- a/doc/src/frameworks-technologies/implicit-sharing.qdoc
+++ b/doc/src/frameworks-technologies/implicit-sharing.qdoc
@@ -50,7 +50,7 @@
/*!
\page implicit-sharing.html
\title Implicit Sharing
- \ingroup frameworks-technologies
+ \ingroup qt-basic-concepts
\brief Reference counting for fast copying.
diff --git a/doc/src/frameworks-technologies/ipc.qdoc b/doc/src/frameworks-technologies/ipc.qdoc
index 18a9455355..b49a816f85 100644
--- a/doc/src/frameworks-technologies/ipc.qdoc
+++ b/doc/src/frameworks-technologies/ipc.qdoc
@@ -44,7 +44,8 @@
\title Inter-Process Communication in Qt
\brief Inter-Process communication in Qt applications.
- \ingroup frameworks-technologies
+ \ingroup technology-apis
+ \ingroup qt-network
Qt provides several ways to implement Inter-Process Communication
(IPC) in Qt applications.
diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc
index 7568981e1f..3bac8ce2e7 100644
--- a/doc/src/frameworks-technologies/model-view-programming.qdoc
+++ b/doc/src/frameworks-technologies/model-view-programming.qdoc
@@ -46,71 +46,13 @@
/*!
\page model-view-programming.html
- \nextpage An Introduction to Model/View Programming
- \startpage index.html Qt Reference Documentation
\title Model/View Programming
- \brief A guide to the extensible model/view architecture used by Qt's
- item view classes.
+ \brief A guide to Qt's extensible model/view architecture.
- \ingroup frameworks-technologies
+ \section1 Introduction to Model/View Programming
- \list
- \o \l{An Introduction to Model/View Programming}
- \tableofcontents{1 An Introduction to Model/View Programming}
- \o \l{Using Models and Views}
- \tableofcontents{1 Using Models and Views}
- \o \l{Model Classes}
- \tableofcontents{1 Model Classes}
- \o \l{Creating New Models}
- \tableofcontents{1 Creating New Models}
- \o \l{View Classes}
- \tableofcontents{1 View Classes}
- \o \l{Handling Selections in Item Views}
- \tableofcontents{1 Handling Selections in Item Views}
- \o \l{Delegate Classes}
- \tableofcontents{1 Delegate Classes}
- \o \l{Item View Convenience Classes}
- \tableofcontents{1 Item View Convenience Classes}
- \o \l{Using Drag and Drop with Item Views}
- \tableofcontents{1 Using Drag and Drop with Item Views}
- \o \l{Proxy Models}
- \tableofcontents{1 Proxy Models}
- \o \l{Model Subclassing Reference}
- \tableofcontents{1 Model Subclassing Reference}
- \endlist
-
- \keyword Model/View Classes
- \section1 All Model/View Classes
-
- These classes use the model/view design pattern in which the
- underlying data (in the model) is kept separate from the way the data
- is presented and manipulated by the user (in the view).
-
- \annotatedlist model-view
-
- \section1 Related Examples
-
- \list
- \o \l{itemviews/dirview}{Dir View}
- \o \l{itemviews/spinboxdelegate}{Spin Box Delegate}
- \o \l{itemviews/pixelator}{Pixelator}
- \o \l{itemviews/simpletreemodel}{Simple Tree Model}
- \o \l{itemviews/chart}{Chart}
- \endlist
-*/
-
-/*!
- \page model-view-introduction.html
- \previouspage Model/View Programming
- \nextpage Using Models and Views
- \startpage index.html Qt Reference Documentation
-
- \title An Introduction to Model/View Programming
-
- \tableofcontents
-
- Qt 4 introduces a new set of item view classes that use a model/view
+ Qt 4 introduced a new set of item view classes that use a model/view
architecture to manage the relationship between data and the way it
is presented to the user. The separation of functionality introduced by
this architecture gives developers greater flexibility to customize the
@@ -121,7 +63,7 @@
view system. Each of the components in the architecture is explained,
and examples are given that show how to use the classes provided.
- \section1 The Model/View Architecture
+ \section2 The model/view architecture
Model-View-Controller (MVC) is a design pattern originating from
Smalltalk that is often used when building user interfaces.
@@ -185,7 +127,7 @@
model and view about the state of the editor.
\endlist
- \section2 Models
+ \section3 Models
All item models are based on the QAbstractItemModel class. This class
defines an interface that is used by views and delegates to access data.
@@ -225,7 +167,7 @@
QAbstractItemModel, QAbstractListModel, or QAbstractTableModel to create
your own custom models.
- \section2 Views
+ \section3 Views
Complete implementations are provided for different kinds of
views: QListView displays a list of items, QTableView displays data
@@ -237,7 +179,7 @@
The available views are examined in the section on \l{View Classes}.
- \section2 Delegates
+ \section3 Delegates
QAbstractItemDelegate is the abstract base class for delegates in the
model/view framework. Since Qt 4.4, the default delegate implementation is
@@ -251,7 +193,7 @@
Delegates are described in the section on \l{Delegate Classes}.
- \section2 Sorting
+ \section3 Sorting
There are two ways of approaching sorting in the model/view
architecture; which approach to choose depends on your underlying
@@ -272,7 +214,7 @@
before presenting the data in the view. This is covered in detail
in the section on \l {Proxy Models}.
- \section2 Convenience Classes
+ \section3 Convenience classes
A number of \e convenience classes are derived from the standard view
classes for the benefit of applications that rely on Qt's item-based
@@ -293,24 +235,13 @@
classes, such as QListView, QTableView, and QTreeView with
QStandardItemModel.
- \section1 The Model/View Components
+ \section1 Using models and views
- The following sections describe the way in which the model/view pattern
- is used in Qt. Each section provides an example of use, and is followed
- by a section showing how you can create new components.
-*/
-
-/*!
- \page model-view-using.html
- \contentspage model-view-programming.html Contents
- \previouspage An Introduction to Model/View Programming
- \nextpage Model Classes
+ The following sections explain how to use the model/view pattern
+ in Qt. Each section includes an an example and is followed by a
+ section showing how to create new components.
- \title Using Models and Views
-
- \tableofcontents
-
- \section1 Introduction
+ \section2 Two models included in Qt
Two of the standard models provided by Qt are QStandardItemModel and
QFileSystemModel. QStandardItemModel is a multi-purpose model that can be
@@ -325,7 +256,7 @@
to set up a model for use with ready-made views, and explore how to
manipulate data using model indexes.
- \section1 Using Views with an Existing Model
+ \section2 Using views with an existing model
The QListView and QTreeView classes are the most suitable views
to use with QFileSystemModel. The example presented below displays the
@@ -361,7 +292,7 @@
The \c index() function used in this case is unique to QFileSystemModel; we
supply it with a directory and it returns a model index. Model indexes are
- discussed in the \l{Model Classes} chapter.
+ discussed in \l{Model Classes}.
The rest of the function just displays the views within a splitter
widget, and runs the application's event loop:
@@ -369,23 +300,15 @@
\snippet doc/src/snippets/shareddirmodel/main.cpp 8
In the above example, we neglected to mention how to handle selections
- of items. This subject is covered in more detail in the chapter on
- \l{Handling Selections in Item Views}. Before examining how selections
- are handled, you may find it useful to read the \l{Model Classes} chapter
- which describes the concepts used in the model/view framework.
-*/
+ of items. This subject is covered in more detail in the section about
+ \l{Handling Selections in Item Views}.
-/*!
- \page model-view-model.html
- \contentspage model-view-programming.html Contents
- \previouspage Using Models and Views
- \nextpage Creating New Models
-
- \title Model Classes
+ \section1 Model classes
- \tableofcontents
+ Before examining how selections are handled, you may find it
+ useful to examine the concepts used in the model/view framework.
- \section1 Basic Concepts
+ \section2 Basic concepts
In the model/view architecture, the model provides a standard interface
that views and delegates use to access data. In Qt, the standard
@@ -401,11 +324,11 @@
Models also notify any attached views about changes to data through the
signals and slots mechanism.
- This chapter describes some basic concepts that are central to the way
+ This section describes some basic concepts that are central to the way
item of data are accessed by other components via a model class. More
- advanced concepts are discussed in later chapters.
+ advanced concepts are discussed in later sections.
- \section2 Model Indexes
+ \section3 Model indexes
To ensure that the representation of the data is kept separate from the
way it is accessed, the concept of a \e{model index} is introduced. Each
@@ -435,7 +358,7 @@
and the model index of a parent item. The following sections describe
and explain these properties in detail.
- \section2 Rows and Columns
+ \section3 Rows and columns
In its most basic form, a model can be accessed as a simple table in which
items are located by their row and column numbers. \e{This does not mean
@@ -468,7 +391,7 @@
section.
\endtable
- \section2 Parents of Items
+ \section3 Parents of items
The table-like interface to item data provided by models is ideal when
using data in a table or list view; the row and column number system maps
@@ -501,7 +424,7 @@
\snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 5
\endtable
- \section2 Item Roles
+ \section3 Item roles
Items in a model can perform various \e roles for other components,
allowing different kinds of data to be supplied for different situations.
@@ -534,7 +457,7 @@
interpret or ignore this information as required. It is also possible to
define additional roles for application-specific purposes.
- \section2 Summary of Concepts
+ \section3 Summary
\list
\o Model indexes give views and delegates information about the location
@@ -546,17 +469,16 @@
components, such as views and delegates.
\o If a valid model index is specified for the parent item when an index is
requested using \l{QAbstractItemModel::index()}{index()}, the index
- returned will refer to an item beneath that parent item in the
- model.
+ returned refers to an item beneath that parent item in the model.
The index obtained refers to a child of that item.
\o If an invalid model index is specified for the parent item when an index
is requested using \l{QAbstractItemModel::index()}{index()}, the index
- returned will refer to a top-level item in the model.
+ returned refers to a top-level item in the model.
\o The \l{Qt::ItemDataRole}{role} distinguishes between the
different kinds of data associated with an item.
\endlist
- \section2 Using Model Indexes
+ \section2 Using model indexes
To demonstrate how data can be retrieved from a model, using model
indexes, we set up a QFileSystemModel without a view and display the
@@ -610,26 +532,16 @@
to the model.
\endlist
+ \section2 Further reading
- \section1 Further Reading
-
- New models can be created by implementing the standard interface provided
- by QAbstractItemModel. In the \l{Creating New Models} chapter, we will
- demonstrate this by creating a convenient ready-to-use model for holding
- lists of strings.
-*/
-
-/*!
- \page model-view-view.html
- \contentspage model-view-programming.html Contents
- \previouspage Creating New Models
- \nextpage Handling Selections in Item Views
+ New models can be created by implementing the standard interface
+ provided by QAbstractItemModel. In the \l{Creating New Models}
+ section, we demonstrate this by creating a convenient ready-to-use
+ model for holding lists of strings.
- \title View Classes
+ \section1 View classes
- \tableofcontents
-
- \section1 Concepts
+ \section2 Concepts
In the model/view architecture, the view obtains items of data from the
model and presents them to the user. The way that the data is
@@ -668,7 +580,7 @@
subclassed from the QHeaderView class to provide more specialized
labels for views.
- \section1 Using an Existing View
+ \section2 Using an existing view
Qt provides three ready-to-use view classes that present data from
models in ways that are familiar to most users.
@@ -686,7 +598,7 @@
facilities, and can be customized to suit the needs of more specialized
user interfaces.
- \section2 Using a Model
+ \section3 Using a model
We take the string list model that \l{Creating New Models}{we created as
an example model}, set it up with some data, and construct a view to
@@ -697,8 +609,8 @@
Note that the \c StringListModel is declared as a \l QAbstractItemModel.
This allows us to use the abstract interface to the model, and
- ensures that the code will still work even if we replace the string list
- model with a different model in the future.
+ ensures that the code still works, even if we replace the string list
+ model with a different model.
The list view provided by \l QListView is sufficient for presenting
the items in the string list model. We construct the view, and set up
@@ -721,7 +633,7 @@
list model. Since the model is editable, the view automatically allows
each item in the list to be edited using the default delegate.
- \section2 Using Multiple Views onto the Same Model
+ \section3 Using multiple views of a model
Providing multiple views onto the same model is simply a matter of
setting the same model for each view. In the following code we create
@@ -745,7 +657,7 @@
selection model. This can be useful in certain situations but, for
many applications, a shared selection model is desirable.
- \section1 Handling Selections of Items
+ \section2 Handling selections of items
The mechanism for handling selections of items within views is provided
by the \l QItemSelectionModel class. All of the standard views construct
@@ -758,13 +670,12 @@
when we want to provide multiple consistent views onto the same model
data.
- Generally, unless you are subclassing a model or view, you will not
- need to manipulate the contents of selections directly. However, the
- interface to the selection model can be accessed, if required, and
- this is explored in the chapter on
- \l{Handling Selections in Item Views}.
+ Generally, unless you are subclassing a model or view, you don't
+ need to manipulate the contents of selections directly. However,
+ the interface to the selection model can be accessed, if required,
+ and this is explored in \l{Handling Selections in Item Views}.
- \section2 Sharing Selections Between Views
+ \section3 Sharing selections among views
Although it is convenient that the view classes provide their own
selection models by default, when we use more than one view onto the
@@ -788,19 +699,9 @@
each view; for example, a contiguous selection in a table view can be
represented as a fragmented set of highlighted items in a tree view.
-*/
-
-/*!
- \page model-view-delegate.html
- \contentspage model-view-programming.html Contents
- \previouspage Handling Selections in Item Views
- \nextpage Item View Convenience Classes
-
- \title Delegate Classes
-
- \tableofcontents
+ \section1 Delegate classes
- \section1 Concepts
+ \section2 Concepts
Unlike the Model-View-Controller pattern, the model/view design does not
include a completely separate component for managing interaction with
@@ -821,13 +722,13 @@
Editors for delegates can be implemented either by using widgets to manage
the editing process or by handling events directly.
- The first approach is covered later in this chapter, and it is also
+ The first approach is covered later in this section, and it is also
shown in the \l{Spin Box Delegate Example}{Spin Box Delegate} example.
The \l{Pixelator Example}{Pixelator} example shows how to create a
custom delegate that performs specialized rendering for a table view.
- \section1 Using an Existing Delegate
+ \section2 Using an existing delegate
The standard views provided with Qt use instances of \l QItemDelegate
to provide editing facilities. This default implementation of the
@@ -845,15 +746,15 @@
necessary to use this function when setting the delegate for a custom
view.
- \section1 A Simple Delegate
+ \section2 A simple delegate
- The delegate implemented here uses a \l QSpinBox to provide editing
- facilities, and is mainly intended for use with models that display
- integers. Although we set up a custom integer-based table model for
- this purpose, we could easily have used \l QStandardItemModel instead
- since the custom delegate will control data entry. We construct a
- table view to display the contents of the model, and this will use
- the custom delegate for editing.
+ The delegate implemented here uses a \l QSpinBox to provide
+ editing facilities, and is mainly intended for use with models
+ that display integers. Although we set up a custom integer-based
+ table model for this purpose, we could easily have used \l
+ QStandardItemModel instead, since the custom delegate controls
+ data entry. We construct a table view to display the contents of
+ the model, and this will use the custom delegate for editing.
\img spinboxdelegate-example.png
@@ -866,7 +767,7 @@
Note that no editor widgets are set up when the delegate is
constructed. We only construct an editor widget when it is needed.
- \section2 Providing an Editor
+ \section3 Providing an editor
In this example, when the table view needs to provide an editor, it
asks the delegate to provide an editor widget that is appropriate
@@ -906,7 +807,7 @@
the model, in which case we would need to cast the widget to the
appropriate type before accessing its member functions.
- \section2 Submitting Data to the Model
+ \section3 Submitting data to the model
When the user has finished editing the value in the spin box, the view
asks the delegate to store the edited value in the model by calling the
@@ -935,7 +836,7 @@
delegate with different kinds of models because \l{QVariant}
provides sensible default values for unexpected data.
- \section2 Updating the Editor's Geometry
+ \section3 Updating the editor's geometry
It is the responsibility of the delegate to manage the editor's
geometry. The geometry must be set when the editor is created, and
@@ -951,7 +852,7 @@
position the editor in relation to the other elements in the item.
\target EditingHints
- \section2 Editing Hints
+ \section3 Editing hints
After editing, delegates should provide hints to the other components
about the result of the editing process, and provide hints that will
@@ -982,19 +883,10 @@
Delegates do not have to emit these hints, but those that do not will
be less integrated into applications, and will be less usable than
those that emit hints to support common editing actions.
-*/
-
-/*!
- \page model-view-selection.html
- \contentspage model-view-programming.html Contents
- \previouspage View Classes
- \nextpage Delegate Classes
- \title Handling Selections in Item Views
+ \section1 Handling selections in item views
- \tableofcontents
-
- \section1 Concepts
+ \section2 Concepts
The selection model used in the item view classes offers many improvements
over the selection model used in Qt 3. It provides a more general
@@ -1022,8 +914,7 @@
after its application through the use of certain types of selection
commands. These are discussed later in this section.
-
- \section2 Current Item and Selected Items
+ \section3 Current item &amp selected items
In a view, there is always a current item and a selected item - two
independent states. An item can be the current item and selected at the
@@ -1068,8 +959,7 @@
be informed of changes to the selection model via the signals and slots
mechanism.
-
- \section1 Using a Selection Model
+ \section2 Using a selection model
The standard view classes provide default selection models that can
be used in most applications. A selection model belonging to one view
@@ -1088,8 +978,7 @@
each having a different effect on the selections already present in the
selection model.
-
- \section2 Selecting Items
+ \section3 Selecting items
To demonstrate some of the principal features of selections, we construct
an instance of a custom table model with 32 items in total, and open a
@@ -1122,12 +1011,12 @@
The selection of items can be modified using various operations that
are defined by the selection flags. The selection that results from
- these operations may have a complex structure, but will be represented
+ these operations may have a complex structure, but it is represented
efficiently by the selection model. The use of different selection
flags to manipulate the selected items is described when we examine
how to update a selection.
- \section2 Reading the Selection State
+ \section3 Reading the selection state
The model indexes stored in the selection model can be read using
the \l{QItemSelectionModel::selectedIndexes()}{selectedIndexes()}
@@ -1176,7 +1065,7 @@
Monitoring selections made by the user is straightforward with these
signals, but we can also update the selection model directly.
- \section2 Updating a Selection
+ \section3 Updating a selection
Selection commands are provided by a combination of selection flags,
defined by \l{QItemSelectionModel::SelectionFlag}.
@@ -1215,7 +1104,7 @@
with a command that is a combination of
\l{QItemSelectionModel::SelectionFlag}{Select} and
\l{QItemSelectionModel::SelectionFlag}{Rows}, the
- entire row containing the item referred to will be selected.
+ entire row containing the item referred to is selected.
The following code demonstrates the use of the
\l{QItemSelectionModel::SelectionFlag}{Rows} and
\l{QItemSelectionModel::SelectionFlag}{Columns} flags:
@@ -1248,7 +1137,7 @@
has the effect of resetting the selection model's collection of model
indexes.
- \section2 Selecting All Items in a Model
+ \section3 Selecting all items in a model
To select all items in a model, it is necessary to create a
selection for each level of the model that covers all items in that
@@ -1271,19 +1160,8 @@
\l{QAbstractItemModel::hasChildren()}{hasChildren()} function is used to
determine whether any given item is the parent of another level of
items.
-*/
-
-/*!
- \page model-view-creating-models.html
- \contentspage model-view-programming.html Contents
- \previouspage Model Classes
- \nextpage View Classes
-
- \title Creating New Models
- \tableofcontents
-
- \section1 Introduction
+ \section1 Creating new models
The separation of functionality between the model/view components allows
models to be created that can take advantage of existing views. This
@@ -1301,9 +1179,9 @@
for interfaces to simpler non-hierarchical data structures, and are
easier to use as a starting point for simple list and table models.
- In this chapter, we create a simple read-only model to explore
+ In this section, we create a simple read-only model to explore
the basic principles of the model/view architecture. Later in this
- chapter, we will adapt this simple model so that items can be modified
+ section, we adapt this simple model so that items can be modified
by the user.
For an example of a more complex model, see the
@@ -1312,21 +1190,21 @@
The requirements of QAbstractItemModel subclasses is described in more
detail in the \l{Model Subclassing Reference} document.
- \section1 Designing a Model
+ \section2 Designing a model
- When creating a new model for an existing data structure, it is important
- to consider which type of model should be used to provide an interface
- onto the data. If the data structure can be represented as a
- list or table of items, you can subclass QAbstractListModel or
- QAbstractTableModel since these classes provide suitable default
- implementations for many functions.
+ When creating a new model for an existing data structure, it is
+ important to consider which type of model should be used to
+ provide an interface onto the data. If the data structure can be
+ represented as a list or table of items, you can subclass
+ QAbstractListModel or QAbstractTableModel since these classes
+ provide suitable default implementations for many functions.
- However, if the underlying data structure can only be represented by a
- hierarchical tree structure, it is necessary to subclass
+ However, if the underlying data structure can only be represented
+ by a hierarchical tree structure, it is necessary to subclass
QAbstractItemModel. This approach is taken in the
\l{itemviews/simpletreemodel}{Simple Tree Model} example.
- In this chapter, we will implement a simple model based on a list of
+ In this section, we implement a simple model based on a list of
strings, so the QAbstractListModel provides an ideal base class on
which to build.
@@ -1338,7 +1216,7 @@
interact with it using the standard API. The model described below
provides a custom constructor for just this purpose.
- \section1 A Read-Only Example Model
+ \section2 A read-only example model
The model implemented here is a simple, non-hierarchical, read-only data
model based on the standard QStringListModel class. It has a \l QStringList
@@ -1355,7 +1233,6 @@
functions as there are default implementations for most of the
interface. The class declaration is as follows:
-
\snippet doc/src/snippets/stringlistmodel/model.h 0
\snippet doc/src/snippets/stringlistmodel/model.h 1
\codeline
@@ -1379,7 +1256,7 @@
The list of strings is stored internally in the \c stringList private
member variable.
- \section2 Dimensions of The Model
+ \section3 Dimensions of the model
We want the number of rows in the model to be the same as the number of
strings in the string list. We implement the
@@ -1394,7 +1271,7 @@
reimplement the \l{QAbstractItemModel::columnCount()}{columnCount()}
function.
- \section2 Model Headers and Data
+ \section3 Model headers &amp data
For items in the view, we want to return the strings in the string list.
The \l{QAbstractItemModel::data()}{data()} function is responsible for
@@ -1433,7 +1310,7 @@
\l{Qt::ItemDataRole}{ToolTipRole} that views can use to
display information about items in a tooltip.
- \section1 An Editable Model
+ \section2 An editable model
The read-only model shows how simple choices could be presented to the
user but, for many applications, an editable list model is much more
@@ -1447,7 +1324,7 @@
\snippet doc/src/snippets/stringlistmodel/model.h 2
\snippet doc/src/snippets/stringlistmodel/model.h 3
- \section2 Making the Model Editable
+ \section3 Making the model editable
A delegate checks whether an item is editable before creating an
editor. The model must let the delegate know that its items are
@@ -1473,7 +1350,7 @@
\l{Qt::ItemDataRole}{EditRole} since this is the role used by the
standard item delegate. For boolean values, however, you can use
Qt::CheckStateRole and set the Qt::ItemIsUserCheckable flag; a
- checkbox will then be used for editing the value. The underlying
+ checkbox is then used for editing the value. The underlying
data in this model is the same for all roles, so this detail just
makes it easier to integrate the model with standard components.
@@ -1487,7 +1364,7 @@
\snippet doc/src/snippets/stringlistmodel/model.cpp 1
- \section2 Inserting and Removing Rows
+ \section3 Inserting &amp removing rows
It is possible to change the number of rows and columns in a model. In the
string list model it only makes sense to change the number of rows, so we
@@ -1536,39 +1413,29 @@
operation and let other components know that the dimensions of the model
have changed.
- \section1 Next Steps
+ \section2 Next steps
We can display the data provided by this model, or any other model, using
the \l QListView class to present the model's items in the form of a vertical
list.
For the string list model, this view also provides a default editor so that
the items can be manipulated. We examine the possibilities made available by
- the standard view classes in the chapter on \l{View Classes}.
+ the standard view classes in \l{View Classes}.
The \l{Model Subclassing Reference} document discusses the requirements of
QAbstractItemModel subclasses in more detail, and provides a guide to the
virtual functions that must be implemented to enable various features in
different types of models.
-*/
-
-/*!
- \page model-view-convenience.html
- \contentspage model-view-programming.html Contents
- \previouspage Delegate Classes
- \nextpage Using Drag and Drop with Item Views
-
- \title Item View Convenience Classes
- \tableofcontents
+ \section1 Item view convenience classes
- \section1 Overview
-
- Alongside the model/view classes, Qt 4 also includes standard widgets to
- provide classic item-based container widgets. These behave in a similar
- way to the item view classes in Qt 3, but have been rewritten to use the
- underlying model/view framework for performance and maintainability. The
- old item view classes are still available in the compatibility library
- (see the \l{porting4.html}{Porting Guide} for more information).
+ Qt 4 also introduced some standard widgets to provide classic
+ item-based container widgets. These behave in a similar way to the
+ item view classes in Qt 3, but have been rewritten to use the
+ underlying model/view framework for performance and
+ maintainability. The old item view classes are still available in
+ the compatibility library (see the \l{porting4.html}{Porting
+ Guide} for more information).
The item-based widgets have been given names which reflect their uses:
\c QListWidget provides a list of items, \c QTreeWidget displays a
@@ -1577,7 +1444,7 @@
class which implements common behavior for item selection and header
management.
- \section1 List Widgets
+ \section2 List widgets
Single level lists of items are typically displayed using a \c QListWidget
and a number of \c{QListWidgetItem}s. A list widget is constructed in the
@@ -1612,8 +1479,7 @@
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 4
\snippet doc/src/snippets/qlistwidget-using/mainwindow.cpp 5
-
- \section1 Tree Widgets
+ \section2 Tree widgets
Trees or hierarchical lists of items are provided by the \c QTreeWidget
and \c QTreeWidgetItem classes. Each item in the tree widget can have
@@ -1668,8 +1534,7 @@
\snippet doc/src/snippets/qtreewidget-using/mainwindow.cpp 8
\snippet doc/src/snippets/qtreewidget-using/mainwindow.cpp 9
-
- \section1 Table Widgets
+ \section2 Table widgets
Tables of items similar to those found in spreadsheet applications
are constructed with the \c QTableWidget and \c QTableWidgetItem. These
@@ -1693,7 +1558,7 @@
Note that the rows and columns in the table begin at zero.
- \section1 Common Features
+ \section2 Common features
There are a number of item-based features common to each of the
convenience classes that are available through the same interfaces
@@ -1702,7 +1567,7 @@
Look at the list of \l{Model/View Classes} for each of the widgets
for more details about the use of each function used.
- \section2 Hidden Items
+ \section3 Hidden items
It is sometimes useful to be able to hide items in an item view widget
rather than remove them. Items for all of the above widgets can be
@@ -1713,7 +1578,7 @@
Since this operation is item-based, the same function is available for
all three convenience classes.
- \section2 Selections
+ \section3 Selections
The way items are selected is controlled by the widget's selection mode
(\l{QAbstractItemView::SelectionMode}).
@@ -1764,7 +1629,7 @@
current item may not lie within the selection, depending on the way the
user formed the selection.
- \section2 Searching
+ \section3 Searching
It is often useful to be able to find items within an item view widget,
either as a developer or as a service to present to users. All three
@@ -1782,19 +1647,8 @@
The above code causes items in a tree widget to be selected if they
contain the text given in the search string. This pattern can also be
used in the list and table widgets.
-*/
-
-/*!
- \page model-view-dnd.html
- \contentspage model-view-programming.html Contents
- \previouspage Item View Convenience Classes
- \nextpage Proxy Models
- \title Using Drag and Drop with Item Views
-
- \tableofcontents
-
- \section1 Overview
+ \section1 Using drag &amp drop with item views
Qt's drag and drop infrastructure is fully supported by the model/view framework.
Items in lists, tables, and trees can be dragged within the views, and data can be
@@ -1813,7 +1667,7 @@
See also the \l{Model Subclassing Reference} for more information about
enabling drag and drop support in new models.
- \section1 Using Convenience Views
+ \section2 Using convenience views
Each of the types of item used with QListWidget, QTableWidget, and QTreeWidget
is configured to use a different set of flags by default. For example, each
@@ -1852,7 +1706,7 @@
\snippet doc/src/snippets/qlistwidget-dnd/mainwindow.cpp 1
- \section1 Using Model/View Classes
+ \section2 Using model/view classes
Setting up a view for drag and drop follows the same pattern used with the
convenience views. For example, a QListView can be set up in the same way as a
@@ -1874,7 +1728,7 @@
of QAbstractItemModel::removeRows(), either directly or by inheriting the
implementation from its base class.
- \section2 Enabling Drag and Drop for Items
+ \section3 Enabling drag &amp drop for items
Models indicate to views which items can be dragged, and which will accept drops,
by reimplementing the QAbstractItemModel::flags() function to provide suitable
@@ -1894,7 +1748,7 @@
obtain a default set of flags by calling its implementation of the flags()
function.
- \section2 Encoding Exported Data
+ \section3 Encoding exported data
When items of data are exported from a model in a drag and drop operation, they
are encoded into an appropriate format corresponding to one or more MIME types.
@@ -1923,7 +1777,7 @@
and that stream operators must be implemented for them. See the QMetaObject
class description for details.
- \section2 Inserting Dropped Data into a Model
+ \section3 Inserting dropped data into a model
The way that any given model handles dropped data depends on both its type
(list, table, or tree) and the way its contents is likely to be presented to
@@ -1988,7 +1842,7 @@
example shown here, the model only has one level, so this approach is not
appropriate.
- \section2 Decoding Imported Data
+ \section3 Decoding imported data
Each implementation of \l{QAbstractItemModel::dropMimeData()}{dropMimeData()} must
also decode the data and insert it into the model's underlying data structure.
@@ -2007,19 +1861,8 @@
QAbstractItemModel::insertRows() and QAbstractItemModel::setData() functions.
\sa {Item Views Puzzle Example}
-*/
-
-/*!
- \page model-view-proxy-models.html
- \contentspage model-view-programming.html Contents
- \previouspage Using Drag and Drop with Item Views
- \nextpage Model Subclassing Reference
- \title Proxy Models
-
- \tableofcontents
-
- \section1 Overview
+ \section1 Proxy models
In the model/view framework, items of data supplied by a single model can be shared
by any number of views, and each of these can possibly represent the same information
@@ -2042,7 +1885,7 @@
framework ensure that each view is updated appropriately no matter how many proxy models
are placed between itself and the source model.
- \section1 Using Proxy Models
+ \section2 Using proxy models
Proxy models can be inserted between an existing model and any number of views.
Qt is supplied with a standard proxy model, QSortFilterProxyModel, that is usually
@@ -2061,7 +1904,7 @@
in applications. More specialized proxy models can be created by subclassing this
classes and implementing the required comparison operations.
- \section1 Customizing Proxy Models
+ \section2 Customizing proxy models
Generally, the type of processing used in a proxy model involves mapping each item of
data from its original location in the source model to either a different location in
@@ -2074,7 +1917,7 @@
being supplied to views, and also allows the contents of a source model to
be supplied to views as pre-sorted data.
- \section2 Custom Filtering Models
+ \section3 Custom filtering models
The QSortFilterProxyModel class provides a filtering model that is fairly versatile,
and which can be used in a variety of common situations. For advanced users,
@@ -2095,7 +1938,7 @@
return true to ensure that all items are passed through to views; reimplementations
of these functions should return false to filter out individual rows and columns.
- \section2 Custom Sorting Models
+ \section3 Custom sorting models
QSortFilterProxyModel instances use Qt's built-in qStableSort() function to set up
mappings between items in the source model and those in the proxy model, allowing a
@@ -2103,18 +1946,8 @@
source model. To provide custom sorting behavior, reimplement the
\l{QSortFilterProxyModel::lessThan()}{lessThan()} function to perform custom
comparisons.
-*/
-
-/*!
- \page model-view-model-subclassing.html
- \contentspage model-view-programming.html Contents
- \previouspage Proxy Models
-
- \title Model Subclassing Reference
- \tableofcontents
-
- \section1 Introduction
+ \section1 Model subclassing reference
Model subclasses need to provide implementations of many of the virtual functions
defined in the QAbstractItemModel base class. The number of these functions that need
@@ -2143,13 +1976,13 @@
For more information, see the \l
{"Item View Classes" Chapter of C++ GUI Programming with Qt 4}.
- \section1 Item Data Handling
+ \section2 Item data handling
Models can provide varying levels of access to the data they provide: They can be
simple read-only components, some models may support resizing operations, and
others may allow items to be edited.
- \section2 Read-Only Access
+ \section2 Read-Only access
To provide read-only access to data provided by a model, the following functions
\e{must} be implemented in the model's subclass:
@@ -2185,7 +2018,7 @@
provide this function because it is already implemented in QAbstractListModel.
\endtable
- \section2 Editable Items
+ \section3 Editable items
Editable models allow items of data to be modified, and may also provide
functions to allow rows and columns to be inserted and removed. To enable
@@ -2211,7 +2044,7 @@
signal to inform other components of the change.
\endtable
- \section2 Resizable Models
+ \section3 Resizable models
All types of model can support the insertion and removal of rows. Table models
and hierarchical models can also support the insertion and removal of columns.
@@ -2271,7 +2104,7 @@
it is necessary to emit the \l{QAbstractItemModel::layoutChanged()}{layoutChanged()}
signal to cause any attached views to be updated.
- \section2 Lazy Population of Model Data
+ \section3 Lazy population of model data
Lazy population of model data effectively allows requests for information
about the model to be deferred until it is actually needed by views.
@@ -2305,13 +2138,12 @@
children may be displayed incorrectly in some views until the user
attempts to view the non-existent child items.
-
- \section1 Navigation and Model Index Creation
+ \section2 Navigation &amp model index creation
Hierarchical models need to provide functions that views can call to navigate the
tree-like structures they expose, and obtain model indexes for items.
- \section2 Parents and Children
+ \section3 Parents &amp children
Since the structure exposed to views is determined by the underlying data
structure, it is up to each model subclass to create its own model indexes
@@ -2335,7 +2167,7 @@
models to supply some unique identifier to this function to ensure that
the model index can be re-associated with its corresponding item later on.
- \section1 Drag and Drop Support and MIME Type Handling
+ \section2 Drag &amp drop support and MIME type handling
The model/view classes support drag and drop operations, providing default behavior
that is sufficient for many applications. However, it is also possible to customize
@@ -2347,7 +2179,7 @@
The \l{#Convenience Views}{Convenience Views} section provides an overview of this
behavior.
- \section2 MIME Data
+ \section3 MIME data
By default, the built-in models and views use an internal MIME type
(\c{application/x-qabstractitemmodeldatalist}) to pass around information about
@@ -2394,7 +2226,7 @@
the QMimeData::setImageData(), QMimeData::setColorData(), and
QMimeData::setHtml() functions.
- \section2 Accepting Dropped Data
+ \section3 Accepting dropped data
When a drag and drop operation is performed over a view, the underlying model is
queried to determine which types of operation it supports and the MIME types
@@ -2466,7 +2298,7 @@
For more information about drag and drop with item views, refer to
\l{Using Drag and Drop with Item Views}.
- \section2 Convenience Views
+ \section3 Convenience views
The convenience views (QListWidget, QTableWidget, and QTreeWidget) override
the default drag and drop functionality to provide less flexible, but more
@@ -2477,7 +2309,7 @@
into the model. For more information on drag and drop in convenience views,
you can see \l{Using Drag and Drop with Item Views}.
- \section1 Performance Optimization for Large Amounts of Data
+ \section2 Performance optimization for large amounts of data
The \l{QAbstractItemModel::}{canFetchMore()} function checks if the parent
has more data available and returns true or false accordingly. The
@@ -2498,4 +2330,23 @@
\l{QAbstractItemModel::}{canFetchMore()} and \l{QAbstractItemModel::}
{fetchMore()} must be reimplemented as their default implementation returns
false and does nothing.
+
+ \keyword Model/View Classes
+ \section1 The model/view classes
+
+ These classes use the model/view design pattern in which the
+ underlying data (in the model) is kept separate from the way the
+ data is presented and manipulated by the user (in the view).
+
+ \annotatedlist model-view
+
+ \section1 Related examples
+
+ \list
+ \o \l{itemviews/dirview}{Dir View}
+ \o \l{itemviews/spinboxdelegate}{Spin Box Delegate}
+ \o \l{itemviews/pixelator}{Pixelator}
+ \o \l{itemviews/simpletreemodel}{Simple Tree Model}
+ \o \l{itemviews/chart}{Chart}
+ \endlist
*/
diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc
index 2d035c7d42..61b906e5ca 100644
--- a/doc/src/frameworks-technologies/phonon.qdoc
+++ b/doc/src/frameworks-technologies/phonon.qdoc
@@ -41,8 +41,10 @@
/*!
\page phonon-overview.html
- \title Phonon Overview
- \ingroup frameworks-technologies
+ \title Phonon multimedia framework
+ \brief Using the Phonon multimedia framework in Qt.
+ \ingroup technology-apis
+ \ingroup best-practices
\tableofcontents
diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc
index fd6bebb59b..f7dde590e5 100644
--- a/doc/src/frameworks-technologies/threads.qdoc
+++ b/doc/src/frameworks-technologies/threads.qdoc
@@ -47,6 +47,7 @@
/*!
\page threads.html
\title Thread Support in Qt
+ \ingroup qt-basic-concepts
\brief A detailed discussion of thread handling in Qt.
\ingroup frameworks-technologies
diff --git a/doc/src/frameworks-technologies/unicode.qdoc b/doc/src/frameworks-technologies/unicode.qdoc
index 8fa168a4e8..88393a0bd7 100644
--- a/doc/src/frameworks-technologies/unicode.qdoc
+++ b/doc/src/frameworks-technologies/unicode.qdoc
@@ -58,7 +58,7 @@
\keyword Unicode
- \ingroup frameworks-technologies
+ \ingroup technology-apis
Unicode is a multi-byte character set, portable across all major
computing platforms and with decent coverage over most of the world.
diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc
index 6974634123..9d39e080b0 100644
--- a/doc/src/getting-started/demos.qdoc
+++ b/doc/src/getting-started/demos.qdoc
@@ -53,15 +53,14 @@
\l{Qt Examples} and are used to highlight certain features of
Qt.
- \table 50%
+ \table
\header
\o {2,1} Getting an Overview
\row
\o \inlineimage qtdemo-small.png
- \o
- If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's
+ \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
@@ -127,16 +126,15 @@
\section1 Graphics View
\list
- \o \l{demos/chip}{40000 Chips} uses the
- \l{The Graphics View Framework}{Graphics View} framework to efficiently
- display a large number of individual graphical items on a scrolling canvas,
- highlighting features such as rotation, zooming, level of detail control,
- and item selection.
- \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's \e{Widgets on
- the Canvas} feature by embedding a multitude of fully-working dialogs into a
- scene.
+ \o \l{demos/chip}{40000 Chips} uses the \l{Graphics View Framework} to
+ efficiently display a large number of individual graphical items on
+ a scrolling canvas and highlighting features including rotation,
+ zooming, level of detail control, and item selection.
+ \o \l{demos/embeddeddialogs}{Embedded Dialogs} showcases Qt 4.4's
+ \e{Widgets on the Canvas} feature by embedding several
+ fully-functional dialogs in a scene.
\o \l{demos/boxes}{Boxes} showcases Qt's OpenGL support and the
- integration with the Graphics View framework.
+ integration with the \l{Graphics View Framework}.
\endlist
\section1 Tools
@@ -186,7 +184,7 @@
\o \l{demos/embedded/fluidlauncher}{Fluid Launcher} demo application launcher for embedded screens
\o \l{demos/embedded/lightmaps}{Light Maps} demonstrates OpenStreetMap integration with WebKit.
\o \l{demos/embedded/raycasting}{Ray Casting} demonstrates the use of ray casting with the
- \l{The Graphics View Framework}{Graphics View} framework.
+ \l{Graphics View Framework}.
\o \l{demos/embedded/styledemo}{Embedded Styles} demonstrates the use of styles.
\o \l{demos/embedded/weatherinfo}{Weather Info} fetches weather information from the Web.
\endlist
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index 542f672607..643e42b432 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -40,430 +40,46 @@
****************************************************************************/
/*!
- \page examples-overview.html
- \raw HTML
- <script>
- document.location.href = "examples.html";
- </script>
- \endraw
- Click this \l{Qt Examples}{link} if you don't get redirected.
-*/
-
-/*!
- \page examples.html
- \title Qt Examples
- \brief The example programs provided with Qt.
-
- \previouspage Tutorials
- \contentspage How to Learn Qt
- \nextpage Qt Demonstrations
-
- Qt is supplied with a variety of examples that cover almost every aspect
- of development. They are not all designed to be impressive when you run
- them, but their source code is carefully written to show good Qt
- programming practices. You can launch any of these programs from the
- \l{Examples and Demos Launcher} application.
-
- These examples are ordered by functional area, but many examples often
- use features from many parts of Qt to highlight one area in particular.
- If you are new to Qt, you should probably start by going through the
- \l{Tutorials} before you have a look at the
- \l{mainwindows/application}{Application} example.
-
- In addition to the examples and the tutorial, Qt includes a
- \l{Qt Demonstrations}{selection of demos} that deliberately show off
- Qt's features. You might want to look at these as well.
-
- \section1 \l{Widgets Examples}{Widgets}
- \beginfloatleft
- \l{Widgets Examples}{\inlineimage widget-examples.png
- }
-
- \endfloat
- Qt comes with a large range of standard widgets that users of modern
- applications have come to expect. You can also develop your own custom
- widgets and controls, and use them alongside standard widgets.
-
- It is even possible to provide custom styles and themes for widgets that can
- be used to change the appearance of standard widgets and appropriately
- written custom widgets.
-
- \clearfloat
- \section1 \l{Dialog Examples}{Dialogs}
- \beginfloatleft
- \l{Dialog Examples}{\inlineimage dialog-examples.png
- }
-
- \endfloat
- Qt includes standard dialogs for many common operations, such as file
- selection, printing, and color selection.
-
- Custom dialogs can also be created for specialized modal or modeless
- interactions with users.
-
- \clearfloat
- \section1 \l{Main Window Examples}{Main Windows}
- \beginfloatleft
- \l{Main Window Examples}{\inlineimage mainwindow-examples.png
- }
-
- \endfloat
- All the standard features of application main windows are provided by Qt.
-
- Main windows can have pull down menus, tool bars, and dock windows. These
- separate forms of user input are unified in an integrated action system that
- also supports keyboard shortcuts and accelerator keys in menu items.
-
- \clearfloat
- \section1 \l{Layout Examples}{Layouts}
- \beginfloatleft
- \l{Layout Examples}{\inlineimage layout-examples.png
- }
-
- \endfloat
- Qt uses a layout-based approach to widget management. Widgets are arranged in
- the optimal positions in windows based on simple layout rules, leading to a
- consistent look and feel.
-
- Custom layouts can be used to provide more control over the positions and
- sizes of child widgets.
-
- \clearfloat
- \section1 \l{Item Views Examples}{Item Views}
- \beginfloatleft
- \l{Item Views Examples}{\inlineimage itemview-examples.png
- }
-
- \endfloat
- Item views are widgets that typically display data sets. Qt 4's model/view
- framework lets you handle large data sets by separating the underlying data
- from the way it is represented to the user, and provides support for
- customized rendering through the use of delegates.
-
- \clearfloat
- \section1 \l{Graphics View Examples}{Graphics View}
- \beginfloatleft
- \l{Graphics View Examples}{\inlineimage graphicsview-examples.png
- }
-
- \endfloat
- Qt is provided with a comprehensive canvas through the GraphicsView
- classes.
-
- \clearfloat
- \section1 \l{QML Examples and Demos}{Declarative}
- \beginfloatleft
- \l{QML Examples and Demos}{\inlineimage declarative-examples.png
- }
-
- \endfloat
- The Qt Declarative module provides a declarative framework for building
- highly dynamic, custom user interfaces.
+ \group all-examples
+ \title Qt Examples
- \clearfloat
- \section1 \l{Painting Examples}{Painting}
- \beginfloatleft
- \l{Painting Examples}{\inlineimage painting-examples.png
- }
+ Qt includes a set of examples that cover nearly every aspect of Qt
+ development. They aren't meant to be impressive when you run them,
+ but in each case the source code has been carefully written to
+ illustrate one or more best Qt programming practices.
- \endfloat
- Qt's painting system is able to render vector graphics, images, and outline
- font-based text with sub-pixel accuracy accuracy using anti-aliasing to
- improve rendering quality.
-
- \clearfloat
- \section1 \l{Rich Text Examples}{Rich Text}
- \beginfloatleft
- \l{Rich Text Examples}{\inlineimage richtext-examples.png
- }
-
- \endfloat
- Qt provides powerful document-oriented rich text engine that supports Unicode
- and right-to-left scripts. Documents can be manipulated using a cursor-based
- API, and their contents can be imported and exported as both HTML and in a
- custom XML format.
-
- \clearfloat
- \section1 \l{Desktop Examples}{Desktop}
- \beginfloatleft
- \l{Desktop Examples}{\inlineimage desktop-examples.png
- }
-
- \endfloat
- Qt provides features to enable applications to integrate with the user's
- preferred desktop environment.
-
- Features such as system tray icons, access to the desktop widget, and
- support for desktop services can be used to improve the appearance of
- applications and take advantage of underlying desktop facilities.
-
- \clearfloat
- \section1 \l{Drag and Drop Examples}{Drag and Drop}
- \beginfloatleft
- \l{Drag and Drop Examples}{\inlineimage draganddrop-examples.png
- }
-
- \endfloat
- Qt supports native drag and drop on all platforms via an extensible
- MIME-based system that enables applications to send data to each other in the
- most appropriate formats.
+ You can run the examples from the \l{Examples and Demos Launcher}
+ application (except see \l{QML Examples and Demos} {QML Examples}
+ for special instructions for running thos examples).
- Drag and drop can also be implemented for internal use by applications.
+ The examples are listed below by functional area. Each example
+ listed in a particular functional area is meant to illustrate how
+ best to use Qt to do some particular task in that functional area,
+ but the examples will often use features from other functional
+ areas as well for completeness.
- \clearfloat
- \section1 \l{Threading and Concurrent Programming Examples}{Threading and Concurrent Programming}
- \beginfloatleft
- \l{Threading and Concurrent Programming Examples}{\inlineimage thread-examples.png
- }
+ If you are new to Qt, you should probably start by going through
+ the \l{Tutorials}, and then begin with the
+ \l{mainwindows/application} {Application} example.
- \endfloat
- Qt 4 makes it easier than ever to write multithreaded applications. More
- classes have been made usable from non-GUI threads, and the signals and slots
- mechanism can now be used to communicate between threads.
+ In addition to these examples and the \l{Tutorials}{tutorials}, Qt
+ includes a \l{Qt Demonstrations}{selection of demos} that
+ deliberately show off Qt's features. You might want to look at
+ these as well.
- The QtConcurrent namespace includes a collection of classes and functions
- for straightforward concurrent programming.
+ These examples are provided under the terms of the \l{BSD License}.
- \clearfloat
- \section1 \l{Tools Examples}{Tools}
- \beginfloatleft
- \l{Tools Examples}{\inlineimage tool-examples.png
- }
- \endfloat
- Qt is equipped with a range of capable tool classes, from containers and
- iterators to classes for string handling and manipulation.
+ \section1 Examples by Functional Area
- Other classes provide application infrastructure support, handling plugin
- loading and managing configuration files.
-
- \clearfloat
- \section1 \l{Network Examples}{Network}
- \beginfloatleft
- \l{Network Examples}{\inlineimage network-examples.png
- }
-
- \endfloat
- Qt is provided with an extensive set of network classes to support both
- client-based and server side network programming.
-
- \clearfloat
- \section1 \l{Inter-Process Communication Examples}{Inter-Process Communication}
- \beginfloatleft
- \l{Inter-Process Communication Examples}{\inlineimage ipc-examples.png
- }
-
- \endfloat
- Simple, lightweight inter-process communication can be performed using shared
- memory and local sockets.
-
- \clearfloat
- \section1 \l{OpenGL Examples}{OpenGL} and \l{OpenVG Examples}{OpenVG} Examples
- \beginfloatleft
- \l{OpenGL Examples}{\inlineimage opengl-examples.png
- }
-
- \endfloat
- Qt provides support for integration with OpenGL implementations on all
- platforms, giving developers the opportunity to display hardware accelerated
- 3D graphics alongside a more conventional user interface.
-
- Qt provides support for integration with OpenVG implementations on
- platforms with suitable drivers.
-
- \clearfloat
- \section1 \l{Multimedia Examples}{Multimedia Framework}
- \beginfloatleft
- \l{Multimedia Examples}{\inlineimage phonon-examples.png
- }
-
- \endfloat
- Qt provides low-level audio support on linux,windows and mac platforms by default and
- an audio plugin API to allow developers to implement there own audio support for
- custom devices and platforms.
-
- The Phonon Multimedia Framework brings multimedia support to Qt applications.
-
- \clearfloat
- \section1 \l{SQL Examples}{SQL}
- \beginfloatleft
- \l{SQL Examples}{\inlineimage sql-examples.png
- }
-
- \endfloat
- Qt provides extensive database interoperability, with support for products
- from both open source and proprietary vendors.
-
- SQL support is integrated with Qt's model/view architecture, making it easier
- to provide GUI integration for your database applications.
-
- \clearfloat
- \section1 \l{XML Examples}{XML}
- \beginfloatleft
- \l{XML Examples}{\inlineimage xml-examples.png
- }
-
- \endfloat
- XML parsing and handling is supported through SAX and DOM compliant APIs
- as well as streaming classes.
-
- The XQuery/XPath and XML Schema engines in the QtXmlPatterns modules
- provide classes for querying XML files and custom data models.
-
- \clearfloat
- \section1 \l{Qt Designer Examples}{Qt Designer}
- \beginfloatleft
- \l{Qt Designer Examples}{\inlineimage designer-examples.png
- }
-
- \endfloat
- Qt Designer is a capable graphical user interface designer that lets you
- create and configure forms without writing code. GUIs created with
- Qt Designer can be compiled into an application or created at run-time.
-
- \clearfloat
- \section1 \l{UiTools Examples}{UiTools}
- \beginfloatleft
- \l{UiTools Examples}{\inlineimage uitools-examples.png
- }
-
- \endfloat
- User interfaces created with Qt Designer can be loaded and displayed at
- run-time using the facilities of the QtUiTools module without the need
- to generate code in advance.
-
- \clearfloat
- \section1 \l{Qt Linguist Examples}{Qt Linguist}
- \beginfloatleft
- \l{Qt Linguist Examples}{\inlineimage linguist-examples.png
- }
-
- \endfloat
- Internationalization is a core feature of Qt.
-
- \clearfloat
- \section1 \l{Qt Script Examples}{Qt Script}
- \beginfloatleft
- \l{Qt Script Examples}{\inlineimage qtscript-examples.png
- }
-
- \endfloat
- Qt is provided with a powerful embedded scripting environment through the QtScript
- classes.
-
- \clearfloat
- \section1 \l{WebKit Examples}{WebKit}
- \beginfloatleft
- \l{WebKit Examples}{\inlineimage webkit-examples.png
- }
-
- \endfloat
- Qt provides an integrated Web browser component based on WebKit, the popular
- open source browser engine.
-
- \clearfloat
- \section1 \l{Help System Examples}{Help System}
- \beginfloatleft
- \l{Help System Examples}{\inlineimage assistant-examples.png
- }
-
- \endfloat
- Support for interactive help is provided by the Qt Assistant application.
- Developers can take advantages of the facilities it offers to display
- specially-prepared documentation to users of their applications.
-
- \clearfloat
- \section1 \l{State Machine Examples}{State Machine}
- \beginfloatleft
- \l{State Machine Examples}{\inlineimage statemachine-examples.png
- }
-
- \endfloat
- Qt provides a powerful hierarchical finite state machine through the Qt State
- Machine classes.
-
- \clearfloat
- \section1 \l{Animation Framework Examples}{Animation Framework}
- \beginfloatleft
- \l{Animation Framework Examples}{\inlineimage animation-examples.png
- }
-
- \endfloat
- These examples show to to use the \l{The Animation Framework}{animation framework}
- to build highly animated, high-performance GUIs.
-
- \clearfloat
- \section1 \l{Multi-Touch Examples}{Multi-Touch Framework}
- \beginfloatleft
- \l{Multi-Touch Examples}{\inlineimage multitouch-examples.png
- }
-
- \endfloat
- Support for multi-touch input makes it possible for developers to create
- extensible and intuitive user interfaces.
-
- \clearfloat
- \section1 \l{Gestures Examples}{Gestures}
- \beginfloatleft
- \l{Gestures Examples}{\inlineimage gestures-examples.png
- }
-
- \endfloat
- Applications can be written to respond to gestures as a natural input method.
- These examples show how to enable support for standard and custom gestures in
- applications.
-
- \clearfloat
- \section1 \l{D-Bus Examples}{D-Bus}
- \beginfloatleft
- \l{D-Bus Examples}{\inlineimage dbus-examples.png
- }
-
- \endfloat
- Systems with limited resources, specialized hardware, and small
- screens require special attention.
-
- \clearfloat
- \section1 \l{Qt for Embedded Linux Examples}{Qt for Embedded Linux}
- \beginfloatleft
- \l{Qt for Embedded Linux Examples}{\inlineimage qt-embedded-examples.png
- }
-
- \endfloat
- D-Bus is an inter-process communication protocol for Unix/Linux systems.
- These examples demonstrate how to write application that communicate with
- each other.
-
- \clearfloat
- \section1 \l{ActiveQt Examples}{ActiveQt}
- \beginfloatleft
- \l{ActiveQt Examples}{\inlineimage activeqt-examples.png
- }
-
- \endfloat
- These examples demonstrate how to write ActiveX controls and control servers
- with Qt, and how to use ActiveX controls and COM objects in a Qt application.
-
- \clearfloat
- \section1 \l{Qt Quarterly}{Qt Quarterly}
- \beginfloatleft
- \l{Qt Quarterly}{\inlineimage qq-thumbnail.png
- }
-
- \endfloat
- One more valuable source for examples and explanations of Qt
- features is the archive of \l{Qt Quarterly}, a newsletter for
- Qt developers.
-
- \clearfloat
+ \generatelist{related}
*/
/*!
\page examples-widgets.html
- \title Widgets Examples
-
- \contentspage Qt Examples
- \nextpage Dialog Examples
+ \title Widget Examples
+ \ingroup all-examples
+ \brief Lots of examples of how to use different kinds of widgets.
\image widget-examples.png
@@ -509,11 +125,9 @@
/*!
\page examples-dialogs.html
+ \ingroup all-examples
\title Dialog Examples
-
- \previouspage Widgets Examples
- \contentspage Qt Examples
- \nextpage Main Window Examples
+ \brief Using Qt's standard dialogs and building and using custom dialogs.
\image dialog-examples.png
@@ -539,11 +153,9 @@
/*!
\page examples-mainwindow.html
+ \ingroup all-examples
\title Main Window Examples
-
- \previouspage Dialog Examples
- \contentspage Qt Examples
- \nextpage Layout Examples
+ \brief Building applications around a main window.
\image mainwindow-examples.png
@@ -567,11 +179,9 @@
/*!
\page examples-layouts.html
+ \ingroup all-examples
\title Layout Examples
-
- \previouspage Main Window Examples
- \contentspage Qt Examples
- \nextpage Item Views Examples
+ \brief Using Qt's layout-based approach to widget management.
\image layout-examples.png
@@ -594,11 +204,9 @@
/*!
\page examples-itemviews.html
+ \ingroup all-examples
\title Item Views Examples
-
- \previouspage Layout Examples
- \contentspage Qt Examples
- \nextpage Graphics View Examples
+ \brief Using the model/view design pattern to separate presentation from data.
\image itemview-examples.png
@@ -632,11 +240,9 @@
/*!
\page examples-graphicsview.html
+ \ingroup all-examples
\title Graphics View Examples
-
- \previouspage Item Views Examples
- \contentspage Qt Examples
- \nextpage QML Examples and Demos
+ \brief Using Qt to manage and interact with a large (potentially) number of graphics items.
\image graphicsview-examples.png
@@ -651,6 +257,7 @@
\o \l{graphicsview/diagramscene}{Diagram Scene}\raisedaster
\o \l{graphicsview/dragdroprobot}{Drag and Drop Robot}\raisedaster
\o \l{graphicsview/elasticnodes}{Elastic Nodes}\raisedaster
+ \o \l{graphicsview/padnavigator}{Pad Navigator}\raisedaster
\o \l{graphicsview/portedasteroids}{Ported Asteroids}
\o \l{graphicsview/portedcanvas}{Ported Canvas}
\endlist
@@ -677,11 +284,9 @@
/*!
\page examples-painting.html
+ \ingroup all-examples
\title Painting Examples
-
- \previouspage QML Examples and Demos
- \contentspage Qt Examples
- \nextpage Rich Text Examples
+ \brief How to use the Qt painting system
\image painting-examples.png
@@ -709,11 +314,9 @@
/*!
\page examples-richtext.html
+ \ingroup all-examples
\title Rich Text Examples
-
- \previouspage Painting Examples
- \contentspage Qt Examples
- \nextpage Desktop Examples
+ \brief Using the document-oriented rich text engine
\image richtext-examples.png
@@ -732,11 +335,9 @@
/*!
\page examples-desktop.html
+ \ingroup all-examples
\title Desktop Examples
-
- \previouspage Rich Text Examples
- \contentspage Qt Examples
- \nextpage Drag and Drop Examples
+ \brief Integrating your Qt application with your favorite desktop
\image desktop-examples.png
@@ -755,11 +356,9 @@
/*!
\page examples-draganddrop.html
- \title Drag and Drop Examples
-
- \previouspage Desktop Examples
- \contentspage Qt Examples
- \nextpage Threading and Concurrent Programming Examples
+ \ingroup all-examples
+ \title Drag &amp Drop Examples
+ \brief How to access your platform's native darg &amp drop functionality
\image draganddrop-examples.png
@@ -783,11 +382,9 @@
/*!
\page examples-threadandconcurrent.html
+ \ingroup all-examples
\title Threading and Concurrent Programming Examples
-
- \previouspage Drag and Drop Examples
- \contentspage Qt Examples
- \nextpage Tools Examples
+ \brief Threading and concurrent programming in Qt
\image thread-examples.png
@@ -823,11 +420,9 @@
/*!
\page examples.tools.html
+ \ingroup all-examples
\title Tools Examples
-
- \previouspage Threading and Concurrent Programming Examples
- \contentspage Qt Examples
- \nextpage Network Examples
+ \brief Using Qt's containers, iterators, and other tool classes
\image tool-examples.png
@@ -861,11 +456,9 @@
/*!
\page examples-network.html
+ \ingroup all-examples
\title Network Examples
-
- \previouspage Tools Examples
- \contentspage Qt Examples
- \nextpage Inter-Process Communication Examples
+ \brief How to do network programming in Qt
\image network-examples.png
@@ -899,11 +492,9 @@
/*!
\page examples-ipc.html
- \title Inter-Process Communication Examples
-
- \previouspage Network Examples
- \contentspage Qt Examples
- \nextpage OpenGL Examples
+ \ingroup all-examples
+ \title IPC Examples
+ \brief Inter-Process Communication with Qt
\image ipc-examples.png
@@ -916,11 +507,9 @@
/*!
\page examples-opengl.html
+ \ingroup all-examples
\title OpenGL Examples
-
- \previouspage Inter-Process Communication Examples
- \contentspage Qt Examples
- \nextpage OpenVG Examples
+ \brief Accessing OpenGL from Qt
\image opengl-examples.png
@@ -950,11 +539,9 @@
/*!
\page examples-openvg.html
+ \ingroup all-examples
\title OpenVG Examples
-
- \previouspage OpenGL Examples
- \contentspage Qt Examples
- \nextpage Multimedia Examples
+ \brief Accessing OpenVG from Qt
\image openvg-examples.png
@@ -971,11 +558,9 @@
/*!
\page examples-multimedia.html
+ \ingroup all-examples
\title Multimedia Examples
-
- \previouspage OpenGL Examples
- \contentspage Qt Examples
- \nextpage SQL Examples
+ \brief Audio, video, and Phonon with Qt
\image phonon-examples.png
@@ -1020,11 +605,9 @@
/*!
\page examples-sql.html
+ \ingroup all-examples
\title SQL Examples
-
- \previouspage Multimedia Examples
- \contentspage Qt Examples
- \nextpage XML Examples
+ \brief Accessing your SQL database from Qt
\image sql-examples.png
@@ -1049,11 +632,9 @@
/*!
\page examples-xml.html
+ \ingroup all-examples
\title XML Examples
-
- \previouspage SQL Examples
- \contentspage Qt Examples
- \nextpage Qt Designer Examples
+ \brief Using XML with Qt
\image xml-examples.png XML
@@ -1085,11 +666,9 @@
/*!
\page examples-designer.html
+ \ingroup all-examples
\title Qt Designer Examples
-
- \previouspage XML Examples
- \contentspage Qt Examples
- \nextpage UiTools Examples
+ \brief Using Qt Designer to build your UI
\image designer-examples.png QtDesigner
@@ -1110,11 +689,9 @@
/*!
\page examples-uitools.html
+ \ingroup all-examples
\title UiTools Examples
-
- \previouspage Qt Designer Examples
- \contentspage Qt Examples
- \nextpage Qt Linguist Examples
+ \brief Using the QtUiTools module
\image uitools-examples.png UiTools
@@ -1126,11 +703,9 @@
/*!
\page examples-linguist.html
+ \ingroup all-examples
\title Qt Linguist Examples
-
- \previouspage UiTools Examples
- \contentspage Qt Examples
- \nextpage Qt Script Examples
+ \brief Using Qt Linguist to internationalize your Qt application
\image linguist-examples.png
@@ -1146,11 +721,9 @@
/*!
\page examples-script.html
+ \ingroup all-examples
\title Qt Script Examples
-
- \previouspage Qt Linguist Examples
- \contentspage Qt Examples
- \nextpage WebKit Examples
+ \brief Using the Qt scripting environment
\image qtscript-examples.png QtScript
@@ -1175,11 +748,9 @@
/*!
\page examples-webkit.html
+ \ingroup all-examples
\title WebKit Examples
-
- \previouspage Qt Script Examples
- \contentspage Qt Examples
- \nextpage Help System Examples
+ \brief Using WebKit in your Qt application
\image webkit-examples.png WebKit
@@ -1215,12 +786,10 @@
*/
/*!
- \page examples-helpsystem.html
+ \page examples-helpsystem.html
+ \ingroup all-examples
\title Help System Examples
-
- \previouspage WebKit Examples
- \contentspage Qt Examples
- \nextpage State Machine Examples
+ \brief Adding interactive help to your Qt application
\image assistant-examples.png HelpSystem
@@ -1239,11 +808,9 @@
/*!
\page examples-statemachine.html
+ \ingroup all-examples
\title State Machine Examples
-
- \previouspage Help System Examples
- \contentspage Qt Examples
- \nextpage Animation Framework Examples
+ \brief Using Qt's finite state machine classes
\image statemachine-examples.png StateMachine
@@ -1265,11 +832,9 @@
/*!
\page examples-animation.html
+ \ingroup all-examples
\title Animation Framework Examples
-
- \previouspage State Machine Examples
- \contentspage Qt Examples
- \nextpage Multi-Touch Examples
+ \brief Doing animations with Qt
\image animation-examples.png Animation
@@ -1287,11 +852,9 @@
/*!
\page examples-multitouch.html
+ \ingroup all-examples
\title Multi-Touch Examples
-
- \previouspage Animation Framework Examples
- \contentspage Qt Examples
- \nextpage Gestures Examples
+ \brief Using Qt's multi-touch input capability
Support for multi-touch input makes it possible for developers to create
extensible and intuitive user interfaces.
@@ -1306,11 +869,9 @@
/*!
\page examples-gestures.html
+ \ingroup all-examples
\title Gestures Examples
-
- \previouspage Multi-Touch Examples
- \contentspage Qt Examples
- \nextpage D-Bus Examples
+ \brief Gesture programming examples
The API of the gesture framework is not yet finalized and
still subject to change.
@@ -1322,11 +883,9 @@
/*!
\page examples-dbus.html
+ \ingroup all-examples
\title D-Bus Examples
-
- \previouspage Gestures Examples
- \contentspage Qt Examples
- \nextpage Qt for Embedded Linux Examples
+ \brief Using D-Bus from Qt applications
\list
\o \l{dbus/dbus-chat}{Chat}
@@ -1341,11 +900,9 @@
/*!
\page examples-embeddedlinux.html
+ \ingroup all-examples
\title Qt for Embedded Linux Examples
-
- \previouspage D-Bus Examples
- \contentspage Qt Examples
- \nextpage ActiveQt Examples
+ \brief Using Qt in Embedded Linux
\image qt-embedded-examples.png QtEmbedded
@@ -1363,11 +920,9 @@
/*!
\page examples-activeqt.html
+ \ingroup all-examples
\title ActiveQt Examples
-
- \previouspage Qt for Embedded Linux Examples
- \contentspage Qt Examples
- \nextpage Qt Quarterly
+ \brief Using ActiveX from Qt applications
\image activeqt-examples.png ActiveQt
diff --git a/doc/src/getting-started/how-to-learn-qt.qdoc b/doc/src/getting-started/how-to-learn-qt.qdoc
index ce8f5218f6..642421b07f 100644
--- a/doc/src/getting-started/how-to-learn-qt.qdoc
+++ b/doc/src/getting-started/how-to-learn-qt.qdoc
@@ -59,11 +59,11 @@
If you want to design your user interfaces using a design tool, then
read at least the first few chapters of the \l{Qt Designer manual}.
- By now you'll have produced some small working applications and have a
- broad feel for Qt programming. You could start work on your own
- projects straight away, but we recommend reading a couple of key
- overviews to deepen your understanding of Qt: \l{Qt Object Model}
- and \l{Signals and Slots}.
+ By now you'll have produced some small working applications and
+ have a broad feel for Qt programming. You could start work on your
+ own projects straight away, but we recommend reading a couple of
+ key overviews to deepen your understanding of Qt: The Qt \l{Object
+ Model} and \l{Signals and Slots}.
\beginfloatleft
\inlineimage qtdemo-small.png
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 3ea351e35f..4a96a39461 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -703,21 +703,19 @@ If you are using pre-built binaries, follow the instructions given in the
\ingroup qtsymbian
\brief How to install Qt on the Symbian platform using Linux.
-\note Qt for the Symbian platform has some requirements that are given in more detail
-in the \l{Qt for the Symbian platform Requirements} document. TODO list requirements like SDK here.
-
\note \bold {This document describes how to install and configure Qt for
the Symbian platform from scratch, using Linux as the build host.
-Qt does not come with a binary package for Linux yet, but if you want to avoid
-the full build of Qt and start developing applications right away, you can
-download drop-in binaries from here: TODO}
+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
- TODO Make sure your Symbian development environment is correctly installed and
- patched as explained in the \l{Qt for the Symbian platform Requirements} document.
+ \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.
\o Install Qt
@@ -770,7 +768,7 @@ download drop-in binaries from here: TODO}
The Qt libraries are built with "All -Tcb" capability, so that
they can support all types of applications. However, these
- capabilities are automatically lowered if you make a selfsigned
+ capabilities are automatically lowered if you make a self-signed
package.
\o Building a Qt package with a Symbian developer certificate
@@ -826,7 +824,7 @@ download drop-in binaries from here: TODO}
Note the identifier on the line where your Symbian device
appears. Then execute the following, using the first and
- second part of the identifier in place of \c XXXX,
+ second part of the identifier in place of \c XXX,
respectively.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 44
@@ -961,7 +959,7 @@ download drop-in binaries from here: TODO}
\l{http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&amp;DisplayLang=en}{here}.
\endlist
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
*/
/*!
@@ -971,7 +969,7 @@ download drop-in binaries from here: TODO}
\brief Setting up the Mac OS X environment for Qt.
\previouspage General Qt Requirements
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
*/
/*!
@@ -1110,7 +1108,7 @@ download drop-in binaries from here: TODO}
distributions; try searching for \c gstreamer or \c libgstreamer in your
distribution's package repository to find suitable packages.
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
*/
/*!
@@ -1164,7 +1162,7 @@ download drop-in binaries from here: TODO}
information on Windows CE Customization can be found
\l{Windows CE - Working with Custom SDKs}{here}.
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
*/
/*!
@@ -1174,7 +1172,7 @@ download drop-in binaries from here: TODO}
\brief Setting up the Embedded Linux environment for Qt.
\previouspage General Qt Requirements
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
\section1 Building Qt for Embedded Linux with uclibc
@@ -1274,5 +1272,5 @@ download drop-in binaries from here: TODO}
We recommend you to take a look at \l{http://developer.symbian.org/wiki/index.php/Qt_Quick_Start}{Symbian Foundation - Qt Quick Start}
to get more information about how to setup the development environment.
- \sa {Known Issues in %VERSION%}
+ \sa {Known Issues}
*/
diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc
index b73e15de59..5b6b2fc240 100644
--- a/doc/src/getting-started/known-issues.qdoc
+++ b/doc/src/getting-started/known-issues.qdoc
@@ -41,15 +41,15 @@
/*!
\page known-issues.html
- \title Known Issues in %VERSION%
+ \title Known Issues
\ingroup platform-specific
- \brief A summary of known issues in Qt %VERSION% at the time of release.
+ \brief A summary of known issues in this Qt version at the time of release.
- An up-to-date list of known issues with Qt %VERSION% can be found via the
+ 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 in Qt %VERSION%, see the \l{Task Tracker}
- on the Qt website.
+ 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}
diff --git a/doc/src/howtos/HWacceleration.qdoc b/doc/src/howtos/HWacceleration.qdoc
index fbc657cd27..c7b1a72081 100644
--- a/doc/src/howtos/HWacceleration.qdoc
+++ b/doc/src/howtos/HWacceleration.qdoc
@@ -41,17 +41,20 @@
/*!
\page HWAcc_rendering.html
- \title Using hardware acceleration on embedded platforms.
+ \title Hardware Acceleration &amp Embedded Platforms.
+ \brief How to use hardware acceleration for fast rendering.
\ingroup best-practices
\section1 Abstract
+
This document describes how to use hardware acceleration for fast
- rendering on embedded platforms supported by Qt. In short, it explains
- how the graphics pipeline works. Since there might be differences to
- how the APIs are being used on different embedded platforms, a table
- links to documentation dedicated to platform specific documentation
- for each supported hardware acceleration API.
+ rendering on embedded platforms supported by Qt. In short, it
+ explains how the graphics pipeline works. Since there might be
+ differences to how the APIs are being used on different embedded
+ platforms, a table links to documentation dedicated to platform
+ specific documentation for each supported hardware acceleration
+ API.
\input platforms/emb-hardwareacceleration.qdocinc
diff --git a/doc/src/howtos/accelerators.qdoc b/doc/src/howtos/accelerators.qdoc
index 65f1defc59..b6ef5c2a6d 100644
--- a/doc/src/howtos/accelerators.qdoc
+++ b/doc/src/howtos/accelerators.qdoc
@@ -42,6 +42,7 @@
/*!
\page accelerators.html
\title Standard Accelerator Keys
+ \brief Recommended accelerator keys.
\ingroup best-practices
diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc
index dd39509a25..9377961257 100644
--- a/doc/src/howtos/appicon.qdoc
+++ b/doc/src/howtos/appicon.qdoc
@@ -42,6 +42,7 @@
/*!
\page appicon.html
\title Setting the Application Icon
+ \brief How to set your application's icon.
\ingroup best-practices
diff --git a/doc/src/howtos/guibooks.qdoc b/doc/src/howtos/guibooks.qdoc
index 1a706704f5..aa108d127d 100644
--- a/doc/src/howtos/guibooks.qdoc
+++ b/doc/src/howtos/guibooks.qdoc
@@ -43,6 +43,7 @@
\page guibooks.html
\title Books about GUI Design
\ingroup best-practices
+ \brief Some recommended books about GUI design.
This is not a comprehensive list -- there are many other books worth
buying. Here we mention just a few user interface books that don't
@@ -96,8 +97,6 @@
Microsoft Windows User Experience}}, ISBN 1-55615-679-0,
is Microsoft's look and feel bible. Indispensable for everyone who
has customers that worship Microsoft, and it's quite good, too.
- It is also available
- \link http://msdn.microsoft.com/library/en-us/dnwue/html/welcome.asp online\endlink.
\bold{\l{http://www.amazon.com/exec/obidos/ASIN/047159900X/trolltech/t}{The Icon Book}}
by William Horton, ISBN 0-471-59900-X, is perhaps the only thorough
diff --git a/doc/src/howtos/openvg.qdoc b/doc/src/howtos/openvg.qdoc
index f70ed54bfd..f4a34cda30 100644
--- a/doc/src/howtos/openvg.qdoc
+++ b/doc/src/howtos/openvg.qdoc
@@ -172,8 +172,25 @@
\endlist
The other members of QPainter::CompositionMode are not supported
- because OpenVG 1.1 does not have an equivalent in its \c VGBlendMode
- enumeration. Any attempt to set an unsupported mode will result in
+ unless the \c{VG_KHR_advanced_blending} extension is present,
+ in which case the following additional modes are supported:
+
+ \list
+ \o QPainter::CompositionMode_Overlay
+ \o QPainter::CompositionMode_ColorDodge
+ \o QPainter::CompositionMode_ColorBurn
+ \o QPainter::CompositionMode_HardLight
+ \o QPainter::CompositionMode_SoftLight
+ \o QPainter::CompositionMode_Difference
+ \o QPainter::CompositionMode_Exclusion
+ \o QPainter::CompositionMode_SourceOut
+ \o QPainter::CompositionMode_DestinationOut
+ \o QPainter::CompositionMode_SourceAtop
+ \o QPainter::CompositionMode_DestinationAtop
+ \o QPainter::CompositionMode_Xor
+ \endlist
+
+ Any attempt to set an unsupported mode will result in
the actual mode being set to QPainter::CompositionMode_SourceOver.
Client applications should avoid using unsupported modes.
@@ -245,7 +262,10 @@
The QVG_SCISSOR_CLIP define will disable clipping with vgMask() or
vgRenderToMask() and instead use the scissor rectangle list to perform
- clipping. Clipping with an arbitrary QPainterPath will not be supported.
+ clipping. Clipping with an arbitrary QPainterPath will need to convert
+ the path into a series of rectangles. If the number of rectangles
+ exceeds VG_MAX_SCISSOR_RECTS, then the results will not be exact.
+
The QVG_SCISSOR_CLIP define should only be used if the OpenVG engine
does not support vgMask() or vgRenderToMask().
diff --git a/doc/src/howtos/qtdesigner.qdoc b/doc/src/howtos/qtdesigner.qdoc
index 2dd7fcfe67..92041f0a74 100644
--- a/doc/src/howtos/qtdesigner.qdoc
+++ b/doc/src/howtos/qtdesigner.qdoc
@@ -42,6 +42,7 @@
/*!
\page qtdesigner-components.html
\title Creating and Using Components for Qt Designer
+ \brief How to create and use custom widget plugins.
\ingroup best-practices
\tableofcontents
diff --git a/doc/src/howtos/restoring-geometry.qdoc b/doc/src/howtos/restoring-geometry.qdoc
index 36c5e4f4e4..e72b99320c 100644
--- a/doc/src/howtos/restoring-geometry.qdoc
+++ b/doc/src/howtos/restoring-geometry.qdoc
@@ -42,7 +42,7 @@
/*!
\page restoring-geometry.html
\title Restoring a Window's Geometry
-
+ \brief How to save &amp restore window geometry.
\ingroup best-practices
This document describes how to save and restore a \l{Window
diff --git a/doc/src/howtos/session.qdoc b/doc/src/howtos/session.qdoc
index e2e87a89dc..f53af0433d 100644
--- a/doc/src/howtos/session.qdoc
+++ b/doc/src/howtos/session.qdoc
@@ -42,7 +42,7 @@
/*!
\page session.html
\title Session Management
-
+ \brief How to do session management with Qt.
\ingroup best-practices
A \e session is a group of running applications, each of which has a
diff --git a/doc/src/howtos/sharedlibrary.qdoc b/doc/src/howtos/sharedlibrary.qdoc
index 70fc4db562..ed803ed7cb 100644
--- a/doc/src/howtos/sharedlibrary.qdoc
+++ b/doc/src/howtos/sharedlibrary.qdoc
@@ -42,7 +42,7 @@
/*!
\page sharedlibrary.html
\title Creating Shared Libraries
-
+ \brief How to create shared libraries.
\ingroup best-practices
The following sections list certain things that should be taken into
diff --git a/doc/src/howtos/timers.qdoc b/doc/src/howtos/timers.qdoc
index cfc2fb4abd..b0019167eb 100644
--- a/doc/src/howtos/timers.qdoc
+++ b/doc/src/howtos/timers.qdoc
@@ -42,7 +42,7 @@
/*!
\page timers.html
\title Timers
- \brief How to use timers in your application.
+ \brief How to use Qt timers in your application.
\ingroup best-practices
diff --git a/doc/src/images/declarative-folderlistmodel.png b/doc/src/images/declarative-folderlistmodel.png
new file mode 100644
index 0000000000..a469f9683e
--- /dev/null
+++ b/doc/src/images/declarative-folderlistmodel.png
Binary files differ
diff --git a/doc/src/images/declarative-image_fillMode.gif b/doc/src/images/declarative-image_fillMode.gif
deleted file mode 100644
index eb0a9afb7f..0000000000
--- a/doc/src/images/declarative-image_fillMode.gif
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-integrating-graphicswidgets.png b/doc/src/images/declarative-integrating-graphicswidgets.png
deleted file mode 100644
index d57f4b9206..0000000000
--- a/doc/src/images/declarative-integrating-graphicswidgets.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectcrop.png b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
new file mode 100644
index 0000000000..64fb086fac
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectfit.png b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
new file mode 100644
index 0000000000..2585fa5f5f
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-stretch.png b/doc/src/images/declarative-qtlogo-stretch.png
new file mode 100644
index 0000000000..32a0114e4e
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-stretch.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tile.png b/doc/src/images/declarative-qtlogo-tile.png
new file mode 100644
index 0000000000..7d1b9d0485
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tile.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilehorizontally.png b/doc/src/images/declarative-qtlogo-tilehorizontally.png
new file mode 100644
index 0000000000..367a8c7d0b
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilehorizontally.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilevertically.png b/doc/src/images/declarative-qtlogo-tilevertically.png
new file mode 100644
index 0000000000..68afafa8c3
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilevertically.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo1.png b/doc/src/images/declarative-qtlogo.png
index 940d159ae4..940d159ae4 100644
--- a/doc/src/images/declarative-qtlogo1.png
+++ b/doc/src/images/declarative-qtlogo.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo2.png b/doc/src/images/declarative-qtlogo2.png
deleted file mode 100644
index b1d128a294..0000000000
--- a/doc/src/images/declarative-qtlogo2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo3.png b/doc/src/images/declarative-qtlogo3.png
deleted file mode 100644
index d5165248cf..0000000000
--- a/doc/src/images/declarative-qtlogo3.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo4.png b/doc/src/images/declarative-qtlogo4.png
deleted file mode 100644
index 7c8aa64210..0000000000
--- a/doc/src/images/declarative-qtlogo4.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo5.png b/doc/src/images/declarative-qtlogo5.png
deleted file mode 100644
index b7b3513e53..0000000000
--- a/doc/src/images/declarative-qtlogo5.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo6.png b/doc/src/images/declarative-qtlogo6.png
deleted file mode 100644
index 07a078f912..0000000000
--- a/doc/src/images/declarative-qtlogo6.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/modelview-move-rows-1.png b/doc/src/images/modelview-move-rows-1.png
new file mode 100644
index 0000000000..b629a72dd4
--- /dev/null
+++ b/doc/src/images/modelview-move-rows-1.png
Binary files differ
diff --git a/doc/src/images/modelview-move-rows-2.png b/doc/src/images/modelview-move-rows-2.png
new file mode 100644
index 0000000000..674ca18f78
--- /dev/null
+++ b/doc/src/images/modelview-move-rows-2.png
Binary files differ
diff --git a/doc/src/images/modelview-move-rows-3.png b/doc/src/images/modelview-move-rows-3.png
new file mode 100644
index 0000000000..5445dd599c
--- /dev/null
+++ b/doc/src/images/modelview-move-rows-3.png
Binary files differ
diff --git a/doc/src/images/modelview-move-rows-4.png b/doc/src/images/modelview-move-rows-4.png
new file mode 100644
index 0000000000..ecd65bac6c
--- /dev/null
+++ b/doc/src/images/modelview-move-rows-4.png
Binary files differ
diff --git a/doc/src/images/multitouch-fingerpaint-example.png b/doc/src/images/multitouch-fingerpaint-example.png
new file mode 100644
index 0000000000..c741b65526
--- /dev/null
+++ b/doc/src/images/multitouch-fingerpaint-example.png
Binary files differ
diff --git a/doc/src/images/qml-clocks-example.png b/doc/src/images/qml-clocks-example.png
new file mode 100644
index 0000000000..1b352b589b
--- /dev/null
+++ b/doc/src/images/qml-clocks-example.png
Binary files differ
diff --git a/doc/src/images/qml-corkboards-example.png b/doc/src/images/qml-corkboards-example.png
new file mode 100644
index 0000000000..8acffa7b64
--- /dev/null
+++ b/doc/src/images/qml-corkboards-example.png
Binary files differ
diff --git a/doc/src/images/qml-dial.png b/doc/src/images/qml-dial.png
new file mode 100644
index 0000000000..da5c031c40
--- /dev/null
+++ b/doc/src/images/qml-dial.png
Binary files differ
diff --git a/doc/src/images/qml-dialcontrol-example.png b/doc/src/images/qml-dialcontrol-example.png
new file mode 100644
index 0000000000..74cd645d3a
--- /dev/null
+++ b/doc/src/images/qml-dialcontrol-example.png
Binary files differ
diff --git a/doc/src/images/qml-dynamicscene-example.png b/doc/src/images/qml-dynamicscene-example.png
new file mode 100644
index 0000000000..1f725d1b09
--- /dev/null
+++ b/doc/src/images/qml-dynamicscene-example.png
Binary files differ
diff --git a/doc/src/images/qml-flickr-example.png b/doc/src/images/qml-flickr-demo.png
index 71ea567929..71ea567929 100644
--- a/doc/src/images/qml-flickr-example.png
+++ b/doc/src/images/qml-flickr-demo.png
Binary files differ
diff --git a/doc/src/images/qml-flipable-example.png b/doc/src/images/qml-flipable-example.png
new file mode 100644
index 0000000000..dd68a66cef
--- /dev/null
+++ b/doc/src/images/qml-flipable-example.png
Binary files differ
diff --git a/doc/src/images/qml-image-example.png b/doc/src/images/qml-image-example.png
new file mode 100644
index 0000000000..c1951c0dae
--- /dev/null
+++ b/doc/src/images/qml-image-example.png
Binary files differ
diff --git a/doc/src/images/qml-intro-anchors1.png b/doc/src/images/qml-intro-anchors1.png
new file mode 100644
index 0000000000..fdb301ea22
--- /dev/null
+++ b/doc/src/images/qml-intro-anchors1.png
Binary files differ
diff --git a/doc/src/images/qml-intro-anchors2.png b/doc/src/images/qml-intro-anchors2.png
new file mode 100644
index 0000000000..84f43bd3df
--- /dev/null
+++ b/doc/src/images/qml-intro-anchors2.png
Binary files differ
diff --git a/doc/src/images/qml-intro-anchors3.png b/doc/src/images/qml-intro-anchors3.png
new file mode 100644
index 0000000000..21ae97baf7
--- /dev/null
+++ b/doc/src/images/qml-intro-anchors3.png
Binary files differ
diff --git a/doc/src/images/qml-intro-helloa.png b/doc/src/images/qml-intro-helloa.png
new file mode 100644
index 0000000000..00b34b0208
--- /dev/null
+++ b/doc/src/images/qml-intro-helloa.png
Binary files differ
diff --git a/doc/src/images/qml-minehunt-example.png b/doc/src/images/qml-minehunt-demo.png
index 3b6956936f..3b6956936f 100644
--- a/doc/src/images/qml-minehunt-example.png
+++ b/doc/src/images/qml-minehunt-demo.png
Binary files differ
diff --git a/doc/src/images/qml-photoviewer-example.png b/doc/src/images/qml-photoviewer-demo.png
index be6f1bf1f9..be6f1bf1f9 100644
--- a/doc/src/images/qml-photoviewer-example.png
+++ b/doc/src/images/qml-photoviewer-demo.png
Binary files differ
diff --git a/doc/src/images/qml-progressbar-example.png b/doc/src/images/qml-progressbar-example.png
new file mode 100644
index 0000000000..3ddd6c64ad
--- /dev/null
+++ b/doc/src/images/qml-progressbar-example.png
Binary files differ
diff --git a/doc/src/images/qml-rssnews-demo.png b/doc/src/images/qml-rssnews-demo.png
new file mode 100644
index 0000000000..948ef4d87c
--- /dev/null
+++ b/doc/src/images/qml-rssnews-demo.png
Binary files differ
diff --git a/doc/src/images/qml-samegame-example.png b/doc/src/images/qml-samegame-demo.png
index c17b4e0775..c17b4e0775 100644
--- a/doc/src/images/qml-samegame-example.png
+++ b/doc/src/images/qml-samegame-demo.png
Binary files differ
diff --git a/doc/src/images/qml-searchbox-example.png b/doc/src/images/qml-searchbox-example.png
new file mode 100644
index 0000000000..97d12bba89
--- /dev/null
+++ b/doc/src/images/qml-searchbox-example.png
Binary files differ
diff --git a/doc/src/images/qml-slideswitch-example.png b/doc/src/images/qml-slideswitch-example.png
new file mode 100644
index 0000000000..17cb3eb36b
--- /dev/null
+++ b/doc/src/images/qml-slideswitch-example.png
Binary files differ
diff --git a/doc/src/images/qml-snake-example.png b/doc/src/images/qml-snake-demo.png
index d3c077d1f8..d3c077d1f8 100644
--- a/doc/src/images/qml-snake-example.png
+++ b/doc/src/images/qml-snake-demo.png
Binary files differ
diff --git a/doc/src/images/qml-spinner-example.png b/doc/src/images/qml-spinner-example.png
new file mode 100644
index 0000000000..ed381f8aa7
--- /dev/null
+++ b/doc/src/images/qml-spinner-example.png
Binary files differ
diff --git a/doc/src/images/qml-tabwidget-example.png b/doc/src/images/qml-tabwidget-example.png
new file mode 100644
index 0000000000..05887f3d1a
--- /dev/null
+++ b/doc/src/images/qml-tabwidget-example.png
Binary files differ
diff --git a/doc/src/images/qml-tic-tac-toe-example.png b/doc/src/images/qml-tic-tac-toe-example.png
new file mode 100644
index 0000000000..5a5cc8262b
--- /dev/null
+++ b/doc/src/images/qml-tic-tac-toe-example.png
Binary files differ
diff --git a/doc/src/images/qml-tvtennis-example.png b/doc/src/images/qml-tvtennis-example.png
new file mode 100644
index 0000000000..ac2b5276bd
--- /dev/null
+++ b/doc/src/images/qml-tvtennis-example.png
Binary files differ
diff --git a/doc/src/images/qml-twitter-demo.png b/doc/src/images/qml-twitter-demo.png
new file mode 100644
index 0000000000..63d6486a5a
--- /dev/null
+++ b/doc/src/images/qml-twitter-demo.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 2e6f9bd44e..b759435811 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,16 +44,15 @@
\keyword Qt Reference Documentation
\raw HTML
- <div class="indexbox" >
+ <div class="indexbox guide" >
<div class="heading">
Qt Developer Guide</div>
<div class="indexboxcont indexboxbar">
- <div class="section indexIcon">
- <img src="images/qt_guide.png" alt="" /></div>
+ <div class="section indexIcon"><span></span></div>
<div class="section">
<p>Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.</p>
</div>
- <div class="section sectionlist lastcol">
+ <div class="section sectionlist">
<ul>
<li><a href="">Getting started</a></li>
<li><a href="installation.html">Installation &amp; first steps</a></li>
@@ -65,50 +64,50 @@
</div>
</div>
</div>
- <div class="indexbox">
+ <div class="indexbox api">
<div class="heading">
Qt API Overviews</div>
- <div class="indexboxcont indexboxbar tricol">
- <div class="sectionlist">
+ <div class="indexboxcont indexboxbar ">
+ <div class="sectionlist tricol">
<ul>
- <li><a href="modules.html">All modules</a></li>
- <li><a href="classes.html">All classes</a></li>
- <li><a href="namespaces.html">All namespaces</a></li>
- <li><a href="functions.html">All functions</a></li>
- <li><a href="platform-specific.html">Platform support &amp; specifics</a></li>
+ <li><a href="classes.html">Class index</a></li>
+ <li><a href="functions.html">Function index</a></li>
+ <li><a href="modules.html">Modules</a></li>
+ <li><a href="namespaces.html">Namespaces</a></li>
+ <li><a href="qtglobal.html">Global stuff</a></li>
+ <li><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</div>
- <div class="sectionlist">
+ <div class="sectionlist tricol">
<ul>
- <li><a href="object.html">QObject model</a></li>
- <li><a href="application-windows.html">Window architecture</a></li>
- <li><a href="widgets-and-layouts.html">Styles &amp; layout</a></li>
- <li><a href="eventsandfilters.html">Event handling</a></li>
- <li><a href="paintsystem.html">Paint system</a></li>
+ <li><a href="qt-basic-concepts.html">Basic Qt Architecture</a></li>
+ <li><a href="declarativeui.html">Device UI's &amp; Qt Quick</a></li>
+ <li><a href="qt-gui-concepts.html">Desktop UI components</a></li>
+ <li><a href="platform-specific.html">Platform-specific info</a></li>
+ <li><a href="qt-graphics.html">Graphics, Painting &amp Printing</a></li>
+ <li><a href="qt-network.html">Input/Output &amp networking</a></li>
</ul>
</div>
- <div class="lastcol">
+ <div class="sectionlist">
<ul>
- <li><a href="graphicsview.html">Canvas UI with Graphics View</a></li>
- <li><a href="declarativeui.html">UI design &amp; Qt Quick</a></li>
- <li><a href="io.html">Input/output</a></li>
- <li><a href="webintegration.html">Integrating Web Content</a></li>
- <li><a href="developing-with-qt.html">X-platform, debug &amp; deploy</a></li>
+ <li><a href="model-view-programming.html">Model/View programming</a></li>
+ <li><a href="technology-apis.html">Qt API's for other technologies</a></li>
+ <li><a href="best-practices.html">Qt How-to's &amp best practices</a></li>
+ <li><a href="developing-with-qt.html">Cross-platform development</a></li>
</ul>
</div>
</div>
</div>
- <div class="indexbox">
+ <div class="indexbox tools">
<div class="heading">
Qt Tools</div>
<div class="indexboxcont">
- <div class="section indexIcon">
- <img src="images/qt_tools.png" alt="" /></div>
+ <div class="section indexIcon"><span></span></div>
<div class="section">
<p>Qt offers a selection of development tools for different tasks. Use Qt Creator for
project and code management as well as building powerfull UIs.</p>
</div>
- <div class="section sectionlist lastcol">
+ <div class="section sectionlist">
<ul>
<li><a href="http://doc.qt.nokia.com/qtcreator-1.3/index.html">Qt Creator</a></li>
<li><a href="designer-manual.html">Qt Designer</a></li>
@@ -118,9 +117,8 @@
<li><a href="qvfb.html">Virtual Framebuffer</a></li>
</ul>
</div>
- </div>
- </div>
-
+ </div>
+ </div>
\endraw
*/
diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc
index 424dec2708..4493deb527 100644
--- a/doc/src/internationalization/linguist-manual.qdoc
+++ b/doc/src/internationalization/linguist-manual.qdoc
@@ -252,6 +252,9 @@
can also process Localization Interchange File Format (XLIFF)
format files; files in this format typically have file names that
end with the \c .xlf suffix.
+
+ \note The minimum supported version for XLIFF format files is
+ 1.1. XLIFF 1.0 version files are not supported.
Pass the \c -help option to \c lupdate to obtain the list of
supported options:
@@ -962,8 +965,10 @@
application.
\o \c .xlf \e {XLIFF files} \BR are human-readable XML files that adhere
to the international XML Localization Interchange File Format. \QL
- can be used to edit XLIFF files generated by other programs. For standard
- Qt projects, however, only the TS file format is used.
+ can be used to edit XLIFF files generated by other programs. However, for
+ standard Qt projects, only the TS file format is used. \note The minimum
+ supported version for XLIFF format files is 1.1. XLIFF 1.0 version files
+ are not supported.
\o QM \e {Qt message files} \BR are binary files that contain
translations used by an application at run-time. These files are
generated by \l lrelease, but can also be generated by \QL.
diff --git a/doc/src/ja_JP/development/designer-manual.qdoc b/doc/src/ja_JP/development/designer-manual.qdoc
new file mode 100644
index 0000000000..585af166a2
--- /dev/null
+++ b/doc/src/ja_JP/development/designer-manual.qdoc
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page designer-quick-start.html
+
+ \title Qt Designer クイックガイド
+
+ \QD を使うための基本的な手順は、以下の\bold{四つ}です。
+
+ \list 1
+ \o フォームとオブジェクトを選択する
+ \o フォームにオブジェクトを配置する
+ \o スロットにシグナルを接続する
+ \o フォームをプレビューする
+ \endlist
+
+ \image rgbController-screenshot.png
+
+ Red、Green、Blue(RGB)の値を操作するために必要なコントロールを含む
+ 小さなウィジェット(上記スクリーンショット参照)を設計する場合を想定します。
+ このウィジェットは、画像処理プログラム内のどこからでも表示できるウィジェットです。
+
+ \table
+ \row
+ \i \inlineimage designer-choosing-form.png
+ \i \bold{フォームを選択する}
+
+ \gui{新しいフォーム} ダイアログから \gui Widget を選択して開始します。
+ \endtable
+
+
+ \table
+ \row
+ \i \inlineimage rgbController-arrangement.png
+ \i \bold{フォームにウィジェットを配置する}
+
+ 3つのラベル(Label)、スピンボックス(Spin Box)、垂直方向のスライダ(Vertical Slider)をフォーム上へドラッグします。
+ ラベルの既定の文字列を変更するには、文字列をダブルクリックします。
+ 希望するレイアウトに合わせて配置します。
+ \endtable
+
+ 画像のようにこれらのウィジェットを配置するには、
+ レイアウトにウィジェットを配置する必要があります。
+ これを3つグループに対して行います。
+ まず "RED" ラベルを選択します。
+ 次に、\key Ctrl (Mac OS X では \key Command)キーを押したまま、対応するスピンボックスとスライダを選択します。
+ \gui{フォーム} メニューで、\gui{格子状に並べる}を選択します。
+
+ \table
+ \row
+ \i \inlineimage rgbController-form-gridLayout.png
+ \i \inlineimage rgbController-selectForLayout.png
+ \endtable
+
+ 他の2つのラベルに対しても、対応するスピンボックスとスライダごとにこの手順を繰り返します。
+
+ 次の手順は、これら3つのレイアウトを組み合わせて、1つの\bold{メインレイアウト}を作成することです。
+ メインレイアウトとは、トップレベルウィジェット(この場合は QWidget)のレイアウトです。
+ トップレベルウィジェットにレイアウトを配置することは重要です。
+ そうでなければ、ウィンドウをサイズ変更したときにウィンドウ上のウィジェットのサイズが変更されません。
+ レイアウトを設定するには、フォーム上の3つのレイアウト以外の任意の場所で\gui{右クリック}し、\gui{水平に並べる}を選択します。
+ または、\gui{格子状に並べる}を選択することもできます。
+ そのどちらでも同じ配置(以下を参照)で表示されます。
+
+ \image rgbController-final-layout.png
+
+ \note メインレイアウトはフォームに表示できません。
+ メインレイアウトがインストールされているかどうかを確認するには、
+ フォームをサイズ変更してみます。
+ インストールされている場合は、各ウィジェットのサイズが適宜変更されます。
+ または、\QD の \gui{Object Inspector} で確認することもできます。
+ トップレベルウィジェットにレイアウトが配置されていない場合、
+ その横に崩れたレイアウトのアイコン \inlineimage rgbController-no-toplevel-layout.png
+ が表示されます。
+
+ スライダをクリックして特定の値までドラッグするときに、
+ スピンボックスにスライダの位置を反映させます。
+ この操作を行うには、スライダの \l{QAbstractSlider::}{valueChanged()}
+ シグナルをスピンボックスの \l{QSpinBox::}{setValue()}
+ スロットに接続する必要があります。
+ また、逆方向、すなわちスピンボックスの \l{QSpinBox::}{valueChanged()}
+ シグナルをスライダの \l{QAbstractSlider::value()}{setValue()} スロットに接続する必要があります。
+
+ この操作を行うには、\key{F4} キーを押すか、\gui{編集|シグナル/スロットの編集} を選択し、
+ \gui{シグナル/スロットの編集}モードに切り替える必要があります。
+
+ \table
+ \row
+ \i \inlineimage rgbController-signalsAndSlots.png
+ \i \bold{シグナルをスロットに接続する}
+
+ スライダをクリックし、カーソルをスピンボックスまでドラッグします。
+ 以下のような \gui{シグナルスロットを設定} ダイアログがポップアップ表示されます。
+ 適切なシグナルとスロットを選択し、\gui OK をクリックします。
+ \endtable
+
+ \image rgbController-configure-connection1.png
+
+ 手順を(逆の順序で)繰り返し、
+ スピンボックスをクリックしてカーソルをスライダまでドラッグし、
+ スピンボックスの \l{QSpinBox::}{valueChanged()} シグナルを、
+ スライダの \l{QAbstractSlider::value()}{setValue()} スロットに接続します。
+
+ 以下のスクリーンショットは、適切なシグナルとスロットを選択するためのガイドとして利用できます。
+
+ \image rgbController-configure-connection2.png
+
+ RGBコントローラーの "RED" コンポーネントのオブジェクトが正常に接続されたので、
+ "GREEN" および "BLUE" コンポーネントにも同じ手順を繰り返します。
+
+ RGB値の範囲は 0 ~ 255 であるため、
+ スピンボックスとスライダを特定の範囲に制限する必要があります。
+
+ \table
+ \row
+ \i \inlineimage rgbController-property-editing.png
+ \i \bold{ウィジェットのプロパティを設定する}
+
+ 最初のスピンボックスをクリックします。
+ \gui{プロパティエディタ}に \l{QSpinBox} のプロパティが表示されます。
+ \l{QSpinBox::}{maximum} のプロパティに、"255" と入力します。
+ 次に、最初の垂直方向のスライダをクリックすると、
+ \l{QAbstractSlider} のプロパティが表示されます。
+ \l{QAbstractSlider::}{maximum} のプロパティにも、"255" と入力します。
+ 残りのスピンボックスとスライダに対しても、この処理を繰り返します。
+ \endtable
+
+ ここで、フォームをプレビューし、アプリケーションの外観を確認します。
+ この操作を行うには、\key{Ctrl + R} を押すか、
+ \gui{フォーム}メニューから\gui{プレビュー}を選択します。
+ スライダをドラッグすると、
+ スピンボックスにその値が反映されます(逆の場合も同じ)。
+ またサイズを変更し、子ウィジェットの管理に使用するレイアウトが
+ どのようにウィンドウのさまざまなサイズに対応しているか確認します。
+*/
+
diff --git a/doc/src/ja_JP/development/qmake-manual.qdoc b/doc/src/ja_JP/development/qmake-manual.qdoc
new file mode 100644
index 0000000000..8c9297fa20
--- /dev/null
+++ b/doc/src/ja_JP/development/qmake-manual.qdoc
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qmake-tutorial.html
+ \title qmake チュートリアル
+
+ このチュートリアルでは \c qmake の使い方を説明します。
+ このチュートリアルを読み終わったら \c qmake
+ のユーザガイドを読むことをお勧めします。
+
+ \section1 簡単な例
+
+ アプリケーションの基本的な実装は既に完了していて、
+ 次のファイルが作成されていると仮定します。
+
+ \list
+ \o hello.cpp
+ \o hello.h
+ \o main.cpp
+ \endlist
+
+ これらのファイルは Qt ディストリビューションの
+ \c{examples/qmake/tutorial} ディレクトリにあります。
+ アプリケーションの設定について知っておくべきことは、
+ それが Qt で書かれているということだけです。
+ まず、テキストエディタで \c{examples/qmake/tutorial} に
+ \c hello.pro というファイルを作成します。
+ 最初にすることは、開発プロジェクトに含まれるソースファイルとヘッダファイルを
+ \c qmake に教える行を追加することです。
+
+ ソースファイルをプロジェクトファイルに追加します。
+ これには \l{qmake Variable Reference#SOURCES}{SOURCES} 変数を使います。
+ 新しい行を作り、\c{SOURCES +=}、続いて hello.cpp を入力します。
+ つまり、以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 108
+
+ これを以下のようになるまでプロジェクトの各ソースファイルに対して行います:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 109
+
+ make に似たシンタックスを使いたい場合は、
+ 以下のように改行をエスケープしてすべてのファイルを 1 行に書きます:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 110
+
+ ソースファイルの一覧をプロジェクトファイルに追加しました。
+ 次にヘッダファイルを追加します。
+ ヘッダファイルはソースファイルと全く同じ方法で追加することができます。
+ ただし変数は \l{qmake Variable Reference#HEADERS}{HEADERS}
+ を使います。
+
+ これを終えると、プロジェクトファイルは以下のようになるでしょう:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 111
+
+ ターゲットの名前は自動的に設定され、
+ プロジェクトファイルと同じ名前になります。
+ ただしプラットフォームに合わせたサフィックスがつけられます。
+ 例えば、プロジェクトファイルが \c hello.pro である場合、
+ ターゲットは Windows では \c hello.exe 、Unix では \c hello になります。
+ プロジェクトファイルで別の名前を指定することもできます:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 112
+
+ 最後に \l{qmake Variable Reference#CONFIG}{CONFIG} 変数を設定します。
+ このアプリケーションは Qt アプリケーションなので \c CONFIG に
+ \c qt を追加する必要があります。
+ \c qmake は リンクの必要があるライブラリを追加し、
+ \c moc と \c uic の実行コマンドが Makefile に含まれるようにします。
+
+ 最終的なプロジェクトファイルは以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 113
+
+ \c qmake を使って、このアプリケーションのための Makefile を生成します。
+ プロジェクトのディレクトリでコマンドラインに次のように入力します:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 114
+
+ そして、使用するコンパイラによって \c make または \c nmake を入力します。
+
+ Visual Studio ユーザの場合、\c qmake は、以下のように
+ \c .dsp ファイルまたは \c .vcproj ファイルも作成できます:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 115
+
+ \section1 アプリケーションをデバッグできるようにする
+
+ アプリケーションのリリースバージョンはデバッグシンボルなどのデバッグ情報を含みません。
+ 開発中は、関連情報を含むアプリケーションのデバッグバージョンを作成するのが便利です。
+ これは、プロジェクトファイルの \c CONFIG 変数に \c debug
+ を追加することで簡単に実現できます。
+
+ たとえば:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 116
+
+ 直前の例と同様に、Makefile を生成するには \c qmake を使います。
+ アプリケーションをデバッグ環境で実行する際に役に立つ情報を得られるようになります。
+
+ \section1 プラットフォーム固有のソースファイルを追加する
+
+ 数時間コーディングをしていると、
+ アプリケーションにプラットフォーム固有な部分が出てきて
+ プラットフォーム固有のコードを別のファイルに分けたい場合があるかもしれません。
+ ここでは 2 つのファイル \c hellowin.cpp と \c hellounix.cpp があるとして、
+ これをプロジェクトファイルに追加します。
+ これらのファイルをそのまま \c SOURCES 変数に追加することはできません。
+ なぜなら、両方のファイルが Makefile に追加されてしまうからです。
+ \c qmake が実行されたプラットフォームにしたがって処理されるスコープを使う必要があります。
+
+ Windows 用のファイルを追加するシンプルなスコープは以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 117
+
+ \c qmake が Windows 上で実行されると、ソースファイルのリストに
+ \c hellowin.cpp が追加されます。
+ \c qmake が他のプラットフォームで実行された場合、この部分は無視されます。
+ 次に Unix 用ファイルのスコープを作成します。
+
+ これを終えると、プロジェクトファイルは以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 118
+
+ これまでと同様に、Makefile を生成するには \c qmake を使います。
+
+ \section1 ファイルが存在しない場合に qmake を中止する
+
+ 特定のファイルが存在しない場合に Makefile を作成したくない場合、
+ exists() 関数を使ってファイルが存在するかどうかを確認することができます。
+ また error() 関数を使って \c qmake の処理を中止させることができます。
+ これらの関数はスコープとして動作します。
+ 使い方はスコープの条件をこれらの関数で置き換えるだけです。
+ \c main.cpp ファイルの確認は以下のようになります :
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 119
+
+ 記号 \c{!} はテストを否定します。
+ つまり \c{exists( main.cpp )} はファイルが存在する場合に真になり、
+ \c{!exists( main.cpp )} はファイルが存在しない場合に真になります。
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 120
+
+ 前と同様に、\c qmake を実行して Makefile を生成します。
+ 仮に \c main.cpp の名前を変更すると、上記のメッセージが表示され、
+ \c qmake は処理を中止します。
+
+ \section1 複数の条件をチェックする
+
+ Windows を使っていて、
+ コマンドラインからこのアプリケーションを実行したときに
+ qDebug() の出力を見ることができるようにしたい場合、
+ アプリケーションをコンソールの設定を追加してビルドする必要があります。
+ Windows で Makefile をこの設定にするには、
+ \c CONFIG に \c console を追加します。
+ Windows で実行されていて、\e{かつ} \c CONFIG にすでに \c debug
+ がある場合にのみ \c CONFIG を追加したい場合があるかもしれません。
+ このような場合、2 つのスコープをネストさせて使います。
+ まず 1 つのスコープを作成し、その中にもう 1 つスコープを作成します。
+ そして 2 つのスコープの中に設定を書きます。例えば:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 121
+
+ ネストされたスコープはコロンを使ってつなぐことができます。
+ 最終的なプロジェクトファイルは以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 122
+
+ 以上です。\c qmake のチュートリアルが終了しました。
+ それでは、あなたの開発プロジェクトのプロジェクトファイルを作成してみましょう。
+*/
+
diff --git a/doc/src/ja_JP/development/qtestlib.qdoc b/doc/src/ja_JP/development/qtestlib.qdoc
new file mode 100644
index 0000000000..65c4c3f336
--- /dev/null
+++ b/doc/src/ja_JP/development/qtestlib.qdoc
@@ -0,0 +1,432 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtestlib-tutorial.html
+ \brief QTestLib を使ったテストの導入ガイド
+ \contentspage QTestLib マニュアル
+ \nextpage {第1章: ユニットテストの作成}{第1章}
+
+ \title QTestLib チュートリアル
+
+ このチュートリアルでは QTestLib フレームワークの機能の初歩的な使い方を説明します。
+ このチュートリアルは全5章で構成されています:
+
+ \list 1
+ \o \l {第1章: ユニットテストの作成}{ユニットテストの作成}
+ \o \l {第2章: データドリブンテスト}{データドリブンテスト}
+ \o \l {第3章: GUI イベントのシミュレート}{GUI イベントのシミュレート}
+ \o \l {第4章: GUI イベントの再現}{GUI イベントの再現}
+ \o \l {第5章: ベンチマークの作成}{ベンチマークの作成}
+ \endlist
+
+*/
+
+
+/*!
+ \example qtestlib/tutorial1
+
+ \contentspage {QTestLib チュートリアル}{目次}
+ \nextpage {第2章: データドリブンテスト}{第2章}
+
+ \title 第1章: ユニットテストの作成
+
+ 第1章では、クラスのテストを行うシンプルなユニットテストを作成して実行する方法を説明します。
+
+ \section1 テストを作成する
+
+ QString クラスの挙動をテストすると仮定しましょう。
+ まず、テスト関数を含むクラスが必要です。
+ このクラスは、 QObject を継承する必要があります:
+
+ \snippet examples/qtestlib/tutorial1/testqstring.cpp 0
+
+ QTest ヘッダーを include してください。
+ それから、テストフレームワークがテスト関数を検索して実行できるよう、
+ テスト関数を private slot として宣言する必要があります。
+
+ 次に、テスト関数を実装します。実装は以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qtestlib.qdoc 8
+
+ \l QVERIFY() マクロは、引数として渡される式を評価します。
+ 式が真と評価されるとテスト関数の実行が継続されます。
+ そうでなければ、エラーメッセージがテストログに追加されテスト関数の実行が停止します。
+
+ テストログに詳細情報を追加したい場合は、
+ \l QCOMPARE() マクロを代わりに使用してください:
+
+ \snippet examples/qtestlib/tutorial1/testqstring.cpp 1
+
+ 文字列が等しくない場合、両方の文字列の内容がテストログに追加され、
+ 比較に失敗した理由を直ちに確認できます。
+
+ 最後に、テストケースを実行可能にするために以下の2行が必要となります:
+
+ \snippet examples/qtestlib/tutorial1/testqstring.cpp 2
+
+ \l QTEST_MAIN() マクロは、すべてのテスト関数を実行するシンプルな
+ \c main() 関数に展開されます。
+ テストクラスの宣言と実装が \c .cpp ファイルに存在する場合、
+ Qt のメタオブジェクト機能を動作させるために、
+ 生成された moc ファイルを include する必要があります。
+
+ \section1 テストを実行する
+
+ 作成したテストを実行してみましょう。
+ テストが \c testqstring.cpp
+ として空のディレクトリに保存されていると仮定して、
+ qmake を使用してプロジェクトを作成し、makefile を生成します。
+
+ \snippet doc/src/snippets/code/doc_src_qtestlib.qdoc 9
+
+ \bold {注:} Windows をお使いの場合、 \c make を \c nmake または、
+ 任意のビルドツールに置き換えてください。
+
+ 作成した実行ファイルを実行すると、次の出力が表示されます:
+
+ \snippet doc/src/snippets/code/doc_src_qtestlib.qdoc 10
+
+ おめでとうございます!
+ QTestLib フレームワークを使用して、
+ 最初のユニットテストの作成と実行に成功しました。
+*/
+
+/*!
+ \example qtestlib/tutorial2
+
+ \previouspage {第1章: ユニットテストの作成}{第1章}
+ \contentspage {QTestLib チュートリアル}{目次}
+ \nextpage {第3章: GUI イベントのシミュレート}{第3章}
+
+ \title 第2章: データドリブンテスト
+
+ 本章ではテストを複数回、それぞれ異なるテストデータを使用して行う方法について、
+ 例を示しながら説明します。
+
+ これまでは、テストデータをテスト関数にハードコードしていました。
+ この場合、テストデータを追加した関数は以下のようになります:
+
+ \snippet doc/src/snippets/code/doc_src_qtestlib.qdoc 11
+
+ 関数が繰り返しを行うコードによって分散するのを防ぐために、
+ QTestLib はテストデータのテスト関数への追加をサポートします。
+ そのために、別の private slot をテストクラスに追加する必要があります:
+
+ \snippet examples/qtestlib/tutorial2/testqstring.cpp 0
+
+ \section1 データ関数を記述する
+
+ テスト関数に関連するデータ関数では、テスト関数と同じ関数名を使用して、
+ 末尾に \c{_data} を追加します。
+ データ関数は以下のようになります:
+
+ \snippet examples/qtestlib/tutorial2/testqstring.cpp 1
+
+ まず、 \l QTest::addColumn() 関数を使用して、
+ テストテーブルの2つの要素(テスト文字列(\c{"string"})および、
+ QString::toUpper() 関数をその文字列に適用するときに予期された結果(\c{"result"}))
+ を定義します。
+
+ 次に、 \l QTest::newRow() 関数を使用して、
+ データをテーブルに追加します。
+ それぞれのデータセットは、テストテーブルでは別々の行(Row)になります。
+
+ \l QTest::newRow() は、データセット名をその引数として受け付けます。
+ テストに失敗した場合、テストログでこのデータセット名が使用され、
+ 失敗したデータの一覧が表示されます。
+ 続いて、最初に任意の文字列(\c{"string"})を、次に
+ QString::toUpper() 関数をその文字列(\c{"string"})に適用するときに予期された結果(\c{"result"})の順に、
+ テーブル行にデータセットをストリーミングします。
+
+ テストデータとは、二次元テーブルを指します。
+ ここでは、\c string および \c result と呼ばれる2つの列と3つの行が含まれます。
+ さらに、インデックスと同様に、各行に名前を関連付けます:
+
+ \table
+ \header
+ \o index
+ \o name
+ \o string
+ \o result
+ \row
+ \o 0
+ \o all lower
+ \o "hello"
+ \o HELLO
+ \row
+ \o 1
+ \o mixed
+ \o "Hello"
+ \o HELLO
+ \row
+ \o 2
+ \o all upper
+ \o "HELLO"
+ \o HELLO
+ \endtable
+
+ \section1 テスト関数を書き換える
+
+ ここで、テスト関数の書き換えを行います:
+
+ \snippet examples/qtestlib/tutorial2/testqstring.cpp 2
+
+ TestQString::toUpper() 関数は 3 回実行されます。
+ すなわち、関連する TestQString::toUpper_data()
+ 関数で作成したテストテーブルの各エントリ毎に一度実行されます。
+
+ TestQString::toUpper() 関数では
+ まず、 \l QFETCH() マクロを使用して、データセットの2つの要素を取得します。
+ \l QFETCH() は、要素のデータタイプと要素名の、
+ 2 つの引数を取ります。
+ 次に \l QCOMPARE() マクロを使用して、テストを実行します。
+
+ このアプローチにより、テストの修正を行うことなく
+ テストに新規データを非常に簡単に追加できます。
+
+ このテストの場合も、テストケースを実行可能にするには、
+ 同様に以下の2行が必要です:
+
+ \snippet examples/qtestlib/tutorial2/testqstring.cpp 3
+
+ これまでと同様に、 \l QTEST_MAIN() マクロは
+ すべてのテスト関数を実行するシンプルな
+ \c main() 関数に展開されます。
+ テストクラスの宣言と実装が \c .cpp ファイルに存在する場合、
+ Qt のメタオブジェクト機能を動作させるために、
+ 生成された moc ファイルを include する必要があります。
+
+*/
+
+/*!
+ \example qtestlib/tutorial3
+
+ \previouspage {第2章: データドリブンテスト}{第2章}
+ \contentspage {QTestLib チュートリアル}{目次}
+ \nextpage {第4章: GUI イベントの再現}{第4章}
+
+ \title 第3章: GUI イベントのシミュレート
+
+ QTestLib にはグラフィカルユーザインターフェースをテストするための機能があります。
+ QTestLib は、ネイティブなウィンドウシステムのイベントをシミュレートする代わりに、
+ Qt の内部で使われるイベントを送信します。
+ このため、テストが実行されるコンピュータには
+ 副次的な悪影響が発生しません。
+
+ 本章では、シンプルな GUI テストを作成する方法を確認します。
+
+ \section1 GUI テストを作成する
+
+ 今回は、 QLineEdit クラスの挙動をテストすると仮定しましょう。
+ これまでと同様に、テスト関数を含むクラスが必要です:
+
+ \snippet examples/qtestlib/tutorial3/testgui.cpp 0
+
+ 唯一の違いは、 QTest だけでなく、 QtGui クラスの宣言を
+ include する必要があることです。
+
+ \snippet examples/qtestlib/tutorial3/testgui.cpp 1
+
+ テスト関数を実装する際は、最初に QLineEdit を作成します。
+ 次に、 \l QTest::keyClicks() 関数を使用して、
+ "hello world" をラインエディットに入力する操作をシミュレートします。
+
+ \note キーボードショートカットを正しくテストするには、
+ ウィジェットの表示も必要になります。
+
+ QTest::keyClicks() は、
+ ウィジェットのキーシーケンスの入力をシミュレートします。
+ 必要に応じてキーボード修飾子の指定や、
+ 各キー入力後の遅延(ミリ秒単位)を指定することができます。
+ 同様に、 QTest::keyClick() 、 QTest::keyPress() 、 QTest::keyRelease() 、
+ QTest::mouseClick() 、 QTest::mouseDClick() 、 QTest::mouseMove() 、
+ QTest::mousePress() 及び QTest::mouseRelease() 関数を使用して、
+ 関連付けられた GUI イベントをシミュレートできます。
+
+ 最後に、 \l QCOMPARE() マクロを使用して、
+ ラインエディットの文字列が正しいかどうか確認します。
+
+ これまでと同様に、
+ テストケースを実行可能にするには、
+ 以下の2行が必要です:
+
+ \snippet examples/qtestlib/tutorial3/testgui.cpp 2
+
+ QTEST_MAIN() マクロは
+ すべてのテスト関数を実行するシンプルな
+ \c main() 関数に展開されます。
+ テストクラスの宣言と実装が \c .cpp ファイルに存在する場合、
+ Qt のメタオブジェクト機能を動作させるために、
+ 生成された moc ファイルを include する必要があります。
+*/
+
+/*!
+ \example qtestlib/tutorial4
+
+ \previouspage {第3章: GUI イベントのシミュレート}{第3章}
+ \contentspage {QTestLib チュートリアル}{目次}
+ \nextpage {第5章: ベンチマークの作成}{第5章}
+
+ \title 第4章: GUI イベントの再現
+
+ 本章では、GUI イベントをシミュレートしたり、
+ あるウィジェットで一連の GUI イベントを再生したり保存したりする方法について説明します。
+
+ 一連のイベントを保存して再生するアプローチは、
+ \l{第2章: データドリブンテスト}{第2章}
+ で説明したアプローチとよく似ています。
+ 必要な変更は、テストクラスにデータ関数を追加することです:
+
+ \snippet examples/qtestlib/tutorial4/testgui.cpp 0
+
+ \section1 データ関数を記述する
+
+ これまでと同様にテスト関数に関連するデータ関数では、
+ テスト関数と同じ名前を使用して末尾に \c{_data} を追加します。
+
+ \snippet examples/qtestlib/tutorial4/testgui.cpp 1
+
+ まず、 QTest::addColumn() 関数を使用して、
+ テーブルの2つの要素(GUI イベントのリスト(\c{"events"})および、
+ QWidget のイベントのリストを適用するときに予期された結果(\c{"expected"}))を定義します。
+ 最初の要素の型は \l QTestEventList であることに注意してください。
+
+ QTestEventList では、後で使用するテストデータの保存を行うために
+ GUI イベントを読み込んだり、 QWidget ウィジェットで再生したりできます。
+
+ 現在のデータ関数で、 \l QTestEventList を2つ作成します。
+ 最初のリストには 'a' キーを一度だけ入力します。
+ QTestEventList::addKeyClick() 関数を使用して、
+ リストにイベントを追加します。
+ 次に、QTest::newRow() 関数を使用してデータセットに名前を付けて、
+ テーブルにイベントリストおよび予期された結果をストリーミングします。
+
+ 2つ目のリストには、2つのキー入力('a' に続いてバックスペース(Qt::Key_Backspace))を設定します。
+ QTestEventList::addKeyClick() を使用してリストにイベントを追加し、
+ QTest::newRow() を使用して名前を関連付けたテーブルにイベントリストおよび予期された結果を挿入します。
+
+ \section1 テスト関数を書き換える
+
+ ここで、テストの書き換えを行います:
+
+ \snippet examples/qtestlib/tutorial4/testgui.cpp 2
+
+ TestGui::testGui() 関数は2回実行されます。
+ 関連する TestGui::testGui_data()
+ 関数で作成したテストデータの各エントリ毎にそれぞれ実行されます。
+
+ まず、\l QFETCH() マクロを使用して、データセットの2つの要素を取得します。
+ \l QFETCH() は、要素のデータ型と要素名の2つの引数を取ります。
+ 次に QLineEdit を作成し、 QTestEventList::simulate() 関数を使用して
+ ウィジェットにイベントのリストを適用します。
+
+ 最後に、 QCOMPARE() マクロを使用してラインエディットの文字列が正しいかどうか確認します。
+
+ これまでと同様に、
+ テストケースを実行可能にするには、
+ 以下の2行が必要です:
+
+ \snippet examples/qtestlib/tutorial4/testgui.cpp 3
+
+ \l QTEST_MAIN() マクロは
+ すべてのテスト関数を実行するシンプルな
+ \c main() 関数に展開されます。
+ テストクラスの宣言と実装が \c .cpp ファイルに存在する場合、
+ Qt のメタオブジェクト機能を動作させるために、
+ 生成された moc ファイルを include する必要があります。
+*/
+
+/*!
+ \example qtestlib/tutorial5
+
+ \previouspage {第4章: GUI イベントの再現}{第4章}
+ \contentspage {QTestLib チュートリアル}{目次}
+
+ \title 第5章: ベンチマークの作成
+
+ 最終章となる本章では QTestLib を使ってベンチマークを作成する方法について説明します。
+
+ \section1 ベンチマークの作成
+ ベンチマークを作成するには QBENCHMARK マクロを用いてテスト関数を拡張します。
+ ベンチマークテスト関数には通常、テストの準備コードと測定するコードを含む
+ QBENCHMARK マクロが一つ含まれます。
+ QString::localeAwareCompare() のベンチマークを行う関数は以下のようになります。
+
+ \snippet examples/qtestlib/tutorial5/benchmarking.cpp 0
+
+ 測定の準備は関数の最初に行われています。
+ この時点では測定は始まっていません。
+ QBENCHMARK マクロで囲まれたブロックの中身のみが計測されます。
+ このブロックの内部は正確な測定を行うために、何度か繰り返し実行される場合があります。
+
+ \l {testlib-benchmarking-measurement}{ベンチマークの方法}(バックエンド)は何種類か用意されており、
+ コマンドライン引数から選択することが出来ます。
+
+ \section1 データ関数
+
+ データ関数は複数のデータでベンチマークを行うテストを作成するのに有用です。
+ たとえば、ロケール準拠と標準的な比較を行う場合は以下のようになります。
+
+ \snippet examples/qtestlib/tutorial5/benchmarking.cpp 1
+
+ テスト関数ではデータに従ってベンチマークする手法を決定します。
+
+ \snippet examples/qtestlib/tutorial5/benchmarking.cpp 2
+
+ "if (useLocaleCompare)" 文はそのオーバヘッドを測定対象外とするために
+ QBENCHMARK マクロのブロックの外部にあります。
+ ベンチマークの実行時にはそれぞれどちらか一つの QBENCHMARK マクロが実行されます。
+
+ \section1 外部ツール
+
+ テストデータの可視化を行うためのツールが Qt Labs Web サイトの
+ \l{qtestlib-tools} プロジェクトに含まれています。
+ そこには実行したテストの結果からパフォーマンスを比較したり、
+ パフォーマンスのWeb用グラフを作成するツールが含まれています。
+
+ それらのツールの詳細と簡単なグラフの例は
+ \l{qtestlib-tools Announcement} を参照してください。
+
+*/
+
+
+
diff --git a/doc/src/ja_JP/examples/arrowpad.qdoc b/doc/src/ja_JP/examples/arrowpad.qdoc
new file mode 100644
index 0000000000..25182647da
--- /dev/null
+++ b/doc/src/ja_JP/examples/arrowpad.qdoc
@@ -0,0 +1,248 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example linguist/arrowpad
+ \title サンプル: アローパッド
+
+ この例では、\e {Qt Linguist} の主なコンセプトである"文脈"について、
+ 少し詳しく取り上げて説明します。
+ また、2つ以上の言語を使用する方法についても説明します。
+
+ \image linguist-arrowpad_en.png
+
+ アプリケーションで使用可能な言語の数に制限はありませんが、
+ ここではフランス語とオランダ語の2言語の翻訳を使用します。
+ \c arrowpad.pro の関連する行は以下のとおりです。
+
+ \snippet examples/linguist/arrowpad/arrowpad.pro 0
+ \codeline
+ \snippet examples/linguist/arrowpad/arrowpad.pro 1
+
+ \c lupdate を実行すると、2つの類似したメッセージファイル
+ \c arrowpad_fr.ts と \c arrowpad_nl.ts が作成されます。
+ これらのファイルにはすべてのソーステキストとその文脈が含まれます。
+ それらのテキストは \c tr() の呼び出しを通じて翻訳対象として
+ ソースコード内でマークされているものです。
+
+ Qt アプリケーションの翻訳の詳細については、
+ \l{Qt Linguist manual}{Qt Linguist マニュアル} をご覧ください。
+
+ \section1 各行の簡単な解説
+
+ \c arrowpad.h では、 QWidget の派生クラスである \c ArrowPad
+ クラスを定義します。
+ 上記のスクリーンショットで
+ 中央の 4 つのボタンを持つウィジェットが \c ArrowPad です。
+
+ \snippet examples/linguist/arrowpad/arrowpad.h 0
+ \snippet examples/linguist/arrowpad/arrowpad.h 1
+ \snippet examples/linguist/arrowpad/arrowpad.h 2
+
+ \c lupdate を実行するとソーステキストの抽出だけでなく、
+ 文脈へのグループ化を行うことができます。
+ ソーステキストが表示されるクラスの名前が文脈となります。
+ 従って、この例では、"ArrowPad" が
+ \c ArrowPad クラスの文字列の文脈です。
+ \c Q_OBJECT のマクロは、以下の内容で
+ \c ArrowPad に \c tr(x) を定義します:
+
+ \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 0
+
+ 各ソーステキストが表示されるクラスを把握しておくと、
+ \e {Qt Linguist} で論理的に関連のある文字列をグループ化することが出来ます。
+ 例えば、ダイアログ内のすべての文字列には
+ ダイアログのクラス名の文脈が含まれるため、同時に表示されます。
+ 文字列が表示される文脈によって翻訳の内容が影響を受ける場合があるため、
+ 翻訳者にとって有用な情報となります。
+ 一部の翻訳では、キーボードショートカットを変更する必要があります。
+ また、同じグループにまとめられた特定の文脈(クラス)
+ にすべてのソーステキストを含めることにより、
+ 翻訳者はコンフリクトを起こすことなく、
+ より簡単にショートカットを変更できます。
+
+ \c arrowpad.cpp で、\c ArrowPad クラスを実装します。
+
+ \snippet examples/linguist/arrowpad/arrowpad.cpp 0
+ \snippet examples/linguist/arrowpad/arrowpad.cpp 1
+ \snippet examples/linguist/arrowpad/arrowpad.cpp 2
+ \snippet examples/linguist/arrowpad/arrowpad.cpp 3
+
+ ラベルはユーザ表示可能な文字列であるため、
+ ボタンのラベルごとに \c ArrowPad::tr() を呼び出します。
+
+ \image linguist-arrowpad_en.png
+
+ \snippet examples/linguist/arrowpad/mainwindow.h 0
+ \snippet examples/linguist/arrowpad/mainwindow.h 1
+
+ 上記のスクリーンショットでは、ウィンドウ全体が \c MainWindow です。
+ これは、\c mainwindow.h ヘッダーファイルで定義します。
+ ここでも、\c MainWindow が \e {Qt Linguist} の文脈になるよう、
+ \c Q_OBJECT を使用します。
+
+ \snippet examples/linguist/arrowpad/mainwindow.cpp 0
+
+ \c MainWindow と \c mainwindow.cpp を実装する際に、
+ \c ArrowPad クラスのインスタンスを作成します。
+
+ \snippet examples/linguist/arrowpad/mainwindow.cpp 1
+
+ また、\c MainWindow::tr() を、
+ アクションおよびショートカット用に、計 2 回呼び出します。
+
+ \c tr() を使用して、言語によって異なるキーをサポートします。
+ 英語の場合、"Ctrl+Q" は Quit (終了) に適していますが、
+ オランダ語の翻訳者は "Ctrl+A" (Afsluiten の場合) を、
+ ドイツ語の翻訳者は "Strg+E" (Beenden の場合) を使うといいでしょう。
+ \key Ctrl キーショートカットを \c tr() で使用する場合は
+ 引数を 2 つ使用して、
+ ショートカットが実行する機能を2番目の引数に記述してください。
+
+ \c main.cpp で定義した標準的な \c main() 関数は、以下のようになります。
+
+ \snippet examples/linguist/arrowpad/main.cpp 2
+ \snippet examples/linguist/arrowpad/main.cpp 3
+
+ 現在のロケールに基づいて、使用する翻訳を選択します。
+ 例えば、QLocale::system() は、
+ \c LANG 環境変数の設定によって影響を受ける場合があります。
+ \c .qm メッセージファイル(および TS ファイル)の命名規則に
+ ロケールを使用すると、
+ 簡単にロケールに基づいて翻訳ファイルを選択することが
+ できるようになります。
+
+ 選択したロケールに QM メッセージファイルが存在しない場合、
+ 元のソーステキストが使用され、エラーは生成されません。
+
+ \section1 フランス語からオランダ語に翻訳する
+
+ ここでは、サンプルアプリケーションをフランス語に翻訳することから始めます。
+ \e {Qt Linguist} を起動し、\c arrowpad_fr.ts の作業を行います。
+ 2つの文脈 ("ArrowPad" および "MainWindow")
+ にグループ化された7つのソーステキスト ("\&Up", "\&Left" 等)
+ が含まれているはずです。
+
+ 次に、以下の翻訳を入力します:
+
+ \list
+ \o \c ArrowPad
+ \list
+ \o \&Up - \&Haut
+ \o \&Left - \&Gauche
+ \o \&Right - \&Droite
+ \o \&Down - \&Bas
+ \endlist
+ \o \c MainWindow
+ \list
+ \o E\&xit - \&Quitter
+ \o Ctrl+Q - Ctrl+Q
+ \o \&File - \&Fichier
+ \endlist
+ \endlist
+
+ 翻訳の入力が終わったら、 \key{Ctrl+Return} (もしくは\gui {完了にして次へ}
+ ボタン)を押すと、
+ 翻訳が完了とマークされ次のソーステキストに移動するため便利です。
+
+ ファイルを保存して、オランダ語の翻訳でも同じ手順を実行し、
+ \c arrowpad_nl.ts の作業を行います:
+
+ \list
+ \o \c ArrowPad
+ \list
+ \o \&Up - \&Omhoog
+ \o \&Left - \&Links
+ \o \&Right - \&Rechts
+ \o \&Down - Omlaa\&g
+ \endlist
+ \o \c MainWindow
+ \list
+ \o E\&xit - \&Afsluiten
+ \o Ctrl+Q - Ctrl+A
+ \o File - \&Bestand
+ \endlist
+ \endlist
+
+ \c tt1_fr.ts と \c tt1_nl.ts の翻訳ソースファイルは
+ QM ファイルに変換する必要があります。
+ 以前と同様の方法で \e {Qt Linguist} を使用して変換できますが、
+ コマンドラインツール \c lrelease を使うと
+ \e {Qt Linguist} から個々の \gui {ファイル|リリース} を読み込まなくても、
+ アプリケーションの\e{すべての} QM ァイルを作成できます。
+
+ 以下を入力します:
+
+ \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 1
+
+ これにより、\c arrowpad_fr.qm と \c arrowpad_nl.qm が作成されます。
+ \c LANG 環境変数を \c fr に設定します。
+ Unix では、以下の2つのコマンドのいずれかが機能します。
+
+ \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 2
+
+ Windows では、\c autoexec.bat を修正するか、以下を実行します。
+
+ \snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 3
+
+ プログラムを実行すると、フランス語版が表示されます:
+
+ \image linguist-arrowpad_fr.png
+
+ \c LANG=nl を設定し、オランダ語でも同じ手順を実行します。
+ これで、オランダ語版が表示されます:
+
+ \image linguist-arrowpad_nl.png
+
+ \section1 エクササイズ
+
+ \e {Qt Linguist} で未完了の翻訳を行います。
+ 例えば、各テキストのチェックマークをクリックして翻訳を未完了の状態にして保存します。
+ その後、 \c lupdate 、\c lrelease 、サンプルの順に実行します。
+ この変更がどのような影響を及ぼしましたか。
+
+ \c LANG=fr_CA (フランス語(カナダ))に設定し、
+ サンプルプログラムを再実行します。
+ \c LANG=fr の場合と同じ結果になる理由を説明してください。
+
+ オランダ語翻訳のショートカットのいずれかを変更し、
+ \e \&Bestand と \e \&Boven の競合を解消します。
+*/
diff --git a/doc/src/ja_JP/examples/hellotr.qdoc b/doc/src/ja_JP/examples/hellotr.qdoc
new file mode 100644
index 0000000000..cc01b81eb7
--- /dev/null
+++ b/doc/src/ja_JP/examples/hellotr.qdoc
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example linguist/hellotr
+ \title サンプル: こんにちは tr()
+
+ これは、小さな Hello World プログラムを日本語に翻訳する例です。
+ 以下のスクリーンショットは英語版です。
+
+ \image linguist-hellotr_en.png
+
+ Qt アプリケーションの翻訳に関する詳細は、\l{Qt Linguist manual}
+ をご覧ください。
+
+ \section1 各行の簡単な解説
+
+ \snippet examples/ja_JP/linguist/hellotr/main.cpp 0
+
+ この行では、 QTranslator クラスの宣言を読み込みます。
+ QTranslator クラスのオブジェクトは、
+ ユーザに表示する文字列を翻訳します。
+
+ \snippet examples/ja_JP/linguist/hellotr/main.cpp 5
+
+ 親をもたない QTranslator オブジェクトを作成します。
+
+ \snippet examples/ja_JP/linguist/hellotr/main.cpp 6
+
+ プログラムで使用するソーステキストの日本語の翻訳を含む、
+ \c hellotr_ja.qm ( \c .qm というファイル拡張子は省略します)
+ と呼ばれるファイルを読み込みます。
+ ファイルが見つからなくてもエラーは発生しません。
+
+ \snippet examples/ja_JP/linguist/hellotr/main.cpp 7
+
+ \c hellotr_ja.qm の翻訳を、プログラムで使用する翻訳プールに追加します。
+
+ \snippet examples/ja_JP/linguist/hellotr/main.cpp 8
+
+ "Hello world!" を表示するプッシュボタンを作成します。
+ 検索した \c hellotr_ja.qm に "Hello world!" の翻訳が含まれている場合、
+ その翻訳が表示されます。
+ 含まれていない場合、翻訳前のテキストがそのまま表示されます。
+
+ QObject を継承するすべてのクラスには、\c tr() 関数が含まれます。
+ QObject クラスのメンバ関数内では、\c QPushButton::tr("Hello world!")
+ や \c QObject::tr("Hello world!") の代わりに、シンプルに
+ \c tr("Hello world!") を使います。
+
+ \section1 英語版のアプリケーションを実行する
+
+ 翻訳ファイル \c hellotr_ja.qm の作成が終わっていないため、
+ 以下のアプリケーションを起動したときに元の文字列が表示されます。
+
+ \image linguist-hellotr_en.png
+
+ \section1 日本語のメッセージファイルを作成する
+
+ 最初のステップは、プロジェクトのすべてのソースファイルを列挙する
+ \c hellotr.pro を作成することです。
+ プロジェクトファイルは、qmake プロジェクトファイルまたは、通常の
+ makefile である可能性があります。
+ 以下の記述を含むプロジェクトファイルを作成してください。
+
+ \snippet examples/ja_JP/linguist/hellotr/hellotr.pro 0
+ \snippet examples/ja_JP/linguist/hellotr/hellotr.pro 1
+
+ \c TRANSLATIONS は、管理するメッセージファイルを指します。
+ この例では、日本語の翻訳のみ管理します。
+
+ ファイル拡張子は、\c .qm ではなく、\c .ts であることにご注意ください。
+ \c .ts は翻訳のソースファイルのフォーマットであり、
+ アプリケーションの開発時に使用します。
+ プログラマーまたはリリースマネージャーは \c lupdate プログラムを実行し、
+ ソースコードから抽出したソーステキストを使用して
+ TS ファイルの生成と更新を行います。
+ 翻訳者は、 \e {Qt Linguist} を使用して TS ファイルの読み取りと更新を行い、
+ 翻訳の追加と編集を行います。
+
+ TS の形式は、ユーザが直接閲覧可能な XML 形式であるため、
+ 直接Eメールで送信したり、簡単にバージョン管理の対象にすることが出来ます。
+ このファイルを手動で編集する場合、XML の既定のエンコードは UTF-8 で、
+ Latin1(ISO 8859-1)ではないことに気をつけてください。
+ '\oslash'(ノルウェー語の o にスラッシュが付いたもの)などの
+ Latin1 文字を入力する1つの方法は、XML エンティティ "&#xf8;"
+ を使用することです。
+ これはすべての Unicode 4.0 文字に対して有効です。
+
+ 翻訳が完了したら、\c lrelease プログラムを使用して、
+ TS ファイルを QM ファイル(Qt Message ファイル)形式に変換します。
+ QM 形式は、極めて高速な検索性能を実現するようにデザインされた
+ コンパクトなライブラリ形式です。
+ \c lupdate と \c lrelease はどちらも、
+ プロジェクト全体のソースファイルとヘッダーファイル
+ (プロジェクトファイルの HEADERS および SOURCES 行で指定されている)
+ を読み取り、\c tr() 関数呼び出しの際に表示される文字列を抽出します。
+
+ \c lupdate は、メッセージファイル(この場合は \c hellotr_ja.ts)
+ の作成と更新を行い、これらをソースコードと同期させるために使用します。
+ \c lupdate にはデータの削除機能がないため、
+ \c lupdate はいつでも安全に実行できます。
+ 例えば、ソースが変更されるたびに TS ファイルが更新されるよう、
+ makefile に記述できます。
+
+ それでは、以下のように \c lupdate を実行してみましょう:
+
+ \snippet doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc 0
+
+ (\c -verbose オプションは、操作を説明するメッセージを表示するよう
+ \c lupdate に指示します。)
+ 現在のディレクトリに、以下の内容で
+ \c hellotr_ja.ts ファイルが作成されていると思います:
+
+ \snippet doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc 1
+
+ ツール (\c lupdate、 \e {Qt Linguist}、\c lrelease)
+ を使用して読み取りと更新を行うため、
+ ファイル形式を理解する必要はありません。
+
+ \section1 Qt Linguist を使用して日本語に翻訳する
+
+ XML やテキストエディタを使用して、TS ファイルを翻訳することも出来ますが、
+ ここでは \e {Qt Linguist} を使用して翻訳を行います。
+
+ \e {Qt Linguist} を起動するには、以下を入力します。
+
+ \snippet doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc 2
+
+ 左上のペインに "QPushButton" が表示されるはずです。
+ これをダブルクリックし、次に "Hello world!" をクリックして、
+ \gui Translation ペイン (ウィンドウ右中央)に
+ "こんにちは、世界!" と入力します。
+ 感嘆符(!)を忘れないように付けてください!
+
+ \gui{完了} チェックボックスをオンにして、
+ メニューバーから \gui{ファイル|保存} を選択します。
+ TS ファイルから、以下の記述がなくなります。
+
+ \snippet doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc 3
+
+ その代わりに以下が含まれます。
+
+ \snippet doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc 4
+
+ \section1 日本語版のアプリケーションを実行する
+
+ 日本語版のアプリケーションを実行する前に、
+ TS ファイルから QM ファイルを生成する必要があります。
+ QM ファイルは、\e {Qt Linguist}(単一の TS ファイルの場合)のメニューから、
+ もしくは、コマンドラインプログラム \c lrelease を使用して生成できます。
+ \c lrelease を使用する場合、
+ プロジェクトファイルに列挙されている TS ファイルごとに
+ 1 つの QM ファイルを作成することが出来ます。
+ \e {Qt Linguist} のメニューバーから \gui{ファイル|リリース} を選択し、
+ ポップアップ表示される \gui{ファイルの保存} ダイアログで\gui{保存}を選択し、
+ \c hellotr_ja.ts から \c hellotr_ja.qm を生成します。
+ 今すぐ \c hellotr プログラムを再実行してみましょう。
+ これで、ボタンに "こんにちは、世界!" と表示されます。
+
+ \image linguist-hellotr_ja.png
+*/
diff --git a/doc/src/ja_JP/examples/trollprint.qdoc b/doc/src/ja_JP/examples/trollprint.qdoc
new file mode 100644
index 0000000000..16867742a1
--- /dev/null
+++ b/doc/src/ja_JP/examples/trollprint.qdoc
@@ -0,0 +1,286 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example linguist/trollprint
+ \title サンプル: トロールプリント
+
+ トロールプリント(Troll Print)は、
+ ユーザがプリンタの設定をするためのサンプルアプリケーションです。
+ これには、英語とポルトガル語の2つのバージョンが用意されています。
+
+ \image linguist-trollprint_10_en.png
+
+ この例では、いくつかのポルトガル語の翻訳を含む翻訳ファイル
+ \c trollprint_pt.ts を用意しました。
+
+ 同じアプリケーションの2つのバージョン、
+ Troll Print 1.0 と 1.1 をリリースすることを想定します。
+ 1つのバージョンで作成した翻訳を次のリリースで再利用する方法を習得します。
+ (このチュートリアルでは、いくつかのソースファイルの編集が必要です。
+ 新しい一時ディレクトリにすべてのファイルをコピーして、
+ ここで作業を行うのがベストでしょう。)
+
+ Qtアプリケーションの翻訳の詳細については、
+ \l{Qt Linguist manual}{Qt Linguist マニュアル} をご覧ください。
+
+ \section1 各行の簡単な解説
+
+ \c PrintPanel クラスを \c printpanel.h で宣言します。
+
+ \snippet examples/linguist/trollprint/printpanel.h 0
+
+ \c PrintPanel は QWidget の派生クラスです。
+ \c tr() が正しく動作するには、\c Q_OBJECT マクロが必要です。
+
+ 実装ファイルは \c printpanel.cpp です。
+
+ \snippet examples/linguist/trollprint/printpanel.cpp 0
+
+ Troll Print 1.0 で一部のコードがコメントアウトされています。
+ Troll Print 1.1 にバージョンアップする際に、
+ コメントから戻してください。
+
+ \snippet examples/linguist/trollprint/printpanel.cpp 1
+ \snippet examples/linguist/trollprint/printpanel.cpp 2
+
+ PrintPanel では、\c tr("Enabled") と \c tr("Disabled")
+ を2回ずつ使用することに注意してください。
+ "Enabled" と "Disabled" はどちらも同じ文脈で表示されるため、
+ \e {Qt Linguist} では、それぞれ1回目の使用に対してのみ表示され、
+ 2回目以降の使用に対しては翻訳が流用されるため表示されません。
+ これは便利な時間短縮ツールですが、ポルトガル語などの一部の言語では、
+ 2回目の使用に対して異なる翻訳が必要になります。
+ これから、\e {Qt Linguist}で、
+ すべての \c tr() に対して異なる翻訳を表示できるように設定する方法を学習します。
+
+ \c MainWindow, \c mainwindow.h はシンプルなヘッダーファイルです。
+ \c mainwindow.cpp の実装には、翻訳対象としてマークする必要のある
+ ユーザに表示するソーステキストがあります。
+
+ \snippet examples/linguist/trollprint/mainwindow.cpp 0
+
+ ウィンドウのタイトルは翻訳する必要があります。
+
+ \snippet examples/linguist/trollprint/mainwindow.cpp 1
+ \snippet examples/linguist/trollprint/mainwindow.cpp 3
+
+ また、アクションとメニューも翻訳する必要があります。
+ キーボードショートカット "Ctrl+Q" に対して使用している \c tr()
+ の第 2 引数は、このショートカットがどのような機能を有しているかを
+ 翻訳者に示す唯一の情報であることに注意してください。
+
+ \snippet examples/linguist/trollprint/main.cpp 0
+
+ \c main.cpp の \c main() 関数は、
+ \l{linguist/arrowpad}{アローパッド} の例の場合と同じになります。
+ 具体的には、現在のロケールに基づいて、翻訳ファイルを選択します。
+
+ \section1 英語とポルトガル語で Troll Print 1.0 を実行する
+
+ 既存の \c trollprint_pt.ts ファイルの翻訳を使用します。
+
+ \c LANG 環境変数を \c pt に設定して、\c trollprint を実行します。
+ QM ファイルがないため、スクリーンショットは英語版のままです。
+ ここで、\c lrelease (例: \c {lrelease trollprint.pro})を実行し、
+ サンプルを再実行します。
+ これで、ポルトガル語版(Troll Imprimir 1.0)になりました:
+
+ \image linguist-trollprint_10_pt_bad.png
+
+ 翻訳は正しく表示されていますが、誤りがあります。
+ 文法的に正しいポルトガル語では、
+ "Enabled" が2回目に使用されるときの正しい翻訳は、
+ "Ativado" ではなく "Ativadas" であり、
+ "Disabled" が2回目に翻訳されるときも、
+ 語尾を同様に変化させる必要があります。
+
+ \e {Qt Linguist} で \c trollprint_pt.ts を開くと、
+ ソースコードには "Enabled" と "Disabled" が2回ずつ使われていますが、
+ 翻訳ソースファイルでは1回ずつしか使われていません。
+ これは、\e {Qt Linguist} では、
+ ソーステキストが重複する場合は翻訳を流用することにより、
+ 翻訳者の作業を最小限に抑えようとするためです。
+ このように類似した翻訳に誤りがある場合、
+ プログラマは繰り返し使用する際に翻訳の曖昧さを排除する必要があります。
+ これは、2個の引数を取る\c tr() を使用することにより、
+ 容易に実行できます。
+
+ 実際には、翻訳者の"文脈"は変更する必要のある文字列が表示されるクラスに対するクラス名であるため、
+ どのファイルを変更すべきか簡単に特定できます。
+ この場合、ファイルは \c printpanel.cpp であり、
+ 変更すべき行は4行あります。
+ ラジオボタンの最初のペアの \c tr() 呼び出しに、2つ目の引数 "two-sided"(両面) をに追加します:
+
+ \snippet doc/src/snippets/code/doc_src_examples_trollprint.qdoc 0
+
+ そして、ラジオボタンの2番目のペアの \c tr() 呼び出しに、
+ 2つ目の引数 "colors"(色) を追加します。
+
+ \snippet doc/src/snippets/code/doc_src_examples_trollprint.qdoc 1
+
+ ここで、\c lupdate を実行し、\e {Qt Linguist} で
+ \c trollprint_pt.ts を開きます。2 つの変更個所がわかるはずです。
+
+ まず、翻訳ソースファイルには、\e{3組}の "Enabled" と
+ "Disabled" のペアが含まれています。
+ 最初のペアは、既に利用されていないテキストであることを意味する灰色になっています。
+ これは、 \c tr() 内の文字列が第二引数を追加した新たな
+ \c tr() の文字列で置き換えられたからです。
+ 2番目のペアには、"two-sided"(両面) というコメントが含まれており、
+ 3番目のペアには、"colors"(色) というコメントが含まれています。
+ これらのコメントは、\e {Qt Linguist} に
+ \gui {開発者のコメント} として表示されます。
+
+ 次に、翻訳者の作業を最小限に抑えるために、
+ 新たに使用される "Enabled" と "Disabled" の文字列に対して、
+ 訳語 "Ativado" と "Desativado" が自動的に使用されます。
+ これらの訳語は、これらの原語が2回目に使用される場合の正しい翻訳ではありません。
+ ここからが、チュートリアルの出発点です。
+
+ 2番目の "Ativado" を "Ativadas" に、
+ 2番目の "Desativado" を "Desativadas" に変更し、保存して終了します。
+ \c lrelease を実行して最新のバイナリ \c trollprint_pt.qm ファイルを作成し、
+ Troll Print (または Troll Imprimir) を実行します。
+
+ \image linguist-trollprint_10_pt_good.png
+
+ \e {Qt Linguist} では "comments" と呼ばれる
+ \c tr() 呼び出しの2つ目の引数は、
+ 同じ文脈(クラス)で発生する類似したソーステキストを識別します。
+ コメントは、たとえば Ctrl キーによるキーボードショートカットが
+ ショートカットによって実行される機能を伝達する唯一の手段である場合等に、
+ 翻訳者に情報を提供するのに便利です。
+
+ 翻訳者に情報を提供する他の手段は、
+ 翻訳の必要があるソーステキストを含むアプリケーションの
+ 特定の部分への移動方法に関する情報を提供することです。
+ これにより、翻訳者は、翻訳が表示される文脈を確認し、
+ 翻訳を検索してテストを行うことができます。
+ これは、ソースコードで \c TRANSLATOR
+ コメントを使用して行います:
+
+ \snippet doc/src/snippets/code/doc_src_examples_trollprint.qdoc 2
+
+ 一部のソースファイル、特にダイアログクラスのコメントに
+ ダイアログに到達するまでに必要な操作を記述します。
+ また、\c mainwindow.cpp や \c printpanel.cpp など、
+ 適切なサンプルファイルにこれらを追加することもできます。
+ \c lupdate を実行して \e {Qt Linguist} を起動し、
+ \c trollprint_pt.ts を読み込みます。
+ ソーステキストの一覧を参照する際に、
+ \gui{ソーステキスト}と\gui{開発者のコメント}
+ の領域に表示されるコメントを確認できます。
+
+ 特に大きなプログラムでは、翻訳者が自分の翻訳を探し、
+ それが適切かどうかを確認することが困難な場合があります。
+ コメントは役立つナビゲーション情報を提供するため、
+ 翻訳に要する時間を節約できます:
+
+ \snippet doc/src/snippets/code/doc_src_examples_trollprint.qdoc 3
+
+ \section1 Troll Print 1.1
+
+ これから、Troll Print のバージョン 1.1 のリリースの準備を行います。
+ テキストエディターを起動して、次の手順に従って変更を行ってください:
+
+ \list
+ \o \c printpanel.cpp の文字列 "\<b\>TROLL PRINT\</b\>" を引数に
+ QLabel を作成する2つの行のコメントを解除します。
+ \o ソースの変更: \c printpanel.cpp で、"2-sided" を
+ "Two-sided" に置き換えます。
+ \o \c mainwindow.cpp で、すべての "1.0" を "1.1" に置き換えます。
+ \o \c mainwindow.cpp で、著作権表示の年号を 1999-2000 に更新します。
+ \endlist
+
+ (実際のアプリケーションでは、バージョン番号と著作権表示の年号は
+ const または #define をつかって定義するでしょう。)
+
+ 終了したら、\c lupdate を実行し、\e {Qt Linguist} で
+ \c trollprint_pt.ts を開きます。以下の項目は、特別なコンテンツです:
+
+ \list
+ \o \c MainWindow
+ \list
+ \o Troll Print 1.0 - 古いテキストとして灰色でマーク
+ \o About Troll Print 1.0 - 古いテキストとして灰色でマーク
+ \o Troll Print 1.0. Copyright 1999 Software, Inc. -
+ 古いテキストとして灰色でマーク
+ \o Troll Print 1.1 - 自動的に "Troll Imprimir 1.1" に翻訳(未完了)
+ \o About Troll Print 1.1 - 自動的に "Troll Imprimir 1.1" に翻訳(未完了)
+ \o Troll Print 1.1. Copyright 1999-2000 Software,
+ Inc. - 自動的に "Troll Imprimir 1.1.
+ Copyright 1999-2000 Software, Inc." に翻訳(未完了)
+ \endlist
+ \o \c PrintPanel
+ \list
+ \o 2-sided - 古いテキストとして灰色でマーク
+ \o \<b\>TROLL PRINT\</b\> - 未翻訳のテキストとして"?"マーク
+ \o Two-sided - 未翻訳のテキストとして"?"マーク
+ \endlist
+ \endlist
+
+ \c lupdate は、修正を容易に行い、数字の処理を効率的に行うために、
+ 様々な処理を行っています。
+
+ \c MainWindow の翻訳の見直しを行います。
+ "\<b\>TROLL PRINT\</b\>" を "\<b\>TROLL IMPRIMIR\</b\>" と翻訳します。
+ "Two-sided" を翻訳する際には、\gui{フレーズと推測} の欄から
+ "2-lados" をダブルクリックして訳に選択した後に、
+ "2" を "Dois" に変更します。
+
+ 保存して終了し、\c lrelease を実行します。
+ ポルトガル語版の表示は以下のようになります:
+
+ \image linguist-trollprint_11_pt.png
+
+ \gui{Ajuda|Sobre} (\gui{Help|About}) を選択し、
+ バージョン情報ボックスを確認します。
+
+ \gui{Ajuda|Sobre Qt} (\gui{Help|About Qt}) を選択した場合、
+ 英語版のダイアログが表示されます。
+ Qt の翻訳はまだ終わっていません。
+ 詳細については、\l{Internationalization with Qt} を参照してください。
+
+ ここで、\c LANG=en を設定し、元の英語版を実行してみてください:
+
+ \image linguist-trollprint_11_en.png
+*/
diff --git a/doc/src/ja_JP/getting-started/tutorials.qdoc b/doc/src/ja_JP/getting-started/tutorials.qdoc
new file mode 100644
index 0000000000..701ba88443
--- /dev/null
+++ b/doc/src/ja_JP/getting-started/tutorials.qdoc
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page tutorials.html
+ \title チュートリアル
+
+ \contentspage How to Learn Qt
+ \nextpage Qt Examples
+
+ \brief Qt の学習を助けるチュートリアルやガイドの概要
+
+ \nextpage Qt Examples
+
+ Qt で提供されているこれらのチュートリアルやガイドは
+ 新たに Qt の開発を始めるユーザの良い助けとなります。
+ これらのドキュメントでは ウィジェットの基本的な使い方から始まり
+ ステップバイステップでアプリケーションの使い方を学ぶことが出来ます。
+
+ \table
+ \row
+ \o{2,1} \l{ウィジェットのチュートリアル}{\bold ウィジェット}
+ \o{2,1} \l{チュートリアル: アドレス帳}{\bold {アドレス帳}}
+ \row
+ \o \image widget-examples.png Widgets
+ \o
+ ウィジェットとレイアウトを使って GUI アプリケーションを作成する
+ 初心者向けのガイドです。
+
+ \o \image addressbook-tutorial.png AddressBook
+ \o
+ 完全な機能を持つアドレス帳アプリケーションを作成する 7 章で構成されたガイドです。
+
+ \row
+ \o{2,1} \l{Qt Designer クイックガイド}{\bold{Qt Designer}}
+ \o{2,1} \l{Qt Linguist Manual: Programmers#Tutorials}{\bold {Qt Linguist}}
+ \row
+ \o \image designer-examples.png QtDesigner
+ \o
+ \QD を使ってフォームを生成する基本的な手順を説明するクイックガイドです。
+
+ \o \image linguist-examples.png QtLinguist
+ \o
+ \l{サンプル: こんにちは tr()}{こんにちは tr()}、
+ \l{サンプル: アローパッド}{アローパッド}、
+ \l{サンプル: トロールプリント}{トロールプリント}
+ の三例を通じて翻訳の方法を説明します。
+
+ \row
+ \o{2,1} \l{QTestLib チュートリアル}{\bold QTestLib}
+ \o{2,1} \l{qmake チュートリアル}{\bold qmake}
+ \row
+ \o{2,1}
+ Qt のユニットテストフレームワークである QTestLib の機能の初歩的な使い方を説明するチュートリアルです。
+ このチュートリアルは4章で構成されています。
+
+ \o{2,1}
+ \c qmake の使い方を説明するチュートリアルです。
+ このチュートリアルを卒業した後は \l{qmake Manual}{qmake user guide}(英語)
+ を読むことをお勧めします。
+
+ \endtable
+*/
diff --git a/doc/src/ja_JP/images/linguist-hellotr_en.png b/doc/src/ja_JP/images/linguist-hellotr_en.png
new file mode 100644
index 0000000000..05aa9452e0
--- /dev/null
+++ b/doc/src/ja_JP/images/linguist-hellotr_en.png
Binary files differ
diff --git a/doc/src/ja_JP/images/linguist-hellotr_ja.png b/doc/src/ja_JP/images/linguist-hellotr_ja.png
new file mode 100644
index 0000000000..d9beb016a2
--- /dev/null
+++ b/doc/src/ja_JP/images/linguist-hellotr_ja.png
Binary files differ
diff --git a/doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc b/doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc
new file mode 100644
index 0000000000..e05cd12db9
--- /dev/null
+++ b/doc/src/ja_JP/snippets/code/doc_src_examples_hellotr.qdoc
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+lupdate -verbose hellotr.pro
+//! [0]
+
+
+//! [1]
+<!DOCTYPE TS><TS>
+<context>
+ <name>QPushButton</name>
+ <message>
+ <source>Hello world!</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
+//! [1]
+
+
+//! [2]
+linguist hellotr_ja.ts
+//! [2]
+
+
+//! [3]
+<translation type='unfinished'></translation>
+//! [3]
+
+
+//! [4]
+<translation>こんにちは、世界!</translation>
+//! [4]
diff --git a/doc/src/ja_JP/tutorials/addressbook.qdoc b/doc/src/ja_JP/tutorials/addressbook.qdoc
new file mode 100644
index 0000000000..9fb1059d0f
--- /dev/null
+++ b/doc/src/ja_JP/tutorials/addressbook.qdoc
@@ -0,0 +1,1070 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page tutorials-addressbook.html
+
+ \title チュートリアル: アドレス帳
+ \brief シンプルだが、完全な機能を持つアプリケーションの作成を通じた
+ GUI プログラミングへの導入。
+
+ このチュートリアルでは、Qt クロスプラットフォームフレームワークを使用した
+ GUI プログラミングの概要について説明しています。
+
+ \image addressbook-tutorial-screenshot.png
+
+ \omit
+ It doesn't cover everything; the emphasis is on teaching the programming
+ philosophy of GUI programming, and Qt's features are introduced as needed.
+ Some commonly used features are never used in this tutorial.
+ \endomit
+
+ このチュートリアルでは以下に示す Qt の基本的な機能を学ぶことが出来ます:
+
+ \list
+ \o ウィジェットとレイアウトマネージャ
+ \o コンテナクラス
+ \o シグナル/スロット
+ \o 入力デバイスと出力デバイス
+ \endlist
+
+ Qt を初めて利用する方は、最初に \l{How to Learn Qt} をご覧ください。
+
+ チュートリアルの目次:
+
+ \list 1
+ \o \l{tutorials/addressbook/part1}{ユーザインターフェースの設計}
+ \o \l{tutorials/addressbook/part2}{アドレスの追加}
+ \o \l{tutorials/addressbook/part3}{項目間のナビゲーション}
+ \o \l{tutorials/addressbook/part4}{アドレスの編集と削除}
+ \o \l{tutorials/addressbook/part5}{検索機能の追加}
+ \o \l{tutorials/addressbook/part6}{読み込みと保存}
+ \o \l{tutorials/addressbook/part7}{その他の機能}
+ \endlist
+
+ このチュートリアルのソースコードは、Qt の
+ \c examples/tutorials/addressbook ディレクトリに置かれています。
+
+ この小さなアプリケーションは本格的な最新の GUI
+ アプリケーションのようには見えませんが、
+ 複雑なアプリケーションで使用される多くの基本的な技術が採用されています。
+ このチュートリアルが終わったら、
+ メニューやツールバー、ステータスバーなどを表示する
+ 小さな GUI アプリケーションである
+ \l{mainwindows/application}{Application}
+ のサンプルをチェックすることをお勧めします。
+
+*/
+
+/*!
+ \page tutorials-addressbook-part1.html
+
+ \example tutorials/addressbook/part1
+ \title 第1章 - ユーザインターフェースのデザイン
+
+ 本チュートリアルの第1章では
+ アドレス帳アプリケーションで使用する基本的なインターフェース
+ (GUI) の設計について説明します。
+
+ GUI プログラム作成の最初のステップは、
+ ユーザインターフェースを設計することです。
+ 本章の目標は、基本的なアドレス帳アプリケーションを実装するのに必要な
+ ラベルと入力フィールドを設定することです。
+ 下図は、ここで作成しようとしているアドレス帳のスクリーンショットです。
+
+ \image addressbook-tutorial-part1-screenshot.png
+
+ ユーザがアドレス帳に名前や住所を入力できるようにするには、
+ 2つの QLabel のオブジェクトである \c nameLabel 及び \c addressLabel と、
+ 入力フィールドとして QLineEdit オブジェクトの \c nameLine と
+ QTextEdit オブジェクトの \c addressText が必要です。
+ 使用するウィジェットとその配置は下図に示してあります。
+
+ \image addressbook-tutorial-part1-labeled-screenshot.png
+
+ 以下の3つのファイルを使用してこのアドレス帳を実装します:
+
+ \list
+ \o \c{addressbook.h} - \c AddressBook クラスを宣言するファイル、
+ \o \c{addressbook.cpp} - \c AddressBook クラスを実装するファイル、
+ \o \c{main.cpp} - \c AddressBook クラスのインスタンスを持つ
+ \c main() 関数を含むファイル。
+ \endlist
+
+ \section1 Qt プログラミング - 派生クラスの作成
+
+ Qt プログラムを作成する際は、
+ 通常 Qt オブジェクトの派生クラスを作成して機能を追加します。
+ これは、カスタムウィジットや標準的なウィジェットの集合体を作成する場合の
+ 重要なコンセプトの1つです。
+ ウィジェットの挙動の拡張や変更のために派生クラスを作成することには
+ 以下のような利点があります:
+
+ \list
+ \o 仮想関数または純粋仮想関数の実装を行って要求される機能を実装できます。
+ 必要によっては基底クラスの実装にフォールバックして利用できます。
+
+ \o これにより、アプリケーションのその他の部分が
+ ユーザインターフェースの個々のウィジェットを指定する必要がないよう、
+ ユーザインターフェースの一部をクラス内にカプセル化できます。
+
+ \o 派生クラスは、同一のアプリケーションまたはライブラリに
+ 複数のカスタムウィジットを作成するために使用できます。
+ また、派生クラスのコードは、他のプロジェクトで再利用可能です。
+
+ \endlist
+
+ Qt ではアドレス帳ウィジェットを提供していないため、
+ 標準的な Qt ウィジェットクラスを継承して機能を追加します。
+ 本チュートリアルで作成する \c AddressBook クラスは、
+ 基本的なアドレス帳ウィジェットが必要な場合に再利用できます。
+
+ \section1 AddressBook クラスの宣言
+
+ \l{tutorials/addressbook/part1/addressbook.h}{\c addressbook.h}
+ ファイルは、 \c AddressBook クラスを宣言するために使用します。
+
+ ここでは \c AddressBook を QWidget の派生クラスとし、
+ コンストラクタを宣言することから始めます。
+ また、 Q_OBJECT マクロを使用して、クラスで多言語化機能及び、
+ Qt のシグナル/スロット機能が使われていることを示します。
+ ただし、現段階ではこれらの機能の全てを使わない場合もあります。
+
+ \snippet tutorials/addressbook/part1/addressbook.h class definition
+
+ クラスは、 前述した QLineEdit と QTextEdit のプライベートなインスタンス
+ \c nameLine と \c addressText の宣言を保有します。
+ 後述の章で、 \c nameLine 及び \c addressText に保存したデータが、
+ 多くのアドレス帳の機能で必要になることがわかるでしょう。
+
+ 我々が使用する QLabel オブジェクトは、
+ 一旦作成すると後で参照する必要がないため、宣言する必要はありません。
+ Qt でオブジェクトの所有権を追跡する方法については、次節で説明します。
+
+ Q_OBJECT マクロ自体は、Qt のより高度な機能を実装します。
+ ここでは、 Q_OBJECT マクロを、 \l{QObject::}{tr()} 及び
+ \l{QObject::}{connect()} 関数を使用可能にする
+ ショートカットとみなしたほうが良いでしょう。
+
+ これで、 \c addressbook.h ファイルが完成しました。
+ 次は対応する \c addressbook.cpp ファイルの実装を行います。
+
+ \section1 AddressBook クラスの実装
+
+ \c AddressBook のコンストラクタは、 \a{parent} パラメータとして
+ QWidget を受け取ります。
+ 慣例により、このパラメータを基底クラスのコンストラクタに渡します。
+ 親が複数の子を所有できるというこの所有概念は、
+ Qt でウィジェットのグループ化を行う場合に有用です。
+ 例えば、親を削除すると、親に属する子も全て削除されます。
+
+ \snippet tutorials/addressbook/part1/addressbook.cpp constructor and input fields
+
+ このコンストラクタ内で、 \c nameLine と \c addressText のインスタンスを生成し、
+ 2つのローカル QLabel オブジェクトの \c nameLabel と \c addressLabel
+ を宣言し、そのインスタンスを生成します。
+ \l{QObject::tr()}{tr()} 関数は、
+ 翻訳した文字列が存在する場合にそれを返します。
+ そうでない場合は、引数の文字列自体を返します。
+ この関数は文字列が他の言語に翻訳されるようにマークする役目を持ちます。
+ 翻訳可能な文字列を使用するたびに、マークしてください。
+
+ Qt を使用してプログラミングを行う場合、
+ レイアウトが機能する仕組みを理解していると便利です。
+ Qt は主に、以下の3つのレイアウトクラスを提供します。
+ ウィジェットの配置を処理するための QHBoxLayout 、 QVBoxLayout 及び
+ QGridLayout です。
+
+ \image addressbook-tutorial-part1-labeled-layout.png
+
+ ここでは、 QGridLayout を使って、
+ ラベルと入力フィールドを配置します。
+ QGridLayout は、有効なスペースを格子状に分割し、
+ 行/列番号により指定するセルに、ウィジェットを配置します。
+ 上図は、レイアウトセルとウィジェットの位置を示しており、
+ 以下のコードを使用して、この配置を指定します:
+
+ \snippet tutorials/addressbook/part1/addressbook.cpp layout
+
+ \c addressLabel は、追加引数として Qt::AlignTop を用いて配置されていることに注意してください。
+ これは、セル(1,0) で縦方向の中央に配置されないようにするためです。
+ Qt のレイアウトにおける基本概念については、
+ \l{Layout Management} のドキュメントをご覧ください。
+
+ ウィジェットにレイアウトオブジェクトをインストールするには、
+ ウィジェットの \l{QWidget::setLayout()}{setLayout()}
+ 関数を呼び出す必要があります。
+
+ \snippet tutorials/addressbook/part1/addressbook.cpp setting the layout
+
+ 最後に、ウィジェットのタイトルを "Simple Address Book" とします。
+
+ \section1 アプリケーションを実行する
+
+ 別のファイル \c main.cpp に、 \c main() 関数に実装します。
+ この関数内で、QApplication である \c app のインスタンスを生成します。
+ QApplication は、既定のフォントやカーソルなど
+ アプリケーションに共通な複数のリソース及び、
+ イベントループの実行に関与しています。
+ 従って、Qt を使用する全ての GUI アプリケーションでは、
+ 必ず QApplication が存在します。
+
+ \snippet tutorials/addressbook/part1/main.cpp main function
+
+ スタックに新しい \c AddressBook ウィジェットを生成し、
+ \l{QWidget::show()}{show()} 関数を呼び出して表示します。
+ ただし、ウィジェットはアプリケーションのイベントループが
+ 開始されるまで表示されません。
+ アプリケーションの \l{QApplication::}{exec()} 関数を呼び出して、
+ イベントループを開始します。
+ この関数により返された結果は、 \c main() 関数の戻り値として使用されます。
+ この時点で、スタックで \c AddressBook
+ をインスタンス化した理由が明らかになります。
+ イベントループが終了すると \c main() 関数のスコープの外に移動します。
+ それに伴って \c AddressBook 及び、
+ これに属する全ての子ウィジェットが削除されるため、
+ メモリリークを防ぐことができます。
+*/
+
+/*!
+ \page tutorials-addressbook-part2.html
+
+ \example tutorials/addressbook/part2
+ \title 第2章 - アドレスの追加
+
+ 基本的なアドレス帳アプリケーションを作成するための次の手順は、
+ ユーザからの操作を可能にすることです。
+
+ \image addressbook-tutorial-part2-add-contact.png
+
+ 新しい連絡先を追加するために、
+ ユーザがクリックするプッシュボタンを作成します。
+ また、これらの連絡先を整理して保存するために、
+ 何らかのデータ構造が必要になります。
+
+ \section1 AddressBook クラスの宣言
+
+ ラベルと入力フィールドの設定が完了しているため、
+ 連絡先を追加する際に必要なプッシュボタンを追加します。
+ \c addressbook.h ファイルに、
+ 3つの QPushButton オブジェクトを宣言し、
+ 対応する3つの public slot を作成します。
+
+ \snippet tutorials/addressbook/part2/addressbook.h slots
+
+ スロットとは特定のシグナルに応答して呼び出される関数をいいます。
+ このコンセプトについては、 \c AddressBook
+ クラスを実装する際にさらに詳細に取り上げます。
+ なお、Qt のシグナル/スロットのコンセプトの概要については、
+ \l{Signals and Slots} のドキュメントを参照してください。
+
+ 3つの QPushButton オブジェクト \c addButton 、 \c submitButton 、
+ \c cancelButton は、前章の \c nameLine と \c addressText とともに、
+ プライベート変数宣言に含まれています。
+
+ \snippet tutorials/addressbook/part2/addressbook.h pushbutton declaration
+
+ アドレス帳の連絡先を横断して表示するには、
+ 連絡先保持用のコンテナが必要です。
+ QMap のオブジェクトである \c contacts をこの目的に使用します。
+ \c contacts にはキーとして連絡先の名前 \e key
+ とそれに対応する値として連絡先の住所 \e value を格納します。
+
+ \snippet tutorials/addressbook/part2/addressbook.h remaining private variables
+
+ QString の2つのプライベートオブジェクトとして \c oldName と \c oldAddress
+ も宣言します。
+ これらのオブジェクトは、ユーザが \gui Add
+ をクリックする前に最後に表示した連絡先の名前と住所が含まれている必要があります。
+ ユーザが \gui Cancel
+ をクリックすると、最後に表示した連絡先の詳細に戻って表示することが出来ます。
+
+ \section1 AddressBook クラスの実装
+
+ \c AddressBook のコンストラクタ内で、連絡先の詳細を編集することなく
+ 表示のみを行えるよう、 \c nameLine と \c addressText
+ を読み取り専用に設定します。
+
+ \dots
+ \snippet tutorials/addressbook/part2/addressbook.cpp setting readonly 1
+ \dots
+ \snippet tutorials/addressbook/part2/addressbook.cpp setting readonly 2
+
+ 次に、プッシュボタン \c addButton 、 \c submitButton 、 \c cancelButton
+ のインスタンスを生成します。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp pushbutton declaration
+
+ \c addButton を、 \l{QPushButton::show()} 関数を呼び出して表示します。
+ \c submitButton と \c cancelButton は、
+ \l{QPushButton::hide()}{hide()} を呼び出して非表示にします。
+ これら2つのプッシュボタンはユーザが \gui Add
+ をクリックした場合にのみ表示され、後に説明する
+ \c addContact() によって処理されます。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp connecting signals and slots
+
+ 各プッシュボタンの \l{QPushButton::clicked()}{clicked()} を、
+ それぞれのスロットに接続します。
+ 下図はこれを説明したものです。
+
+ \image addressbook-tutorial-part2-signals-and-slots.png
+
+ 次に、 QVBoxLayout を使用して、
+ アドレス帳ウィジェットの右側にプッシュボタンを
+ 上下一列に配置します。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp vertical layout
+
+ \l{QBoxLayout::addStretch()}{addStretch()} 関数は、
+ プッシュボタンを等間隔に並べるのではなく、
+ ウィジェット上部に近づけて配置するために使用します。
+ 下図は、\l{QBoxLayout::addStretch()}{addStretch()} を使用した場合と、
+ 使用しない場合の違いを示しています。
+
+ \image addressbook-tutorial-part2-stretch-effects.png
+
+ 次に、\l{QGridLayout::addLayout()}{addLayout()} を使用して、
+ \c buttonLayout1 を \c mainLayout に追加します。
+ \c buttonLayout1 は \c mainLayout の子となり、
+ レイアウトが入れ子になりました。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp grid layout
+
+ レイアウトの配置は以下のようになります:
+
+ \image addressbook-tutorial-part2-labeled-layout.png
+
+ \c addContact() では、最後に表示した連絡先の詳細を、
+ \c oldName と \c oldAddress に保存します。
+ 次に、これらの入力フィールドをクリアし、読み取り専用モードを解除します。
+ \c nameLine にフォーカスをセットして、 \c submitButton と \c cancelButton を表示します。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp addContact
+
+ \c submitContact() 関数は、以下の次の3つの要素から成ります:
+
+ \list 1
+
+ \o \c nameLine 及び \c addressText から連絡先の詳細を抽出し、
+ QString オブジェクトに保存します。
+ また、ユーザが入力フィールドに何も入力せずに
+ \gui Submit をクリックしないよう確認します。
+ どちらかのフィールドが空であれば、ユーザに名前と住所の入力を求める
+ QMessageBox が表示されます。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part1
+
+ \o 続けて、連絡先が既に存在するかどうか確認します。
+ 存在しない場合は \c contacts に連絡先を追加して QMessageBox を表示し、
+ 連絡先が追加されたことをユーザに知らせます。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part2
+
+ 連絡先が既に存在する場合、 QMessageBox を表示し、
+ 連絡先が重複して追加されないように
+ 連絡先が存在することをユーザに知らせます。
+ \c contacts オブジェクトは、名前と住所のキー値のペアで構成されているため、
+ \e key が一意であることを確認します。
+
+ \o 上記の両方の事例に対処したら、
+ 以下のコードを使ってプッシュボタンを通常の状態に戻します:
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part3
+
+ \endlist
+
+ 以下のスクリーンショットは、ユーザに情報メッセージを表示するために使用する
+ QMessageBox オブジェクトです。
+
+ \image addressbook-tutorial-part2-add-successful.png
+
+ \c cancel() 関数は、最後に表示した連絡先の詳細を復元して
+ \c addButton を有効にし、 \c submitButton と \c cancelButton
+ を非表示にします。
+
+ \snippet tutorials/addressbook/part2/addressbook.cpp cancel
+
+ 連絡先を追加する際の概念は、ユーザがいつでも自由に
+ \gui{送信} または \gui{キャンセル} をクリックできるようにすることです。
+ 以下のフローチャートは、この概念を詳細に説明しています:
+
+ \image addressbook-tutorial-part2-add-flowchart.png
+*/
+
+/*!
+ \page tutorials-addressbook-part3.html
+
+ \example tutorials/addressbook/part3
+ \title 第3章 - 項目間のナビゲーション
+
+ アドレス帳アプリケーションは、半分完成しました。
+ 次に表示する連絡先を変更するために、いくつかの関数を追加します。
+ しかし、最初に、これらの連絡先を保存するために使用するデータ構造の種類を決める必要があります。
+
+ 第2章では、連絡先の名前 \e key 及び、連絡先の住所 \e value
+ の鍵と値のペアで QMap を使用しました。
+ これは、この事例で使用するのに適した構造です。
+ ただし、各項目間を移動して表示するには、多少の機能拡張が必要です。
+
+ QMap を、最初の要素と最後の要素を含むすべての要素が接続された
+ 循環リストに似たデータ構造に、機能拡張します。
+ 下図はこのデータ構造を説明したものです。
+
+ \image addressbook-tutorial-part3-linkedlist.png
+
+ \section1 AddressBook クラスの宣言
+
+ アドレス帳アプリケーションにナビゲーション機能を追加するには、
+ \c AddressBook クラスに2つのスロットを追加する必要があります。
+ next() 及び \c previous() を
+ \c addressbook.h ファイルに追加します。
+
+ \snippet tutorials/addressbook/part3/addressbook.h navigation functions
+
+ また、新たに2つの QPushButton オブジェクトが必要になります。
+ プライベート変数として
+ \c nextButton と \c previousButton を宣言します。
+
+ \snippet tutorials/addressbook/part3/addressbook.h navigation pushbuttons
+
+ \section1 AddressBook クラスの実装
+
+ \c addressbook.cpp の \c AddressBook コンストラクタでは、
+ \c nextButton と \c previousButton のインスタンスを生成し
+ 初期設定で無効にします。
+ これは、アドレス帳に複数の連絡先が存在しない場合、
+ ナビゲーションを有効にしないためです。
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp navigation pushbuttons
+
+ これらのプッシュボタンを、それぞれスロットに接続します:
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals
+
+ 以下の画像は、ここで作成しようとしている
+ グラフィカルユーザインターフェースです。
+ 最終アプリケーションが完成間近であることがわかるでしょう。
+
+ \image addressbook-tutorial-part3-screenshot.png
+
+ \c next() と \c previous() では基本的な規約に従って、
+ \c nextButton を右側に、 \c previousButton を左側に配置します。
+ 直感的でわかりやすいレイアウトに仕上げるために、
+ QHBoxLayout を使用してウィジェットを横に並べて配置します:
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp navigation layout
+
+ 次に、 \c mainLayout に、QHBoxLayout のオブジェクトである
+ \c buttonLayout2 を追加します。
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp adding navigation layout
+
+ 下図は、 \c mainLayout のウィジェットの配置を示します。
+ \image addressbook-tutorial-part3-labeled-layout.png
+
+ \c addContact() 関数内部では、
+ ユーザが連絡先を追加しているときに移動しないよう、
+ これらのボタンを無効にする必要があります。
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp disabling navigation
+
+ また、 \c submitContact() 関数では、 \c contacts のサイズに応じて、
+ ナビゲーションボタン \c nextButton 及び \c previousButton を有効にします。
+ 前述のように、アドレス帳に複数の連絡先が存在しない場合は、
+ ナビゲーションを有効にできません。
+ 以下のコードは、その処理方法を示しています。
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp enabling navigation
+
+ \c cancel() 関数にも、これらの処理を含めます。
+
+ ここで、QMap のオブジェクト \c contacts を使って、
+ 循環リストをエミュレートしましょう。
+ \c next() 関数で、 \c contacts のイテレータを作成し、次に:
+
+ \list
+ \o イテレータが \c contacts の末尾にない場合は、次の項目に移動します。
+
+ \o イテレータが \c contacts の末尾にある場合は、
+ \c contacts の先頭に移動します。
+ これによって、QMap が循環リストのように機能するという印象を与えます。
+ \endlist
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp next() function
+
+ \c contacts 内の正しいオブジェクトに移動したら、
+ \c nameLine と \c addressText に内容を表示します。
+
+ 同様に、 \c previous() 関数で、 \c contacts のイテレータを作成し、次に:
+ \list
+ \o イテレータが \c contacts の末尾にある場合は、
+ 表示をクリアして戻ります。
+
+ \o イテレータが \c contacts の先頭にある場合は、末尾に移動します。
+
+ \o イテレータを直前の項目に移動します。
+ \endlist
+
+ \snippet tutorials/addressbook/part3/addressbook.cpp previous() function
+
+ もう一度、 \c contacts に現在のオブジェクトの内容を表示します。
+*/
+
+/*!
+ \page tutorials-addressbook-part4.html
+
+ \example tutorials/addressbook/part4
+ \title 第4章 - アドレスの編集と削除
+
+ 本章では、アドレス帳アプリケーションに保存されている
+ 連絡先の内容を変更する方法について説明します。
+
+ \image addressbook-tutorial-screenshot.png
+
+ ここでは、連絡先を整理して保存するだけでなく、
+ ナビゲーションが可能なアドレス帳を作成します。
+ 必要に応じて連絡先の詳細を変更できるよう、
+ 編集・削除機能を追加すると便利です。
+ ただし、列挙型書式の若干の改善が必要になります。
+ 前章では、次の2つのモードを扱いました:
+ \c AddingMode 及び \c NavigationMode -
+ ただし、これらは列挙型として定義しませんでした。
+ 代わりに、対応するボタンを手動で有効または無効にし、
+ 複数行のコードを繰り返します。
+
+ 本章では、以下のような2つの異なる値を持つ \c Mode 列挙型を定義します:
+
+ \list
+ \o \c{NavigationMode}
+ \o \c{AddingMode}
+ \o \c{EditingMode}
+ \endlist
+
+ \section1 AddressBook クラスの宣言
+
+ \c addressbook.h ファイルをアップデートし、 \c Mode 列挙型を追加します:
+
+ \snippet tutorials/addressbook/part4/addressbook.h Mode enum
+
+ また、public slot として2つの新しいスロット
+ \c editContact() 及び \c removeContact() を追加します。
+
+ \snippet tutorials/addressbook/part4/addressbook.h edit and remove slots
+
+ モードを切り替えるために、すべての QPushButton オブジェクトの
+ 有効化/無効化を制御する \c updateInterface() 関数を導入します。
+ また、前述の編集と削除を行うスロット用に、2つの新しいボタン
+ \c editButton 及び \c removeButton を追加します。
+
+ \snippet tutorials/addressbook/part4/addressbook.h updateInterface() declaration
+ \dots
+ \snippet tutorials/addressbook/part4/addressbook.h buttons declaration
+ \dots
+ \snippet tutorials/addressbook/part4/addressbook.h mode declaration
+
+ 最後に、現在のモードを保持する列挙型の \c currentMode を宣言します。
+
+ \section1 AddressBook クラスの実装
+
+ ここで、アドレス帳アプリケーションのモード変更機能を実装する必要があります。
+ アドレス帳をはじめて起動するときは、
+ メモリに連絡先が保存されていないため、
+ コンストラクタでは、 \c editButton 及び \c removeButton
+ のインスタンスの生成と無効化を行います。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp edit and remove buttons
+
+ また、ボタンをそれぞれのスロット \c editContact() 及び \c removeContact()
+ に接続し、 \c buttonLayout1 に追加します。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp connecting edit and remove
+ \dots
+ \snippet tutorials/addressbook/part4/addressbook.cpp adding edit and remove to the layout
+
+ \c editContact() は、モードを \c EditingMode に切り替える前に、
+ 連絡先の古い詳細情報を、 \c oldName と \c oldAddress に保存します。
+ このモードでは、 \c submitButton と \c cancelButton
+ の両方が有効になるため、ユーザは連絡先の詳細を変更し、
+ どちらか一方のボタンをクリックできます。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp editContact() function
+
+ \c submitContact() 関数は、 \c{if-else} ステートメントにより、
+ 2つの処理に分割しています。
+ \c currentMode が \c AddingMode であるかどうかを確認します。
+ その場合、連絡先追加の処理を行います。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp submitContact() function beginning
+ \dots
+ \snippet tutorials/addressbook/part4/addressbook.cpp submitContact() function part1
+
+ \c AddingMode でない場合、 \c currentMode が \c EditingMode
+ であるかどうか確認します。
+ その場合、 \c oldName を \c name と比較します。
+ 名前を変更した場合、 \c contacts から古い連絡先を削除し、
+ 新たに更新した連絡先を挿入します。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp submitContact() function part2
+
+ 住所のみを変更した場合 (たとえば、 \c oldAddress は \c address と異なる)、
+ 連絡先の住所を更新します。
+ 最後に、 \c currentMode を \c NavigationMode に設定します。
+ これは、無効にしたプッシュボタンをすべて再び有効にするための重要なステップです。
+
+ アドレス帳から連絡先の削除を行う
+ \c removeContact() 関数を実装します。
+ この関数では、まず連絡先が \c contacts に存在するかどうか確認します。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp removeContact() function
+
+ 存在する場合、ユーザに削除を確認するために、QMessageBox を表示します。
+ ユーザが確認したら、 \c previous() を呼び出して、
+ ユーザインターフェースで他の連絡先を表示できることを確認し、
+ QMap の \l{QMap::remove()}{remove()} 関数を使用して連絡先を削除します。
+ 念のため、QMessageBox を表示してユーザに知らせます。
+ この関数で使用するメッセージボックスを以下に示します:
+
+ \image addressbook-tutorial-part4-remove.png
+
+ \section2 ユーザインターフェースを更新する
+
+ 既に、 \c updateInterface() 関数が
+ 現在のモードに応じてプッシュボタンの有効化と無効化を行うための
+ 手段であることを説明しました。
+ この関数は、渡される \c mode 引数に応じて現在のモードを更新します。
+ なお、引数の値を確認する前に \c currentMode に代入しています。
+
+ このとき、それぞれのプッシュボタンは、
+ 現在のモードに応じて有効または無効になります。
+ \c AddingMode 及び \c EditingMode でのコードを以下に示します:
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 1
+
+ \c NavigationMode の場合、 QPushButton::setEnabled()
+ 関数のパラメータに条件を含めます。
+ これは、アドレス帳に少なくとも1つ以上の連絡先が存在する場合に、
+ \c editButton と \c removeButton が有効であることを確認するためのものです。
+ \c nextButton と \c previousButton は、
+ アドレス帳に少なくとも2つ以上の連絡先が存在する場合にのみ有効になります。
+
+ \snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 2
+
+ モードの設定及び、同一関数内でのユーザインターフェースの更新を行うタスクを実行することにより、
+ アプリケーションの内部状態により
+ ユーザインターフェースが「非同期」になる可能性を防ぎます。
+*/
+
+/*!
+ \page tutorials-addressbook-part5.html
+
+ \example tutorials/addressbook/part5
+ \title 第5章 - 検索機能の追加
+
+ 本章では、アドレス帳アプリケーションの連絡先と住所を
+ 検索する方法について説明します。
+
+ \image addressbook-tutorial-part5-screenshot.png
+
+ アドレス帳アプリケーションへ連絡先の追加を繰り返すと、
+ \e Next 及び \e Previous ボタンによる連絡先のナビゲートが面倒になります。
+ この場合、\e{検索(Find)}機能を使うと、
+ 連絡先の検索をより効率的に行うことができます。
+ 上記スクリーンショットは、\e Find ボタン及び、
+ パネル上のボタンの位置を示します。
+
+ ユーザーが \e Find ボタンをクリックすると、
+ 連絡先の名前の入力を求めるダイアログを表示します。
+ Qt が提供する QDialog クラスを継承して \c FindDialog クラスを導入します。
+
+ \section1 FindDialog クラスの宣言
+
+ \image addressbook-tutorial-part5-finddialog.png
+
+ QDialog を継承するには、最初に、QDialog のヘッダーを
+ \c finddialog.h ファイルで include する必要があります。
+ また、これらのウィジェットをダイアログクラスで使用するため、
+ 前方宣言を使用して QLineEdit と QPushButton を宣言します。
+
+ \c AddressBook クラスと同様に、 \c FindDialog クラスには Q_OBJECT
+ マクロが含まれ、ダイアログが別のウィンドウとして開かれる場合でも、
+ コンストラクタは親 QWidget を取るように定義されます。
+
+ \snippet tutorials/addressbook/part5/finddialog.h FindDialog header
+
+ \c FindDialog のインスタンスを保持するクラスにより使用される
+ パブリック関数 \c getFindText() を定義します。
+ この関数を経由してユーザが入力した検索文字列を取得します。
+ また、ユーザが \gui Find ボタンをクリックしたときに検索文字列を処理するために、
+ public slot として \c findClicked() を定義します。
+
+ 最後に、\gui Find ボタンに対応するプライベート変数として \c findButton 、
+ ユーザが検索文字列を入力するラインエディット \c lineEdit 及び、
+ 後の作業で使用する検索文字列を保存するために使用する内部文字列として
+ \c findText の定義を行います。
+
+ \section1 FindDialog クラスの実装
+
+ \c FindDialog のコンストラクタ内で、プライベート変数の
+ \c lineEdit 、 \c findButton 及び \c findText を設定します。
+ QHBoxLayout を用いてウィジェットを配置します。
+
+ \snippet tutorials/addressbook/part5/finddialog.cpp constructor
+
+ シグナルをそれぞれのスロットに接続し、
+ レイアウトとウィンドウのタイトルを設定します。
+ \c findButton の \l{QPushButton::clicked()} シグナルは、
+ \c findClicked() と \l{QDialog::accept()}{accept()}
+ に接続されていることがわかります。
+ QDialog により提供される \l{QDialog::accept()}{accept()} スロットは
+ ダイアログを非表示にして、結果コードを \l{QDialog::}{Accepted}
+ に設定します。
+ この関数を使用して、 \c AddressBook の \c findContact() 関数に、
+ \c FindDialog オブジェクトが閉じていることを知らせます。
+ この論理については、 \c findContact() 関数について取り上げる際に、
+ さらに詳細に説明します。
+
+ \image addressbook-tutorial-part5-signals-and-slots.png
+
+ \c findClicked() で、ユーザが連絡先の名前を入力せずに
+ \gui Find ボタンをクリックしたかどうか確認するために
+ \c lineEdit を検証します。
+ 次に、 \c lineEdit から抽出した検索文字列を \c findText に設定します。
+ その後、 \c lineEdit のコンテンツをクリアし、ダイアログを非表示にします。
+
+ \snippet tutorials/addressbook/part5/finddialog.cpp findClicked() function
+
+ \c findText 変数用のパブリックな取得関数
+ \c getFindText() を実装します。
+ コンストラクタ及び \c findClicked() 関数でのみ
+ \c findText を直接設定するため、
+ \c getFindText() に対応する設定関数は作成しません。
+ \c getFindText() はパブリックであるため、インスタンスを生成し
+ \c FindDialog を使用するクラスは、
+ ユーザが入力して確定した検索文字列にいつでもアクセスできます。
+
+ \snippet tutorials/addressbook/part5/finddialog.cpp getFindText() function
+
+ \section1 AddressBook クラスの宣言
+
+ \c AddressBook クラス内部から \c FindDialog を使用できるよう、
+ \c addressbook.h ファイルに \c finddialog.h を含めます。
+
+ \snippet tutorials/addressbook/part5/addressbook.h include finddialog's header
+
+ これまでのところ、アドレス帳の全機能に、
+ QPushButton とそのボタンに対応するスロットが含まれています。
+ 同様に、\gui{検索(Find)}機能には、
+ \c findButton 及び \c findContact() が含まれています。
+
+ \c findButton はプライベート変数として宣言され、
+ \c findContact() 関数は public slot として宣言されます。
+
+ \snippet tutorials/addressbook/part5/addressbook.h findContact() declaration
+ \dots
+ \snippet tutorials/addressbook/part5/addressbook.h findButton declaration
+
+ 最後に、 \c FindDialog のインスタンスを参照するためのプライベート変数
+ \c dialog を宣言します。
+
+ \snippet tutorials/addressbook/part5/addressbook.h FindDialog declaration
+
+ インスタンス化されたダイアログは複数回使用します。
+ プライベート変数を使用すると、
+ クラスの複数の場所から参照できるようになります。
+
+ \section1 AddressBook クラスの実装
+
+ \c AddressBook クラスのコンストラクタ内で、
+ プライベートオブジェクトの \c findButton と \c findDialog
+ のインスタンスを生成します:
+
+ \snippet tutorials/addressbook/part5/addressbook.cpp instantiating findButton
+ \dots
+ \snippet tutorials/addressbook/part5/addressbook.cpp instantiating FindDialog
+
+ 次に、 \c findButton の \l{QPushButton::clicked()}{clicked()} シグナルを、
+ \c findContact() に接続します。
+
+ \snippet tutorials/addressbook/part5/addressbook.cpp signals and slots for find
+
+ 後は、 \c findContact() 関数のコードだけです:
+
+ \snippet tutorials/addressbook/part5/addressbook.cpp findContact() function
+
+ \c FindDialog インスタンスの \c dialog を表示することから始めます。
+ これは、ユーザが検索用に連絡先の名前を入力するためのものです。
+ ユーザがダイアログの \c findButton をクリックすると
+ ダイアログが非表示になり、結果コードが QDialog::Accepted に設定されます。
+ これにより、 \c if ステートメントが常に真になります。
+
+ 続けて、検索文字列の抽出を行います。
+ この場合、検索文字列は \c contactName で、
+ \c FindDialog の \c getFindText() 関数を使用して取得します。
+ アドレス帳に連絡先が存在する場合、直ちに表示します。
+ 存在しない場合、検索が失敗したことを示す以下の QMessageBox が表示されます。
+
+ \image addressbook-tutorial-part5-notfound.png
+*/
+
+/*!
+ \page tutorials-addressbook-part6.html
+
+ \example tutorials/addressbook/part6
+ \title 第6章 - 読み込みと保存
+
+ 本章では、アドレス帳アプリケーションの読み込みと保存処理で使用する、
+ Qt のファイル処理機能について説明します。
+
+ \image addressbook-tutorial-part6-screenshot.png
+
+ 連絡先の参照及び検索機能は便利な機能ですが、
+ 連絡先の保存と読み込みが可能になるまではアドレス帳は完成しません。
+
+ Qt は \l{Input/Output and Networking}{入出力}
+ 用のクラスを様々提供していますが、
+ 今回は簡単に組み合わせて使用できる QFile と QDataStream の2つのクラスを選択しました。
+
+ QFile のオブジェクトは、
+ 読み込みと書き込みが可能なディスク上のファイルを表します。
+ QFile は、さまざまなデバイスを表すより一般的な QIODevice クラスの派生クラスです。
+
+ QDataStream オブジェクトは、バイナリデータを QIODevice に保存して、
+ 後でもう一度取得できるようシリアライズするために使用します。
+ パラメータとしてそれぞれのデバイスを使用すると、
+ ストリームを開くのと同じくらい簡単に、 QIODevice
+ からの読み込みと書き込みを行うことができます。
+
+ \section1 AddressBook クラスの宣言
+
+ 2つの QPushButton オブジェクトの \c loadButton と \c saveButton
+ に加えて、2つの public slot の \c saveToFile() と \c loadFromFile()
+ を宣言します。
+
+ \snippet tutorials/addressbook/part6/addressbook.h save and load functions declaration
+ \dots
+ \snippet tutorials/addressbook/part6/addressbook.h save and load buttons declaration
+
+ \section1 AddressBook クラスの実装
+
+ コンストラクタで、 \c loadButton と \c saveButton のインスタンスを生成します。
+ 理想的には、プッシュボタンのラベルを、
+ "Load contacts from a file"(「ファイルから連絡先を読み込む」)及び、
+ "Save contacts to a file"(「連絡先をファイルに保存する」)
+ に設定するほうがよりユーザーフレンドリーです。
+ ただし、他のプッシュボタンのサイズを考慮して、
+ \gui{Load...}及び\gui{Save...}に設定します。
+ Qt は、 \l{QWidget::setToolTip()}{setToolTip()} を使用して
+ ツールチップを簡単に設定する方法を提供していますので、
+ 以下のコードでプッシュボタンにツールチップを設定します:
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp tooltip 1
+ \dots
+ \snippet tutorials/addressbook/part6/addressbook.cpp tooltip 2
+
+ ここには記載していませんが、
+ これまで実装した他の機能のように右側のレイアウトパネル
+ \c button1Layout にプッシュボタンを追加し、
+ プッシュボタンの \l{QPushButton::clicked()}{clicked()}
+ シグナルをそれぞれのスロットに接続します。
+
+ 保存機能の場合、最初に QFileDialog::getSaveFileName() を使用して、
+ \c fileName を取得します。
+ これは、QFileDialog により提供される簡易関数で、
+ モーダルなファイルダイアログをポップアップ表示させ、
+ ユーザはファイル名を入力したり、既存の \c{.abk} ファイルを選択することが出来ます。
+ \c{.abk} ファイルは、
+ 連絡先を保存したときに作成されるアドレス帳の拡張子です。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp saveToFile() function part1
+
+ 以下のスクリーンショットのようなネイティブのファイルダイアログが表示されます:
+
+ \image addressbook-tutorial-part6-save.png
+
+ \c fileName が空ではない場合、 \c fileName を用いて
+ QFile のオブジェクト \c file を作成します。
+ QFile は QIODevice の派生クラスであるため、
+ QDataStream から使用できます。
+
+ 次に、ファイルを \l{QIODevice::}{WriteOnly} モードでオープンします。
+ オープンに失敗した場合、 QMessageBox を表示してユーザに知らせます。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp saveToFile() function part2
+
+ オープンに成功した場合、 QDataStream のインスタンス \c out を生成して、
+ 開いているファイルに書き込みます。
+ QDataStream では、同じバージョンのストリームを使用して、
+ 読み込みと書き込みを行う必要があります。
+ \c file にシリアライズする前に、
+ \l{QDataStream::Qt_4_5}{Qt 4.5で導入されたバージョン}
+ を今回使用するバージョンとして設定します。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp saveToFile() function part3
+
+ 読み込み機能の場合も QFileDialog::getOpenFileName() を使用して
+ \c fileName を取得します。
+ この関数は QFileDialog::getSaveFileName() に対応するものであり、
+ モーダルなファイルダイアログをポップアップ表示させ、
+ ユーザはファイル名を入力したり、既存の \c{.abk}
+ ファイルを選択してアドレス帳に読み込ことができます。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp loadFromFile() function part1
+
+ たとえば、 Windows では、この関数は、以下のスクリーンショットのような
+ ネイティブのファイルダイアログをポップアップ表示させます。
+
+ \image addressbook-tutorial-part6-load.png
+
+ \c fileName が空ではない場合、 QFile のオブジェクト
+ \c file を使用して、 \l{QIODevice::}{ReadOnly} モードでオープンします。
+ \c saveToFile() の実装の場合と同様に、オープンに失敗した場合は
+ QMessageBox を表示して、ユーザに知らせます。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp loadFromFile() function part2
+
+ オープンに成功した場合、
+ QDataStream のインスタンス \c in を生成して前記のようにバージョン設定を行い、
+ シリアライズしたデータを \c contacts のデータ構造に読み込みます。
+ \c contacts オブジェクトはデータが読み込まれる前に空にするので、
+ ファイルの読み込みプロセスは簡素化されます。
+ より高度な方法では、一時オブジェクトの QMap に読み込んで、
+ 重複していない連絡先を \c contacts にコピーします。
+
+ \snippet tutorials/addressbook/part6/addressbook.cpp loadFromFile() function part3
+
+ ファイルから読み込んだ連絡先を表示するには、
+ 最初に取得したデータを検証し、
+ 読み込んだファイルにアドレス帳の連絡先が実際に含まれているか確認します。
+ 含まれている場合、最初の連絡先を表示します。
+ 含まれていない場合、QMessageBox を表示して、
+ 問題があることをユーザに知らせます。
+ 最後にインターフェースを更新し、適宜
+ プッシュボタンの有効化と無効化を行います。
+*/
+
+/*!
+ \page tutorials-addressbook-part7.html
+
+ \example tutorials/addressbook/part7
+ \title 第7章 - 追加機能
+
+ 本章では、アドレス帳アプリケーションを
+ 普段の生活で便利に使用するための追加機能について説明します。
+
+ \image addressbook-tutorial-part7-screenshot.png
+
+ アドレス帳アプリケーションは、それ自体で便利ですが、
+ 他のアプリケーションとデータの交換ができればなお便利です。
+ vCard 形式は、この目的で使用可能な一般的なファイル形式です。
+ 本章では、連絡先を vCard ファイル(\c{.vcf})
+ にエクスポートできるよう、アドレス帳クライアントを拡張します。
+
+ \section1 AddressBook クラスの宣言
+
+ QPushButton のオブジェクト \c exportButton 及び、
+ 対応する public slot の \c exportAsVCard() を
+ \c addressbook.h ファイルの \c AddressBook クラスに追加します。
+
+ \snippet tutorials/addressbook/part7/addressbook.h exportAsVCard() declaration
+ \dots
+ \snippet tutorials/addressbook/part7/addressbook.h exportButton declaration
+
+ \section1 AddressBook クラスの実装
+
+ \c AddressBook のコンストラクタで、 \c exportButton の
+ \l{QPushButton::clicked()}{clicked()} シグナルを
+ \c exportAsVCard() に接続します。
+ このボタンも、右側のボタンのパネルの処理を行うレイアウトである
+ \c buttonLayout1 に追加します。
+
+ \c exportAsVCard() 関数では、
+ 連絡先の名前を \c name に抽出することから始めます。
+ \c firstName 、 \c lastName 及び \c nameList を宣言します。
+ 次に \c name を検索し、最初の空白のインデックスを取得します。
+ 空白が存在する場合、連絡先の名前を \c firstName と
+ \c lastName に分割します。
+ 次に、空白をアンダースコア ("_") に置き換えます。
+ 空白が存在しない場合は、連絡先にファーストネーム(名)
+ しか保存されていない可能性があります。
+
+ \snippet tutorials/addressbook/part7/addressbook.cpp export function part1
+
+ \c saveToFile() 関数と同様に、ユーザがファイルの場所を選択できるよう
+ ファイルダイアログを開きます。
+ 選択したファイル名を使用して、
+ 書き込みを行うための QFile のインスタンスを生成します。
+
+ ファイルを \l{QIODevice::}{WriteOnly} モードでオープンします。
+ オープンに失敗した場合、 QMessageBox を表示して、
+ 問題があることをユーザに知らせて戻ります。
+ オープンに成功した場合、 QTextStream のオブジェクト \c out へ
+ パラメータファイルを渡します。
+ QDataStream のように、QTextStream クラスは、
+ プレーンテキストファイルの読み込みと書き込みを行う機能を提供します。
+ 結果として、生成された \c{.vcf} は
+ テキストエディターで開いて編集することができます。
+
+ \snippet tutorials/addressbook/part7/addressbook.cpp export function part2
+
+ まず \c{BEGIN:VCARD} タグ、次に \c{VERSION:2.1} タグの順に
+ vCard ファイルに書き込みます。
+ 連絡先の名前は、 \c{N:} タグを使用して書き込みます。
+ vCard の "File as" プロパティを設定する \c{FN:} タグを書き込む際は、
+ 連絡先にラストネーム(姓)が含まれているかどうかを確認する必要があります。
+ 含まれている場合、 \c nameList の情報を使用して入力します。
+ 含まれていない場合、 \c firstName のみを書き込みます。
+
+ \snippet tutorials/addressbook/part7/addressbook.cpp export function part3
+
+ 続けて連絡先の住所の書き込みを行います。
+ 住所のセミコロンには、"\\" をエスケープ文字として追加する必要があります。
+ 改行はセミコロンに置き換えられ、コンマはスペースに置き換えられます。
+ 次に、 \c{ADR;HOME:;} タグ、 \c address 、
+ \c{END:VCARD} タグの順に書き込みます。
+
+ \snippet tutorials/addressbook/part7/addressbook.cpp export function part4
+
+ 最後に、vCard のエクスポートに成功したことをユーザに知らせるために、
+ QMessageBox が表示されます。
+
+ \e{vCard は、\l{http://www.imc.org}{Internet Mail Consortium} の登録商標です。}
+*/
diff --git a/doc/src/ja_JP/tutorials/widgets-tutorial.qdoc b/doc/src/ja_JP/tutorials/widgets-tutorial.qdoc
new file mode 100644
index 0000000000..6a6b1a2347
--- /dev/null
+++ b/doc/src/ja_JP/tutorials/widgets-tutorial.qdoc
@@ -0,0 +1,257 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page widgets-tutorial.html
+ \title ウィジェットのチュートリアル
+ \brief 本チュートリアルではウィジェットとレイアウトの基本的な使い方を説明し、それらが GUI アプリケーションの開発でどのように使われるかを説明します。
+
+ \section1 はじめに
+
+ ウィジェットは Qt によるグラフィカルユーザインターフェース(GUI)アプリケーションの基本構成要素です。
+ ボタン、ラベル、テキストエディターなどの各 GUI コンポーネントはウィジェットであり、
+ 既存のウィンドウのユーザーインタフェース内に配置したり、独立したウィンドウとして表示することができます。
+ それぞれのコンポーネントは QWidget の派生クラスとして実装されます。
+ QWidget 自体は QObject の派生クラスです。
+
+ QWidget は抽象クラスではなく、
+ 他のウィジェット用のコンテナとして使用されたり、
+ カスタムウィジェットを作る場合の基底クラスとして使用されます。
+ 他のウィジェットを配置するウィンドウとしてもよく使われます。
+
+ \l{QObject} と同様に QWidget は所有権を示すために親オブジェクトを指定して生成できるため、
+ 親オブジェクトが使用されなくなった場合には破棄されます。
+ ウィジェットではこの親子関係が他の意味も持ちます。
+ 子ウィジェットは親ウィジェットが使用する領域内に表示されます。
+ これは、ウィンドウを削除するとそのウィンドウに含まれる全てのウィジェットが自動的に破棄されることを意味します。
+
+ \section1 main 関数の記述
+
+ Qt の GUI サンプルの多くは標準的なアプリケーションの初期化コードを含む
+ \c{main.cpp} ファイルと、アプリケーションのロジックやカスタム
+ GUI コンポーネントを含むいくつかのソース/ヘッダファイルから構成されています。
+
+ \c{main.cpp} 内の典型的な \c main() 関数は以下のようになります:
+
+ \snippet doc/src/snippets/widgets-tutorial/template.cpp main.cpp body
+
+ 最初に、コマンドラインから渡される引数を渡して QApplication のオブジェクトを生成します。
+ ウィジェットを生成して表示した後、 QApplication::exec() を呼び出して Qt のイベントループを開始します。
+ この関数から戻ってくるまでアプリケーションの制御は Qt 側にて行われます。最後に、\c{main()} は QApplication::exec() から取得された値を返します。
+
+ \section1 簡単なウィジェットのサンプル
+
+ 以下の簡単なウィジェットのサンプルでは \c main() 関数の中にコードを記述しています。
+
+ \list
+ \o \l {tutorials/widgets/toplevel}{ウィンドウの作成}
+
+ \o \l {tutorials/widgets/childwidget}{子ウィジェット}
+
+ \o \l {tutorials/widgets/windowlayout}{レイアウトの利用}
+
+ \o \l {tutorials/widgets/nestedlayouts}{複雑なレイアウト}
+ \endlist
+
+ \section1 複雑なウィジェットのサンプル
+
+ \l{Widgets examples}{より高度なサンプル} の場合、ウィジェットやレイアウトのためのコードは他のファイルに記述されています。
+ 例えば、メインウインドウ用の GUI は、 QMainWindow 派生クラスのコンストラクタで作成されるでしょう。
+
+ \section1 サンプルのビルド
+
+ Qt のバイナリパッケージを取得してインストールするか、Qt を自分でコンパイルした場合には既にこのチュートリアルで説明されているサンプルはビルドされ、実行する準備ができています。
+ これらを変更し再コンパイルをしたい場合は、次の手順に従う必要があります:
+
+ \list 1
+ \o コマンドラインで、再コンパイルしたいサンプルを含むディレクトリに移動します。
+ \o \c qmake と入力し、\key{Return} キーを押します。
+ うまくいかない場合は、現在のパス内にこの実行ファイルが存在することを確認するか、
+ フルパスを指定して実行してください。
+ \o Linux/Unix および Mac OS X の場合、\c make と入力し、\key{Return} キーを押します。
+ Windows 上の Visual Studio の場合、\c nmake と入力し、\key{Return} キーを押します。
+ \endlist
+
+ 現在のディレクトリに実行ファイルが生成されます。
+ Windows では、このファイルは \c debug または \c release
+ ディレクトリに配置されているかもしれません。
+ このファイルを実行すると、作業中のサンプルコードの動作を確認できます。
+*/
+
+/*!
+ \example tutorials/widgets/toplevel
+ \title ウィジェットのチュートリアル - ウィンドウの作成
+
+ 親を持たないウィジェットを作成した場合、そのウィジェットは表示時にウィンドウ(\e{トップレベルウィジェット})として扱われます。
+ このウィジェットが必要なくなった場合にそれを破棄してくれる親ウィジェットがないため、トップレベルウィジェットの管理は開発者が行ってください。
+
+ 以下のサンプルでは QWidget を使用してウィンドウを作成し、サイズを指定して表示します:
+
+ \raw HTML
+ <table align="left" width="100%">
+ <tr class="qt-code"><td>
+ \endraw
+ \snippet tutorials/widgets/toplevel/main.cpp main program
+ \raw HTML
+ </td><td align="right">
+ \endraw
+ \inlineimage widgets-tutorial-toplevel.png
+ \raw HTML
+ </td></tr>
+ </table>
+ \endraw
+
+ 実際の GUI を作成するには、ウィンドウ内にウィジェットを配置する必要があります。
+ これは、ウィジェットのコンストラクタに QWidget のインスタンスを渡すことで実現します。
+ 詳細は本チュートリアルの次の章で示します。
+*/
+
+/*!
+ \example tutorials/widgets/childwidget
+ \title ウィジェットのチュートリアル - 子ウィジェット
+
+ 前のサンプルで作成したウィンドウに子ウィジェットを追加するために、
+ 親として \c window を子ウィジェットのコンストラクタに渡します。
+ ここでは、ウィンドウにボタンを追加し特定の場所に配置します:
+
+ \raw HTML
+ <table align="left" width="100%">
+ <tr class="qt-code"><td>
+ \endraw
+ \snippet tutorials/widgets/childwidget/main.cpp main program
+ \raw HTML
+ </td><td align="right">
+ \endraw
+ \inlineimage widgets-tutorial-childwidget.png
+ \raw HTML
+ </td></tr>
+ </table>
+ \endraw
+
+ このボタンはウィンドウの子になり、
+ ウィンドウが破棄された場合にはボタンも破棄されるでしょう。
+ ウィンドウを非表示化したり閉じた際には、自動的に破棄はされません。
+ サンプルが終了する場合には破棄されるでしょう。
+*/
+
+/*!
+ \example tutorials/widgets/windowlayout
+ \title ウィジェットのチュートリアル - レイアウトの利用
+
+ 一般的に子ウィジェットは、位置とサイズを明確に指定するのではなく、
+ レイアウトオブジェクトを使用してウィンドウ内に配置します。
+ ここでは、ラベルとラインエディットを生成し、横に並べて配置します。
+
+ \raw HTML
+ <table align="left" width="100%">
+ <tr class="qt-code"><td>
+ \endraw
+ \snippet tutorials/widgets/windowlayout/main.cpp main program
+ \raw HTML
+ </td><td align="right">
+ \endraw
+ \inlineimage widgets-tutorial-windowlayout.png
+ \raw HTML
+ </td></tr>
+ </table>
+ \endraw
+
+ 生成する \c layout オブジェクトは、 \l{QHBoxLayout::}{addWidget()} 関数を使って設定されたウィジェットの位置とサイズを管理します。
+ また、\l{QWidget::}{setLayout()} を使用してレイアウトをウィンドウに設定します。
+ レイアウトはそれ自体は目には見えない存在です。
+ レイアウトの管理対象となっているウィジェット(や他のレイアウト)に対しての効果としてのみ、その存在を確認できます。
+
+ 上記サンプルにおいて、各ウィジェットの所有権はあまり明確ではありません。
+ 親オブジェクトのない3つのウィジェットと1つのレイアウトを作成するため、
+ 空のウィンドウと、ラベルとラインエディットをそれぞれ含む別々のウィンドウが表示されるように見えるかもしれません。
+ しかし、レイアウトにラベルとラインエディットを管理するように指定すると、
+ ウィンドウにそのレイアウトを設定した際に「親の再指定」が行われるため、
+ ウィジェットおよびレイアウト自体がそのウィンドウの子になります。
+*/
+
+/*!
+ \example tutorials/widgets/nestedlayouts
+ \title ウィジェットのチュートリアル - 複雑なレイアウト
+
+ ウィジェットの中に他のウィジェットを含めることができるように、
+ レイアウトは異なるレベルでのウィジェットのグループ化にも使用されます。
+ ここではウィンドウ上部にラベルとラインエディットを隣り合わせに配置し、
+ その下に検索結果が表示されるテーブルビューを表示します。
+
+ これは、レイアウトを2つ作成して行います。\c{queryLayout} は、QLabel と QLineEdit を左右に並べて表示する QHBoxLayout です。
+ \c{mainLayout} は、\c{queryLayout} と QTableView を上下に並べて表示する QVBoxLayout です。
+
+ \raw HTML
+ <table align="left" width="100%">
+ <tr class="qt-code"><td>
+ \endraw
+ \snippet tutorials/widgets/nestedlayouts/main.cpp first part
+ \snippet tutorials/widgets/nestedlayouts/main.cpp last part
+ \raw HTML
+ </td><td align="right">
+ \endraw
+ \inlineimage widgets-tutorial-nestedlayouts.png
+ \raw HTML
+ </td></tr>
+ </table>
+ \endraw
+
+ \c{mainLayout} の \l{QBoxLayout::}{addLayout()} 関数にて追加された
+ \c{queryLayout} と \c{resultView} は追加された順番で上から並べられます。
+
+ ここでは QTableView ウィジェット \c resultView に表示されるデータを含むモデルの設定のコードは省略していますが、
+ 後ほど示します。
+
+ QHBoxLayout や QVBoxLayout と共に Qt から提供される QGridLayout および QFormLayout を使用することにより、
+ より複雑なユーザインターフェースの構築が可能になります。
+ これらのレイアウトの効果は、\l{Qt Designer} を実行して確認できます。
+
+ \section1 モデルを設定する
+
+ 上記のコードでは、レイアウトの有効利用に重点を置いていたため、
+ テーブルのデータについては示していませんでした。
+ 以下のコードで、モデルには行に対応する項目が含まれ、それぞれの行には2つの列のデータが設定されていることがわかるでしょう。
+
+ \snippet tutorials/widgets/nestedlayouts/main.cpp set up the model
+
+ モデルとビューの有効利用については、\l{Item Views Examples} および
+ \l{Model/View Programming} の概要に含まれています。
+*/
diff --git a/doc/src/legal/opensourceedition.qdoc b/doc/src/legal/opensourceedition.qdoc
index d95e107648..cbd043ea7d 100644
--- a/doc/src/legal/opensourceedition.qdoc
+++ b/doc/src/legal/opensourceedition.qdoc
@@ -46,18 +46,21 @@
\ingroup licensing
\brief Information about the license and features of the Open Source Edition.
- Free (or open source) software is software that comes with a license
+ Free and Open Source Software (FOSS) is software that comes with a license
that gives users certain rights. In particular the right to use the
software, to modify it, to obtain its source, and to pass it on (under
the same terms). Notice that the term "free" is about rights, not
- money. The Free Software Foundation (creators of the GNU GPL) speaks
+ money. The Free Software Foundation, the creator of the GNU GPL, speaks
of free in this context as in "free speech", not as in "no cost".
Nokia supports the free software concept by providing the Qt Open Source
Edition, which is licensed under the \l{GNU General Public License (GPL)}
(version 3) and the \l{GNU Lesser General Public License (LGPL)} (version 2.1).
You can use this edition of Qt to create and distribute software with licenses
- that are compatible to these free software licenses.
+ that are compatible with these free software licenses.
+
+ Additionally, the \l{Qt Examples}{examples} included with Qt are provided under
+ the terms of the \l{BSD License}.
The support of open source with the Open Source Versions of Qt has enabled large
successful software projects like KDE to thrive, with thousands of developers
@@ -73,8 +76,8 @@
More information on Free and Open Source software is available online:
\list
- \o GNU GPL: \l http://www.gnu.org/.
- \o Open Source licensing: \l http://www.opensource.org/.
+ \o GNU GPL, GNU LGPL: \l http://www.gnu.org/
+ \o Open Source licensing: \l http://www.opensource.org/
\endlist
See \l{Licensing Information} for a collection of documents about licenses
@@ -85,6 +88,5 @@
the sales department at http://qt.nokia.com/contact.
If you are in doubt what edition of Qt is right for your project,
- please contact
- \l{mailto:qt-info@nokia.com}{qt-info@nokia.com}.
+ please contact \l{mailto:qt-info@nokia.com}{qt-info@nokia.com}.
*/
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc
index 1ab1c000c2..2c0744bc81 100644
--- a/doc/src/modules.qdoc
+++ b/doc/src/modules.qdoc
@@ -41,7 +41,7 @@
/*!
\group modules
- \title All Qt Modules
+ \title All Modules
\startpage index.html Qt Reference Documentation
\nextpage QtCore
@@ -96,8 +96,8 @@
/*!
\module QtCore
\title QtCore Module
- \contentspage All Qt Modules
- \previouspage All Qt Modules
+ \contentspage All Modules
+ \previouspage All Modules
\nextpage QtGui
\ingroup modules
@@ -115,7 +115,7 @@
/*!
\module QtGui
\title QtGui Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -132,7 +132,7 @@
\module QtMultimedia
\page qtmultimedia-module.html
\title QtMultimedia Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -156,7 +156,7 @@
/*!
\module QtNetwork
\title QtNetwork Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtMultimedia
\nextpage QtOpenGL
\ingroup modules
@@ -178,7 +178,7 @@
/*!
\module QtOpenGL
\title QtOpenGL Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtNetwork
\nextpage QtOpenVG
\ingroup modules
@@ -231,7 +231,7 @@
\module QtOpenVG
\title QtOpenVG Module
\since 4.6
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtOpenGL
\nextpage QtScript
\ingroup modules
@@ -286,7 +286,7 @@
\module QtScript
\title QtScript Module
\since 4.3
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtOpenVG
\nextpage QtScriptTools
\ingroup modules
@@ -346,7 +346,7 @@
\module QtScriptTools
\title QtScriptTools Module
\since 4.5
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtScript
\nextpage QtSql
\ingroup modules
@@ -370,7 +370,7 @@
/*!
\module QtSql
\title QtSql Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtScript
\nextpage QtSvg
\ingroup modules
@@ -393,7 +393,7 @@
\module QtSvg
\title QtSvg Module
\since 4.1
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtSql
\nextpage QtWebKit
\ingroup modules
@@ -444,7 +444,7 @@
/*!
\module QtXml
\title QtXml Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtSvg
\nextpage QtXmlPatterns
\ingroup modules
@@ -471,7 +471,7 @@
\module QtXmlPatterns
\title QtXmlPatterns Module
\since 4.4
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtXml
\nextpage Phonon Module
\ingroup modules
@@ -551,7 +551,7 @@
\page phonon-module.html
\module Phonon
\title Phonon Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtXmlPatterns
\nextpage Qt3Support
\ingroup modules
@@ -621,7 +621,7 @@
/*!
\module Qt3Support
\title Qt3Support Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage Phonon Module
\nextpage QtDesigner
\ingroup modules
@@ -654,7 +654,7 @@
/*!
\module QtDesigner
\title QtDesigner Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage Qt3Support
\nextpage QtUiTools
\ingroup modules
@@ -681,7 +681,7 @@
\module QtUiTools
\title QtUiTools Module
\since 4.1
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtDesigner
\nextpage QtHelp
\ingroup modules
@@ -717,7 +717,7 @@
/*!
\module QtHelp
\title QtHelp Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtUiTools
\nextpage QtTest
\ingroup modules
@@ -776,7 +776,7 @@
/*!
\module QtTest
\title QtTest Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtHelp
\nextpage QAxContainer
\ingroup modules
@@ -806,7 +806,7 @@
/*!
\module QAxContainer
\title QAxContainer Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtTest
\nextpage QAxServer
\ingroup modules
@@ -858,7 +858,7 @@
/*!
\module QAxServer
\title QAxServer Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QAxContainer
\nextpage QtDBus module
\ingroup modules
@@ -910,7 +910,7 @@
/*!
\module QtDBus
\title QtDBus module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QAxServer
\ingroup modules
diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc
index 10d697a709..b10481e53a 100644
--- a/doc/src/network-programming/bearermanagement.qdoc
+++ b/doc/src/network-programming/bearermanagement.qdoc
@@ -40,12 +40,11 @@
****************************************************************************/
/*!
-\page bearer-management.html
+ \page bearer-management.html
-\title Bearer Management
-\brief An API to control the system's connectivity state.
-
-\ingroup network
+ \title Bearer Management
+ \ingroup qt-network
+ \brief An API to control the system's connectivity state.
Bearer Management controls the connectivity state of the system so that
the user can start or stop interfaces or roam transparently between
diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc
index 36f48cf45e..91348092cf 100644
--- a/doc/src/network-programming/qtnetwork.qdoc
+++ b/doc/src/network-programming/qtnetwork.qdoc
@@ -50,6 +50,7 @@
/*!
\page network-programming.html
\title Network Programming
+ \ingroup qt-network
\brief An Introduction to Network Programming with Qt
The QtNetwork module offers classes that allow you to write TCP/IP clients
diff --git a/doc/src/network-programming/ssl.qdoc b/doc/src/network-programming/ssl.qdoc
index 2feb7b654d..7f365a9f45 100644
--- a/doc/src/network-programming/ssl.qdoc
+++ b/doc/src/network-programming/ssl.qdoc
@@ -40,11 +40,11 @@
****************************************************************************/
/*!
- \group ssl
+ \page ssl.html
\title Secure Sockets Layer (SSL) Classes
- \ingroup groups
-
\brief Classes for secure communication over network sockets.
+ \ingroup qt-network
+
\keyword SSL
The classes below provide support for secure network communication using
diff --git a/doc/src/objectmodel/metaobjects.qdoc b/doc/src/objectmodel/metaobjects.qdoc
index c1b0ea66e0..f6fcc44885 100644
--- a/doc/src/objectmodel/metaobjects.qdoc
+++ b/doc/src/objectmodel/metaobjects.qdoc
@@ -41,9 +41,11 @@
/*!
\page metaobjects.html
- \title Meta-Object System
+ \title The Meta-Object System
+ \ingroup qt-basic-concepts
\brief An overview of Qt's meta-object system and introspection capabilities.
\keyword meta-object
+ \target Meta-Object System
Qt's meta-object system provides the signals and slots mechanism for
inter-object communication, run-time type information, and the dynamic
diff --git a/doc/src/objectmodel/object.qdoc b/doc/src/objectmodel/object.qdoc
index 2f06004217..8ae91ec773 100644
--- a/doc/src/objectmodel/object.qdoc
+++ b/doc/src/objectmodel/object.qdoc
@@ -41,11 +41,10 @@
/*!
\page object.html
- \title Qt Object Model
+ \title Object Model
+ \ingroup qt-basic-concepts
\brief A description of the powerful features made possible by Qt's dynamic object model.
- \ingroup frameworks-technologies
-
The standard C++ object model provides very efficient runtime
support for the object paradigm. But its static nature is
inflexibile in certain problem domains. Graphical user interface
@@ -60,11 +59,11 @@
communication called \l{signals and slots}
\o queryable and designable \l{Qt's Property System}{object
properties}
- \o powerful \l{events and event filters}
+ \o powerful \l{The Event System}{events and event filters}
\o contextual \l{i18n}{string translation for internationalization}
\o sophisticated interval driven \l timers that make it possible
to elegantly integrate many tasks in an event-driven GUI
- \o hierarchical and queryable \l{Object Trees and Object Ownership}{object
+ \o hierarchical and queryable \l{Object Trees & Ownership}{object
trees} that organize object ownership in a natural way
\o guarded pointers (QPointer) that are automatically
set to 0 when the referenced object is destroyed, unlike normal C++
@@ -114,7 +113,7 @@
\o might have a unique \l{QObject::objectName()}. If we copy a Qt
Object, what name should we give the copy?
- \o has a location in an \l{Object Trees and Object Ownership}
+ \o has a location in an \l{Object Trees & Ownership}
{object hierarchy}. If we copy a Qt Object, where should the copy
be located?
diff --git a/doc/src/objectmodel/objecttrees.qdoc b/doc/src/objectmodel/objecttrees.qdoc
index 11824aec55..97d646a7cb 100644
--- a/doc/src/objectmodel/objecttrees.qdoc
+++ b/doc/src/objectmodel/objecttrees.qdoc
@@ -41,7 +41,8 @@
/*!
\page objecttrees.html
- \title Object Trees and Object Ownership
+ \title Object Trees & Ownership
+ \ingroup qt-basic-concepts
\brief Information about the parent-child pattern used to describe
object ownership in Qt.
diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc
index a807caf2db..7f876c3f18 100644
--- a/doc/src/objectmodel/properties.qdoc
+++ b/doc/src/objectmodel/properties.qdoc
@@ -41,8 +41,10 @@
/*!
\page properties.html
- \title Qt's Property System
+ \title The Property System
+ \ingroup qt-basic-concepts
\brief An overview of Qt's property system.
+ \target Qt's Property System
Qt provides a sophisticated property system similar to the ones
supplied by some compiler vendors. However, as a compiler- and
diff --git a/doc/src/objectmodel/signalsandslots.qdoc b/doc/src/objectmodel/signalsandslots.qdoc
index 0f3f618426..f33badf908 100644
--- a/doc/src/objectmodel/signalsandslots.qdoc
+++ b/doc/src/objectmodel/signalsandslots.qdoc
@@ -41,7 +41,8 @@
/*!
\page signalsandslots.html
- \title Signals and Slots
+ \title Signals & Slots
+ \ingroup qt-basic-concepts
\brief An overview of Qt's signals and slots inter-object
communication mechanism.
diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc
index 7302e30a34..c3c59af4ab 100644
--- a/doc/src/overviews.qdoc
+++ b/doc/src/overviews.qdoc
@@ -48,26 +48,97 @@
*/
/*!
- \group frameworks-technologies
- \title Frameworks and Technologies
+ \group qt-basic-concepts
+ \title Basic Qt Architecture
- \brief Documentation about the frameworks and technologies in Qt
+ \brief The basic architecture of the Qt cross-platform application and UI framework.
- These documents dive into the frameworks of classes that Qt provides,
- and provide background information about the technical solutions used
- in Qt's architecture.
+ Qt is a cross-platform application and UI framework for writing
+ web-enabled applications for desktop, mobile, and embedded
+ operating systems. These pages explain basic architectural
+ concepts of Qt:
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-gui-concepts
+ \title Qt Desktop UI Components
+
+ \brief The Qt components for constructing native look & feel desktop UI's.
+
+ These pages are about Qt's traditional set of GUI components for
+ building both native look ^ feel and custom UI's for the desktop
+ environment. Use \l {declarativeui.html} {Qt Quick} for building
+ UI's for mobile devices.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-graphics
+ \title Qt Graphics and Painting
+
+ \brief The Qt components for doing graphics.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-network
+ \title Network programming with Qt
+
+ \brief The these pages are about Qt's support for network programming.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group technology-apis
+ \title Qt API's for other technologies
+
+ These pages document Qt's API's for some widely-used standards and
+ technologies.
\generatelist{related}
*/
/*!
+ \group qt-activex
+ \title Qt For ActiveX
+ \brief Qt API's for using ActiveX controls, servers, and COM.
+ \ingroup technology-apis
+ \ingroup platform-specific
+
+ These pages document Qt's API's for developing with ActiveX
+ controls, servers, and COM.
+
+ \generatelist{related}
+*/
+
+/*!
+ \group qt-sql
+ \title Using SQL in Qt
+ \brief Qt API's for using SQL.
+ \ingroup technology-apis
+ \ingroup best-practices
+
+ These pages document Qt's API's for using SQL database systems
+ in Qt applications.
+
+ \generatelist{related}
+*/
+
+/*!
\group best-practices
\title How-To's and Best Practices
\brief How-To Guides and Best Practices
- These documents provide guidelines and best practices explaining
- how to use Qt to solve specific technical problems.
+ These documents provide guidelines and best practices for using Qt
+ to solve specific technical problems. They are listed
+ alphabetically by the first word in the title, so scan the entire
+ list to find what you want.
\generatelist{related}
*/
diff --git a/doc/src/painting-and-printing/coordsys.qdoc b/doc/src/painting-and-printing/coordsys.qdoc
index 5807f57146..d6714b809e 100644
--- a/doc/src/painting-and-printing/coordsys.qdoc
+++ b/doc/src/painting-and-printing/coordsys.qdoc
@@ -41,14 +41,11 @@
/*!
\page coordsys.html
- \title The Coordinate System
+ \title Coordinate System
+ \ingroup qt-graphics
\brief Information about the coordinate system used by the paint
system.
- \previouspage Drawing and Filling
- \contentspage The Paint System
- \nextpage Reading and Writing Image Files
-
The coordinate system is controlled by the QPainter
class. Together with the QPaintDevice and QPaintEngine classes,
QPainter form the basis of Qt's painting system, Arthur. QPainter
diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc
index 802751f3d2..c106f35923 100644
--- a/doc/src/painting-and-printing/paintsystem.qdoc
+++ b/doc/src/painting-and-printing/paintsystem.qdoc
@@ -60,7 +60,9 @@
/*!
\page paintsystem.html
- \title The Paint System
+ \title Paint System
+ \brief A system for painting on the screen or on print devices using the same API
+ \ingroup qt-graphics
\ingroup frameworks-technologies
Qt's paint system enables painting on screen and print devices
@@ -87,7 +89,7 @@
\o \l{Classes for Painting}
\o \l{Paint Devices and Backends}
\o \l{Drawing and Filling}
- \o \l{The Coordinate System}
+ \o \l{Coordinate System}
\o \l{Reading and Writing Image Files}
\o \l{Styling}
\o \l{Printing with Qt}
@@ -337,10 +339,10 @@
Normally, QPainter draws in a "natural" coordinate system, but it
is able to perform view and world transformations using the
- QTransform class. For more information, see \l {The Coordinate
- System} documentation which also describes the rendering process,
- i.e. the relation between the logical representation and the
- rendered pixels, and the benefits of anti-aliased painting.
+ QTransform class. For more information, see \l {Coordinate
+ System}, which also describes the rendering process, i.e. the
+ relation between the logical representation and the rendered
+ pixels, and the benefits of anti-aliased painting.
\table 100%
\row \o
@@ -566,5 +568,5 @@
\endtable
For more information about widget styling and appearance, see the
- documentation about \l{Implementing Styles and Style Aware Widgets}.
+ \l{Styles &amp Style Aware Widgets}.
*/
diff --git a/doc/src/painting-and-printing/printing.qdoc b/doc/src/painting-and-printing/printing.qdoc
index 3d6ade23c7..6dad097cd3 100644
--- a/doc/src/painting-and-printing/printing.qdoc
+++ b/doc/src/painting-and-printing/printing.qdoc
@@ -49,6 +49,7 @@
/*!
\page printing.html
\title Printing with Qt
+ \ingroup qt-graphics
\previouspage Styling
\contentspage The Paint System
diff --git a/doc/src/platforms/emb-openvg.qdocinc b/doc/src/platforms/emb-openvg.qdocinc
index 2f9cc21d61..877d70cc91 100644
--- a/doc/src/platforms/emb-openvg.qdocinc
+++ b/doc/src/platforms/emb-openvg.qdocinc
@@ -135,8 +135,25 @@ transformations for non-image elements in performance critical code.
\endlist
The other members of QPainter::CompositionMode are not supported
-because OpenVG 1.1 does not have an equivalent in its \c VGBlendMode
-enumeration. Any attempt to set an unsupported mode will result in
+unless the \c{VG_KHR_advanced_blending} extension is present,
+in which case the following additional modes are supported:
+
+\list
+\o QPainter::CompositionMode_Overlay
+\o QPainter::CompositionMode_ColorDodge
+\o QPainter::CompositionMode_ColorBurn
+\o QPainter::CompositionMode_HardLight
+\o QPainter::CompositionMode_SoftLight
+\o QPainter::CompositionMode_Difference
+\o QPainter::CompositionMode_Exclusion
+\o QPainter::CompositionMode_SourceOut
+\o QPainter::CompositionMode_DestinationOut
+\o QPainter::CompositionMode_SourceAtop
+\o QPainter::CompositionMode_DestinationAtop
+\o QPainter::CompositionMode_Xor
+\endlist
+
+Any attempt to set an unsupported mode will result in
the actual mode being set to QPainter::CompositionMode_SourceOver.
Client applications should avoid using unsupported modes.
@@ -208,7 +225,9 @@ The QVG_NO_RENDER_TO_MASK define will disable the use of vgRenderToMask().
The QVG_SCISSOR_CLIP define will disable clipping with vgMask() or
vgRenderToMask() and instead use the scissor rectangle list to perform
-clipping. Clipping with an arbitrary QPainterPath will not be supported.
+clipping. Clipping with an arbitrary QPainterPath will need to convert
+the path into a series of rectangles. If the number of rectangles
+exceeds VG_MAX_SCISSOR_RECTS, then the results will not be exact.
The QVG_SCISSOR_CLIP define should only be used if the OpenVG engine does
not support vgMask() or vgRenderToMask().
diff --git a/doc/src/platforms/emb-qvfb.qdoc b/doc/src/platforms/emb-qvfb.qdoc
index bcadb73c50..ceec027d09 100644
--- a/doc/src/platforms/emb-qvfb.qdoc
+++ b/doc/src/platforms/emb-qvfb.qdoc
@@ -146,17 +146,13 @@
\list
\o ClamshellPhone
- \o pda
- \o PDAPhone
- \o Qt ExtendedPDA
- \o Qt ExtendedPhone-Advanced
- \o Qt ExtendedPhone-Simple
+ \o PortableMedia
+ \o S60-nHD-Touchscreen
+ \o S60-QVGA-Candybar
\o SmartPhone
\o SmartPhone2
\o SmartPhoneWithButtons
\o TouchscreenPhone
- \o Trolltech-Keypad
- \o Trolltech-Touchscreen
\endlist
In addition, it is possible to create custom skins.
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc
index 8f5b6a558f..16e0c0ff77 100644
--- a/doc/src/platforms/platform-notes.qdoc
+++ b/doc/src/platforms/platform-notes.qdoc
@@ -517,7 +517,7 @@
Note that some modules rely on other modules. If your application uses
QtXmlPatterns, QtWebkit or QtScript it may still require \c NetworkServices
- \o as these modules rely on QtNetwork to go online.
+ as these modules rely on QtNetwork to go online.
For more information see the documentation of the individual Qt classes. If
a class does not mention Symbian capabilities, it requires none.
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index 591d6f18dd..316764b7c6 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -127,6 +127,7 @@
\row \o \c run \o Run the application on the emulator.
\row \o \c runonphone \o Run the application on a device.
\row \o \c sis \o Create signed \c .sis file for project.
+ \row \o \c unsigned_sis \o Create unsigned \c .sis file for project.
\row \o \c installer_sis \o Create signed \l{Smart Installer}{smart installer}
\c .sis file for project.
Smart installer will attempt to download
@@ -191,7 +192,11 @@
\table
\row \o -i \o Install the package right away using PC suite.
\row \o -p \o Only preprocess the template \c .pkg file.
- \row \o -c=<file> \o Read certificate information from a file.
+ \row \o -c <file> \o Read certificate information from a file.
+ \row \o -u \o Preserves unsigned package.
+ \row \o -o \o Creates only unsigned package.
+ \row \o -s \o Generates stub sis for ROM.
+ \row \o -n <name> \o Specifies the final sis name.
\endtable
Execute the \c{createpackage.pl} script without any
diff --git a/doc/src/porting/porting4-canvas.qdoc b/doc/src/porting/porting4-canvas.qdoc
index b69f53b5d6..592f430888 100644
--- a/doc/src/porting/porting4-canvas.qdoc
+++ b/doc/src/porting/porting4-canvas.qdoc
@@ -56,7 +56,7 @@
number of custom-made 2D graphical items, and a view widget for
visualizing the items, with support for zooming and rotation. Graphics
View was introduced in Qt 4.2, replacing its predecessor, QCanvas. For
- more on Graphics View, see \l{The Graphics View Framework}.
+ more on Graphics View, see \l{Graphics View Framework}.
This document walks through the steps needed, class by class and function
by function, to port a QCanvas application to Graphics View.
diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc
index 1b6eeb7729..75fe844564 100644
--- a/doc/src/porting/porting4.qdoc
+++ b/doc/src/porting/porting4.qdoc
@@ -1000,8 +1000,8 @@
\row \o \c QCanvasView \o Q3CanvasView
\endtable
- \l{The Graphics View Framework} replaces QCanvas. For more on porting to
- Graphics View, see \l{Porting to Graphics View}.
+ The \l{Graphics View Framework} replaces QCanvas. For more on
+ porting to Graphics View, see \l{Porting to Graphics View}.
\section1 QColor
diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc
index 2c229891e1..1f203a6c17 100644
--- a/doc/src/scripting/scripting.qdoc
+++ b/doc/src/scripting/scripting.qdoc
@@ -362,7 +362,7 @@
By default, the script engine does not take ownership of the
QObject that is passed to QScriptEngine::newQObject(); the object
is managed according to Qt's object ownership (see
- \l{Object Trees and Object Ownership}). This mode is appropriate
+ \l{Object Trees & Ownership}). This mode is appropriate
when, for example, you are wrapping C++ objects that are part of
your application's core; that is, they should persist regardless of
what happens in the scripting environment. Another way of stating
@@ -627,9 +627,9 @@
To completely understand how to make C++ objects available to Qt
Script, some basic knowledge of the Qt meta-object system is very
- helpful. We recommend that you read the \l{Qt Object Model}. The
- information in this document and the documents it links to are very
- useful for understanding how to implement application objects.
+ helpful. We recommend that you read about the Qt \l{Object Model}
+ and \l{The Meta-Object System}, which are useful for understanding
+ how to implement application objects.
However, this knowledge is not essential in the simplest cases.
To make an object available in QtScript, it must derive from
diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
index 22ea2401d8..e3ad483d6c 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
@@ -67,3 +67,23 @@ beginInsertColumns(parent, 6, 8);
//! [5]
beginRemoveColumns(parent, 4, 6);
//! [5]
+
+
+//! [6]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 2);
+//! [6]
+
+
+//! [7]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 6);
+//! [7]
+
+
+//! [8]
+beginMoveRows(parent, 2, 2, parent, 0);
+//! [8]
+
+
+//! [9]
+beginMoveRows(parent, 2, 2, parent, 4);
+//! [9]
diff --git a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
index 4f2766108a..81099a7308 100644
--- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
+++ b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp
@@ -271,3 +271,9 @@ class QGraphicsPathItem : public QAbstractGraphicsShapeItem
};
//! [18]
+//! [19]
+QTransform xform = item->deviceTransform(view->viewportTransform());
+QRect deviceRect = xform.mapRect(rect).toAlignedRect();
+view->viewport()->scroll(dx, dy, deviceRect);
+//! [19]
+
diff --git a/doc/src/snippets/declarative/Sprite.qml b/doc/src/snippets/declarative/Sprite.qml
new file mode 100644
index 0000000000..5f32b0ae80
--- /dev/null
+++ b/doc/src/snippets/declarative/Sprite.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle { width: 80; height: 50; color: "red" }
+//![0]
diff --git a/doc/src/snippets/declarative/anchorchanges.qml b/doc/src/snippets/declarative/anchorchanges.qml
new file mode 100644
index 0000000000..993618bc98
--- /dev/null
+++ b/doc/src/snippets/declarative/anchorchanges.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: window
+ width: 120; height: 120
+ color: "black"
+
+ Rectangle { id: myRect; width: 50; height: 50; color: "red" }
+
+ states: State {
+ name: "reanchored"
+
+ AnchorChanges {
+ target: myRect
+ anchors.top: window.top
+ anchors.bottom: window.bottom
+ }
+ PropertyChanges {
+ target: myRect
+ anchors.topMargin: 10
+ anchors.bottomMargin: 10
+ }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/animation.qml b/doc/src/snippets/declarative/animation.qml
new file mode 100644
index 0000000000..65acd36e8e
--- /dev/null
+++ b/doc/src/snippets/declarative/animation.qml
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+Row {
+
+//![property-anim-1]
+Rectangle {
+ id: rect
+ width: 120; height: 200
+
+ Image {
+ id: img
+ source: "pics/qt.png"
+ x: 60 - img.width/2
+ y: 0
+
+ SequentialAnimation on y {
+ loops: Animation.Infinite
+ NumberAnimation { to: 200 - img.height; easing.type: Easing.OutBounce; duration: 2000 }
+ PauseAnimation { duration: 1000 }
+ NumberAnimation { to: 0; easing.type: Easing.OutQuad; duration: 1000 }
+ }
+ }
+}
+//![property-anim-1]
+
+//![property-anim-2]
+Rectangle {
+ width: 200; height: 200
+
+ Rectangle {
+ color: "red"
+ width: 50; height: 50
+ NumberAnimation on x { to: 50 }
+ }
+}
+//![property-anim-2]
+
+
+Item {
+//![property-anim-3]
+PropertyAnimation {
+ id: animation
+ target: image
+ property: "scale"
+ from: 1; to: 0.5
+}
+
+Image {
+ id: image
+ source: "pics/qt.png"
+ MouseArea {
+ anchors.fill: parent
+ onPressed: animation.start()
+ }
+}
+//![property-anim-3]
+}
+
+
+//![transitions-1]
+transitions: [
+ Transition {
+ NumberAnimation {
+ properties: "x,y"
+ easing.type: Easing.OutBounce
+ duration: 200
+ }
+ }
+]
+//![transitions-1]
+
+
+//![transitions-2]
+Transition {
+ from: "*"
+ to: "MyState"
+ reversible: true
+
+ SequentialAnimation {
+ NumberAnimation {
+ duration: 1000
+ easing.type: Easing.OutBounce
+
+ // animate myItem's x and y if they have changed in the state
+ target: myItem
+ properties: "x,y"
+ }
+
+ NumberAnimation {
+ duration: 1000
+
+ // animate myItem2's y to 200, regardless of what happens in the state
+ target: myItem2
+ property: "y"
+ to: 200
+ }
+ }
+}
+//![transitions-2]
+
+
+//![transitions-3]
+Transition {
+ from: "*"
+ to: "MyState"
+ reversible: true
+
+ SequentialAnimation {
+ ColorAnimation { duration: 1000 }
+ PauseAnimation { duration: 1000 }
+
+ ParallelAnimation {
+ NumberAnimation {
+ duration: 1000
+ easing.type: Easing.OutBounce
+ targets: box1
+ properties: "x,y"
+ }
+ NumberAnimation {
+ duration: 1000
+ targets: box2
+ properties: "x,y"
+ }
+ }
+ }
+}
+//![transitions-3]
+
+//![behavior]
+Rectangle {
+ id: redRect
+ color: "red"
+ width: 100; height: 100
+
+ Behavior on x {
+ NumberAnimation { duration: 300; easing.type: Easing.InOutQuad }
+ }
+}
+//![behavior]
+
+}
diff --git a/doc/src/snippets/declarative/border-image.qml b/doc/src/snippets/declarative/border-image.qml
deleted file mode 100644
index 9c4247ed50..0000000000
--- a/doc/src/snippets/declarative/border-image.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- id: page
- color: "white"
- width: 520; height: 280
-
- Row {
- anchors.centerIn: parent
- spacing: 50
-//! [0]
-BorderImage {
- width: 180; height: 180
- border { left: 30; top: 30; right: 30; bottom: 30 }
- horizontalTileMode: BorderImage.Stretch
- verticalTileMode: BorderImage.Stretch
- source: "content/colors.png"
-}
-
-BorderImage {
- width: 180; height: 180
- border { left: 30; top: 30; right: 30; bottom: 30 }
- horizontalTileMode: BorderImage.Round
- verticalTileMode: BorderImage.Round
- source: "content/colors.png"
-}
-//! [0]
- }
-}
diff --git a/doc/src/snippets/declarative/borderimage.qml b/doc/src/snippets/declarative/borderimage.qml
new file mode 100644
index 0000000000..62b6def536
--- /dev/null
+++ b/doc/src/snippets/declarative/borderimage.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 520; height: 280
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 50
+//! [0]
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ horizontalTileMode: BorderImage.Stretch
+ verticalTileMode: BorderImage.Stretch
+ source: "content/colors.png"
+}
+
+BorderImage {
+ width: 180; height: 180
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ horizontalTileMode: BorderImage.Round
+ verticalTileMode: BorderImage.Round
+ source: "content/colors.png"
+}
+//! [0]
+ }
+}
diff --git a/doc/src/snippets/declarative/codingconventions/dotproperties.qml b/doc/src/snippets/declarative/codingconventions/dotproperties.qml
index 942b0b1bcc..69743bad24 100644
--- a/doc/src/snippets/declarative/codingconventions/dotproperties.qml
+++ b/doc/src/snippets/declarative/codingconventions/dotproperties.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
Item {
diff --git a/doc/src/snippets/declarative/codingconventions/javascript-imports.qml b/doc/src/snippets/declarative/codingconventions/javascript-imports.qml
index 417366c694..86d8b69bc2 100644
--- a/doc/src/snippets/declarative/codingconventions/javascript-imports.qml
+++ b/doc/src/snippets/declarative/codingconventions/javascript-imports.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
//![0]
diff --git a/doc/src/snippets/declarative/codingconventions/javascript.qml b/doc/src/snippets/declarative/codingconventions/javascript.qml
index 64b5a4001f..39885dbb9c 100644
--- a/doc/src/snippets/declarative/codingconventions/javascript.qml
+++ b/doc/src/snippets/declarative/codingconventions/javascript.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
Rectangle {
diff --git a/doc/src/snippets/declarative/codingconventions/lists.qml b/doc/src/snippets/declarative/codingconventions/lists.qml
index 63e81002b1..55a50c63ea 100644
--- a/doc/src/snippets/declarative/codingconventions/lists.qml
+++ b/doc/src/snippets/declarative/codingconventions/lists.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
Item {
diff --git a/doc/src/snippets/declarative/codingconventions/photo.qml b/doc/src/snippets/declarative/codingconventions/photo.qml
index c28c2c985a..5421a8b188 100644
--- a/doc/src/snippets/declarative/codingconventions/photo.qml
+++ b/doc/src/snippets/declarative/codingconventions/photo.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
//! [0]
diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
index ab1bbc9b18..9873cbec90 100644
--- a/doc/src/snippets/declarative/comments.qml
+++ b/doc/src/snippets/declarative/comments.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
Text {
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
new file mode 100644
index 0000000000..25bc10cc89
--- /dev/null
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -0,0 +1,47 @@
+//![0]
+var component;
+var sprite;
+
+function finishCreation() {
+ if (component.status == Component.Ready) {
+ sprite = component.createObject(appWindow);
+ if (sprite == null) {
+ // Error Handling
+ } else {
+ sprite.x = 100;
+ sprite.y = 100;
+ // ...
+ }
+ } else if (component.status == Component.Error) {
+ // Error Handling
+ console.log("Error loading component:", component.errorString());
+ }
+}
+//![0]
+
+function createSpriteObjects() {
+
+//![1]
+component = Qt.createComponent("Sprite.qml");
+if (component.status == Component.Ready)
+ finishCreation();
+else
+ component.statusChanged.connect(finishCreation);
+//![1]
+
+//![2]
+component = Qt.createComponent("Sprite.qml");
+sprite = component.createObject(appWindow);
+
+if (sprite == null) {
+ // Error Handling
+ console.log("Error loading component:", component.errorString());
+} else {
+ sprite.x = 100;
+ sprite.y = 100;
+ // ...
+}
+//![2]
+
+}
+
diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml
new file mode 100644
index 0000000000..3686188c45
--- /dev/null
+++ b/doc/src/snippets/declarative/createComponent.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+import "componentCreation.js" as MyModule
+
+Rectangle {
+ id: appWindow
+ width: 300; height: 300
+
+ Component.onCompleted: MyModule.createSpriteObjects();
+}
+//![0]
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h b/doc/src/snippets/declarative/createQmlObject.qml
index 73d66b75f5..f274e40f34 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -38,18 +38,22 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
-#include <QGraphicsWidget>
-#include <QPainter>
-class BlueCircle : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
- {
- painter->setPen(QColor(Qt::blue));
- painter->drawEllipse(0, 0, size().width(), size().height());
- }
-};
+import Qt 4.7
+
+Rectangle {
+ id: parentItem
+ property QtObject newObject
+
+ width: 100
+ height: 100
+
+ function createIt() {
//![0]
+newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
+ parentItem, "dynamicSnippet1");
+//![0]
+ }
+
+ Component.onCompleted: createIt()
+}
diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml
deleted file mode 100644
index 9465efb531..0000000000
--- a/doc/src/snippets/declarative/drag.qml
+++ /dev/null
@@ -1,18 +0,0 @@
-import Qt 4.7
-
-//! [0]
-Rectangle {
- id: blurtest; width: 600; height: 200; color: "white"
- Image {
- id: pic; source: "qtlogo-64.png"; anchors.verticalCenter: parent.verticalCenter
- opacity: (600.0-pic.x) / 600;
- MouseArea {
- anchors.fill: parent
- drag.target: pic
- drag.axis: "XAxis"
- drag.minimumX: 0
- drag.maximumX: blurtest.width-pic.width
- }
- }
-}
-//! [0]
diff --git a/doc/src/snippets/declarative/dynamicObjects.qml b/doc/src/snippets/declarative/dynamicObjects.qml
new file mode 100644
index 0000000000..1d1de6c55a
--- /dev/null
+++ b/doc/src/snippets/declarative/dynamicObjects.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+//![0]
+Rectangle {
+ id: rootItem
+ width: 300
+ height: 300
+
+ Component {
+ id: rectComponent
+
+ Rectangle {
+ id: rect
+ width: 40; height: 40;
+ color: "red"
+
+ NumberAnimation on opacity { from: 1; to: 0; duration: 1000 }
+
+ Component.onCompleted: rect.destroy(1000);
+ }
+ }
+
+ function createRectangle() {
+ var object = rectComponent.createObject(rootItem);
+ }
+
+ Component.onCompleted: createRectangle()
+}
+//![0]
diff --git a/doc/src/snippets/declarative/flickableScrollbar.qml b/doc/src/snippets/declarative/flickableScrollbar.qml
new file mode 100644
index 0000000000..7f92c524d8
--- /dev/null
+++ b/doc/src/snippets/declarative/flickableScrollbar.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+//![0]
+Rectangle {
+ width: 200; height: 200
+
+ Flickable {
+ id: flickable
+//![0]
+ anchors.fill: parent
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "pics/qt.png" }
+//![1]
+ }
+
+ Rectangle {
+ id: scrollbar
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: 10
+ height: flickable.visibleArea.heightRatio * flickable.height
+ color: "black"
+ }
+}
+//![1]
diff --git a/doc/src/snippets/declarative/flipable.qml b/doc/src/snippets/declarative/flipable.qml
index ae743450f1..f4e6b6f6ac 100644
--- a/doc/src/snippets/declarative/flipable.qml
+++ b/doc/src/snippets/declarative/flipable.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
//! [0]
import Qt 4.7
diff --git a/doc/src/snippets/declarative/focusscopes.qml b/doc/src/snippets/declarative/focusscopes.qml
new file mode 100644
index 0000000000..557d72f986
--- /dev/null
+++ b/doc/src/snippets/declarative/focusscopes.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+//![0]
+Rectangle {
+ color: "lightsteelblue"; width: 240; height: 320
+
+ ListView {
+ anchors.fill: parent
+ focus: true
+
+ model: ListModel {
+ ListElement { name: "Bob" }
+ ListElement { name: "John" }
+ ListElement { name: "Michael" }
+ }
+
+ delegate: FocusScope {
+ width: childrenRect.width; height: childrenRect.height
+ TextInput {
+ focus: true
+ text: name
+ Keys.onReturnPressed: console.log(name)
+ }
+ }
+ }
+ }
+//![0]
diff --git a/doc/src/snippets/declarative/folderlistmodel.qml b/doc/src/snippets/declarative/folderlistmodel.qml
new file mode 100644
index 0000000000..9809e44ccc
--- /dev/null
+++ b/doc/src/snippets/declarative/folderlistmodel.qml
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+import Qt.labs.folderlistmodel 1.0
+
+ListView {
+ FolderListModel {
+ id: foldermodel
+ nameFilters: ["*.qml"]
+ }
+ Component {
+ id: filedelegate
+ Text { text: fileName }
+ }
+ model: foldermodel
+ delegate: filedelegate
+}
+//![0]
diff --git a/doc/src/snippets/declarative/gradient.qml b/doc/src/snippets/declarative/gradient.qml
index 168398d34f..7a68233e3b 100644
--- a/doc/src/snippets/declarative/gradient.qml
+++ b/doc/src/snippets/declarative/gradient.qml
@@ -1,5 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import Qt 4.7
+//![code]
Rectangle {
width: 100; height: 100
gradient: Gradient {
@@ -8,3 +50,4 @@ Rectangle {
GradientStop { position: 1.0; color: "green" }
}
}
+//![code]
diff --git a/doc/src/snippets/declarative/gridview/ContactModel.qml b/doc/src/snippets/declarative/gridview/ContactModel.qml
new file mode 100644
index 0000000000..2da4660bb2
--- /dev/null
+++ b/doc/src/snippets/declarative/gridview/ContactModel.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+ListModel {
+
+ ListElement {
+ name: "Jim Williams"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "John Brown"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Bill Smyth"
+ portrait: "pics/portrait.png"
+ }
+ ListElement {
+ name: "Sam Wise"
+ portrait: "pics/portrait.png"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
deleted file mode 100644
index 90f139db23..0000000000
--- a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-import Qt 4.7
-
-ListModel {
- id: contactModel
- ListElement {
- name: "Bill Smith"
- number: "555 3264"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "Jim Williams"
- number: "555 5673"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "John Brown"
- number: "555 8426"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "Sam Wise"
- number: "555 0473"
- portrait: "pics/portrait.png"
- }
-}
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index 1d3df9796f..0b3bbf33a9 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -1,47 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![import]
import Qt 4.7
+//![import]
+
+Rectangle {
+ width: childrenRect.width; height: childrenRect.height
+
+Row {
+
+//![classdocs simple]
+GridView {
+ width: 300; height: 200
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+}
+//![classdocs simple]
-//! [3]
+
+//![classdocs advanced]
Rectangle {
- width: 240; height: 180; color: "white"
- // ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
-
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
-//! [0]
+ width: 300; height: 200
+
Component {
- id: delegate
+ id: contactDelegate
Item {
- id: wrapper
- width: 80; height: 78
+ width: grid.cellWidth; height: grid.cellHeight
Column {
+ anchors.fill: parent
Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
}
}
}
-//! [0]
- // Define a highlight component. Just one of these will be instantiated
- // by each ListView and placed behind the current item.
-//! [1]
- Component {
- id: highlight
- Rectangle {
- color: "lightsteelblue"
- radius: 5
- }
- }
-//! [1]
- // The actual grid
-//! [2]
+
GridView {
- width: parent.width; height: parent.height
- model: ContactModel; delegate: delegate
+ id: grid
+ anchors.fill: parent
cellWidth: 80; cellHeight: 80
- highlight: highlight
+
+ model: ContactModel {}
+ delegate: contactDelegate
+ highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
}
-//! [2]
}
-//! [3]
+//![classdocs advanced]
+
+//![delayRemove]
+Component {
+ id: delegate
+ Item {
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
+ }
+ }
+}
+//![delayRemove]
+
+//![highlightFollowsCurrentItem]
+Component {
+ id: highlight
+ Rectangle {
+ width: view.cellWidth; height: view.cellHeight
+ color: "lightsteelblue"; radius: 5
+ SpringFollow on x { to: view.currentItem.x; spring: 3; damping: 0.2 }
+ SpringFollow on y { to: view.currentItem.y; spring: 3; damping: 0.2 }
+ }
+}
+
+GridView {
+ id: view
+ width: 300; height: 200
+ cellWidth: 80; cellHeight: 80
+
+ model: ContactModel {}
+ delegate: Column {
+ Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
+ Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
+ }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+}
+//![highlightFollowsCurrentItem]
+
+}
+
+}
diff --git a/doc/src/snippets/declarative/listmodel-modify.qml b/doc/src/snippets/declarative/listmodel-modify.qml
new file mode 100644
index 0000000000..03fb31415f
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-modify.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+Rectangle {
+ width: 200; height: 200
+
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+}
+
+//![delegate]
+ Component {
+ id: fruitDelegate
+ Item {
+ width: 200; height: 50
+ Text { text: name }
+ Text { text: '$' + cost; anchors.right: parent.right }
+
+ // Double the price when clicked.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.setProperty(index, "cost", cost * 2)
+ }
+ }
+ }
+//![delegate]
+
+ListView {
+ width: 200; height: 200
+ model: fruitModel
+ delegate: fruitDelegate
+}
+
+}
diff --git a/doc/src/snippets/declarative/listmodel-nested.qml b/doc/src/snippets/declarative/listmodel-nested.qml
new file mode 100644
index 0000000000..4ae43ff370
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-nested.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+Rectangle {
+ width: 200; height: 200
+
+
+//![model]
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ attributes: [
+ ListElement { description: "Core" },
+ ListElement { description: "Deciduous" }
+ ]
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ attributes: [
+ ListElement { description: "Citrus" }
+ ]
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ attributes: [
+ ListElement { description: "Tropical" },
+ ListElement { description: "Seedless" }
+ ]
+ }
+}
+//![model]
+
+//![delegate]
+Component {
+ id: fruitDelegate
+ Item {
+ width: 200; height: 50
+ Text { id: nameField; text: name }
+ Text { text: '$' + cost; anchors.left: nameField.right }
+ Row {
+ anchors.top: nameField.bottom
+ spacing: 5
+ Text { text: "Attributes:" }
+ Repeater {
+ model: attributes
+ Text { text: description }
+ }
+ }
+ }
+}
+//![delegate]
+
+ListView {
+ width: 200; height: 200
+ model: fruitModel
+ delegate: fruitDelegate
+}
+
+}
diff --git a/doc/src/snippets/declarative/listmodel-simple.qml b/doc/src/snippets/declarative/listmodel-simple.qml
new file mode 100644
index 0000000000..00b8cb00d3
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel-simple.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 200; height: 200
+
+ ListModel {
+ id: fruitModel
+//![0]
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+//![1]
+ }
+
+ Component {
+ id: fruitDelegate
+ Row {
+ spacing: 10
+ Text { text: name }
+ Text { text: '$' + cost }
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: fruitModel
+ delegate: fruitDelegate
+ }
+}
+//![1]
diff --git a/doc/src/snippets/declarative/listmodel.qml b/doc/src/snippets/declarative/listmodel.qml
new file mode 100644
index 0000000000..91b82306ef
--- /dev/null
+++ b/doc/src/snippets/declarative/listmodel.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+ListModel {
+ id: fruitModel
+
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/listview/ContactModel.qml b/doc/src/snippets/declarative/listview/ContactModel.qml
new file mode 100644
index 0000000000..f9eb4cbc59
--- /dev/null
+++ b/doc/src/snippets/declarative/listview/ContactModel.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+ListModel {
+ ListElement {
+ name: "Bill Smith"
+ number: "555 3264"
+ }
+ ListElement {
+ name: "John Brown"
+ number: "555 8426"
+ }
+ ListElement {
+ name: "Sam Wise"
+ number: "555 0473"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml
deleted file mode 100644
index 20687cf61d..0000000000
--- a/doc/src/snippets/declarative/listview/dummydata/ContactModel.qml
+++ /dev/null
@@ -1,17 +0,0 @@
-import Qt 4.7
-
-ListModel {
- id: contactModel
- ListElement {
- name: "Bill Smith"
- number: "555 3264"
- }
- ListElement {
- name: "John Brown"
- number: "555 8426"
- }
- ListElement {
- name: "Sam Wise"
- number: "555 0473"
- }
-}
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
deleted file mode 100644
index 794b3f26d4..0000000000
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- width: 180; height: 200; color: "white"
-
- // ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
-
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
-//! [0]
- Component {
- id: delegate
- Item {
- id: wrapper
- width: 180; height: 40
- Column {
- x: 5; y: 5
- Text { text: '<b>Name:</b> ' + name }
- Text { text: '<b>Number:</b> ' + number }
- }
- // Use the ListView.isCurrentItem attached property to
- // indent the item if it is the current item.
- states: [
- State {
- name: "Current"
- when: wrapper.ListView.isCurrentItem
- PropertyChanges { target: wrapper; x: 10 }
- }
- ]
- transitions: [
- Transition { NumberAnimation { properties: "x"; duration: 200 } }
- ]
- }
- }
-//! [0]
- // Specify a highlight with custom movement. Note that autoHighlight
- // is set to false in the ListView so that we can control how the
- // highlight moves to the current item.
-//! [1]
- Component {
- id: highlight
- Rectangle {
- width: 180; height: 40
- color: "lightsteelblue"; radius: 5
- SpringFollow on y {
- to: list.currentItem.y
- spring: 3
- damping: 0.2
- }
- }
- }
- ListView {
- id: list
- width: parent.height; height: parent.height
- model: ContactModel; delegate: delegate
- highlight: highlight
- highlightFollowsCurrentItem: false
- focus: true
- }
-//! [1]
-}
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index 61bf126ea0..e44eb0b1e1 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -1,49 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![import]
import Qt 4.7
+//![import]
-//! [3]
-Rectangle {
- width: 180; height: 200; color: "white"
+Item {
+
+//![classdocs simple]
+ListView {
+ width: 180; height: 200
+
+ model: ContactModel {}
+ delegate: Text {
+ text: name + ": " + number
+ }
+}
+//![classdocs simple]
- // ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
- // development without a real data source.
+//![classdocs advanced]
+Rectangle {
+ width: 180; height: 200
- // Define a delegate component. A component will be
- // instantiated for each visible item in the list.
-//! [0]
Component {
- id: delegate
+ id: contactDelegate
Item {
- id: wrapper
width: 180; height: 40
Column {
- x: 5; y: 5
Text { text: '<b>Name:</b> ' + name }
Text { text: '<b>Number:</b> ' + number }
}
}
}
-//! [0]
- // Define a highlight component. Just one of these will be instantiated
- // by each ListView and placed behind the current item.
-//! [1]
- Component {
- id: highlight
- Rectangle {
- color: "lightsteelblue"
- radius: 5
- }
- }
-//! [1]
- // The actual list
-//! [2]
+
ListView {
- width: parent.width; height: parent.height
- model: ContactModel
- delegate: delegate
- highlight: highlight
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: contactDelegate
+ highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
}
-//! [2]
}
-//! [3]
+//![classdocs advanced]
+
+//![delayRemove]
+Component {
+ id: delegate
+ Item {
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
+ PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
+ }
+ }
+}
+//![delayRemove]
+
+//![highlightFollowsCurrentItem]
+Component {
+ id: highlight
+ Rectangle {
+ width: 180; height: 40
+ color: "lightsteelblue"; radius: 5
+ SpringFollow on y {
+ to: list.currentItem.y
+ spring: 3
+ damping: 0.2
+ }
+ }
+}
+
+ListView {
+ id: list
+ width: 180; height: 200
+ model: ContactModel {}
+ delegate: Text { text: name }
+
+ highlight: highlight
+ highlightFollowsCurrentItem: false
+ focus: true
+}
+//![highlightFollowsCurrentItem]
+
+//![isCurrentItem]
+ListView {
+ width: 180; height: 200
+
+ Component {
+ id: contactsDelegate
+ Text {
+ id: contactInfo
+ text: name + ": " + number
+ color: contactInfo.ListView.isCurrentItem ? "red" : "black"
+ }
+ }
+
+ model: ContactModel {}
+ delegate: contactsDelegate
+ focus: true
+}
+//![isCurrentItem]
+
+}
diff --git a/doc/src/snippets/declarative/mousearea.qml b/doc/src/snippets/declarative/mousearea.qml
new file mode 100644
index 0000000000..c6071c7729
--- /dev/null
+++ b/doc/src/snippets/declarative/mousearea.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
+import Qt 4.7
+//! [import]
+
+Rectangle {
+ width: childrenRect.width
+ height: childrenRect.height
+
+Row {
+
+//! [intro]
+Rectangle {
+ width: 100; height: 100
+ color: "green"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { parent.color = 'red' }
+ }
+}
+//! [intro]
+
+//! [intro-extended]
+Rectangle {
+ width: 100; height: 100
+ color: "green"
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onClicked: {
+ if (mouse.button == Qt.RightButton)
+ parent.color = 'blue';
+ else
+ parent.color = 'red';
+ }
+ }
+}
+//! [intro-extended]
+
+//! [drag]
+Rectangle {
+ id: container
+ width: 600; height: 200
+
+ Image {
+ id: pic
+ source: "pics/qt.png"
+ opacity: (600.0 - pic.x) / 600
+
+ MouseArea {
+ anchors.fill: parent
+ drag.target: pic
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: container.width - pic.width
+ }
+ }
+}
+//! [drag]
+
+//! [mousebuttons]
+Text {
+ text: mouseArea.pressedButtons & Qt.RightButton ? "right" : ""
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ }
+}
+//! [mousebuttons]
+
+}
+
+}
diff --git a/doc/src/snippets/declarative/mouseregion.qml b/doc/src/snippets/declarative/mouseregion.qml
deleted file mode 100644
index a4640698c8..0000000000
--- a/doc/src/snippets/declarative/mouseregion.qml
+++ /dev/null
@@ -1,26 +0,0 @@
-import Qt 4.7
-
-Rectangle { width: 200; height: 100
-Row {
-//! [0]
-Rectangle { width: 100; height: 100; color: "green"
- MouseArea { anchors.fill: parent; onClicked: { parent.color = 'red' } }
-}
-//! [0]
-//! [1]
-Rectangle {
- width: 100; height: 100; color: "green"
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
- if (mouse.button == Qt.RightButton)
- parent.color = 'blue';
- else
- parent.color = 'red';
- }
- }
-}
-//! [1]
-}
-}
diff --git a/doc/src/snippets/declarative/parentchange.qml b/doc/src/snippets/declarative/parentchange.qml
new file mode 100644
index 0000000000..7f5718a43f
--- /dev/null
+++ b/doc/src/snippets/declarative/parentchange.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 200
+ height: 100
+
+ Rectangle {
+ id: redRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ Rectangle {
+ id: blueRect
+ x: redRect.width
+ width: 50; height: 50
+ color: "blue"
+
+ states: State {
+ name: "reparented"
+ ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+ }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/pathview/ContactModel.qml b/doc/src/snippets/declarative/pathview/ContactModel.qml
new file mode 100644
index 0000000000..1a042a378f
--- /dev/null
+++ b/doc/src/snippets/declarative/pathview/ContactModel.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+ListModel {
+ ListElement {
+ name: "Bill Jones"
+ icon: "pics/qtlogo.png"
+ }
+ ListElement {
+ name: "Jane Doe"
+ icon: "pics/qtlogo.png"
+ }
+ ListElement {
+ name: "John Smith"
+ icon: "pics/qtlogo.png"
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml b/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml
deleted file mode 100644
index 400407659c..0000000000
--- a/doc/src/snippets/declarative/pathview/dummydata/MenuModel.qml
+++ /dev/null
@@ -1,17 +0,0 @@
-import Qt 4.7
-
-ListModel {
- id: menuModel
- ListElement {
- name: "Bill Jones"
- icon: "pics/qtlogo-64.png"
- }
- ListElement {
- name: "Jane Doe"
- icon: "pics/qtlogo-64.png"
- }
- ListElement {
- name: "John Smith"
- icon: "pics/qtlogo-64.png"
- }
-}
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
index ba860c2e43..3ba3b952a0 100644
--- a/doc/src/snippets/declarative/pathview/pathattributes.qml
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -1,13 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
import Qt 4.7
Rectangle {
- width: 240; height: 200; color: 'white'
-//! [0]
+ width: 240; height: 200
+
//! [1]
Component {
id: delegate
Item {
- id: wrapper
width: 80; height: 80
scale: PathView.scale
opacity: PathView.opacity
@@ -18,9 +59,12 @@ Rectangle {
}
}
//! [1]
+
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: delegate
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
path: Path {
startX: 120; startY: 100
PathAttribute { name: "scale"; value: 1.0 }
@@ -32,5 +76,5 @@ Rectangle {
}
}
//! [2]
-//! [0]
}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pathview.qml b/doc/src/snippets/declarative/pathview/pathview.qml
index 3686398e11..1669847359 100644
--- a/doc/src/snippets/declarative/pathview/pathview.qml
+++ b/doc/src/snippets/declarative/pathview/pathview.qml
@@ -1,24 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
import Qt 4.7
Rectangle {
- width: 240; height: 200; color: 'white'
-//! [0]
+ width: 240; height: 200
+
//! [1]
Component {
id: delegate
- Item {
- id: wrapper
- width: 80; height: 80
- Column {
- Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
- Text { text: name; font.pointSize: 16}
- }
+ Column {
+ Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { text: name; font.pointSize: 16 }
}
}
//! [1]
+
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: delegate
+ anchors.fill: parent
+ model: ContactModel {}
+ delegate: delegate
path: Path {
startX: 120; startY: 100
PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
@@ -26,5 +67,5 @@ Rectangle {
}
}
//! [2]
-//! [0]
}
+//! [0]
diff --git a/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
index 4f68e162de..4f68e162de 100644
--- a/doc/src/snippets/declarative/pathview/pics/qtlogo-64.png
+++ b/doc/src/snippets/declarative/pathview/pics/qtlogo.png
Binary files differ
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro b/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro
index 68eeaf211b..68eeaf211b 100644
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp b/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp
index 4073a6cc20..4073a6cc20 100644
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml b/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml
new file mode 100644
index 0000000000..59fbe1aec6
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 300
+ height: 300
+
+ color: backgroundColor
+
+ Text {
+ anchors.centerIn: parent
+ text: "Hello Yellow World!"
+ }
+}
+//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
index d0d253a602..d0d253a602 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro
index e6af0d033e..e6af0d033e 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/main.cpp b/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp
index dc651f6d68..dc651f6d68 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/custompalette/main.qml b/doc/src/snippets/declarative/qtbinding/custompalette/main.qml
new file mode 100644
index 0000000000..7dce022145
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/main.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 240
+ height: 320
+ color: palette.background
+
+ Text {
+ anchors.centerIn: parent
+ color: palette.text
+ text: "Click me to change color!"
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ palette.text = "blue";
+ }
+ }
+}
+//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/resources/example.qrc b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
index 5e4941512b..5e4941512b 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/example.qrc
+++ b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
diff --git a/doc/src/declarative/snippets/qtbinding/resources/images/background.png b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
index e69de29bb2..e69de29bb2 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/images/background.png
+++ b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
diff --git a/doc/src/declarative/snippets/qtbinding/resources/main.cpp b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
index 5459b9e289..5459b9e289 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/resources/main.qml b/doc/src/snippets/declarative/qtbinding/resources/main.qml
new file mode 100644
index 0000000000..bf31b54a91
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Image {
+ source: "images/background.png"
+}
+//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/resources/resources.pro b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
index cc01ee126f..cc01ee126f 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/resources.pro
+++ b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp b/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp
index 537a2888ff..537a2888ff 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp
diff --git a/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
new file mode 100644
index 0000000000..2184a5d968
--- /dev/null
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 300
+ height: 300
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (stopwatch.isRunning())
+ stopwatch.stop()
+ else
+ stopwatch.start();
+ }
+ }
+}
+//![0]
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp
index 4954a5f52f..4954a5f52f 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h
index 8d17121b1c..8d17121b1c 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
index d803e6a351..d803e6a351 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
diff --git a/doc/src/snippets/declarative/rect-border-width.qml b/doc/src/snippets/declarative/rect-border-width.qml
new file mode 100644
index 0000000000..73ce9f6393
--- /dev/null
+++ b/doc/src/snippets/declarative/rect-border-width.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+//![0]
+Rectangle {
+ width: 100; height: 100
+ color: "yellow"
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 10
+ clip: true
+
+ Rectangle {
+ anchors.fill: parent
+ border.width: 1
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/repeater-index.qml b/doc/src/snippets/declarative/repeater-index.qml
deleted file mode 100644
index 709eaf2082..0000000000
--- a/doc/src/snippets/declarative/repeater-index.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- width: 50; height: childrenRect.height; color: "white"
-
-//! [0]
- Column {
- Repeater {
- model: 10
- Text { text: "I'm item " + index }
- }
- }
-//! [0]
-}
-
diff --git a/doc/src/snippets/declarative/repeater.qml b/doc/src/snippets/declarative/repeater.qml
index 02a820886c..be5d62df11 100644
--- a/doc/src/snippets/declarative/repeater.qml
+++ b/doc/src/snippets/declarative/repeater.qml
@@ -1,16 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [import]
import Qt 4.7
+//! [import]
-Rectangle {
- width: 220; height: 20; color: "white"
+Row {
-//! [0]
- Row {
- Rectangle { width: 10; height: 20; color: "red" }
- Repeater {
- model: 10
- Rectangle { width: 20; height: 20; radius: 10; color: "green" }
+//! [simple]
+Row {
+ Repeater {
+ model: 3
+ Rectangle {
+ width: 100; height: 40
+ border.width: 1
+ color: "yellow"
}
- Rectangle { width: 10; height: 20; color: "blue" }
}
-//! [0]
+}
+//! [simple]
+
+//! [index]
+Column {
+ Repeater {
+ model: 10
+ Text { text: "I'm item " + index }
+ }
+}
+//! [index]
+
+//! [modeldata]
+Column {
+ Repeater {
+ model: ["apples", "oranges", "pears"]
+ Text { text: "Data: " + modelData }
+ }
+}
+//! [modeldata]
+
+//! [layout]
+Row {
+ Rectangle { width: 10; height: 20; color: "red" }
+ Repeater {
+ model: 10
+ Rectangle { width: 20; height: 20; radius: 10; color: "green" }
+ }
+ Rectangle { width: 10; height: 20; color: "blue" }
+}
+//! [layout]
+
}
diff --git a/doc/src/snippets/declarative/rotation.qml b/doc/src/snippets/declarative/rotation.qml
index f2fd78c42d..54372928e9 100644
--- a/doc/src/snippets/declarative/rotation.qml
+++ b/doc/src/snippets/declarative/rotation.qml
@@ -1,33 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [0]
import Qt 4.7
-Rectangle {
- width: 360; height: 80
- color: "white"
-//! [0]
- Row {
- x: 10; y: 10
- spacing: 10
- Image { source: "pics/qt.png" }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
- smooth: true
- }
+Row {
+ x: 10; y: 10
+ spacing: 10
+
+ Image { source: "pics/qt.png" }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
+ smooth: true
+ }
+ Image {
+ source: "pics/qt.png"
+ transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
+ smooth: true
}
-//! [0]
}
+//! [0]
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
new file mode 100644
index 0000000000..a99c2e27d7
--- /dev/null
+++ b/doc/src/snippets/declarative/state.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "black"
+
+ states: [
+ State {
+ name: "clicked"
+ PropertyChanges {
+ target: myRect
+ color: "red"
+ }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (myRect.state == "") // i.e. the default state
+ myRect.state = "clicked";
+ else
+ myRect.state = "";
+ }
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/states.qml b/doc/src/snippets/declarative/states.qml
new file mode 100644
index 0000000000..c3b1796e2c
--- /dev/null
+++ b/doc/src/snippets/declarative/states.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+ id: myItem
+ width: 200; height: 200
+
+ Rectangle {
+ id: myRect
+ width: 100; height: 100
+ color: "red"
+ }
+
+ states: [
+ State {
+ name: "moved"
+ PropertyChanges {
+ target: myRect
+ x: 50
+ y: 50
+ }
+ }
+ ]
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myItem.state = 'moved'
+ }
+//![0]
+
+//![transitions]
+transitions: [
+ Transition {
+ NumberAnimation { properties: "x,y"; duration: 500 }
+ }
+]
+//![transitions]
+
+//![1]
+}
+//![1]
diff --git a/doc/src/snippets/declarative/systempalette.qml b/doc/src/snippets/declarative/systempalette.qml
new file mode 100644
index 0000000000..98b333e25e
--- /dev/null
+++ b/doc/src/snippets/declarative/systempalette.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+
+ width: 640; height: 480
+ color: myPalette.window
+
+ Text {
+ anchors.fill: parent
+ text: "Hello!"; color: myPalette.windowText
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/texteditor.qml b/doc/src/snippets/declarative/texteditor.qml
new file mode 100644
index 0000000000..6735c6cf91
--- /dev/null
+++ b/doc/src/snippets/declarative/texteditor.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+//![0]
+Flickable {
+ id: flick
+
+ width: 300; height: 200;
+ contentWidth: edit.paintedWidth
+ contentHeight: edit.paintedHeight
+ clip: true
+
+ 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;
+ }
+
+ TextEdit {
+ id: edit
+ width: flick.width
+ height: flick.height
+ focus: true
+ wrapMode: TextEdit.Wrap
+ onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/visualdatamodel.qml b/doc/src/snippets/declarative/visualdatamodel.qml
new file mode 100644
index 0000000000..cdde5131b2
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 200; height: 100
+
+ VisualDataModel {
+ id: visualModel
+ model: ListModel {
+ ListElement { name: "Apple" }
+ ListElement { name: "Orange" }
+ }
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ Text { text: "Name: " + name}
+ }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: visualModel
+ }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
new file mode 100644
index 0000000000..174adee24f
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
+#include <QApplication>
+#include <QDirModel>
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+
+ QDirModel model;
+ view.rootContext()->setContextProperty("dirModel", &model);
+
+ view.setSource(QUrl::fromLocalFile("view.qml"));
+ view.show();
+
+ return app.exec();
+}
+//![0]
+
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
index 4c18ef371f..e623faa7ad 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,23 +39,28 @@
**
****************************************************************************/
//![0]
-#include "redsquare.h"
-#include "bluecircle.h"
+import Qt 4.7
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-#include <QtDeclarative/qdeclarative.h>
+ListView {
+ id: view
+ width: 300
+ height: 400
-class ShapesPlugin : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- void registerTypes(const char *uri) {
- qmlRegisterType<RedSquare>(uri, 1, 0, "RedSquare");
- qmlRegisterType<BlueCircle>(uri, 1, 0, "BlueCircle");
- }
-};
+ model: VisualDataModel {
+ model: dirModel
-#include "shapesplugin.moc"
+ delegate: Rectangle {
+ width: 200; height: 25
+ Text { text: filePath }
-Q_EXPORT_PLUGIN2(shapesplugin, ShapesPlugin);
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (hasModelChildren)
+ view.model.rootIndex = view.model.modelIndex(index)
+ }
+ }
+ }
+ }
+}
//![0]
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro b/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro
new file mode 100644
index 0000000000..fec070cb5d
--- /dev/null
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/visualdatamodel_rootindex.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+QT += gui declarative
+
+SOURCES += main.cpp
diff --git a/doc/src/snippets/declarative/workerscript.qml b/doc/src/snippets/declarative/workerscript.qml
index 838e7e5f73..e07911ab88 100644
--- a/doc/src/snippets/declarative/workerscript.qml
+++ b/doc/src/snippets/declarative/workerscript.qml
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
//![0]
import Qt 4.7
diff --git a/doc/src/snippets/declarative/xmlrole.qml b/doc/src/snippets/declarative/xmlrole.qml
new file mode 100644
index 0000000000..6d04dafdcd
--- /dev/null
+++ b/doc/src/snippets/declarative/xmlrole.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Rectangle {
+ width: 300; height: 200
+
+//![0]
+XmlListModel {
+ id: model
+//![0]
+ source: "xmlrole.xml"
+
+//![1]
+ // XmlRole queries will be made on <book> elements
+ query: "/catalogue/book"
+
+ // query the book title
+ XmlRole { name: "title"; query: "title/string()" }
+
+ // query the book's year
+ XmlRole { name: "year"; query: "year/number()" }
+
+ // query the book's type (the '@' indicates 'type' is an attribute, not an element)
+ XmlRole { name: "type"; query: "@type/string()" }
+
+ // query the book's first listed author (note in XPath the first index is 1, not 0)
+ XmlRole { name: "first_author"; query: "author[1]/string()" }
+}
+//![1]
+
+ListView {
+ width: 300; height: 200
+ model: model
+ delegate: Column {
+ Text { text: title + " (" + type + ")"; font.bold: true }
+ Text { text: first_author }
+ Text { text: year }
+ }
+}
+
+}
diff --git a/doc/src/snippets/declarative/xmlrole.xml b/doc/src/snippets/declarative/xmlrole.xml
new file mode 100644
index 0000000000..c9f999e523
--- /dev/null
+++ b/doc/src/snippets/declarative/xmlrole.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<catalogue>
+ <book type="Hardcover">
+ <title>C++ GUI Programming with Qt 4</title>
+ <year>2006</year>
+ <author>Jasmin Blanchette</author>
+ <author>Mark Summerfield</author>
+ </book>
+ <book type="Paperback">
+ <title>Programming with Qt</title>
+ <year>2002</year>
+ <author>Matthias Kalle Dalheimer</author>
+ </book>
+ </catalogue>
diff --git a/doc/src/snippets/qxmlschema/main.cpp b/doc/src/snippets/qxmlschema/main.cpp
index 83fb245633..26a87413d3 100644
--- a/doc/src/snippets/qxmlschema/main.cpp
+++ b/doc/src/snippets/qxmlschema/main.cpp
@@ -91,11 +91,8 @@ void Schema::loadFromData() const
" elementFormDefault=\"qualified\">"
"</xsd:schema>" );
- QBuffer buffer(&data);
- buffer.open(QIODevice::ReadOnly);
-
QXmlSchema schema;
- schema.load(&buffer);
+ schema.load(data);
if (schema.isValid())
qDebug() << "schema is valid";
diff --git a/doc/src/sql-programming/qsqldatatype-table.qdoc b/doc/src/sql-programming/qsqldatatype-table.qdoc
index fc961f5351..329222b65e 100644
--- a/doc/src/sql-programming/qsqldatatype-table.qdoc
+++ b/doc/src/sql-programming/qsqldatatype-table.qdoc
@@ -41,19 +41,20 @@
/*!
\page sql-types.html
- \title Recommended Use of Data Types in Databases
+ \title Data Types for Qt-supported Database Systems
+ \brief Recommended data types for database systems
- \ingroup best-practices
+ \ingroup qt-sql
- \section1 Recommended Use of Types in Qt Supported Databases
+ \section1 Recommended Data Types for Qt-Supported Database Systems
- This table shows the recommended data types used when extracting data
- from the databases supported in Qt. It is important to note that the
- types used in Qt are not necessarily valid as input to the specific
- database. One example could be that a double would work perfectly as
- input for floating point records in a database, but not necessarily
- as a storage format for output from the database since it would be stored
- with 64-bit precision in C++.
+ This table shows the recommended data types for extracting data from
+ the databases supported in Qt. Note that types used in Qt are not
+ necessarily valid as input types to a specific database
+ system. e.g., A double might work perfectly as input for floating
+ point records in a particular database, but not necessarily as a
+ storage format for output from that database, because it would be
+ stored with 64-bit precision in C++.
\tableofcontents
diff --git a/doc/src/sql-programming/sql-driver.qdoc b/doc/src/sql-programming/sql-driver.qdoc
index 6bccd8361d..f0e4e522f3 100644
--- a/doc/src/sql-programming/sql-driver.qdoc
+++ b/doc/src/sql-programming/sql-driver.qdoc
@@ -44,7 +44,7 @@
\title SQL Database Drivers
\brief How to configure and install QtSql drivers for supported databases.
- \ingroup best-practices
+ \ingroup qt-sql
The QtSql module uses driver \l{How to Create Qt
Plugins}{plugins} to communicate with the different database
diff --git a/doc/src/sql-programming/sql-programming.qdoc b/doc/src/sql-programming/sql-programming.qdoc
index f1f3e5e75a..936e555127 100644
--- a/doc/src/sql-programming/sql-programming.qdoc
+++ b/doc/src/sql-programming/sql-programming.qdoc
@@ -49,6 +49,7 @@
/*!
\page sql-programming.html
\title SQL Programming
+ \ingroup qt-sql
\nextpage Connecting to Databases
\brief Database integration for Qt applications.
@@ -72,7 +73,7 @@
\endlist
\o \l{Executing SQL Statements}
\list
- \o \l{Recommended Use of Data Types in Databases}
+ \o \l{Data Types for Qt-supported Database Systems}
\endlist
\o \l{Using the SQL Model Classes}
\o \l{Presenting Data in a Table View}
@@ -118,6 +119,7 @@
/*!
\page sql-connecting.html
\title Connecting to Databases
+ \ingroup qt-sql
\contentspage SQL Programming
\previouspage SQL Programming
@@ -187,6 +189,7 @@
/*!
\page sql-sqlstatements.html
\title Executing SQL Statements
+ \ingroup qt-sql
\previouspage Connecting to Databases
\contentspage SQL Programming
@@ -237,8 +240,9 @@
QVariant::toString() and QVariant::toInt() to convert
variants to QString and \c int.
- For an overview of the recommended types used with Qt supported
- Databases, please refer to \l{Recommended Use of Data Types in Databases}{this table}.
+ For an overview of the recommended types for use with Qt-supported
+ Databases, please refer to \l{Data Types for Qt-supported Database
+ Systems} {this table}.
You can iterate back and forth using QSqlQuery::next(),
QSqlQuery::previous(), QSqlQuery::first(), QSqlQuery::last(), and
@@ -337,6 +341,7 @@
/*!
\page sql-model.html
\title Using the SQL Model Classes
+ \ingroup qt-sql
\previouspage Executing SQL Statements
\contentspage SQL Programming
@@ -483,6 +488,7 @@
/*!
\page sql-presenting.html
\title Presenting Data in a Table View
+ \ingroup qt-sql
\previouspage Using the SQL Model Classes
\contentspage SQL Programming
@@ -587,6 +593,7 @@
/*!
\page sql-forms.html
\title Creating Data-Aware Forms
+ \ingroup qt-sql
\previouspage Presenting Data in a Table View
\contentspage SQL Programming
diff --git a/doc/src/template/images/api_examples.png b/doc/src/template/images/api_examples.png
deleted file mode 100755
index 1fcbc96bd1..0000000000
--- a/doc/src/template/images/api_examples.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/api_lookup.png b/doc/src/template/images/api_lookup.png
deleted file mode 100755
index 1cffd5e352..0000000000
--- a/doc/src/template/images/api_lookup.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/api_topics.png b/doc/src/template/images/api_topics.png
deleted file mode 100755
index a76a6c3ed2..0000000000
--- a/doc/src/template/images/api_topics.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/arrow_down.png b/doc/src/template/images/arrow_down.png
new file mode 100644
index 0000000000..9d01e97f6a
--- /dev/null
+++ b/doc/src/template/images/arrow_down.png
Binary files differ
diff --git a/doc/src/template/images/bg_l.png b/doc/src/template/images/bg_l.png
index 95470c78cc..90b1da10b9 100755
--- a/doc/src/template/images/bg_l.png
+++ b/doc/src/template/images/bg_l.png
Binary files differ
diff --git a/doc/src/template/images/bg_l_blank.png b/doc/src/template/images/bg_l_blank.png
index e0eca3f1c3..5a9673d81b 100755
--- a/doc/src/template/images/bg_l_blank.png
+++ b/doc/src/template/images/bg_l_blank.png
Binary files differ
diff --git a/doc/src/template/images/bg_ll.png b/doc/src/template/images/bg_ll.png
deleted file mode 100755
index 99796e7b5f..0000000000
--- a/doc/src/template/images/bg_ll.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ll_blank.png b/doc/src/template/images/bg_ll_blank.png
index 95a1c45e04..95a1c45e04 100755..100644
--- a/doc/src/template/images/bg_ll_blank.png
+++ b/doc/src/template/images/bg_ll_blank.png
Binary files differ
diff --git a/doc/src/template/images/bg_lr.png b/doc/src/template/images/bg_lr.png
deleted file mode 100755
index fef1d17bbe..0000000000
--- a/doc/src/template/images/bg_lr.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_r.png b/doc/src/template/images/bg_r.png
index 42a35a546f..f0fb121dea 100755
--- a/doc/src/template/images/bg_r.png
+++ b/doc/src/template/images/bg_r.png
Binary files differ
diff --git a/doc/src/template/images/bg_ul.png b/doc/src/template/images/bg_ul.png
deleted file mode 100755
index 303181f18f..0000000000
--- a/doc/src/template/images/bg_ul.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ul_blank.png b/doc/src/template/images/bg_ul_blank.png
index 70512614cc..70512614cc 100755..100644
--- a/doc/src/template/images/bg_ul_blank.png
+++ b/doc/src/template/images/bg_ul_blank.png
Binary files differ
diff --git a/doc/src/template/images/bg_ur.png b/doc/src/template/images/bg_ur.png
deleted file mode 100755
index bfa51a4cee..0000000000
--- a/doc/src/template/images/bg_ur.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ur_blank.png b/doc/src/template/images/bg_ur_blank.png
deleted file mode 100755
index 57799616c0..0000000000
--- a/doc/src/template/images/bg_ur_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/box_bg.png b/doc/src/template/images/box_bg.png
index 232655a818..3322f923f8 100755
--- a/doc/src/template/images/box_bg.png
+++ b/doc/src/template/images/box_bg.png
Binary files differ
diff --git a/doc/src/template/images/breadcrumb.png b/doc/src/template/images/breadcrumb.png
index f0571ce1b5..0ded5514d2 100755
--- a/doc/src/template/images/breadcrumb.png
+++ b/doc/src/template/images/breadcrumb.png
Binary files differ
diff --git a/doc/src/template/images/bullet_gt.png b/doc/src/template/images/bullet_gt.png
index 88759256ce..7561b4edc4 100755
--- a/doc/src/template/images/bullet_gt.png
+++ b/doc/src/template/images/bullet_gt.png
Binary files differ
diff --git a/doc/src/template/images/bullet_sq.png b/doc/src/template/images/bullet_sq.png
index db85ee3400..a84845e3c7 100755
--- a/doc/src/template/images/bullet_sq.png
+++ b/doc/src/template/images/bullet_sq.png
Binary files differ
diff --git a/doc/src/template/images/content_bg.png b/doc/src/template/images/content_bg.png
deleted file mode 100755
index 416397d047..0000000000
--- a/doc/src/template/images/content_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/form_bg.png b/doc/src/template/images/form_bg.png
deleted file mode 100755
index bf2ee54464..0000000000
--- a/doc/src/template/images/form_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/header.png b/doc/src/template/images/header.png
deleted file mode 100644
index 141488b860..0000000000
--- a/doc/src/template/images/header.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/header_bg.png b/doc/src/template/images/header_bg.png
new file mode 100644
index 0000000000..a436aa61ef
--- /dev/null
+++ b/doc/src/template/images/header_bg.png
Binary files differ
diff --git a/doc/src/template/images/page.png b/doc/src/template/images/page.png
new file mode 100644
index 0000000000..1db151bd31
--- /dev/null
+++ b/doc/src/template/images/page.png
Binary files differ
diff --git a/doc/src/template/images/page_bg.png b/doc/src/template/images/page_bg.png
index fb7d051a28..9b3bd999df 100755
--- a/doc/src/template/images/page_bg.png
+++ b/doc/src/template/images/page_bg.png
Binary files differ
diff --git a/doc/src/template/images/print.png b/doc/src/template/images/print.png
deleted file mode 100755
index 4581da1870..0000000000
--- a/doc/src/template/images/print.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_guide.png b/doc/src/template/images/qt_guide.png
deleted file mode 100755
index 9f53a052eb..0000000000
--- a/doc/src/template/images/qt_guide.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_icon.png b/doc/src/template/images/qt_icon.png
deleted file mode 100755
index fbaee35843..0000000000
--- a/doc/src/template/images/qt_icon.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_ref_doc.png b/doc/src/template/images/qt_ref_doc.png
deleted file mode 100755
index 141488b860..0000000000
--- a/doc/src/template/images/qt_ref_doc.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_tools.png b/doc/src/template/images/qt_tools.png
deleted file mode 100755
index cc24179819..0000000000
--- a/doc/src/template/images/qt_tools.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/sep.png b/doc/src/template/images/sep.png
deleted file mode 100755
index c895646f23..0000000000
--- a/doc/src/template/images/sep.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/spinner.gif b/doc/src/template/images/spinner.gif
new file mode 100644
index 0000000000..1ed786f2ec
--- /dev/null
+++ b/doc/src/template/images/spinner.gif
Binary files differ
diff --git a/doc/src/template/images/sprites-combined.png b/doc/src/template/images/sprites-combined.png
index 41860225c7..3a48b21f6b 100755
--- a/doc/src/template/images/sprites-combined.png
+++ b/doc/src/template/images/sprites-combined.png
Binary files differ
diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js
index fa454e3101..58a0248591 100755
--- a/doc/src/template/scripts/functions.js
+++ b/doc/src/template/scripts/functions.js
@@ -1,10 +1,8 @@
-
/* START non link areas where cursor should change to pointing hand */
$('.t_button').mouseover(function() {
$('.t_button').css('cursor','pointer');
/*document.getElementById(this.id).style.cursor='pointer';*/
});
-
/* END non link areas */
$('#smallA').click(function() {
$('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller');
@@ -35,27 +33,160 @@ $('#bigA').click(function() {
$(this).addClass('active')
});
-function doSearch(str){
-
-if (str.length>3)
- {
- alert('Search is not yet activated.');
- // document.getElementById("refWrapper").innerHTML="";
- return;
- }
- else
- return;
-
-// var url="indexSearch.php";
-// url=url+"?q="+str;
- // url=url+"&sid="+Math.random();
- // var url="http://localhost:8983/solr/select?";
- // url=url+"&q="+str;
- // url=url+"&fq=&start=0&rows=10&fl=&qt=&wt=&explainOther=&hl.fl=";
-
- // $.get(url, function(data){
- // alert(data);
- // document.getElementById("refWrapper").innerHTML=data;
- //});
-
-} \ No newline at end of file
+$('.feedclose').click(function() {
+ $('.bd').show();
+ $('.hd').show();
+ $('.footer').show();
+ $('#feedbackBox').hide();
+ $('#blurpage').hide();
+});
+
+$('.feedback').click(function() {
+ $('.bd').hide();
+ $('.hd').hide();
+ $('.footer').hide();
+ $('#feedbackBox').show();
+ $('#blurpage').show();
+});
+var lookupCount = 0;
+var articleCount = 0;
+var exampleCount = 0;
+var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links
+
+function processNokiaData(response){
+ var propertyTags = response.getElementsByTagName('page');
+
+ for (var i=0; i< propertyTags.length; i++) {
+ var linkStart = "<li class=\"liveResult\"><a href='"+qturl+"";
+ var linkEnd = "</a></li>";
+
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){
+ lookupCount++;
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd;
+
+ $('#ul001').append(full_li_element);
+ $('#ul001 .defaultLink').css('display','none');
+
+ }
+ }
+
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){
+ articleCount++;
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
+
+ $('#ul002').append(full_li_element);
+ $('#ul002 .defaultLink').css('display','none');
+
+ }
+ }
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){
+ exampleCount++;
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
+
+ $('#ul003').append(full_li_element);
+ $('#ul003 .defaultLink').css('display','none');
+
+ }
+ }
+ if(i==propertyTags.length){$('#pageType').removeClass('loading');}
+
+ }
+
+ if(lookupCount == 0){$('#ul001').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');}
+ if(articleCount == 0){$('#ul002').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul002 li').css('display','block');}
+ if(exampleCount == 0){$('#ul003').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul003 li').css('display','block');}
+ // reset count variables;
+ lookupCount=0;
+ articleCount = 0;
+ exampleCount = 0;
+
+}
+//build regular expression object to find empty string or any number of blank
+var blankRE=/^\s*$/;
+function CheckEmptyAndLoadList()
+{
+ var pageUrl = window.location.href;
+ var pageVal = $('title').html();
+ $('#feedUrl').remove();
+ $('#pageVal').remove();
+ $('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
+ $('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
+ $('.liveResult').remove();
+ $('.defaultLink').css('display','block');
+ var value = document.getElementById('pageType').value;
+ if((blankRE.test(value)) || (value.length < 3))
+ {
+ //empty inputbox
+ // load default li elements into the ul if empty
+ // loadAllList(); // replaced
+ $('.defaultLink').css('display','block');
+ // $('.liveResult').css('display','none');
+ }else{
+ $('.defaultLink').css('display','none');
+ }
+}
+/*
+$(window).resize(function(){
+if($(window).width()<400)
+ $('body').addClass('offline');
+else
+ $('body').removeClass('offline');
+ });
+ */
+// Loads on doc ready
+ $(document).ready(function () {
+ //alert(pageUrl);
+ //$('#pageUrl').attr('foo',pageUrl);
+ var pageTitle = $('title').html();
+ var currentString = $('#pageType').val() ;
+ if(currentString.length < 1){
+ $('.defaultLink').css('display','block');
+ CheckEmptyAndLoadList();
+ }
+
+ $('#pageType').keyup(function () {
+ var searchString = $('#pageType').val() ;
+ if ((searchString == null) || (searchString.length < 3)) {
+ $('#pageType').removeClass('loading');
+ $('.liveResult').remove(); // replaces removeResults();
+ CheckEmptyAndLoadList();
+ $('.report').remove();
+ // debug$('.content').prepend('<li>too short or blank</li>'); // debug
+ return;
+ }
+ if (this.timer) clearTimeout(this.timer);
+ this.timer = setTimeout(function () {
+ $('#pageType').addClass('loading');
+ // debug$('.content').prepend('<li>new search started </li>');// debug
+ // debug$('.content').prepend('<p class=\"report\">Search string ' +searchString +'</p>'); // debug
+
+ $.ajax({
+ contentType: "application/x-www-form-urlencoded",
+ url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
+ data: 'searchString='+searchString,
+ dataType:'xml',
+ type: 'post',
+ success: function (response, textStatus) {
+
+ $('.liveResult').remove(); // replaces removeResults();
+ $('#pageType').removeClass('loading');
+
+ processNokiaData(response);
+
+ }
+ });
+ }, 500);
+ });
+ });
diff --git a/doc/src/template/scripts/narrow.js b/doc/src/template/scripts/narrow.js
new file mode 100644
index 0000000000..12d0ce89d5
--- /dev/null
+++ b/doc/src/template/scripts/narrow.js
@@ -0,0 +1,78 @@
+var narrowInit = function() {
+ /* TODO:
+ Could probably be more efficient, not hardcoding each element to be created
+ */
+ // 1: Create search form
+ var narrowSearch = $('<div id="narrowsearch"></div>');
+ var searchform = $("#qtdocsearch");
+ narrowSearch.append(searchform);
+ $("#qtdocheader .content .qtref").after(narrowSearch);
+
+ // 2: Create dropdowns
+ var narrowmenu = $('<ul id="narrowmenu" class="sf-menu"></ul>');
+
+ // Lookup
+ var lookuptext = $("#lookup h2").attr("title");
+ $("#lookup ul").removeAttr("id");
+ $("#lookup ul li").removeAttr("class");
+ $("#lookup ul li").removeAttr("style");
+ var lookupul = $("#lookup ul");
+ var lookuplist = $('<li></li>');
+ var lookuplink = $('<a href="#"></a>');
+ lookuplink.append(lookuptext);
+ lookuplist.append(lookuplink);
+ lookuplist.append(lookupul);
+ narrowmenu.append(lookuplist);
+
+ // Topics
+ var topicstext = $("#topics h2").attr("title");
+ $("#topics ul").removeAttr("id");
+ $("#topics ul li").removeAttr("class");
+ $("#topics ul li").removeAttr("style");
+ var topicsul = $("#topics ul");
+ var topicslist = $('<li></li>');
+ var topicslink = $('<a href="#"></a>');
+ topicslink.append(topicstext);
+ topicslist.append(topicslink);
+ topicslist.append(topicsul);
+ narrowmenu.append(topicslist);
+
+ // Examples
+ var examplestext = $("#examples h2").attr("title");
+ $("#examples ul").removeAttr("id");
+ $("#examples ul li").removeAttr("class");
+ $("#examples ul li").removeAttr("style");
+ var examplesul = $("#examples ul");
+ var exampleslist = $('<li></li>');
+ var exampleslink = $('<a href="#"></a>');
+ exampleslink.append(examplestext);
+ exampleslist.append(exampleslink);
+ exampleslist.append(examplesul);
+ narrowmenu.append(exampleslist);
+
+ $("#shortCut").after(narrowmenu);
+ $('ul#narrowmenu').superfish({
+ delay: 100,
+ autoArrows: false,
+ disableHI: true
+ });
+}
+
+$(document).ready(function(){
+ if ($('body').hasClass('narrow')) {
+ narrowInit();
+ }
+});
+
+$(window).bind('resize', function () {
+ if($(window).width()<600) {
+ $('body').addClass('narrow');
+
+ if ($("#narrowsearch").length == 0) {
+ narrowInit();
+ }
+ }
+ else {
+ $('body').removeClass('narrow');
+ }
+}); \ No newline at end of file
diff --git a/doc/src/template/scripts/superfish.js b/doc/src/template/scripts/superfish.js
new file mode 100644
index 0000000000..c6a9c7de04
--- /dev/null
+++ b/doc/src/template/scripts/superfish.js
@@ -0,0 +1,121 @@
+
+/*
+ * Superfish v1.4.8 - jQuery menu widget
+ * Copyright (c) 2008 Joel Birch
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
+ */
+
+;(function($){
+ $.fn.superfish = function(op){
+
+ var sf = $.fn.superfish,
+ c = sf.c,
+ $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
+ over = function(){
+ var $$ = $(this), menu = getMenu($$);
+ clearTimeout(menu.sfTimer);
+ $$.showSuperfishUl().siblings().hideSuperfishUl();
+ },
+ out = function(){
+ var $$ = $(this), menu = getMenu($$), o = sf.op;
+ clearTimeout(menu.sfTimer);
+ menu.sfTimer=setTimeout(function(){
+ o.retainPath=($.inArray($$[0],o.$path)>-1);
+ $$.hideSuperfishUl();
+ if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
+ },o.delay);
+ },
+ getMenu = function($menu){
+ var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
+ sf.op = sf.o[menu.serial];
+ return menu;
+ },
+ addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
+
+ return this.each(function() {
+ var s = this.serial = sf.o.length;
+ var o = $.extend({},sf.defaults,op);
+ o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
+ $(this).addClass([o.hoverClass,c.bcClass].join(' '))
+ .filter('li:has(ul)').removeClass(o.pathClass);
+ });
+ sf.o[s] = sf.op = o;
+
+ $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
+ if (o.autoArrows) addArrow( $('>a:first-child',this) );
+ })
+ .not('.'+c.bcClass)
+ .hideSuperfishUl();
+
+ var $a = $('a',this);
+ $a.each(function(i){
+ var $li = $a.eq(i).parents('li');
+ $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
+ });
+ o.onInit.call(this);
+
+ }).each(function() {
+ var menuClasses = [c.menuClass];
+ if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
+ $(this).addClass(menuClasses.join(' '));
+ });
+ };
+
+ var sf = $.fn.superfish;
+ sf.o = [];
+ sf.op = {};
+ sf.IE7fix = function(){
+ var o = sf.op;
+ if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
+ this.toggleClass(sf.c.shadowClass+'-off');
+ };
+ sf.c = {
+ bcClass : 'sf-breadcrumb',
+ menuClass : 'sf-js-enabled',
+ anchorClass : 'sf-with-ul',
+ arrowClass : 'sf-sub-indicator',
+ shadowClass : 'sf-shadow'
+ };
+ sf.defaults = {
+ hoverClass : 'sfHover',
+ pathClass : 'overideThisToUse',
+ pathLevels : 1,
+ delay : 800,
+ animation : {opacity:'show'},
+ speed : 'normal',
+ autoArrows : true,
+ dropShadows : true,
+ disableHI : false, // true disables hoverIntent detection
+ onInit : function(){}, // callback functions
+ onBeforeShow: function(){},
+ onShow : function(){},
+ onHide : function(){}
+ };
+ $.fn.extend({
+ hideSuperfishUl : function(){
+ var o = sf.op,
+ not = (o.retainPath===true) ? o.$path : '';
+ o.retainPath = false;
+ var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
+ .find('>ul').hide().css('visibility','hidden');
+ o.onHide.call($ul);
+ return this;
+ },
+ showSuperfishUl : function(){
+ var o = sf.op,
+ sh = sf.c.shadowClass+'-off',
+ $ul = this.addClass(o.hoverClass)
+ .find('>ul:hidden').css('visibility','visible');
+ sf.IE7fix.call($ul);
+ o.onBeforeShow.call($ul);
+ $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
+ return this;
+ }
+ });
+
+})(jQuery);
diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
new file mode 100644
index 0000000000..ddd580af53
--- /dev/null
+++ b/doc/src/template/style/OfflineStyle.css
@@ -0,0 +1,819 @@
+@media screen
+{
+ html
+ {
+ color: #000000;
+ background: #FFFFFF;
+ }
+ body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td
+ {
+ margin: 0;
+ padding: 0;
+ }
+ table
+ {
+ border-collapse: collapse;
+ border-spacing: 0;
+ }
+ fieldset, img
+ {
+ border: 0;
+ }
+ address, caption, cite, code, dfn, em, strong, th, var, optgroup
+ {
+ font-style: inherit;
+ font-weight: inherit;
+ }
+ del, ins
+ {
+ text-decoration: none;
+ }
+ li
+ {
+ list-style: none;
+ }
+ caption, th
+ {
+ text-align: left;
+ }
+ h1, h2, h3, h4, h5, h6
+ {
+ font-size: 100%;
+ }
+ q:before, q:after
+ {
+ content: '';
+ }
+ abbr, acronym
+ {
+ border: 0;
+ font-variant: normal;
+ }
+ sup
+ {
+ vertical-align: baseline;
+ }
+ sub
+ {
+ vertical-align: baseline;
+ }
+ tt, .qmlreadonly span, .qmldefault span
+ {
+ word-spacing:5px;
+ }
+ .heading
+ {
+ font: normal 600 16px/1.0 Arial;
+ }
+ .subtitle
+ {
+ font-size: 13px;
+ }
+ .small-subtitle
+ {
+ font-size: 13px;
+ }
+ legend
+ {
+ color: #000000;
+ }
+ input, button, textarea, select, optgroup, option
+ {
+ font-family: inherit;
+ font-size: inherit;
+ font-style: inherit;
+ font-weight: inherit;
+ }
+ input, button, textarea, select
+ {
+ font-size: 100%;
+ }
+ body
+ {
+ font: normal 13px/1.2 Verdana;
+ color: #363534;
+ }
+ strong
+ {
+ font-weight: bold;
+ }
+ em
+ {
+ font-style: italic;
+ }
+ a
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
+ .header, .footer, .wrapper
+ {
+ /*min-width: 600px;*/
+ max-width: 1500px;
+ margin: 0 5px;
+ }
+ .wrapper
+ {
+ position:relative;
+ top:50px;
+ }
+ .wrapper .bd
+ {
+ position: relative;
+ }
+
+ .header, .footer
+ {
+ display: block;
+ clear: both;
+ overflow: hidden;
+ }
+ .header
+ {
+ height: 115px;
+ position: relative;
+ }
+
+
+ .header .qtref
+ {
+ position: absolute;
+ top: 28px;
+ left: 88px;
+ width: 302px;
+ height: 22px;
+ }
+ .header .qtref span
+ {
+ display: block;
+ height: 22px;
+ }
+ .wrap .content h1
+ {
+ font: 600 18px/1.2 Arial;
+ }
+ .wrap .content h2
+ {
+ font: 600 16px/1.2 Arial;
+ }
+ .wrap .content h3
+ {
+ font: 600 14px/1.2 Arial;
+ }
+ .wrap .content h4
+ {
+ font: 600 12px/1.2 Arial;
+ }
+
+ .wrap .content p
+ {
+ line-height: 20px;
+ padding: 5px;
+ }
+ .wrap .content table p
+ {
+ line-height: 20px;
+ padding: 0px;
+ }
+ .wrap .content ul
+ {
+ padding-left: 25px;
+ padding-top: 10px;
+ }
+ a:hover
+ {
+ color: #4c0033;
+ text-decoration: underline;
+ }
+ .content a:visited
+ {
+ color: #4c0033;
+ text-decoration: none;
+ }
+ .content a:visited:hover
+ {
+ color: #4c0033;
+ text-decoration: underline;
+ }
+
+ pre
+ {
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ overflow-x: auto;
+ }
+ table, pre
+ {
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #E6E6E6;
+ border-collapse: separate;
+ font-size: 11px;
+ /*min-width: 395px;*/
+ margin-bottom: 25px;
+ display: inline-block;
+ }
+ thead
+ {
+ margin-top: 5px;
+ font:600 12px/1.2 Arial;
+ }
+ th
+ {
+ padding: 5px 15px 5px 15px;
+ background-color: #E1E1E1;
+ /* border-bottom: 1px solid #E6E6E6;*/
+ border-left: 1px solid #E6E6E6;
+ /* border-right: 1px solid #E6E6E6;*/
+ }
+ td
+ {
+ padding: 3px 15px 3px 20px;
+ /* border-left: 1px solid #E6E6E6;
+ border-right: 1px solid #E6E6E6;*/
+ }
+ tr.odd td:hover, tr.even td:hover
+ {
+ /* border-right: 1px solid #C3C3C3;
+ border-left: 1px solid #C3C3C3;*/
+ }
+
+ td.rightAlign
+ {
+ padding: 3px 15px 3px 10px;
+ }
+ table tr.odd
+ {
+ border-left: 1px solid #E6E6E6;
+ background-color: #F6F6F6;
+ color: #66666E;
+ }
+ table tr.even
+ {
+ border-left: 1px solid #E6E6E6;
+ background-color: #ffffff;
+ color: #66666E;
+ }
+ table tr.odd td:hover, table tr.even td:hover
+ {
+ background-color: #E6E6E6;
+ }
+
+ span.comment
+ {
+ color: #8B0000;
+ font-style: italic;
+ }
+ span.string, span.char
+ {
+ color: #254117;
+ }
+
+ .qmltype
+ {
+ text-align: center;
+ font-size: 160%;
+ }
+ .qmlreadonly
+ {
+ float: right;
+ color: #254117;
+ }
+
+ .qmldefault
+ {
+ float: right;
+ color: red;
+ }
+
+ .footer
+ {
+ border-top:1px solid #E5E5E5;
+ min-height: 100px;
+ color: #797775;
+ font: normal 9px/1 Verdana;
+ text-align: center;
+ padding-top: 40px;
+ margin: 0;
+ }
+
+
+ .wrap
+ {
+ margin: 0 5px 0 5px;
+ }
+ .wrap .toolbar
+ {
+ display:block;
+ }
+
+ .wrap .breadcrumb ul li
+ {
+ float: left;
+ background: url(../images/breadcrumb.png) no-repeat 0 5px;
+ padding-left: 15px;
+ margin-left: 15px;
+ font-weight: bold;
+ }
+ .wrap .breadcrumb ul li.last
+ {
+ font-weight: normal;
+ }
+ .wrap .breadcrumb ul li a
+ {
+ /* color: #363534;*/
+ color: #00732F;
+ }
+ .wrap .breadcrumb ul li.first
+ {
+ background-image: none;
+ padding-left: 0;
+ margin-left: 0;
+ }
+ .wrap .content
+ {
+ word-wrap:break-word;
+ }
+ .wrap .content li
+ {
+ padding-left: 12px;
+ background: url(../images/bullet_sq.png) no-repeat 0 5px;
+ font: normal 400 10pt/1 Verdana;
+ margin-bottom: 10px;
+ }
+
+ .offline .wrap .content
+ {
+ padding-top: 15px;
+ }
+
+ .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+ hr
+ {
+ background-color: #E6E6E6;
+ border: 1px solid #E6E6E6;
+ height: 1px;
+ width: 100%;
+ text-align: left;
+ margin: 5px 0px 5px 0px;
+ }
+
+ .content .alignedsummary
+ {
+ margin: 5px;
+ width:100%;
+ }
+
+
+ .toc
+ {
+ float: right;
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ height: auto;
+ width: 200px;
+ }
+
+ .toc h3, .generic a
+ {
+ font: 600 12px/1.2 Arial;
+ }
+
+ .wrap .content .toc ul
+ {
+ padding-left: 0px;
+ }
+
+
+ .wrap .content .toc .level2
+ {
+ margin-left: 15px;
+ }
+
+ .wrap .content .toc .level3
+ {
+ margin-left: 30px;
+ }
+
+ .content .toc li
+ {
+ font: normal 10px/1.2 Verdana;
+ background: url(../images/bullet_dn.png) no-repeat 0 5px;
+ }
+
+
+ .generic{
+ max-width:75%;
+ }
+ .generic td{
+ padding:0;
+ }
+
+ .generic .odd .alphaChar{
+ background-color: #F6F6F6;
+ }
+
+ .generic .even .alphaChar{
+ background-color: #FFFFFF;
+ }
+
+ .highlightedCode
+ {
+ margin:10px;
+ }
+
+ .flowList{
+ vertical-align:top;
+ }
+ .alphaChar{
+ width:100%;
+ background-color:#F6F6F6;
+ border:1px solid #E6E6E6;
+ font-size:12pt;
+ padding-left:10px;
+ margin-top:10px;
+ margin-bottom:10px;
+ }
+
+ .flowList dl{
+ }
+ .flowList dd{
+ display:inline-block;
+ margin-left:10px;
+ width:250px;
+ }
+ .wrap .content .flowList p{
+ padding:0px;
+ }
+
+ .relpage
+ {
+ -moz-border-radius: 7px 7px 7px 7px;
+ border: 1px solid #DDDDDD;
+ padding: 25px 25px;
+ clear: both;
+ }
+ .relpage ul
+ {
+ float: none;
+ padding: 15px;
+ }
+ .content .relpage li
+ {
+ font: normal 11px/1.2 Verdana;
+ }
+ h3.fn, span.fn
+ {
+ background-color: #F6F6F6;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #E6E6E6;
+ font-weight: bold;
+ word-spacing:3px;
+ }
+
+ .functionIndex {
+ font-size:12pt;
+ word-spacing:10px;
+ margin-bottom:10px;
+ background-color: #F6F6F6;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #E6E6E6;
+ width:100%;
+ }
+
+ .centerAlign { text-align:center;}
+ .rightAlign {text-align:right;}
+ .leftAlign {text-align:left;}
+ .topAlign{vertical-align:top }
+ .functionIndex a{display:inline-block;}
+
+ /* start index box */
+ .indexbox
+ {
+ width: 100%;
+ display:inline-block;
+ }
+
+ .indexboxcont { display: block; }
+
+ .indexboxbar
+ {
+ border-bottom:1px solid #E5E5E5;
+ margin-bottom: 25px;
+ }
+
+ .indexboxcont .section
+ {
+ display: inline-block;
+ padding:0 2% 0 1%;
+ vertical-align:top;
+ }
+
+ .indexboxcont .section {
+ float: left;
+ }
+
+ .indexboxcont .section p
+ {
+ padding-top: 20px;
+ padding-bottom: 20px;
+ }
+ .indexboxcont .sectionlist
+ {
+ display: inline-block;
+ vertical-align:top;
+ padding: 0;
+ }
+ .indexboxcont .sectionlist ul
+ {
+ margin-bottom: 20px;
+ }
+
+ .indexboxcont .sectionlist ul li
+ {
+ line-height: 12px;
+ }
+
+ .content .indexboxcont li
+ {
+ font: normal 600 13px/1 Verdana;
+ }
+
+ .indexbox a:hover, .indexbox a:visited:hover
+ {
+ color: #4c0033;
+ text-decoration: underline;
+ }
+
+ .indexbox a:visited
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
+
+ .indexbox .indexIcon {
+ width: 11%;
+ }
+
+
+ .indexboxcont:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+ body.offline
+ {
+ background-image: none;
+ }
+
+ .offline .footer {
+ margin: 0;
+ }
+ .offline .header
+ {
+ width: 100%;
+ margin: 0;
+ height: auto;
+ background-color: #ffffff;
+ padding: 10px 0 5px 0;
+ overflow: visible;
+ border-bottom: solid #E5E5E5 1px;
+ z-index:1;
+ position:fixed;
+ }
+
+ .offline .header .content
+ {
+ }
+ .offline .header .qtref
+ {
+ color: #00732F;
+ position: static;
+ float: left;
+ margin-left: 5px;
+ font: bold 18px/1 Arial;
+ }
+
+ .offline .header .qtref:visited
+ {
+ color: #00732F;
+ }
+ .offline .header .qtref:hover
+ {
+ color: #00732F;
+ text-decoration:none;
+ }
+ .offline .header .qtref span
+ {
+ background-image: none;
+ text-indent: 0;
+ text-decoration:none;
+ }
+
+ .offline .wrap
+ {
+ margin: 0 5px 0 5px;
+ }
+
+ .offline .wrap .toolbar
+ {
+ display:block;
+ padding-top:5px;
+ }
+
+ .offline .wrap .breadcrumb ul li {
+ font-weight: normal;
+ }
+
+ .offline .wrap .breadcrumb ul li a {
+ /*color: #44a51c;*/
+ }
+
+ .offline .wrap .breadcrumb ul li.last a {
+ /*color: #363534;*/
+ }
+
+
+
+ .narrow .indexboxcont .section {
+ width: 64%;
+ padding-left: 0;
+ }
+
+ .narrow .indexboxcont .sectionlist {
+ width: 32.5%;
+ }
+
+ .header .icon,
+ .sidebar,
+ .feedback,
+ .t_button,
+ .feedback,
+ #feedbackBox,
+ #feedback,
+ #blurpage,
+ .indexbox .indexIcon span,
+ .wrapper .hd,
+ .offline .indexbox .indexIcon,
+ .offline .header #nav-logo,
+ #offlinemenu,
+ #offlinesearch,
+ .offline .header #nav-topright,
+ .offline .header #shortCut ,
+ .offline .wrapper .hd,
+ .offline .wrapper .ft,
+ .offline .sidebar,
+ .offline .wrap .feedback
+ {
+ display:none;
+ }
+
+ /* end offline mode */
+#narrowmenu {
+ display: none;
+ float: right;
+ margin: 15px 40px 0 0;
+ font-size: 11px;
+ }
+
+ .narrow #narrowmenu {
+ display: block;
+ }
+
+ #narrowsearch{
+ display:none;
+ }
+
+ #narrowmenu ul
+ {
+ border-bottom:solid 1px #E5E5E5;
+ border-left:solid 1px #E5E5E5;
+ border-right:solid 1px #E5E5E5;
+ }
+
+ #narrowmenu a {
+ line-height: 1.1;
+ background: url(../images/arrow_down.png) no-repeat 100% 50%;
+ white-space: nowrap;
+ padding: 0 16px 0 5px;
+ }
+
+ #narrowmenu li {
+ margin-left: 20px;
+ }
+
+ #narrowmenu li li {
+ margin: 0 0 5px 0;
+ }
+
+ #narrowmenu li li a {
+ padding: 0;
+ background-image: none;
+ }
+
+ #narrowmenu li,
+ #narrowmenu li ul {
+ background-color: #fff;
+ }
+
+ #narrowmenu li ul {
+ width: auto;
+ padding: 5px;
+ margin-top:-15px;
+ }
+
+ .sf-menu li:hover ul, .sf-menu li.sfHover ul {
+ top: 1.2em;
+ }
+.sf-menu, .sf-menu * {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.sf-menu {
+ line-height: 1.0;
+}
+.sf-menu ul {
+ position: absolute;
+ top: -999em;
+ width: 10em; /* left offset of submenus need to match (see below) */
+}
+.sf-menu ul li {
+ width: 100%;
+}
+.sf-menu li:hover {
+ visibility: inherit; /* fixes IE7 'sticky bug' */
+}
+.sf-menu li {
+ float: left;
+ position: relative;
+}
+.sf-menu a {
+ display: block;
+ position: relative;
+}
+.sf-menu li:hover ul,
+.sf-menu li.sfHover ul {
+ left: 0;
+ top: 2.5em; /* match top ul list item height */
+ z-index: 99;
+}
+ul.sf-menu li:hover li ul,
+ul.sf-menu li.sfHover li ul {
+ top: -999em;
+}
+ul.sf-menu li li:hover ul,
+ul.sf-menu li li.sfHover ul {
+ left: 10em; /* match ul width */
+ top: 0;
+}
+ul.sf-menu li li:hover li ul,
+ul.sf-menu li li.sfHover li ul {
+ top: -999em;
+}
+ul.sf-menu li li li:hover ul,
+ul.sf-menu li li li.sfHover ul {
+ left: 10em; /* match ul width */
+ top: 0;
+}
+
+}
+/* end of screen media */
+
+/* start of print media */
+
+@media print
+{
+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
+ {
+ display: none;
+ background: none;
+ }
+ .content
+ {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ background: none;
+ display: block;
+ }
+}
+/* end of print media */
diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css
new file mode 100644
index 0000000000..05159aa568
--- /dev/null
+++ b/doc/src/template/style/narrow.css
@@ -0,0 +1,250 @@
+ /* start narrow mode */
+
+ body.narrow
+ {
+ background-image: none;
+ }
+
+ .narrow a {
+ color: #44a51c;
+ }
+
+ .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper {
+ margin: 0 7px;
+ min-width: 300px;
+ }
+
+ .narrow .footer {
+ margin: 0;
+ }
+ .narrow .header
+ {
+ width: 100%;
+ margin: 0;
+ height: auto;
+ background: #fff url(../images/header_bg.png) repeat-x 0 100%;
+ padding: 10px 0 5px 0;
+ overflow: visible;
+ }
+
+ .narrow .header .content
+ {
+ }
+
+ .narrow .header #nav-logo
+ {
+ display: none;
+ }
+
+ .narrow .header .qtref
+ {
+ width: auto;
+ height: auto;
+ color: #363534;
+ position: static;
+ float: left;
+ margin-left: 25px;
+ font: bold 18px/1 Arial;
+ }
+
+ .narrow .header .qtref a
+ {
+ color: #363534;
+ }
+
+ .narrow .header .qtref span
+ {
+ background-image: none;
+ text-indent: 0;
+ }
+
+ .narrow .header #nav-topright
+ {
+ display: none;
+ }
+
+ .narrow .header #shortCut
+ {
+ clear: both;
+ font-weight: normal;
+ position: static;
+ float: left;
+ margin: 15px 0 0 25px;
+ overflow: hidden;
+ padding: 0;
+ height: auto;
+ }
+
+ .narrow .header #shortCut ul
+ {
+ float: none;
+ margin: 0;
+ width: auto;
+ font-size: 11px;
+ }
+
+ .narrow .header #shortCut ul li
+ {
+ background-image: none;
+ }
+
+ .narrow .header #shortCut ul .shortCut-topleft-active,
+ .narrow .header #shortCut ul .shortCut-topleft-inactive
+ {
+ background-image: none;
+ height: auto;
+ padding: 0;
+ width: auto;
+ }
+ .narrow .header #shortCut ul li a
+ {
+ color: #44a51c;
+ }
+
+ .narrow .wrapper .hd
+ {
+ background: url(../images/bg_ul_blank.png) no-repeat 0 0;
+ }
+
+ .narrow .wrapper .bd
+ {
+ background: url(../images/bg_l_blank.png) repeat-y 0 0;
+ }
+
+ .narrow .wrapper .ft
+ {
+ background: url(../images/bg_ll_blank.png) no-repeat 0 0;
+ }
+
+ .narrow .sidebar
+ {
+ display: none;
+ }
+
+ .narrow .wrap
+ {
+ margin: 0 5px 0 5px;
+ }
+
+ .narrow .wrap .toolbar
+ {
+ border-bottom: none;
+ }
+
+ .narrow .wrap .content
+ {
+ padding-top: 15px;
+ }
+
+ .narrow .wrap .feedback
+ {
+ display: none;
+ }
+
+ .narrow .wrap .breadcrumb ul li {
+ font-weight: normal;
+ }
+
+ .narrow .wrap .breadcrumb ul li a {
+ color: #44a51c;
+ }
+
+ .narrow .wrap .breadcrumb ul li.last a {
+ color: #363534;
+ }
+
+ #narrowsearch {
+ display: none;
+ }
+
+ .narrow #narrowsearch {
+ display: block;
+ float: right;
+ margin-right: 25px;
+ _position: relative;
+ }
+
+ .narrow #narrowsearch fieldset {
+ _position: absolute;
+ _margin-top: -1px;
+ }
+
+ .narrow #narrowsearch {
+ background: url("http://doc.qt.nokia.com/prototype/html/images/sprites-combined.png") no-repeat scroll -6px -348px transparent;
+ height: 21px;
+ padding: 2px 0 0 5px;
+ width: 167px;
+ }
+
+ .narrow #narrowsearch input {
+ border: none;
+ font: 13px/1.2 Verdana;
+ height: 19px;
+ outline: none;
+ padding: 0;
+ width: 158px;
+ *border: 1px solid #fff;
+ *height: 17px;
+ _height: 18px;
+ }
+
+ .narrow .indexbox .indexIcon {
+ display: none;
+ }
+
+ .narrow .indexboxcont .section {
+ width: 64%;
+ padding-left: 0;
+ }
+
+ .narrow .indexboxcont .sectionlist {
+ width: 32.5%;
+ }
+
+ #narrowmenu {
+ display: none;
+ float: right;
+ margin: 15px 40px 0 0;
+ font-size: 11px;
+ }
+
+ .narrow #narrowmenu {
+ display: block;
+ }
+
+ #narrowmenu a {
+ line-height: 1.1;
+ background: url(../images/arrow_down.png) no-repeat 100% 50%;
+ white-space: nowrap;
+ padding: 0 16px 0 5px;
+ }
+
+ #narrowmenu li {
+ margin-left: 20px;
+ }
+
+ #narrowmenu li li {
+ margin: 0 0 5px 0;
+ }
+
+ #narrowmenu li li a {
+ padding: 0;
+ background-image: none;
+ }
+
+ #narrowmenu li,
+ #narrowmenu li ul {
+ background-color: #fff;
+ margin-top:-1px;
+ }
+
+ #narrowmenu li ul {
+ width: auto;
+ padding: 5px;
+ }
+
+ .sf-menu li:hover ul, .sf-menu li.sfHover ul {
+ top: 1.2em;
+ }
+
+ /* end narrow mode */
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index d5920b9ddd..47fe2e0a04 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -39,7 +39,7 @@
h1, h2, h3, h4, h5, h6
{
font-size: 100%;
- font-weight: normal;
+/* font-weight: normal; */
}
q:before, q:after
{
@@ -58,6 +58,23 @@
{
vertical-align: baseline;
}
+ tt, .qmlreadonly span, .qmldefault span
+ {
+ word-spacing:5px;
+ }
+ .heading
+ {
+ font: normal 600 16px/1.0 Arial;
+ padding-bottom: 15px;
+ }
+ .subtitle
+ {
+ font-size: 13px;
+ }
+ .small-subtitle
+ {
+ font-size: 13px;
+ }
legend
{
color: #000000;
@@ -73,7 +90,6 @@
{
font-size: 100%;
}
- /* Page style */
html
{
background-color: #e5e5e5;
@@ -92,6 +108,11 @@
{
font-style: italic;
}
+ a
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
.header, .footer, .wrapper
{
min-width: 600px;
@@ -106,23 +127,19 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ul.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 0;
overflow: hidden;
}
.offline .wrapper .hd
{
- background: url(../images/bg_ul_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -15px;
}
.wrapper .hd span
{
height: 15px;
display: block;
- background: url(../images/bg_ur.png) no-repeat 100% 0;
overflow: hidden;
- }
- .offline .wrapper .hd span
- {
- /* background: url(../images/bg_ur_blank.png) no-repeat 100% 0; */
+ background: url(../images/page.png) no-repeat 100% -30px;
}
.wrapper .bd
{
@@ -137,18 +154,18 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ll.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -75px;
overflow: hidden;
}
.offline .wrapper .ft
{
- background: url(../images/bg_ll_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -90px;
}
.wrapper .ft span
{
height: 15px;
display: block;
- background: url(../images/bg_lr.png) no-repeat 100% 0;
+ background: url(../images/page.png) no-repeat 100% -60px;
overflow: hidden;
}
.header, .footer
@@ -182,186 +199,9 @@
width: 302px;
height: 22px;
text-indent: -999em;
- background: url(../images/qt_ref_doc.png) no-repeat 0 0;
- }
- /* header elements */
- #nav-topright
- {
- height: 70px;
- }
-
- #nav-topright ul
- {
- list-style-type: none;
- float: right;
- width: 370px;
- margin-top: 11px;
- }
-
- #nav-topright li
- {
- display: inline-block;
- margin-right: 20px;
- float: left;
- }
-
- #nav-topright li.nav-topright-last
- {
- margin-right: 0;
- }
-
- #nav-topright li a
- {
- background: transparent url(../images/sprites-combined.png) no-repeat;
- height: 18px;
- display: block;
- overflow: hidden;
- text-indent: -9999px;
- }
-
- #nav-topright li.nav-topright-home a
- {
- width: 65px;
- background-position: -2px -91px;
- }
-
- #nav-topright li.nav-topright-home a:hover
- {
- background-position: -2px -117px;
- }
-
-
- #nav-topright li.nav-topright-dev a
- {
- width: 30px;
- background-position: -76px -91px;
- }
-
- #nav-topright li.nav-topright-dev a:hover
- {
- background-position: -76px -117px;
- }
-
-
- #nav-topright li.nav-topright-labs a
- {
- width: 40px;
- background-position: -114px -91px;
- }
-
- #nav-topright li.nav-topright-labs a:hover
- {
- background-position: -114px -117px;
- }
-
- #nav-topright li.nav-topright-doc a
- {
- width: 32px;
- background-position: -162px -91px;
- }
-
- #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
- {
- background-position: -162px -117px;
- }
-
- #nav-topright li.nav-topright-blog a
- {
- width: 40px;
- background-position: -203px -91px;
- }
-
- #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
- {
- background-position: -203px -117px;
- }
-
- #nav-topright li.nav-topright-shop a
- {
- width: 40px;
- background-position: -252px -91px;
- }
-
- #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
- {
- background-position: -252px -117px;
- }
-
- #nav-logo
- {
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px;
- left: -3px;
- position: absolute;
- width: 75px;
- height: 75px;
- top: 13px;
- }
- #nav-logo a
- {
- width: 75px;
- height: 75px;
- display: block;
- text-indent: -9999px;
- overflow: hidden;
- }
- /* Clearing */
- .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
+ background: url(../images/sprites-combined.png) no-repeat -78px -235px;
}
- /* ^ Clearing */
-
-
- .shortCut-topleft-inactive
- {
- padding-left: 3px;
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px;
- height: 20px;
- width: 93px;
- }
- .shortCut-topleft-inactive span
- {
- font-variant: normal;
- }
- #shortCut
- {
- padding-top: 10px;
- font-weight: bolder;
- color: #b0adab;
- }
- #shortCut ul
- {
- list-style-type: none;
- float: left;
- width: 347px;
- margin-left: 100px;
- }
- #shortCut li
- {
- display: inline-block;
- margin-right: 25px;
- float: left;
- white-space: nowrap;
- }
- #shortCut li a
- {
- color: #b0adab;
- text-decoration: none;
- }
- #shortCut li a:hover
- {
- color: #44a51c;
- text-decoration: none;
- }
-
- /* end of header elements */
-
- /* menu element */
.sidebar
{
float: left;
@@ -369,32 +209,32 @@
width: 200px;
font-size: 11px;
}
- .sidebar a
- {
- color: #00732f;
- text-decoration: none;
- }
- .offline .sidebar, .offline .feedback
+
+ .offline .sidebar, .offline .feedback, .offline .t_button
{
display: none;
}
+
.sidebar .searchlabel
{
padding: 0 0 2px 17px;
font: normal bold 11px/1.2 Verdana;
}
+
.sidebar .search
{
padding: 0 15px 0 16px;
}
+
.sidebar .search form
{
- width: 167px;
- height: 21px;
- padding: 2px 0 0 5px;
- background: url(../images/form_bg.png) no-repeat 0 0;
+ background: url(../images/sprites-combined.png) no-repeat -6px -348px;
+ height:21px;
+ padding:2px 0 0 5px;
+ width:167px;
}
- .sidebar .search form fieldset input#searchstring
+
+ .sidebar .search form input#pageType
{
width: 158px;
height: 19px;
@@ -403,35 +243,68 @@
outline: none;
font: 13px/1.2 Verdana;
}
+
.sidebar .box
{
padding: 17px 15px 5px 16px;
}
+
.sidebar .box .first
{
background-image: none;
}
+
.sidebar .box h2
{
font: normal 18px/1.2 Arial;
- padding: 15px 0 0 40px;
+ padding: 0;
min-height: 32px;
}
+ .sidebar .box h2 span
+ {
+ overflow: hidden;
+ display: inline-block;
+ }
.sidebar .box#lookup h2
{
- background: url(../images/api_lookup.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #lookup.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -6px -311px;
+ width: 27px;
+ height: 35px;
+ margin-right: 13px;
}
.sidebar .box#topics h2
{
- background: url(../images/api_topics.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #topics.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -94px -311px;
+ width: 27px;
+ height: 32px;
+ margin-right: 13px;
}
.sidebar .box#examples h2
{
- background: url(../images/api_examples.png) no-repeat 0 0;
+ background-image: none;
}
+ .sidebar #examples.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -48px -311px;
+ width: 30px;
+ height: 31px;
+ margin-right: 9px;
+ }
+
.sidebar .box .list
{
display: block;
+ max-height:200px;
+ overflow-y:auto;
+ overflow-x:none;
}
.sidebar .box .live
{
@@ -443,33 +316,34 @@
{
text-decoration: underline;
}
+ .sidebar .box ul
+ {
+ padding:10px;
+ }
.sidebar .box ul li
{
padding-left: 12px;
background: url(../images/bullet_gt.png) no-repeat 0 5px;
- margin-bottom: 15px;
+ margin-bottom: 5px;
}
.sidebar .bottombar
{
background: url(../images/box_bg.png) repeat-x 0 bottom;
}
- /* content elements */
.wrap
{
- overflow: hidden;
+ margin: 0 5px 0 208px;
+ overflow: visible;
}
.offline .wrap
{
margin: 0 5px 0 5px;
}
- /* tool bar */
.wrap .toolbar
{
background-color: #fafafa;
border-bottom: 1px solid #d1d1d1;
- height: 20px;
- margin-left: 3px;
- margin-right: 5px;
+ height: 20px;
position: relative;
}
.wrap .toolbar .toolblock
@@ -487,7 +361,7 @@
{
padding: 0 0 10px 21px;
right: 5px;
- vertical-align: top;
+ vertical-align: middle;
overflow: hidden;
}
.wrap .toolbar .toolbuttons .active
@@ -507,32 +381,56 @@
font-weight: bold;
color: #B0ADAB;
}
- #smallA
+
+ .toolbuttons #print
+ {
+ border-left: 1px solid #c5c4c4;
+ margin-top: 0;
+ padding-left: 7px;
+ text-indent: 0;
+ }
+ .toolbuttons #print a
+ {
+ width: 16px;
+ height: 16px;
+ }
+
+ .toolbuttons #print a span
+ {
+ width: 16px;
+ height: 16px;
+ text-indent: -999em;
+ display: block;
+ overflow: hidden;
+ background: url(../images/sprites-combined.png) no-repeat -137px -311px;
+ }
+
+ .toolbuttons #smallA
{
font-size: 10pt;
}
- #medA
+ .toolbuttons #medA
{
font-size: 12pt;
}
- #bigA
+ .toolbuttons #bigA
{
font-size: 14pt;
+ margin-right: 7px;
}
+
#smallA:hover, #medA:hover, #bigA:hover
{
color: #00732F;
}
- #print
+
+ .offline .wrap .breadcrumb
{
- font-size: 14pt;
- line-height: 20pt;
}
- #printIcon
+
+ .wrap .breadcrumb ul
{
- margin-left: 5px;
}
- /* bread crumbs */
.wrap .breadcrumb ul li
{
float: left;
@@ -545,6 +443,10 @@
{
font-weight: normal;
}
+ .wrap .breadcrumb ul li a
+ {
+ color: #363534;
+ }
.wrap .breadcrumb ul li.first
{
background-image: none;
@@ -554,29 +456,30 @@
.wrap .content
{
padding: 30px;
- position: relative;
+ word-wrap:break-word;
}
- /* text elements */
- .heading
+
+ .wrap .content li
{
- font: normal 600 16px/1.0 Arial;
- padding-bottom: 15px;
+ padding-left: 12px;
+ background: url(../images/bullet_sq.png) no-repeat 0 5px;
+ font: normal 400 10pt/1 Verdana;
+ /* color: #44a51c;*/
+ margin-bottom: 10px;
}
-
- .subtitle
+ .content li:hover
{
- font-size: 13px;
+ /* text-decoration: underline;*/
}
- .small-subtitle
+ .offline .wrap .content
{
- font-size: 13px;
+ padding-top: 15px;
}
-
+
.wrap .content h1
{
font: 600 18px/1.2 Arial;
- padding-bottom: 15px;
}
.wrap .content h2
{
@@ -588,25 +491,18 @@
}
.wrap .content p
{
- line-height:20px;
- padding:10px 5px 10px 5px;
+ line-height: 20px;
+ padding: 5px;
}
+ .wrap .content table p
+ {
+ line-height: 20px;
+ padding: 0px;
+ }
.wrap .content ul
{
padding-left: 25px;
- }
- .wrap .content li
- {
- padding-left: 12px;
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- font: normal 400 10pt/1 Verdana;
- margin-bottom: 10px;
- line-height: 14px;
- }
- a
- {
- color: #00732F;
- text-decoration: none;
+ padding-top: 10px;
}
a:hover
{
@@ -618,22 +514,26 @@
color: #4c0033;
text-decoration: none;
}
- .offline .wrap .content
+ .content a:visited:hover
{
- padding-top: 15px;
- }
- .footer
+ color: #4c0033;
+ text-decoration: underline;
+ } .footer
{
min-height: 100px;
color: #797775;
font: normal 9px/1 Verdana;
text-align: center;
padding-top: 40px;
+ background-color: #E6E7E8;
+ margin: 0;
}
.feedback
{
- float: right;
- padding-right: 10px;
+ float: none;
+ position: absolute;
+ right: 15px;
+ bottom: 10px;
font: normal 8px/1 Verdana;
color: #B0ADAB;
}
@@ -644,37 +544,244 @@
color: #00732F;
text-decoration: underline;
}
+ .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+ #nav-topright
+ {
+ height: 70px;
+ }
+
+ #nav-topright ul
+ {
+ list-style-type: none;
+ float: right;
+ width: 370px;
+ margin-top: 11px;
+ }
+
+ #nav-topright li
+ {
+ display: inline-block;
+ margin-right: 20px;
+ float: left;
+ }
+
+ #nav-topright li.nav-topright-last
+ {
+ margin-right: 0;
+ }
+
+ #nav-topright li a
+ {
+ background: transparent url(../images/sprites-combined.png) no-repeat;
+ height: 18px;
+ display: block;
+ overflow: hidden;
+ text-indent: -9999px;
+ }
+
+ #nav-topright li.nav-topright-home a
+ {
+ width: 65px;
+ background-position: -2px -91px;
+ }
+
+ #nav-topright li.nav-topright-home a:hover
+ {
+ background-position: -2px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-dev a
+ {
+ width: 30px;
+ background-position: -76px -91px;
+ }
+
+ #nav-topright li.nav-topright-dev a:hover
+ {
+ background-position: -76px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-labs a
+ {
+ width: 40px;
+ background-position: -114px -91px;
+ }
+
+ #nav-topright li.nav-topright-labs a:hover
+ {
+ background-position: -114px -117px;
+ }
+
+ #nav-topright li.nav-topright-doc a
+ {
+ width: 32px;
+ background-position: -162px -91px;
+ }
+
+ #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
+ {
+ background-position: -162px -117px;
+ }
+
+ #nav-topright li.nav-topright-blog a
+ {
+ width: 40px;
+ background-position: -203px -91px;
+ }
+
+ #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
+ {
+ background-position: -203px -117px;
+ }
+
+ #nav-topright li.nav-topright-shop a
+ {
+ width: 40px;
+ background-position: -252px -91px;
+ }
+
+ #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
+ {
+ background-position: -252px -117px;
+ }
+
+ #nav-logo
+ {
+ background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
+ left: -3px;
+ position: absolute;
+ width: 75px;
+ height: 75px;
+ top: 13px;
+ }
+ #nav-logo a
+ {
+ width: 75px;
+ height: 75px;
+ display: block;
+ text-indent: -9999px;
+ overflow: hidden;
+ }
+
+
+ .shortCut-topleft-inactive
+ {
+ padding-left: 3px;
+ background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
+ height: 20px;
+ width: 47px;
+ }
+ .shortCut-topleft-inactive span
+ {
+ font-variant: normal;
+ }
+ .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover
+ {
+ text-decoration:none;
+ }
+ #shortCut
+ {
+ padding-top: 10px;
+ font-weight: bolder;
+ color: #b0adab;
+ }
+ #shortCut ul
+ {
+ list-style-type: none;
+ float: left;
+ width: 347px;
+ margin-left: 100px;
+ }
+ #shortCut li
+ {
+ display: inline-block;
+ margin-right: 25px;
+ float: left;
+ white-space: nowrap;
+ }
+ #shortCut li a
+ {
+ color: #b0adab;
+ }
+ #shortCut li a:hover
+ {
+ color: #44a51c;
+ }
+
hr
{
- background-color: #e0e0e0;
+ background-color: #E6E6E6;
+ border: 1px solid #E6E6E6;
height: 1px;
width: 100%;
text-align: left;
margin: 15px 0px 15px 0px;
}
-
+
.content .alignedsummary
{
margin: 15px;
}
- /* tables */
+ pre
+ {
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ overflow-x: auto;
+ }
table, pre
{
-moz-border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
- font-size: 11px;
- min-width: 395px;
+ font-size: 11px;
+ /*min-width: 395px;*/
margin-bottom: 25px;
+ display: inline-block;
+ }
+ thead
+ {
+ margin-top: 5px;
+ font:600 12px/1.2 Arial;
+ }
+ th
+ {
+ padding: 5px 15px 5px 15px;
+ background-color: #E1E1E1;
+ /* border-bottom: 1px solid #E6E6E6;*/
+ border-left: 1px solid #E6E6E6;
+ /* border-right: 1px solid #E6E6E6;*/
}
- thead{margin-top: 5px;}
- th{ padding: 3px 15px 3px 15px;}
- td{padding: 3px 15px 3px 20px;}
+ td
+ {
+ padding: 3px 15px 3px 20px;
+ /* border-left: 1px solid #E6E6E6;
+ border-right: 1px solid #E6E6E6;*/
+ }
+ tr.odd td:hover, tr.even td:hover
+ {
+ /* border-right: 1px solid #C3C3C3;
+ border-left: 1px solid #C3C3C3;*/
+ }
+
+ td.rightAlign
+ {
+ padding: 3px 15px 3px 10px;
+ }
table tr.odd
{
border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
+ background-color: #F6F6F6;
color: #66666E;
}
table tr.even
@@ -683,14 +790,11 @@
background-color: #ffffff;
color: #66666E;
}
- table tr.odd:hover
- {
- background-color: #E6E6E6;
- }
- table tr.even:hover
+ table tr.odd td:hover, table tr.even td:hover
{
background-color: #E6E6E6;
}
+
span.comment
{
color: #8B0000;
@@ -700,15 +804,7 @@
{
color: #254117;
}
- pre
- {
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
- overflow-x:auto;
- }
+
.qmltype
{
text-align: center;
@@ -736,11 +832,11 @@
#feedbackBox
{
- display:none;
- -moz-border-radius:7px 7px 7px 7px;
- border:1px solid #DDDDDD;
- position:fixed;
- top:100px;
+ display: none;
+ -moz-border-radius: 7px 7px 7px 7px;
+ border: 1px solid #DDDDDD;
+ position: fixed;
+ top: 100px;
left: 33%;
height: 190px;
width: 400px;
@@ -748,29 +844,29 @@
background-color: #e6e7e8;
z-index: 4;
}
- #feedcloseX a
+ #feedcloseX
{
- display:inline;
+ display: inline;
padding: 5px 5px 0 0;
- margin-bottom:3px;
+ margin-bottom: 3px;
color: #363534;
- font-weight:600;
+ font-weight: 600;
float: right;
text-decoration: none;
}
+
#feedbox
- /* here */
{
- display:inline;
+ display: inline;
width: 370px;
height: 120px;
- margin:0px 25px 10px 15px;
+ margin: 0px 25px 10px 15px;
}
#feedsubmit
{
- display:inline;
- float:right;
- margin:4px 32px 0 0;
+ display: inline;
+ float: right;
+ margin: 4px 32px 0 0;
}
#blurpage
{
@@ -786,36 +882,77 @@
}
.toc
{
- float: right;
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
+ float: right;
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
height: auto;
width: 200px;
}
- .toc h3
+ .toc h3, .generic a
{
- font:600 12px/1.2 Arial;
+ font: 600 12px/1.2 Arial;
}
+
+ .generic{
+ max-width:75%;
+ }
+ .generic td{
+ padding:0;
+ }
+
+ .generic .odd .alphaChar{
+ background-color: #F6F6F6;
+ }
+
+ .generic .even .alphaChar{
+ background-color: #FFFFFF;
+ }
+
+ .alignedsummary{}
+ .propsummary{}
+ .memItemLeft{}
+ .memItemRight{}
+ .bottomAlign{}
+ .highlightedCode
+ {
+ margin:10px;
+ }
+ .LegaleseLeft{}
+ .valuelist{}
+ .annotated{}
+ .obsolete{}
+ .compat{}
+ .flags{}
+ .qmlsummary{}
+ .qmlitem{}
+ .qmlproto{}
+ .qmlname{}
+ .qmlreadonly{}
+ .qmldefault{}
+ .qmldoc{}
+ .qt-style{}
+ .redFont{}
+ code{}
.wrap .content .toc ul
{
- /* float: left;*/
padding-left: 0px;
-
}
.wrap .content .toc .level2
{
- /* float: left;*/
- padding-left: 15px;
-
+ margin-left: 15px;
+ }
+
+ .wrap .content .toc .level3
+ {
+ margin-left: 30px;
}
-
.content .toc li
{
@@ -823,133 +960,220 @@
background: url(../images/bullet_dn.png) no-repeat 0 5px;
}
- .relpage
+ .relpage
{
-moz-border-radius: 7px 7px 7px 7px;
border: 1px solid #DDDDDD;
padding: 25px 25px;
- clear:both;
+ clear: both;
}
.relpage ul
{
float: none;
padding: 15px;
}
- .content .relpage li
+ .content .relpage li
{
font: normal 11px/1.2 Verdana;
}
- /* edit */
h3.fn, span.fn
{
background-color: #F6F6F6;
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
- font-weight: bold;
- /* padding: 6px 0px 6px 10px;*/
- /* margin: 42px 0px 0px 0px;*/
+ font-weight: bold;
+ word-spacing:3px;
}
- /* edit */
- .indexbox
- {
- width: 100%;
- }
- .content .indexboxcont li
- {
- font: normal 600 13px/1 Verdana;
- }
+ .functionIndex {
+ font-size:12pt;
+ word-spacing:10px;
+ margin-bottom:10px;
+ background-color: #F6F6F6;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #E6E6E6;
+ width:100%;
+ }
+
+ .centerAlign
+ {
+ text-align:center;
+ }
+
+ .rightAlign
+ {
+ text-align:right;
+ }
- /* .indexbox a
- {
- color: #00732f;
- text-decoration: none;
- }*/
- .indexbox a:hover, .indexbox a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- .indexbox a:visited
+
+ .leftAlign
+ {
+ text-align:left;
+ }
+
+ .topAlign{
+ vertical-align:top
+ }
+
+ .functionIndex a{
+ display:inline-block;
+ }
+
+ /* start index box */
+ .indexbox
{
- color: #00732f;
- text-decoration: none;
+ width: 100%;
+ display:inline-block;
}
.indexboxcont
{
display: block;
+ /* overflow: hidden;*/
}
.indexboxbar
{
- background: transparent url( "../images/horBar.png" ) repeat-x left bottom;
+ background: transparent url(../images/horBar.png ) repeat-x left bottom;
margin-bottom: 25px;
+ /* background-image: none;
+ border-bottom: 1px solid #e2e2e2;*/
}
.indexboxcont .section
{
- display: inline-block;
+ display: inline-block;
width: 49%;
*width:42%;
_width:42%;
padding:0 2% 0 1%;
vertical-align:top;
+
}
.indexboxcont .indexIcon
- {
+ {
width: 11%;
*width:18%;
_width:18%;
overflow:hidden;
+
}
+
+.indexboxcont .section {
+ float: left;
+}
+
.indexboxcont .section p
- {
+ {
padding-top: 20px;
padding-bottom: 20px;
}
-
.indexboxcont .sectionlist
{
display: inline-block;
- width: 33%;
- margin-right: -2px;
- vertical-align: top;
+ vertical-align:top;
+ width: 32.5%;
padding: 0;
}
- .tricol
- {
-
- }
.indexboxcont .sectionlist ul
{
- padding-left: 15px;
margin-bottom: 20px;
}
-/*
+
.indexboxcont .sectionlist ul li
{
line-height: 12px;
}
-*/
- .lastcol
+
+ .content .indexboxcont li
{
- display: inline-block;
- vertical-align: top;
- padding: 0;
- max-width: 25%;
+ font: normal 600 13px/1 Verdana;
}
- .tricol .lastcol
+ .indexbox a:hover, .indexbox a:visited:hover
{
- margin-left:-6px;
+ color: #4c0033;
+ text-decoration: underline;
}
- /*.toc ul*/
+ .indexbox a:visited
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
+
+ .indexbox .indexIcon {
+ width: 11%;
+ }
+
+
+ .indexbox .indexIcon span
+ {
+ display: block;
+ }
+
+ .indexbox.guide .indexIcon span
+ {
+ width: 96px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -5px -376px;
+ padding: 0;
+ }
+
+ .indexbox.tools .indexIcon span
+ {
+ width: 115px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -111px -376px;
+ padding: 0;
+ }
+ .indexboxcont:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+.sidebar .search form input.loading
+{
+ background:url("../images/spinner.gif") no-repeat scroll right center transparent;
+}
+
+ /* end of screen media */
+
+.flowList{
+vertical-align:top;
+}
+.alphaChar{
+width:100%;
+background-color:#F6F6F6;
+border:1px solid #E6E6E6;
+font-size:12pt;
+padding-left:10px;
+margin-top:10px;
+margin-bottom:10px;
+}
+
+.flowList dl{
+}
+.flowList dd{
+display:inline-block;
+margin-left:10px;
+width:250px;
+}
+.wrap .content .flowList p{
+padding:0px;
+}
+pre.highlightedCode {
+ display: block;
+ overflow:hidden;
+}
- /* end page elements */
}
/* end of screen media */
@@ -957,7 +1181,7 @@
@media print
{
- .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
{
display: none;
background: none;
diff --git a/doc/src/template/style/superfish.css b/doc/src/template/style/superfish.css
new file mode 100644
index 0000000000..0cf0f7dc96
--- /dev/null
+++ b/doc/src/template/style/superfish.css
@@ -0,0 +1,51 @@
+.sf-menu, .sf-menu * {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+.sf-menu {
+ line-height: 1.0;
+}
+.sf-menu ul {
+ position: absolute;
+ top: -999em;
+ width: 10em; /* left offset of submenus need to match (see below) */
+}
+.sf-menu ul li {
+ width: 100%;
+}
+.sf-menu li:hover {
+ visibility: inherit; /* fixes IE7 'sticky bug' */
+}
+.sf-menu li {
+ float: left;
+ position: relative;
+}
+.sf-menu a {
+ display: block;
+ position: relative;
+}
+.sf-menu li:hover ul,
+.sf-menu li.sfHover ul {
+ left: 0;
+ top: 2.5em; /* match top ul list item height */
+ z-index: 99;
+}
+ul.sf-menu li:hover li ul,
+ul.sf-menu li.sfHover li ul {
+ top: -999em;
+}
+ul.sf-menu li li:hover ul,
+ul.sf-menu li li.sfHover ul {
+ left: 10em; /* match ul width */
+ top: 0;
+}
+ul.sf-menu li li:hover li ul,
+ul.sf-menu li li.sfHover li ul {
+ top: -999em;
+}
+ul.sf-menu li li li:hover ul,
+ul.sf-menu li li li.sfHover ul {
+ left: 10em; /* match ul width */
+ top: 0;
+}
diff --git a/doc/src/template/style/superfish_skin.css b/doc/src/template/style/superfish_skin.css
new file mode 100644
index 0000000000..8d84827c41
--- /dev/null
+++ b/doc/src/template/style/superfish_skin.css
@@ -0,0 +1,83 @@
+
+/*** DEMO SKIN ***/
+.sf-menu {
+ float: left;
+ margin-bottom: 1em;
+}
+.sf-menu a {
+ border-left: 1px solid #fff;
+ border-top: 1px solid #CFDEFF;
+ padding: .75em 1em;
+ text-decoration:none;
+}
+.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
+ color: #13a;
+}
+.sf-menu li {
+ background: #BDD2FF;
+}
+.sf-menu li li {
+ background: #AABDE6;
+}
+.sf-menu li li li {
+ background: #9AAEDB;
+}
+.sf-menu li:hover, .sf-menu li.sfHover,
+.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
+ background: #CFDEFF;
+ outline: 0;
+}
+
+/*** arrows **/
+.sf-menu a.sf-with-ul {
+ padding-right: 2.25em;
+ min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
+}
+.sf-sub-indicator {
+ position: absolute;
+ display: block;
+ right: .75em;
+ top: 1.05em; /* IE6 only */
+ width: 10px;
+ height: 10px;
+ text-indent: -999em;
+ overflow: hidden;
+ background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
+}
+a > .sf-sub-indicator { /* give all except IE6 the correct values */
+ top: .8em;
+ background-position: 0 -100px; /* use translucent arrow for modern browsers*/
+}
+/* apply hovers to modern browsers */
+a:focus > .sf-sub-indicator,
+a:hover > .sf-sub-indicator,
+a:active > .sf-sub-indicator,
+li:hover > a > .sf-sub-indicator,
+li.sfHover > a > .sf-sub-indicator {
+ background-position: -10px -100px; /* arrow hovers for modern browsers*/
+}
+
+/* point right for anchors in subs */
+.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
+.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
+/* apply hovers to modern browsers */
+.sf-menu ul a:focus > .sf-sub-indicator,
+.sf-menu ul a:hover > .sf-sub-indicator,
+.sf-menu ul a:active > .sf-sub-indicator,
+.sf-menu ul li:hover > a > .sf-sub-indicator,
+.sf-menu ul li.sfHover > a > .sf-sub-indicator {
+ background-position: -10px 0; /* arrow hovers for modern browsers*/
+}
+
+/*** shadows for all but IE6 ***/
+.sf-shadow ul {
+ background: url('../images/shadow.png') no-repeat bottom right;
+ padding: 0 8px 9px 0;
+ -moz-border-radius-bottomleft: 17px;
+ -moz-border-radius-topright: 17px;
+ -webkit-border-top-right-radius: 17px;
+ -webkit-border-bottom-left-radius: 17px;
+}
+.sf-shadow ul.sf-shadow-off {
+ background: transparent;
+}
diff --git a/doc/src/tutorials/addressbook-fr.qdoc b/doc/src/tutorials/addressbook-fr.qdoc
index 98c44a3266..85a9acffbb 100644
--- a/doc/src/tutorials/addressbook-fr.qdoc
+++ b/doc/src/tutorials/addressbook-fr.qdoc
@@ -42,10 +42,6 @@
/*!
\page tutorials-addressbook-fr.html
- \startpage {index.html}{Qt Reference Documentation}
- \contentspage Tutorials
- \nextpage {tutorials/addressbook-fr/part1}{Chapitre 1}
-
\title Tutoriel "Carnet d'adresses"
\brief Une introduction à la programation d'interface graphique montrant comment construire une application simple avec Qt.
@@ -93,8 +89,7 @@
/*!
\page tutorials-addressbook-fr-part1.html
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part2}{Chapitre 2}
+
\example tutorials/addressbook-fr/part1
\title Carnet d'adresses 1 - Conception de l'interface utilisateur
@@ -252,9 +247,7 @@
/*!
\page tutorials-addressbook-fr-part2.html
- \previouspage {tutorials/addressbook-fr/part1}{Chapitre 1}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part3}{Chapitre 3}
+
\example tutorials/addressbook-fr/part2
\title Carnet d'adresses 2 - Ajouter des adresses
@@ -414,9 +407,7 @@
/*!
\page tutorials-addressbook-fr-part3.html
- \previouspage {tutorials/addressbook-fr/part2}{Chapitre 2}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part4}{Chapitre 4}
+
\example tutorials/addressbook-fr/part3
\title Carnet d'adresses 3 - Navigation entre les éléments
@@ -536,9 +527,7 @@
/*!
\page tutorials-addressbook-fr-part4.html
- \previouspage {tutorials/addressbook-fr/part3}{Chapitre 3}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part5}{Chapitre 5}
+
\example tutorials/addressbook-fr/part4
\title Carnet d'Adresses 4 - éditer et supprimer des adresses
@@ -688,9 +677,7 @@
/*!
\page tutorials-addressbook-fr-part5.html
- \previouspage {tutorials/addressbook-fr/part4}{Chapitre 4}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part6}{Chapitre 6}
+
\example tutorials/addressbook-fr/part5
\title Carnet d'adresse 5 - Ajout d'une fonction de recherche
@@ -839,9 +826,7 @@
/*!
\page tutorials-addressbook-part6.html
- \previouspage {tutorials/addressbook-fr/part5}{Chapitre 5}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
- \nextpage {tutorials/addressbook-fr/part7}{Chapitre 7}
+
\example tutorials/addressbook-fr/part6
\title Carnet d'Adresses 6 - Sauvegarde et chargement
@@ -978,8 +963,7 @@
/*!
\page tutorials-addressbook-fr-part7.html
- \previouspage {tutorials/addressbook-fr/part6}{Chapitre 6}
- \contentspage {Tutoriel "Carnet d'adresses"}{Sommaire}
+
\example tutorials/addressbook-fr/part7
\title Carnet d'adresse 7 - Fonctionnalités avancées
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index 04410eb1dd..e5cb448a8a 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -42,15 +42,11 @@
/*!
\page tutorials-addressbook.html
- \startpage {index.html}{Qt Reference Documentation}
- \contentspage Tutorials
- \nextpage {tutorials/addressbook/part1}{Chapter 1}
-
\title Address Book Tutorial
\brief An introduction to GUI programming, showing how to put together a
simple yet fully-functioning application.
- This tutorial gives an introduction to GUI programming using the Qt
+ This tutorial is an introduction to GUI programming with the Qt
cross-platform framework.
\image addressbook-tutorial-screenshot.png
@@ -61,8 +57,8 @@
Some commonly used features are never used in this tutorial.
\endomit
- In the process, we will learn about some basic technologies provided by Qt,
- such as
+ In this tutorial, you will learn about some of the basic
+ components of Qt, including:
\list
\o Widgets and layout managers
@@ -71,13 +67,9 @@
\o Input and output devices
\endlist
- If you are completely new to Qt, please read \l{How to Learn Qt} if you
- have not already done so.
-
- The tutorial's source code is located in Qt's \c examples/tutorials/addressbook
- directory.
+ If you are new to Qt, we recommend reading \l{How to Learn Qt} first.
- Tutorial chapters:
+ Tutorial contents:
\list 1
\o \l{tutorials/addressbook/part1}{Designing the User Interface}
@@ -89,28 +81,30 @@
\o \l{tutorials/addressbook/part7}{Additional Features}
\endlist
- Although this little application does not look much like a fully-fledged
- modern GUI application, it uses many of the basic techniques that are used
- in more complex applications. After you have worked through it, we
- recommend checking out the \l{mainwindows/application}{Application}
- example, which presents a small GUI application, with menus, toolbars, a
- status bar, and so on.
+ The tutorial source code is located in \c{examples/tutorials/addressbook}.
+
+ Although this little application does not look much like a
+ fully-fledged modern GUI application, it uses many of the basic
+ elements that are used in more complex applications. After you
+ have worked through this tutorial, we recommend reading the
+ \l{mainwindows/application}{Application} example, which presents a
+ small GUI application, with menus, toolbars, a status bar, and so
+ on.
*/
/*!
\page tutorials-addressbook-part1.html
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part2}{Chapter 2}
+
\example tutorials/addressbook/part1
- \title Address Book 1 - Designing the User Interface
+ \title Part 1 - Designing the User Interface
- The first part of this tutorial covers the design of the basic graphical
- user interface (GUI) we use for the Address Book application.
+ This first part covers the design of the basic graphical user
+ interface (GUI) for our address book application.
- The first step to creating a GUI program is to design the user interface.
- In this chapter, our goal is to set up the labels and input fields needed
- to implement a basic address book application. The figure below is a
- screenshot of our expected output.
+ The first step in creating a GUI program is to design the user
+ interface. Here the our goal is to set up the labels and input
+ fields to implement a basic address book. The figure below is a
+ screenshot of the expected output.
\image addressbook-tutorial-part1-screenshot.png
@@ -169,14 +163,15 @@
\snippet tutorials/addressbook/part1/addressbook.h class definition
- The class holds declarations of \c nameLine and \c addressText, the
- private instances of QLineEdit and QTextEdit mentioned earlier.
- You will see, in the coming chapters, that data stored in \c nameLine and
- \c addressText is needed for many of the address book's functions.
+ The class holds declarations of \c nameLine and \c addressText,
+ the private instances of QLineEdit and QTextEdit mentioned
+ earlier. The data stored in \c nameLine and \c addressText will
+ be needed for many of the address book functions.
- We do not need to include declarations of the QLabel objects we will use
- because we will not need to reference them once they have been created.
- The way Qt tracks the ownership of objects is explained in the next section.
+ We don't include declarations of the QLabel objects we will use
+ because we will not need to reference them once they have been
+ created. The way Qt tracks the ownership of objects is explained
+ in the next section.
The Q_OBJECT macro itself implements some of the more advanced features of Qt.
For now, it is useful to think of the Q_OBJECT macro as a shortcut which allows
@@ -195,15 +190,14 @@
\snippet tutorials/addressbook/part1/addressbook.cpp constructor and input fields
- Within this constructor, we declare and instantiate two local QLabel objects,
- \c nameLabel and \c addressLabel, as well as instantiate \c nameLine and
- \c addressText. The
- \l{QObject::tr()}{tr()} function returns a translated version of the
- string, if there is one available; otherwise, it returns the string itself.
- Think of this function as an \c{<insert translation here>} marker to mark
- QString objects for translation. You will notice, in the coming chapters as
- well as in the \l{Qt Examples}, that we include it whenever we use a
- translatable string.
+ In this constructor, the QLabel objects \c nameLabel and \c
+ addressLabel are instantiated, as well as \c nameLine and \c
+ addressText. The \l{QObject::tr()}{tr()} function returns a
+ translated version of the string, if there is one
+ available. Otherwise it returns the string itself. This function
+ marks its QString parameter as one that should be translated into
+ other languages. It should be used wherever a translatable string
+ appears.
When programming with Qt, it is useful to know how layouts work.
Qt provides three main layout classes: QHBoxLayout, QVBoxLayout
@@ -254,14 +248,12 @@
/*!
\page tutorials-addressbook-part2.html
- \previouspage Address Book 1 - Designing the User Interface
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part3}{Chapter 3}
+
\example tutorials/addressbook/part2
- \title Address Book 2 - Adding Addresses
+ \title Part 2 - Adding Addresses
- The next step to creating our basic address book application is to allow
- a little bit of user interaction.
+ The next step in creating the address book is to implement some
+ user interactions.
\image addressbook-tutorial-part2-add-contact.png
@@ -283,9 +275,9 @@
However, for an overview of Qt's signals and slots concept, you can refer
to the \l{Signals and Slots} document.
- Three QPushButton objects: \c addButton, \c submitButton and
- \c cancelButton, are now included in our private variable declarations,
- along with \c nameLine and \c addressText from the last chapter.
+ Three QPushButton objects (\c addButton, \c submitButton, and
+ \c cancelButton) are now included in our private variable declarations,
+ along with \c nameLine and \c addressText.
\snippet tutorials/addressbook/part2/addressbook.h pushbutton declaration
@@ -407,20 +399,20 @@
/*!
\page tutorials-addressbook-part3.html
- \previouspage Address Book 2 - Adding Addresses
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part4}{Chapter 4}
+
\example tutorials/addressbook/part3
- \title Address Book 3 - Navigating between Entries
+ \title Part 3 - Navigating between Entries
- The address book application is now half complete. We need to add some
- functions to navigate between contacts. But first, we have to decide
- what sort of a data structure we would like to use to hold these contacts.
+ The address book is now about half complete. We should add the
+ capability to navigate among the contacts, but first we must
+ decide what sort of a data structure we need for containing these
+ contacts.
- In Chapter 2, we used a QMap of key-value pairs with the contact's name
- as the \e key, and the contact's address as the \e value. This works well
- for our case. However, in order to navigate and display each entry, a
- little bit of enhancement is needed.
+ In the previous section, we used a QMap of key-value pairs with
+ the contact's name as the \e key, and the contact's address as the
+ \e value. This works well for our case. However, in order to
+ navigate and display each entry, a little bit of enhancement is
+ needed.
We enhance the QMap by making it replicate a data structure similar to a
circularly-linked list, where all elements are connected, including the
@@ -431,9 +423,9 @@
\section1 Defining the AddressBook Class
- In order to add navigation functions to the address book application, we
- need to add two more slots to our \c AddressBook class: \c next() and
- \c previous(). These are added to our \c addressbook.h file:
+ To add navigation functions to the address book, we must add two
+ more slots to the \c AddressBook class: \c next() and \c
+ previous() to the \c addressbook.h file:
\snippet tutorials/addressbook/part3/addressbook.h navigation functions
@@ -455,8 +447,7 @@
\snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals
- The image below is our expected graphical user interface. Notice that it
- is getting closer to our final application.
+ The image below is the expected graphical user interface.
\image addressbook-tutorial-part3-screenshot.png
@@ -525,27 +516,26 @@
/*!
\page tutorials-addressbook-part4.html
- \previouspage Address Book 3 - Navigating between Entries
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part5}{Chapter 5}
+
\example tutorials/addressbook/part4
- \title Address Book 4 - Editing and Removing Addresses
+ \title Part 4 - Editing and Removing Addresses
- In this chapter, we look at ways to modify the contents of contacts stored
- in the address book application.
+ Now we look at ways to modify the contents of contacts stored in
+ the address book.
\image addressbook-tutorial-screenshot.png
- We now have an address book that not only holds contacts in an organized
- manner, but also allows navigation. It would be convenient to include
- edit and remove functions so that a contact's details can be changed
- when needed. However, this requires a little improvement, in the form of
- enums. In our previous chapters, we had two modes: \c{AddingMode} and
- \c{NavigationMode} - but they were not defined as enums. Instead, we
- enabled and disabled the corresponding buttons manually, resulting in
- multiple lines of repeated code.
+ We now have an address book that not only holds contacts in an
+ organized manner, but also allows navigation. It would be
+ convenient to include edit and remove functions so that a
+ contact's details can be changed when needed. However, this
+ requires a little improvement, in the form of enums. We defined
+ two modes: \c{AddingMode} and \c{NavigationMode}, but they were
+ not defined as enum values. Instead, we enabled and disabled the
+ corresponding buttons manually, resulting in multiple lines of
+ repeated code.
- In this chapter, we define the \c Mode enum with three different values:
+ Here we define the \c Mode enum with three different values:
\list
\o \c{NavigationMode},
@@ -579,10 +569,10 @@
\section1 Implementing the AddressBook Class
- We now have to implement the mode-changing features of the address book
- application. The \c editButton and \c removeButton are instantiated and
- disabled by default, as the address book starts up with zero contacts in
- memory.
+ We now implement the mode-changing features of the address
+ book. The \c editButton and \c removeButton are instantiated and
+ disabled by default. The address book starts with zero contacts
+ in memory.
\snippet tutorials/addressbook/part4/addressbook.cpp edit and remove buttons
@@ -653,33 +643,31 @@
\snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 2
- By performing the task of setting the mode and updating the user interface in
- the same function, we avoid the possibility of the user interface getting "out
- of sync" with the internal state of the application.
-*/
+ By setting the mode and updating the user interface in the same
+ function, we avoid the possibility of the user interface getting
+ out of sync with the internal state of the application.
+ */
/*!
\page tutorials-addressbook-part5.html
- \previouspage Address Book 4 - Editing and Removing Addresses
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part6}{Chapter 6}
+
\example tutorials/addressbook/part5
- \title Address Book 5 - Adding a Find Function
+ \title Part 5 - Adding a Find Function
- In this chapter, we look at ways to locate contacts and addresses in
- the address book application.
+ Here we look at ways to locate contacts and addresses in the
+ address book.
\image addressbook-tutorial-part5-screenshot.png
- As we keep adding contacts to our address book application, it becomes
- tedious to navigate them with the \e Next and \e Previous buttons. In this
- case, a \e Find function would be more efficient in looking up contacts.
- The screenshot above shows the \e Find button and its position on the panel
- of buttons.
+ As we add contacts to our address book, it becomes tedious to
+ navigate the list with the \e Next and \e Previous buttons. A \e
+ Find function would be more efficient. The screenshot above shows
+ the \e Find button and its position on the panel of buttons.
- When the user clicks on the \e Find button, it is useful to display a
- dialog that can prompt the user for a contact's name. Qt provides QDialog,
- which we subclass in this chapter, to implement a \c FindDialog class.
+ When the user clicks on the \e Find button, it is useful to
+ display a dialog that prompts for a contact's name. Qt provides
+ QDialog, which we subclass here to implement a \c FindDialog
+ class.
\section1 Defining the FindDialog Class
@@ -806,20 +794,18 @@
/*!
\page tutorials-addressbook-part6.html
- \previouspage Address Book 5 - Adding a Find Function
- \contentspage {Address Book Tutorial}{Contents}
- \nextpage {tutorials/addressbook/part7}{Chapter 7}
+
\example tutorials/addressbook/part6
- \title Address Book 6 - Loading and Saving
+ \title Part 6 - Loading and Saving
- This chapter covers the file handling features of Qt that we use to write
- loading and saving routines for the address book application.
+ This part covers the Qt file handling features we use to write
+ loading and saving routines for the address book.
\image addressbook-tutorial-part6-screenshot.png
- Although browsing and searching for contacts are useful features, our
- address book is not ready for use until we can save existing contacts and
- load them again at a later time.
+ Although browsing and searching the contact list are useful
+ features, our address book is not complete until we can save
+ existing contacts and load them again at a later time.
Qt provides a number of classes for \l{Input/Output and Networking}
{input and output}, but we have chosen to use two which are simple to use
@@ -930,21 +916,20 @@
/*!
\page tutorials-addressbook-part7.html
- \previouspage Address Book 6 - Loading and Saving
- \contentspage {Address Book Tutorial}{Contents}
+
\example tutorials/addressbook/part7
- \title Address Book 7 - Additional Features
+ \title Part 7 - Additional Features
- This chapter covers some additional features that make the address book
- application more convenient for everyday use.
+ This part covers some additional features that make the address
+ book more convenient for the frequent user.
\image addressbook-tutorial-part7-screenshot.png
- Although our address book application is useful in its own right, it would
- be useful if we could exchange contact data with other applications.
- The vCard format is a popular file format that can be used for this purpose.
- In this chapter, we extend our address book client to allow contacts to
- be exported to vCard \c{.vcf} files.
+ Although our address book is useful in isolation, it would be
+ better if we could exchange contact data with other applications.
+ The vCard format is a popular file format that can be used for
+ this purpose. Here we extend our address book client to allow
+ contacts to be exported to vCard \c{.vcf} files.
\section1 Defining the AddressBook Class
diff --git a/doc/src/tutorials/widgets-tutorial.qdoc b/doc/src/tutorials/widgets-tutorial.qdoc
index 2b04035d32..2b5f8cce25 100644
--- a/doc/src/tutorials/widgets-tutorial.qdoc
+++ b/doc/src/tutorials/widgets-tutorial.qdoc
@@ -45,84 +45,97 @@
\brief This tutorial covers basic usage of widgets and layouts, showing how
they are used to build GUI applications.
- \startpage {index.html}{Qt Reference Documentation}
- \contentspage Tutorials
- \nextpage {tutorials/widgets/toplevel}{Creating a Window}
-
-
\section1 Introduction
- Widgets are the basic building blocks of graphical user interface (GUI)
- applications made with Qt. Each GUI component, such as a button, label or
- text editor, is a widget and can be placed within an existing user
- interface or displayed as an independent window. Each type of component
- is provided by a particular subclass of QWidget, which is itself a
- subclass of QObject.
-
- QWidget is not an abstract class; it can be used as a container for other
- widgets, and can be subclassed with minimal effort to create custom
- widgets. It is most often used to create windows in which other widgets
- are placed.
-
- As with \l{QObject}s, widgets can be created with parent objects to
- indicate ownership, ensuring that objects are deleted when they are no
- longer used. With widgets, these parent-child relationships have an
- additional meaning: each child is displayed within the screen area
- occupied by its parent. This means that, when a window is deleted, all
- the widgets it contains are automatically deleted.
+ Widgets are the basic building blocks for graphical user interface
+ (GUI) applications built with Qt. Each GUI component (e.g.
+ buttons, labels, text editor) is a \l{QWidget}{widget} that is
+ placed somewhere within a user interface window, or is displayed
+ as an independent window. Each type of widge is provided by a
+ subclass of QWidget, which is itself a subclass of QObject.
+
+ QWidget is not an abstract class. It can be used as a container
+ for other widgets, and it can be subclassed with minimal effort to
+ create new, custom widgets. QWidget is often used to create a
+ window inside which other \l{QWidget}s are placed.
+
+ As with \l{QObject}s, \l{QWidget}s can be created with parent
+ objects to indicate ownership, ensuring that objects are deleted
+ when they are no longer used. With widgets, these parent-child
+ relationships have an additional meaning: Each child widget is
+ displayed within the screen area occupied by its parent widget.
+ This means that when you delete a window widget, all the child
+ widgets it contains are also deleted.
\section1 Writing a main Function
- Many of the GUI examples in Qt follow the pattern of having a \c{main.cpp}
- file containing code to initialize the application, and a number of other
- source and header files containing the application logic and custom GUI
- components.
+ Many of the GUI examples provided with Qt follow the pattern of
+ having a \c{main.cpp} file, which contains the standard code to
+ initialize the application, plus any number of other source/header
+ files that contain the application logic and custom GUI components.
- A typical \c main() function, written in \c{main.cpp}, looks like this:
+ A typical \c main() function in \c{main.cpp} looks like this:
\snippet doc/src/snippets/widgets-tutorial/template.cpp main.cpp body
- We first construct a QApplication object which is configured using any
- arguments passed in from the command line. After any widgets have been
- created and shown, we call QApplication::exec() to start Qt's event loop.
- Control passes to Qt until this function returns, at which point we return
- the value we obtain from this function.
+ First, a QApplication object is constructed, which can be
+ configured with arguments passed in from the command line. After
+ the widgets have been created and shown, QApplication::exec() is
+ called to start Qt's event loop. Control passes to Qt until this
+ function returns. Finally, \c{main()} returns the value returned
+ by QApplication::exec().
- In each part of this tutorial, we provide an example that is written
- entirely within a \c main() function. In more sophisticated examples, the
- code to set up widgets and layouts is written in other parts of the
- example. For example, the GUI for a main window may be set up in the
- constructor of a QMainWindow subclass.
+ \section1 Simple widget examples
+
+ Each of theses simple widget examples is written entirely within
+ the \c main() function.
+
+ \list
+ \o \l {tutorials/widgets/toplevel} {Creating a window}
+
+ \o \l {tutorials/widgets/childwidget} {Creating child widgets}
+
+ \o \l {tutorials/widgets/windowlayout} {Using layouts}
+
+ \o \l {tutorials/widgets/nestedlayouts} {Nested layouts}
+ \endlist
+
+ \section1 Real world widget examples
- The \l{Widgets examples} are a good place to look for
- more complex and complete examples and applications.
+ In these \l{Widget examples} {more advanced examples}, the code
+ that creates the widgets and layouts is stored in other files. For
+ example, the GUI for a main window may be created in the
+ constructor of a QMainWindow subclass.
- \section1 Building Examples and Tutorials
+ \section1 Building The Examples
- If you obtained a binary package of Qt or compiled it yourself, the
- examples described in this tutorial should already be ready to run.
- However, if you may wish to modify them and recompile them, you need to
- perform the following steps:
+ If you installed a binary package to get Qt, or if you compiled Qt
+ yourself, the examples described in this tutorial should already
+ be built and ready to run. If you wish to modify and recompile
+ them, follow these steps:
\list 1
- \o At the command line, enter the directory containing the example you
- wish to recompile.
- \o Type \c qmake and press \key{Return}. If this doesn't work, make sure
- that the executable is on your path, or enter its full location.
- \o On Linux/Unix and Mac OS X, type \c make and press \key{Return};
- on Windows with Visual Studio, type \c nmake and press \key{Return}.
+
+ \o From a command prompt, enter the directory containing the
+ example you have modified.
+
+ \o Type \c qmake and press \key{Return}. If this doesn't work,
+ make sure that the executable is on your path, or enter its
+ full location.
+
+ \o On Linux/Unix and Mac OS X, type \c make and press
+ \key{Return}; on Windows with Visual Studio, type \c nmake and
+ press \key{Return}.
+
\endlist
- An executable file should have been created within the current directory.
- On Windows, this file may be located within a \c debug or \c release
- subdirectory. You can run this file to see the example code at work.
+ An executable file is created in the current directory. On
+ Windows, this file may be located in a \c debug or \c release
+ subdirectory. You can run this executable to see the example code
+ at work.
*/
/*!
- \page widgets-tutorial-toplevel.html
- \contentspage {Widgets Tutorial}{Contents}
- \previouspage {Widgets Tutorial}
- \nextpage {Widgets Tutorial - Child Widgets}
\example tutorials/widgets/toplevel
\title Widgets Tutorial - Creating a Window
@@ -151,13 +164,10 @@
To create a real GUI, we need to place widgets inside the window. To do
this, we pass a QWidget instance to a widget's constructor, as we will
demonstrate in the next part of this tutorial.
+
*/
/*!
- \page widgets-tutorial-childwidget.html
- \contentspage {Widgets Tutorial}{Contents}
- \previouspage {Widgets Tutorial - Creating a Window}
- \nextpage {Widgets Tutorial - Using Layouts}
\example tutorials/widgets/childwidget
\title Widgets Tutorial - Child Widgets
@@ -185,10 +195,6 @@
*/
/*!
- \page widgets-tutorial-windowlayout.html
- \contentspage {Widgets Tutorial}{Contents}
- \previouspage {Widgets Tutorial - Child Widgets}
- \nextpage {Widgets Tutorial - Nested Layouts}
\example tutorials/widgets/windowlayout
\title Widgets Tutorial - Using Layouts
@@ -228,9 +234,6 @@
*/
/*!
- \page widgets-tutorial-nestedlayouts.html
- \contentspage {Widgets Tutorial}{Contents}
- \previouspage {Widgets Tutorial - Using Layouts}
\example tutorials/widgets/nestedlayouts
\title Widgets Tutorial - Nested Layouts
diff --git a/doc/src/widgets-and-layouts/focus.qdoc b/doc/src/widgets-and-layouts/focus.qdoc
index 71f41d5246..5ccfb636bc 100644
--- a/doc/src/widgets-and-layouts/focus.qdoc
+++ b/doc/src/widgets-and-layouts/focus.qdoc
@@ -82,7 +82,7 @@
Pressing \key Tab is by far the most common way to move focus
using the keyboard. (Sometimes in data-entry applications Enter
does the same as \key{Tab}; this can easily be achieved in Qt by
- implementing an \l{Events and Event Filters}{event filter}.)
+ implementing an \l{The Event System}{event filter}.)
Pressing \key Tab, in all window systems in common use today,
moves the keyboard focus to the next widget in a circular
diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc
index 0cfde22f24..2ca202f61c 100644
--- a/doc/src/widgets-and-layouts/layout.qdoc
+++ b/doc/src/widgets-and-layouts/layout.qdoc
@@ -47,6 +47,7 @@
/*!
\page layout.html
\title Layout Management
+ \ingroup qt-gui-concepts
\brief A tour of the standard layout managers and an introduction to custom
layouts.
diff --git a/doc/src/widgets-and-layouts/styles.qdoc b/doc/src/widgets-and-layouts/styles.qdoc
index 9a28715b83..b031deca2d 100644
--- a/doc/src/widgets-and-layouts/styles.qdoc
+++ b/doc/src/widgets-and-layouts/styles.qdoc
@@ -47,14 +47,9 @@
/*!
\page style-reference.html
- \title Implementing Styles and Style Aware Widgets
- \brief An overview of styles and the styling of widgets.
-
- \ingroup frameworks-technologies
-
- \previouspage Widget Classes
- \contentspage Widgets and Layouts
- \nextpage {Qt Style Sheets}{Style sheets}
+ \title Styles &amp Style Aware Widgets
+ \ingroup qt-gui-concepts
+ \brief Styles and the styling of widgets.
Styles (classes that inherit QStyle) draw on behalf of widgets
and encapsulate the look and feel of a GUI. The QStyle class is
@@ -90,8 +85,6 @@
current style. This document shows how widgets draw themselves
and which possibilities the style gives them.
- \tableofcontents
-
\section1 Classes for Widget Styling
These classes are used to customize an application's appearance and
diff --git a/doc/src/widgets-and-layouts/widgets.qdoc b/doc/src/widgets-and-layouts/widgets.qdoc
index 7bd27b6984..c93a380a80 100644
--- a/doc/src/widgets-and-layouts/widgets.qdoc
+++ b/doc/src/widgets-and-layouts/widgets.qdoc
@@ -40,130 +40,119 @@
****************************************************************************/
/*!
- \page widgets-and-layouts.html
- \title Widgets and Layouts
-
- \ingroup frameworks-technologies
-
- \nextpage Widget Classes
-
- The primary elements for designing user interfaces in Qt are widgets and layouts.
-
- \section1 Widgets
-
- \l{Widget Classes}{Widgets} can display data and status information, receive
- user input, and provide a container for other widgets that should be grouped
- together. A widget that is not embedded in a parent widget is called a
- \l{Application Windows and Dialogs}{window}.
-
- \image parent-child-widgets.png A parent widget containing various child widgets.
-
- The QWidget class provides the basic capability to render to the screen, and to
- handle user input events. All UI elements that Qt provides are either subclasses
- of QWidget, or are used in connection with a QWidget subclass. Creating custom
- widgets is done by subclassing QWidget or a suitable subclass and reimplementing
- the virtual event handlers.
-
- \section1 Layouts
-
- \l{Layout Management}{Layouts} are an elegant and flexible way to automatically
- arrange child widgets within their container. Each widget reports its size requirements
- to the layout through the \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy}
- properties, and the layout distributes the available space accordingly.
-
- \table
- \row
- \o \image qgridlayout-with-5-children.png
- \o \image qformlayout-with-6-children.png
- \endtable
-
- \l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and
- arranging widgets in layouts.
-
- \section1 Widget Styles
-
- \l{Implementing Styles and Style Aware Widgets}{Styles} draw on behalf of widgets
- and encapsulate the look and feel of a GUI. Qt's built-in widgets use the QStyle
- class to perform nearly all of their drawing, ensuring that they look exactly like
- the equivalent native widgets.
+ \page widgets-and-layouts.html
+ \title Widgets and Layouts
+ \ingroup qt-gui-concepts
+ \brief The primary elements for designing user interfaces in Qt.
+
+ \section1 Widgets
+
+ Widgets are the primary elements for creating user interfaces in Qt.
+ \l{The Widget Classes}{Widgets} can display data and status information,
+ receive user input, and provide a container for other widgets that
+ should be grouped together. A widget that is not embedded in a
+ parent widget is called a \l{Window and Dialog Widgets} {window}.
+
+ \image parent-child-widgets.png A parent widget containing various child widgets.
+
+ The QWidget class provides the basic capability to render to the
+ screen, and to handle user input events. All UI elements that Qt
+ provides are either subclasses of QWidget, or are used in connection
+ with a QWidget subclass. Creating custom widgets is done by
+ subclassing QWidget or a suitable subclass and reimplementing the
+ virtual event handlers.
+
+ \section1 Layouts
+
+ \l{Layout Management}{Layouts} are an elegant and flexible way to
+ automatically arrange child widgets within their container. Each
+ widget reports its size requirements to the layout through the
+ \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy} properties,
+ and the layout distributes the available space accordingly.
+
+ \table
+ \row
+ \o \image qgridlayout-with-5-children.png
+ \o \image qformlayout-with-6-children.png
+ \endtable
+
+ \l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and
+ arranging widgets in layouts.
+
+ \section1 Widget Styles
+
+ \l{Styles &amp Style Aware Widgets}{Styles} draw on behalf of
+ widgets and encapsulate the look and feel of a GUI. Qt's built-in
+ widgets use the QStyle class to perform nearly all of their drawing,
+ ensuring that they look exactly like the equivalent native widgets.
- \table
- \row
- \o \image windowsxp-tabwidget.png
- \o \image plastique-tabwidget.png
- \o \image macintosh-tabwidget.png
- \endtable
-
- \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
- appearance of widgets, in addition to what is already possible by subclassing QStyle.
-*/
-
-/*!
- \page widget-classes.html
- \title Widget Classes
+ \table
+ \row
+ \o \image windowsxp-tabwidget.png
+ \o \image plastique-tabwidget.png
+ \o \image macintosh-tabwidget.png
+ \endtable
- \contentspage Widgets and Layouts
- \nextpage Layout Management
+ \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
+ appearance of widgets, in addition to what is already possible by subclassing QStyle.
- Below you find a list of all widget classes in Qt. You can also browse the
- widget classes Qt provides in the various supported styles in the
- \l{Qt Widget Gallery}.
+ \section1 The Widget Classes
- \tableofcontents
+ The following sections list the widget classes. See the \l{Qt Widget
+ Gallery} for some examples.
- \section1 Basic Widgets
+ \section2 Basic Widgets
- These basic widgets (controls), such as buttons, comboboxes and scroll bars, are
- designed for direct use.
+ These basic widgets (controls), e.g. buttons, comboboxes and
+ scroll bars, are designed for direct use.
- \table
- \row
- \o \image windows-label.png
- \o \image windowsvista-pushbutton.png
- \o \image gtk-progressbar.png
- \row
- \o \image plastique-combobox.png
- \o \image macintosh-radiobutton.png
- \o \image cde-lineedit.png
- \endtable
+ \table
+ \row
+ \o \image windows-label.png
+ \o \image windowsvista-pushbutton.png
+ \o \image gtk-progressbar.png
+ \row
+ \o \image plastique-combobox.png
+ \o \image macintosh-radiobutton.png
+ \o \image cde-lineedit.png
+ \endtable
- \annotatedlist basicwidgets
+ \annotatedlist basicwidgets
- \section1 Advanced Widgets
+ \section2 Advanced Widgets
- Advanced GUI widgets such as tab widgets and progress bars provide more
- complex user interface controls.
+ Advanced GUI widgets, e.g. tab widgets and progress bars, provide
+ more complex user interface controls.
- \table
- \row
- \o \image windowsxp-treeview.png
- \o \image gtk-calendarwidget.png
- \o \image qundoview.png
- \endtable
+ \table
+ \row
+ \o \image windowsxp-treeview.png
+ \o \image gtk-calendarwidget.png
+ \o \image qundoview.png
+ \endtable
- \annotatedlist advanced
+ \annotatedlist advanced
- \table
- \row
- \o \image windowsvista-tabwidget.png
- \o \image macintosh-groupbox.png
- \endtable
+ \table
+ \row
+ \o \image windowsvista-tabwidget.png
+ \o \image macintosh-groupbox.png
+ \endtable
- \section1 Organizer Widgets
+ \section2 Organizer Widgets
- Classes like splitters, tab bars, button groups, etc are used to
- organize and group GUI primitives into more complex applications or
- dialogs.
+ Classes like splitters, tab bars, button groups, etc are used for
+ organizing and grouping GUI primitives into more complex
+ applications and dialogs.
- \annotatedlist organizers
+ \annotatedlist organizers
- \section1 Abstract Widget Classes
+ \section2 Abstract Widget Classes
- Abstract widget classes usable through subclassing. They are generally
- not usable in themselves, but provide functionality that can be used
- by inheriting these classes.
+ The abstract widget classes are base classes. They are not usable as
+ standalone classes but provide functionality when they are subclassed.
- \annotatedlist abstractwidgets
+ \annotatedlist abstractwidgets
*/
/*!
diff --git a/doc/src/windows-and-dialogs/dialogs.qdoc b/doc/src/windows-and-dialogs/dialogs.qdoc
index acee0c5767..0b0a842074 100644
--- a/doc/src/windows-and-dialogs/dialogs.qdoc
+++ b/doc/src/windows-and-dialogs/dialogs.qdoc
@@ -52,6 +52,7 @@
/*!
\page dialogs.html
\title Dialog Windows
+ \ingroup qt-gui-concepts
\brief An overview over dialog windows.
\previouspage The Application Main Window
diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc
index 6adfa75be5..db9a63611d 100644
--- a/doc/src/windows-and-dialogs/mainwindow.qdoc
+++ b/doc/src/windows-and-dialogs/mainwindow.qdoc
@@ -46,10 +46,9 @@
/*!
\page application-windows.html
- \title Application Windows and Dialogs
- \ingroup frameworks-technologies
-
- \nextpage The Application Main Window
+ \title Window and Dialog Widgets
+ \brief Windows and Dialogs in Qt.
+ \ingroup qt-gui-concepts
A \l{Widgets Tutorial}{widget} that is not embedded in a parent widget is called a window.
Usually, windows have a frame and a title bar, although it is also possible to create
@@ -81,7 +80,7 @@
\section1 Main Windows and Dialogs
- \l{The Application Main Window} provides the framework for building the
+ The \l{Application Main Window} provides the framework for building the
application's main user interface, and are created by subclassing QMainWindow.
QMainWindow has its own layout to which you can add a \l{QMenuBar}{menu bar},
\l{QToolBar}{tool bars}, \l{QDockWidget}{dockable widgets} and a
@@ -164,12 +163,9 @@
/*!
\page mainwindow.html
- \title The Application Main Window
- \brief Everything you need for a typical modern main application window,
- including menus, toolbars, workspace, etc.
-
- \contentspage Application Windows and Dialogs
- \nextpage Dialog Windows
+ \title Application Main Window
+ \ingroup qt-gui-concepts
+ \brief Creating the application window.
\tableofcontents