summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-07-16 15:18:04 +0200
committerDavid Boddie <dboddie@trolltech.com>2010-07-16 15:18:04 +0200
commit42f1e22bdfe2fe29f305dbf50e23933b8e1ef8d0 (patch)
tree1c5ae2797ac21da8214c7b8cdaeebe49926585d0
parente2fb9c4df301678719cb0cff78838b35435c3b38 (diff)
parentad4aff6e2d188d88a2c6b4b692932adb08491d22 (diff)
downloadqt4-tools-42f1e22bdfe2fe29f305dbf50e23933b8e1ef8d0.tar.gz
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
-rw-r--r--.gitignore1
-rw-r--r--README.s60-mkspec99
-rwxr-xr-xbin/patch_capabilities.pl2
-rwxr-xr-xbin/syncqt6
-rwxr-xr-xconfigure5
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml1
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml4
-rw-r--r--demos/declarative/twitter/TwitterCore/AuthView.qml2
-rw-r--r--demos/declarative/twitter/TwitterCore/HomeTitleBar.qml1
-rw-r--r--demos/declarative/twitter/TwitterCore/TitleBar.qml1
-rw-r--r--doc/src/classes/phonon-api.qdoc12
-rw-r--r--doc/src/declarative/advtutorial.qdoc24
-rw-r--r--doc/src/declarative/anchor-layout.qdoc5
-rw-r--r--doc/src/declarative/basictypes.qdoc3
-rw-r--r--doc/src/declarative/declarativeui.qdoc6
-rw-r--r--doc/src/declarative/elements.qdoc2
-rw-r--r--doc/src/declarative/extending-tutorial.qdoc328
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter1.pngbin0 -> 6687 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter2.pngbin0 -> 7318 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter3.pngbin0 -> 8145 bytes
-rw-r--r--doc/src/declarative/pics/extending-tutorial-chapter5.pngbin0 -> 5557 bytes
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc2
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc73
-rw-r--r--doc/src/declarative/qdeclarativeperformance.qdoc21
-rw-r--r--doc/src/declarative/qtprogrammers.qdoc12
-rw-r--r--doc/src/examples/movie.qdoc4
-rw-r--r--doc/src/examples/trafficinfo.qdoc2
-rw-r--r--doc/src/frameworks-technologies/dnd.qdoc2
-rw-r--r--doc/src/frameworks-technologies/model-view-programming.qdoc20
-rw-r--r--doc/src/frameworks-technologies/phonon.qdoc1
-rw-r--r--doc/src/getting-started/examples.qdoc4
-rw-r--r--doc/src/images/qml-mousearea-example.pngbin5527 -> 6969 bytes
-rw-r--r--doc/src/images/qml-xmllistmodel-example.pngbin0 -> 5252 bytes
-rw-r--r--doc/src/index.qdoc33
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc17
-rw-r--r--doc/src/snippets/code/doc_src_installation.qdoc2
-rw-r--r--doc/src/snippets/declarative/mousearea.qml13
-rw-r--r--doc/src/template/style/OfflineStyle.css595
-rwxr-xr-xdoc/src/template/style/style.css1193
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.cpp2
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea-example.qml64
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/app.qml18
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro4
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/main.cpp4
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp81
-rw-r--r--examples/declarative/tutorials/extending/chapter1-basics/piechart.h (renamed from examples/declarative/tutorials/extending/chapter1-basics/musician.h)21
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/app.qml24
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro4
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/main.cpp4
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp87
-rw-r--r--examples/declarative/tutorials/extending/chapter2-methods/piechart.h (renamed from examples/declarative/tutorials/extending/chapter3-bindings/musician.h)26
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/app.qml42
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro4
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/main.cpp4
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp89
-rw-r--r--examples/declarative/tutorials/extending/chapter3-bindings/piechart.h84
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml18
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro8
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp8
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp (renamed from examples/declarative/tutorials/extending/chapter2-methods/musician.cpp)30
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h (renamed from examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h)20
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp (renamed from examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp)29
-rw-r--r--examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h (renamed from examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h)21
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/app.qml70
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro7
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp (renamed from examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp)26
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp (renamed from examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp)32
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h (renamed from examples/declarative/tutorials/extending/chapter2-methods/musician.h)34
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp88
-rw-r--r--examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h76
-rw-r--r--examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp56
-rw-r--r--examples/declarative/tutorials/extending/chapter5-plugins/instrument.h61
-rw-r--r--examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp67
-rw-r--r--examples/declarative/tutorials/extending/chapter5-plugins/qmldir1
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/app.qml (renamed from examples/declarative/tutorials/extending/chapter5-plugins/app.qml)29
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro (renamed from examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro)12
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp (renamed from examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp)14
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h (renamed from examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h)6
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp (renamed from examples/declarative/tutorials/extending/chapter1-basics/musician.cpp)23
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/piechart.h (renamed from examples/declarative/tutorials/extending/chapter5-plugins/musician.h)21
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp88
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h74
-rw-r--r--examples/declarative/tutorials/extending/chapter6-plugins/qmldir1
-rw-r--r--examples/declarative/tutorials/extending/extending.pro3
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame.qml2
-rw-r--r--examples/network/bearermonitor/sessionwidget.h2
-rw-r--r--examples/network/bearermonitor/sessionwidget_maemo.ui48
-rw-r--r--mkspecs/features/uic.prf12
-rw-r--r--mkspecs/linux-g++-maemo/qmake.conf3
-rw-r--r--qmake/generators/makefile.cpp8
-rw-r--r--src/3rdparty/phonon/phonon/mediasource.cpp2
-rw-r--r--src/3rdparty/sqlite.pri4
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/io/qiodevice_p.h2
-rw-r--r--src/corelib/io/qprocess.cpp4
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp16
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp36
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp59
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp97
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h20
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp20
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp4
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp145
-rw-r--r--src/declarative/qml/qdeclarativebinding_p_p.h28
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp12
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp478
-rw-r--r--src/declarative/qml/qdeclarativeexpression_p.h83
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp16
-rw-r--r--src/declarative/qml/qdeclarativelist.cpp2
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp19
-rw-r--r--src/gui/dialogs/qwizard_win.cpp42
-rw-r--r--src/gui/dialogs/qwizard_win_p.h21
-rw-r--r--src/gui/graphicsview/qgraphicsgridlayout.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp9
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp4
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp71
-rw-r--r--src/gui/kernel/qapplication.cpp2
-rw-r--r--src/gui/kernel/qapplication.h3
-rw-r--r--src/gui/kernel/qapplication_win.cpp2
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h4
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm38
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
-rw-r--r--src/gui/kernel/qgesture.cpp29
-rw-r--r--src/gui/kernel/qgesture.h3
-rw-r--r--src/gui/kernel/qgesture_p.h1
-rw-r--r--src/gui/kernel/qgesturemanager.cpp4
-rw-r--r--src/gui/kernel/qguifunctions_wince.cpp28
-rw-r--r--src/gui/kernel/qstandardgestures.cpp7
-rw-r--r--src/gui/kernel/qwidget.cpp4
-rw-r--r--src/gui/kernel/qwidget_mac.mm7
-rw-r--r--src/gui/kernel/qwidget_win.cpp1
-rw-r--r--src/gui/kernel/qwidget_wince.cpp1
-rw-r--r--src/gui/styles/qstyle.cpp4
-rw-r--r--src/gui/styles/qstyle.h2
-rw-r--r--src/gui/styles/qstyleoption.cpp6
-rw-r--r--src/gui/styles/qstyleoption.h2
-rw-r--r--src/gui/text/qtextcursor.cpp6
-rw-r--r--src/gui/text/qtextoption.cpp7
-rw-r--r--src/gui/text/qtexttable.cpp28
-rw-r--r--src/gui/util/qcompleter.cpp4
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp21
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp9
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp8
-rw-r--r--src/network/access/qnetworkrequest.cpp8
-rw-r--r--src/network/access/qnetworkrequest.h2
-rw-r--r--src/network/kernel/qauthenticator.cpp408
-rw-r--r--src/network/kernel/qauthenticator.h5
-rw-r--r--src/network/kernel/qauthenticator_p.h6
-rw-r--r--src/network/kernel/qhostaddress.cpp12
-rw-r--r--src/network/socket/qtcpserver.cpp2
-rw-r--r--src/network/ssl/qsslsocket.cpp4
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp89
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/opengl/qgl.cpp14
-rw-r--r--src/plugins/sqldrivers/db2/db2.pro10
-rw-r--r--src/plugins/sqldrivers/ibase/ibase.pro14
-rw-r--r--src/plugins/sqldrivers/mysql/mysql.pro23
-rw-r--r--src/plugins/sqldrivers/oci/oci.pro13
-rw-r--r--src/plugins/sqldrivers/odbc/odbc.pro19
-rw-r--r--src/plugins/sqldrivers/psql/psql.pro18
-rw-r--r--src/plugins/sqldrivers/sqlite/sqlite.pro17
-rw-r--r--src/plugins/sqldrivers/sqlite2/sqlite2.pro9
-rw-r--r--src/plugins/sqldrivers/tds/tds.pro15
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def1
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def1
-rw-r--r--src/script/api/qscriptvalue.cpp6
-rw-r--r--src/sql/drivers/db2/qsql_db2.pri8
-rw-r--r--src/sql/drivers/drivers.pri130
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.pri11
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.pri16
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp2
-rw-r--r--src/sql/drivers/oci/qsql_oci.pri9
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.pri13
-rw-r--r--src/sql/drivers/psql/qsql_psql.pri13
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.pri9
-rw-r--r--src/sql/drivers/sqlite2/qsql_sqlite2.pri4
-rw-r--r--src/sql/drivers/tds/qsql_tds.pri10
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml20
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/chain.qml28
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml4
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test.qml2
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/data/test5.qml2
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp23
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/footer.qml32
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp41
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp7
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp10
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/footer.qml30
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp32
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp26
-rw-r--r--tests/auto/gui.pro1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp27
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result13
-rw-r--r--tests/auto/mediaobject/tst_mediaobject.cpp3
-rw-r--r--tests/auto/network.pro2
-rw-r--r--tests/auto/qauthenticator/qauthenticator.pro5
-rw-r--r--tests/auto/qauthenticator/tst_qauthenticator.cpp155
-rw-r--r--tests/auto/qfiledialog2/tst_qfiledialog2.cpp22
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp2
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp7
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp27
-rw-r--r--tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp7
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp20
-rw-r--r--tests/auto/qmake/testdata/simple_app/build/README1
-rw-r--r--tests/auto/qmake/testdata/simple_app/simple_app.pro1
-rw-r--r--tests/auto/qmake/testdata/simple_app/test.qrc5
-rw-r--r--tests/auto/qmake/tst_qmake.cpp16
-rw-r--r--tests/auto/qmimedata/qmimedata.pro4
-rw-r--r--tests/auto/qmimedata/tst_qmimedata.cpp343
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp29
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp4
-rw-r--r--tests/auto/qscrollbar/tst_qscrollbar.cpp2
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp24
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp4
-rw-r--r--tests/auto/qtexttable/tst_qtexttable.cpp55
-rw-r--r--tests/auto/quuid/quuid.pro9
-rw-r--r--tests/auto/quuid/test/test.pro29
-rw-r--r--tests/auto/quuid/testProcessUniqueness/main.cpp62
-rw-r--r--tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro8
-rw-r--r--tests/auto/quuid/tst_quuid.cpp29
-rw-r--r--tools/assistant/lib/qhelpprojectdata.cpp6
-rw-r--r--tools/assistant/tools/assistant/assistant.pro2
-rw-r--r--tools/assistant/translations/qt_help.pro53
-rw-r--r--tools/assistant/translations/translations.pro54
-rw-r--r--tools/configure/configureapp.cpp16
-rw-r--r--tools/designer/src/components/lib/lib.pro10
-rw-r--r--tools/designer/src/components/objectinspector/objectinspector.pri2
-rw-r--r--tools/designer/src/components/propertyeditor/propertyeditor.pri4
-rw-r--r--tools/designer/src/designer/designer.pro5
-rw-r--r--tools/designer/src/lib/shared/shared.pri10
-rw-r--r--tools/designer/translations/translations.pro141
-rw-r--r--tools/linguist/linguist/linguist.pro12
-rw-r--r--tools/linguist/lupdate/cpp.cpp7
-rw-r--r--tools/qdoc3/codemarker.cpp8
-rw-r--r--tools/qdoc3/codemarker.h9
-rw-r--r--tools/qdoc3/config.h1
-rw-r--r--tools/qdoc3/cppcodemarker.cpp15
-rw-r--r--tools/qdoc3/cppcodemarker.h7
-rw-r--r--tools/qdoc3/cppcodeparser.cpp15
-rw-r--r--tools/qdoc3/htmlgenerator.cpp427
-rw-r--r--tools/qdoc3/htmlgenerator.h22
-rw-r--r--tools/qdoc3/javacodemarker.cpp6
-rw-r--r--tools/qdoc3/javacodemarker.h5
-rw-r--r--tools/qdoc3/node.cpp20
-rw-r--r--tools/qdoc3/node.h1
-rw-r--r--tools/qdoc3/plaincodemarker.cpp7
-rw-r--r--tools/qdoc3/plaincodemarker.h1
-rw-r--r--tools/qdoc3/qscodemarker.cpp7
-rw-r--r--tools/qdoc3/qscodemarker.h1
-rw-r--r--tools/qdoc3/test/assistant.qdocconf24
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf12
-rw-r--r--tools/qdoc3/test/qt-cpp-ignore.qdocconf3
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf8
-rw-r--r--tools/qdoc3/test/qt.qdocconf7
-rw-r--r--tools/qdoc3/tree.cpp14
-rw-r--r--tools/qdoc3/tree.h20
-rw-r--r--tools/qml/deviceorientation_symbian.cpp12
-rw-r--r--tools/qml/main.cpp11
-rw-r--r--tools/qml/qml.pri10
-rw-r--r--tools/qml/qml.pro1
-rw-r--r--tools/qml/qmlruntime.cpp60
-rw-r--r--tools/qml/qmlruntime.h4
-rw-r--r--tools/qtconfig/translations/translations.pro16
-rw-r--r--tools/qvfb/qvfb.pro2
-rw-r--r--tools/qvfb/translations/translations.pro35
-rw-r--r--tools/runonphone/trksignalhandler.cpp27
-rwxr-xr-xtranslations/check-ts.pl13
-rw-r--r--translations/qt_de.ts46
-rw-r--r--translations/translations.pri144
282 files changed, 5403 insertions, 3607 deletions
diff --git a/.gitignore b/.gitignore
index fdb68435f3..4d5aa9b2ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -114,6 +114,7 @@ tools/qtestlib/chart/chart*
tools/qtestlib/updater/updater*
tools/activeqt/testcon/testcon.tlb
translations/*.qm
+translations/*_untranslated.ts
qrc_*.cpp
# xemacs temporary files
diff --git a/README.s60-mkspec b/README.s60-mkspec
deleted file mode 100644
index af500e1377..0000000000
--- a/README.s60-mkspec
+++ /dev/null
@@ -1,99 +0,0 @@
-How to build Qt for Symbian using the Linux makespec.
-
-Prerequisites:
-
- - Working RVCT 2.2 native Linux compiler. The new publicly
- available RVCT 4.0 compiler may work, but it hasn't been tested
- yet.
-
- - A working GnuPoc environment. See this page for details:
- http://www.martin.st/symbian/
- Download the latest version, unpack it and run the 'install_eka2_tools' script as
- described in the last part under the EKA2 part. The part about the your own gcc
- are not needed as we use the rvct compiler.
- Make sure you do the part about Wine setup as well.
-
- - Anderson Lizardo's patches for GnuPoc. Look for the
- qt_s60_gnupoc_v10.patch on this page:
- http://lizardo.wordpress.com/2009/09/24/installing-qt-for-s60-daily-snapshots-on-linux/
- and carry out the instructions under point 8: Installing Open C.
-
-Compiling:
-
- 1. First a few environment variables need to be set:
-
- export RVCT22LIB=<rvct-dir>/lib/armlib
- export EPOCROOT=<s60-root>
- export PATH=$PATH:<s60-root>/epoc32/tools:<rvctInstallDir>/bin
- export PATH=$PATH:<qt-root>/bin
-
- Replace the s60-root with the installation directory of your SDK,
- and the qt-root with the root of your Qt repository.
- These are good candidates for putting in a script somewhere.
-
- 2. Run configure. It needs a bit more switches than usual, so here's
- the full line:
-
- ./configure -developer-build -platform linux-g++ -xplatform \
- symbian/linux-armcc -little-endian -host-little-endian \
- -arch symbian
-
- 3. Compile Qt
-
- cd src
- make
-
- and then wait for a while.
-
- 4. Package and install Qt
-
- cd s60installs
-
- Edit Qt_template.pkg and change the first 0x2xxxxxxx to
- 0xExxxxxxx. Then execute:
-
- makesis Qt_template.pkg
- signsis Qt_template.sis Qt_template.sisx selfsigned.cer selfsigned.key
-
- Then put Qt_template.sisx on a memory card and install it from
- the phone file manager.
-
- Alternatively, you can use the runonphone tool found in the tools
- directory of Qt. To build, this requires a separately configured
- Qt installation for Linux, unfortunately. To use it, you also
- need have App TRK running on the phone. At the time of writing,
- only bleeding edge Linux kernels are able to autodetect the USB
- serial port on the phone, but you can force detection by running:
-
- modprobe usbserial vendor=0xXXXX product=0xXXXX
-
- The XXXXs should be replaced with the two values listed for your
- device when executing "lsusb". In most distributions, this will
- lead to the creation of two devices: /dev/ttyUSB0 and
- /dev/ttyUSB1. The latter is usually the one that App TRK responds
- to. Then execute:
-
- runonphone -p /dev/ttyUSB1 -s Qt_template.sisx dummy.exe
-
- The dummy.exe argument is irrelevant, since we are not executing
- anything yet.
-
- 5. Compile some helloworld application (I leave the details to you
- ;-)
-
- qmake
- make
-
- 6. Package, install and run application.
-
- makesis helloworld_template.pkg
- signsis helloworld_template.sis helloworld_template.sisx \
- <QTDIR>/src/s60installs/selfsigned.cer \
- <QTDIR>/src/s60installs/selfsigned.key
-
- Then either install by memory card, or install and run like this:
-
- runonphone -p /dev/ttyUSB1 -s helloworld_template.sisx \
- helloworld.exe
-
- 7. Enjoy "hello world" on the phone!
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index 501939afc2..7d6f5dc163 100755
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -186,7 +186,7 @@ if (@ARGV)
}
# If the line specifies a file, parse the source and destination locations.
- if ($line =~ m|\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|)
+ if ($line =~ m|^ *\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|)
{
my $sourcePath = $1;
diff --git a/bin/syncqt b/bin/syncqt
index 11b1d7210a..03659d3b74 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -691,6 +691,7 @@ my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dis
my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
my %colliding_headers = ();
+my %inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) );
foreach (@modules_to_sync) {
#iteration info
@@ -800,8 +801,10 @@ foreach (@modules_to_sync) {
foreach (@subdirs) {
my $subdir = "$_";
my @headers = findFiles("$subdir", "^[-a-z0-9_]*\\.h\$" , 0);
+ push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir});
foreach (@headers) {
my $header = "$_";
+ my $shadow = ($header =~ s/^\*//);
$header = 0 if("$header" =~ /^ui_.*.h/);
foreach (@ignore_headers) {
$header = 0 if("$header" eq "$_");
@@ -819,6 +822,7 @@ foreach (@modules_to_sync) {
}
my $iheader = $subdir . "/" . $header;
+ $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
my @classes = $public_header ? classNames($iheader) : ();
if($showonly) {
print "$header [$lib]\n";
@@ -843,7 +847,7 @@ foreach (@modules_to_sync) {
my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
$header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
" #if defined(__GNUC__)\n" .
- " #pragma warning \"$warning_msg\"\n" .
+ " #warning \"$warning_msg\"\n" .
" #elif defined(_MSC_VER)\n" .
" #pragma message \"WARNING: $warning_msg\"\n" .
" #endif\n".
diff --git a/configure b/configure
index 166f2013f4..62e0863a6c 100755
--- a/configure
+++ b/configure
@@ -4481,11 +4481,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
- for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
- if [ '!' -f "$conf" ]; then
- ln -s "$QCONFIG_H" "$conf"
- fi
- done
#mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
rm -f mkspecs/default
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index c7e1a5325a..335c315e4e 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -109,6 +109,7 @@ Item {
Item {
id: returnKey
Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
Keys.onEscapePressed: titleBar.state = ""
}
}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
index 6109535b95..be7dfa430e 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -64,6 +64,10 @@ Item {
container.labelChanged(textInput.text)
container.focus = true
}
+ Keys.onEnterPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
Keys.onEscapePressed: {
textInput.text = container.label
container.focus = true
diff --git a/demos/declarative/twitter/TwitterCore/AuthView.qml b/demos/declarative/twitter/TwitterCore/AuthView.qml
index 4f757778aa..0d05debe7d 100644
--- a/demos/declarative/twitter/TwitterCore/AuthView.qml
+++ b/demos/declarative/twitter/TwitterCore/AuthView.qml
@@ -115,6 +115,7 @@ Item {
KeyNavigation.tab: guest
KeyNavigation.backtab: passIn
Keys.onReturnPressed: login.doLogin();
+ Keys.onEnterPressed: login.doLogin();
Keys.onSelectPressed: login.doLogin();
Keys.onSpacePressed: login.doLogin();
onClicked: login.doLogin();
@@ -135,6 +136,7 @@ Item {
KeyNavigation.tab: nameIn
KeyNavigation.backtab: login
Keys.onReturnPressed: guest.doGuest();
+ Keys.onEnterPressed: guest.doGuest();
Keys.onSelectPressed: guest.doGuest();
Keys.onSpacePressed: guest.doGuest();
onClicked: guest.doGuest();
diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
index b26f7b3131..56f31b13c3 100644
--- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
@@ -136,6 +136,7 @@ Item {
Item {
id: returnKey
Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
Keys.onEscapePressed: titleBar.state = ""
}
}
diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml
index 6cd0a5059d..558bc180ff 100644
--- a/demos/declarative/twitter/TwitterCore/TitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml
@@ -98,6 +98,7 @@ Item {
Item {
id: returnKey
Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
Keys.onEscapePressed: titleBar.state = ""
}
}
diff --git a/doc/src/classes/phonon-api.qdoc b/doc/src/classes/phonon-api.qdoc
index 641b9362ae..6fe022359b 100644
--- a/doc/src/classes/phonon-api.qdoc
+++ b/doc/src/classes/phonon-api.qdoc
@@ -1577,7 +1577,6 @@
\since 4.4
\brief The MediaObject class provides an interface for media playback.
-
The media object manages a \l{Phonon::}{MediaSource}, which
supplies the media object with multimedia content, e.g., from a
file. A playback in Phonon is always started by calling the
@@ -1651,17 +1650,8 @@
playback of the current source, but it is possible to try with a
different one. A user readable error message is given by
errorString().
- \section1 Symbian Platform Security Requirements
-
- On Symbian, processes which access media via the network must
- have the \c NetworkServices platform security capability. If the client
- process lacks this capability, operations will result in errors.
- This failure is indicated by a state() of Phonon::ErrorState.
-
- Platform security capabilities are added via the
- \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY}
- qmake variable.
+ \sa {Symbian Platform Security Requirements}
\sa Phonon::MediaSource, Phonon::AudioOutput, VideoWidget,
{Music Player Example}, {Phonon Overview}, Phonon::VideoPlayer,
Phonon::createPlayer(), {Phonon Module}
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index afedb44d83..1341bbb942 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -164,14 +164,22 @@ 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 {QML: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.
-\o Place the block in its position on the board and set its width and height.
- Also, store it in the blocks array for future reference.
-\o Finally, print error information to the console if the component could not be
- loaded for some reason (for example, if the file is missing).
+
+\o \l {QML: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.
+
+\o Place the block in its position on the board and set its width and
+ height. Also, store it in the blocks array for future reference.
+
+\o Finally, print error information to the console if the component
+ could not be loaded for some reason (for example, if the file is
+ missing).
+
\endlist
diff --git a/doc/src/declarative/anchor-layout.qdoc b/doc/src/declarative/anchor-layout.qdoc
index 9c217e1128..5c025e5765 100644
--- a/doc/src/declarative/anchor-layout.qdoc
+++ b/doc/src/declarative/anchor-layout.qdoc
@@ -33,7 +33,10 @@
In addition to the more traditional \l Grid, \l Row, and \l Column,
QML also provides a way to layout items using the concept of \e anchors.
Each item can be thought of as having a set of 7 invisible "anchor lines":
-\e left, \e horizontalCenter, \e right, \e top, \e verticalCenter, \e baseline, and \e bottom.
+\l {Item::anchors.left}{left}, \l {Item::anchors.horizontalCenter}{horizontalCenter},
+\l {Item::anchors.right}{right}, \l {Item::anchors.top}{top},
+\l {Item::anchors.verticalCenter}{verticalCenter}, \l {Item::anchors.baseline}{baseline},
+and \l {Item::anchors.bottom}{bottom}.
\image edges_qml.png
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 109e6d580c..e327d4a34f 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -107,6 +107,9 @@
Text { text: "Hello world!" }
\endqml
+ Strings have a \c length attribute that holds the number of
+ characters in the string.
+
\sa {QML Basic Types}
*/
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index cd27c40c7f..217e37271a 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -37,7 +37,9 @@ 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.
+and netbooks. Qt Quick consists of the QtDeclarative C++ module, QML, and
+the integration of both of these into the Qt Creator IDE. Using the QtDeclarative
+C++ module, you can load and interact with QML files from your Qt application.
QML is an extension to \l
{http://www.ecma-international.org/publications/standards/Ecma-262.htm}
@@ -58,7 +60,7 @@ complete internet-enabled applications like a \l
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++}.
+{Extending QML in C++}{extensible from C++} through the QtDeclarative Module.
\section1 Getting Started
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 0edd242ae8..c2930b365c 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -113,7 +113,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\row \o \l {Connections} \o Explicitly connects signals and signal handlers
\row \o \l {Component} \o Encapsulate QML items as a component
\row \o \l {Timer} \o Provides timed triggers
-\row \o \l {QtObject} \o Basic element containing only the objectName property
+\row \o \l {QML:QtObject} {QtObject} \o Basic element containing only the objectName property
\row \o \l {WorkerScript} \o Enables the use of threads in QML
\row \o \l {Loader} \o Controls the loading of items or components
\row \o \l {Repeater} \o Uses a model to create multiples of components
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index 2cf00b9425..cc93e86a8a 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -48,8 +48,9 @@ Tutorial chapters:
\o \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
\o \l{declarative/tutorials/extending/chapter3-bindings}{Adding Property Bindings}
\o \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
-\o \l{declarative/tutorials/extending/chapter5-plugins}{Writing an Extension Plugin}
-\o \l{qml-extending-tutorial6.html}{In Summary}
+\o \l{declarative/tutorials/extending/chapter5-listproperties}{Using List Property Types}
+\o \l{declarative/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
+\o \l{qml-extending-tutorial7.html}{In Summary}
\endlist
*/
@@ -59,61 +60,94 @@ Tutorial chapters:
\example declarative/tutorials/extending/chapter1-basics
-Let's create a new QML type called "Musician" that has two properties: a name
-and an instrument. We will make it available in a \l {Modules}{module} called "Music", with
+A common task when extending QML is to provide a new QML type that supports some
+ custom functionality beyond what is provided by the built-in \l {QML Elements}.
+For example, this could be done to implement particular data models, or provide
+elements with custom painting and drawing capabilities, or access system features
+like network programming that are not accessible through built-in QML features.
+
+In this tutorial, we will show how to use the C++ classes in the QtDeclarative
+module to extend QML. The end result will be a simple Pie Chart display implemented by
+several custom QML types connected together through QML features like bindings and
+signals, and made available to the QML runtime through a plugin.
+
+To begin with, let's create a new QML type called "PieChart" that has two properties: a name
+and a color. We will make it available in a \l {Modules}{module} called "Charts", with
a module version of 1.0.
-We want this \c Musician type to be usable from QML like this:
+
+We want this \c PieChart type to be usable from QML like this:
\code
- import Music 1.0
+ import Charts 1.0
- Musician {
- name: "Reddy the Rocker"
- instrument: "Guitar"
+ PieChart {
+ width: 100; height: 100
+ name: "A simple pie chart"
+ color: "red"
}
\endcode
-To do this, we need a C++ class that encapsulates this \c Musician type and its two
-properties. Since QML relies heavily on Qt's \l{Meta-Object System}{meta object system},
+To do this, we need a C++ class that encapsulates this \c PieChart type and its two
+properties. Since QML makes extensive use of Qt's \l{Meta-Object System}{meta object system},
this new class must:
\list
-\o inherit from QObject
-\o declare its properties using the Q_PROPERTY() macro
+\o Inherit from QObject
+\o Declare its properties using the Q_PROPERTY macro
\endlist
-Here is our \c Musician class, defined in \c musician.h:
+Here is our \c PieChart class, defined in \c piechart.h:
-\snippet declarative/tutorials/extending/chapter1-basics/musician.h 0
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0
-It defines the two properties, \c name and \c instrument, with the Q_PROPERTY() macro.
-The class implementation in \c musician.cpp simply sets and returns the \c m_name and
-\c m_instrument values as appropriate.
+The class inherits from QDeclarativeItem because we want to override
+QDeclarativeItem::paint() in order to draw. If the class just represented some
+data type and was not an item that actually needed to be displayed, it could simply inherit
+from QObject. Or, if we want to extend the functionality of an existing QObject-based
+class, it could inherit from that class instead.
-Our QML file, \c app.qml, creates a \c Musician item and display the musician's details
+The \c PieChart class defines the two properties, \c name and \c color, with the Q_PROPERTY macro,
+and overrides QDeclarativeItem::paint(). The class implementation in \c piechart.cpp
+simply sets and returns the \c m_name and \c m_color values as appropriate, and
+implements \c paint() to draw a simple pie chart. It also turns off the
+QGraphicsItem::ItemHasNoContents flag to enable painting:
+
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 0
+\dots 0
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 1
+
+Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml
+file creates a \c PieChart item and display the pie chart's details
using a standard QML \l Text item:
\snippet declarative/tutorials/extending/chapter1-basics/app.qml 0
+Notice that although the color is specified as a string in QML, it is automatically
+converted to a QColor object for the PieChart \c color property. Automatic conversions are
+provided for various other \l {QML Basic Types}{basic types}; for example, a string
+like "640x480" can be automatically converted to a QSize value.
+
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
+display \c app.qml. The application must register the \c PieChart type
using the qmlRegisterType() function, to allow it to be used from QML. If
-you don't register the type, \c app.qml won't be able to create a \c Musician.
+you don't register the type, \c app.qml won't be able to create a \c PieChart.
Here is the application \c main.cpp:
\snippet declarative/tutorials/extending/chapter1-basics/main.cpp 0
-This call to qmlRegisterType() registers the \c Musician type as a type called "Musician", in a module named "Music",
+This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a module named "Charts",
with a module version of 1.0.
Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
\quotefile declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
-Now we can build and run the application. Try it yourself with the code in Qt's \c examples/tutorials/extending/chapter1-basics directory.
+Now we can build and run the application:
-\example declarative/tutorials/extending/chapter1-basics
+\image extending-tutorial-chapter1.png
+
+Try it yourself with the code in Qt's \c examples/tutorials/extending/chapter1-basics directory.
At the moment, the \c app.qml is run from within a C++ application.
This may seem odd if you're used to running QML files with the \l {QML Viewer}.
@@ -128,39 +162,40 @@ Later on, we'll show how to create a plugin so that you can run \c app.qml using
\example declarative/tutorials/extending/chapter2-methods
-Suppose we want \c Musician to have a "perform" method that prints a message
-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:
+Suppose we want \c PieChart to have a "clearChart()" method that erases the
+chart and then emits a "chartCleared" signal. Our \c app.qml would be able
+to call \c clearChart() and receive \c chartCleared() signals like this:
\snippet declarative/tutorials/extending/chapter2-methods/app.qml 0
-To do this, we add a \c perform() method and a \c performanceEnded() signal
+\image extending-tutorial-chapter2.png
+
+To do this, we add a \c clearChart() method and a \c chartCleared() signal
to our C++ class:
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 0
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 1
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 2
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 3
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 3
-The use of Q_INVOKABLE makes the \c perform() method available to the
+The use of Q_INVOKABLE makes the \c clearChart() method available to the
Qt Meta-Object system, and in turn, to QML. Note that it could have
been declared as as a Qt slot instead of using Q_INVOKABLE, as
slots are also callable from QML. Both of these approaches are valid.
-The \c perform() method simply prints a message to the console and
-then emits \c performanceEnded():
+The \c clearChart() method simply changes the color to Qt::transparent,
+repaints the chart, then emits the \c chartCleared() signal:
-\snippet declarative/tutorials/extending/chapter2-methods/musician.cpp 0
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.cpp 0
-Now when we run the application and click the window, the application outputs:
+Now when we run the application and click the window, the pie chart
+disappears, and the application outputs:
\code
- "Reddy the Rocker" is playing the "Guitar"
- The performance has now ended
+ The chart has been cleared
\endcode
Try out the example yourself with the updated code in Qt's \c examples/tutorials/extending/chapter2-methods directory.
@@ -174,45 +209,49 @@ Try out the example yourself with the updated code in Qt's \c examples/tutorials
Property bindings is a powerful feature of QML that allows values of different
elements to be synchronized automatically. It uses signals to notify and update
-other elements' values when property values change.
+other elements' values when property values are changed.
-Let's enable property bindings for the \c instrument property. That means
+Let's enable property bindings for the \c color property. That means
if we have code like this:
\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.
-Whenever \c reddy's \c instrument value changes, \c craig's \c instrument value
-updates to the same value. When the window is clicked, the application outputs:
+\image extending-tutorial-chapter3.png
-\code
- "Reddy the Rocker" is playing the "Guitar"
- "Craig the Copycat" is playing the "Guitar"
- "Reddy the Rocker" is playing the "Drums"
- "Craig the Copycat" is playing the "Drums"
-\endcode
+The "color: chartA.color" statement binds the \c color value of
+\c chartB to the \c color of \c chartA.
+Whenever \c chartA's \c color value changes, \c chartB's \c color value
+updates to the same value. When the window is clicked, the \c onClicked
+handler in the MouseArea changes the color of \c chartA, thereby changing
+both charts to the color blue.
-It's easy to enable property binding for the \c instrument property.
-We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "instrumentChanged" signal
+It's easy to enable property binding for the \c color property.
+We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal
is emitted whenever the value changes.
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 0
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 1
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 2
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 3
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 3
-Then, we emit this signal in \c setInstrument():
+Then, we emit this signal in \c setPieSlice():
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.cpp 0
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.cpp 0
-It's important for \c setInstrument() to check that the instrument value has actually changed
-before emitting \c instrumentChanged(). This ensures the signal is not emitted unnecessarily and
+It's important for \c setColor() to check that the color value has actually changed
+before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and
also prevents loops when other elements respond to the value change.
+The use of bindings is essential to QML. You should always add NOTIFY
+signals for properties if they are able to be implemented, so that your
+properties can be used in bindings. Properties that cannot be bound cannot be
+automatically updated and cannot be used as flexibly in QML. Also, since
+bindings are invoked so often and relied upon in QML usage, users of your
+custom QML types may see unexpected behavior if bindings are not implemented.
+
*/
/*!
@@ -220,19 +259,19 @@ also prevents loops when other elements respond to the value change.
\example declarative/tutorials/extending/chapter4-customPropertyTypes
-The \c Musician type currently has two properties that are both strings.
-It could have all sorts of other properties. For example, we could add an
-integer-type property to store the age of each musician:
+The \c PieChart type currently has a string-type property and a color-type property.
+It could have many other types of properties. For example, we could add an
+integer-type property to store an identifier for each pie chart:
\code
- class Musician : public QObject
+ class PieChart : public QDeclarativeItem
{
...
- Q_PROPERTY(int age READ age WRITE setAge)
+ Q_PROPERTY(int id READ id WRITE setId)
public:
...
- int age() const;
- void setAge(int age);
+ int id() const;
+ void setId(int id);
...
};
\endcode
@@ -257,31 +296,39 @@ types:
If we want to create a property whose type is not supported by QML by default,
we need to register the type with QML.
-For example, let's change the type of the \c instrument property from a string to a
-new type called "Instrument". Instead of assigning a string value to \c instrument,
-we assign an \c Instrument value:
+For example, let's replace the use of the \c property with a type called
+"PieSlice" that has a \c color property. Instead of assigning a color,
+we assign an \c PieSlice value which itself contains a \c color:
\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
-Like \c Musician, this new \c Instrument type has to inherit from QObject and declare
+Like \c PieChart, this new \c PieSlice type inherits from QDeclarativeItem and declares
its properties with Q_PROPERTY():
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h 0
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
-To use it from \c Musician, we modify the \c instrument property declaration
+To use it in \c PieChart, we modify the \c color property declaration
and associated method signatures:
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 0
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 1
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 2
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 3
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
+
+There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice
+is a visual item, so it must be set as a child of the \c PieChart using
+QDeclarativeItem::setParentItem() so that the \c PieChart knows to paint this child
+item when its contents are drawn:
+
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
-Like the \c Musician type, the \c Instrument type has to be registered
-using qmlRegisterType() to be used from QML. As with \c Musician, we'll add the
-type to the "Music" module, version 1.0:
+
+Like the \c PieChart type, the \c PieSlice type has to be registered
+using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the
+type to the "Charts" module, version 1.0:
\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
\dots
@@ -293,15 +340,65 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom
*/
+
/*!
-\title Chapter 5: Writing an Extension Plugin
+\title Chapter 5: Using List Property Types
-\example declarative/tutorials/extending/chapter5-plugins
+\example declarative/tutorials/extending/chapter5-listproperties
-Currently the \c Musician and \c Instrument types are used by \c app.qml,
+Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would
+have multiple slices, with different colors and sizes. To do this, we could
+have a \c slices property that accepts a list of \c PieSlice items:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/app.qml 0
+
+\image extending-tutorial-chapter5.png
+
+To do this, we replace the \c pieSlice property in \c PieChart with a \c slices property,
+declared as a QDeclarativeListProperty type. The QDeclarativeListProperty class enables the
+creation of list properties in QML extensions. We replace the \c pieSlice()
+function with a \c slices() function that returns a list of slices, and add
+an internal \c append_slice() function (discussed below). We also use a QList to
+store the internal list of slices as \c m_slices:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2
+
+Although the \c slices property does not have an associated \c WRITE function,
+it is still modifiable because of the way QDeclarativeListProperty works.
+In the \c PieChart implementation, we implement \c PieChart::slices() to
+return a QDeclarativeListProperty value and indicate that the internal
+\c PieChart::append_slice() function is to be called whenever a request is made from QML
+to add items to the list:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.cpp 0
+
+The \c append_slice() function simply sets the parent item as before,
+and adds the new item to the \c m_slices list. As you can see, the append function for a
+QDeclarativeListProperty is called with two arguments: the list property, and
+the item that is to be appended.
+
+The \c PieSlice class has also been modified to include \c fromAngle and \c angleSpan
+properties and to draw the slice according to these values. This is a straightforward
+modification if you have read the previous pages in this tutorial, so the code is not shown here.
+
+The complete code can be seen in the updated \c examples/tutorials/extending/chapter5-listproperties directory.
+
+*/
+
+
+/*!
+\title Chapter 6: Writing an Extension Plugin
+
+\example declarative/tutorials/extending/chapter6-plugins
+
+Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
which is displayed using a QDeclarativeView in a C++ application. An alternative
way to use our QML extension is to create a plugin library to make it available
-to the QML engine. This means we could load \c app.qml using the \l {QML Viewer}
+to the QML engine. This allows \c app.qml to be loaded with the \l {QML Viewer}
(or some other QML \l{Qt Declarative UI Runtime}{runtime} application) instead of writing a \c main.cpp file and
loading our own C++ application.
@@ -313,28 +410,28 @@ To create a plugin library, we need:
\o A "qmldir" file that tells the QML engine to load the plugin
\endlist
-First, we create a plugin class named \c MusicPlugin. It subclasses QDeclarativeExtensionPlugin
+First, we create a plugin class named \c ChartsPlugin. It subclasses QDeclarativeExtensionPlugin
and registers our QML types in the inherited \l{QDeclarativeExtensionPlugin::}{registerTypes()} method. It also calls
Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
-Here is the \c MusicPlugin definition in \c musicplugin.h:
+Here is the \c ChartsPlugin definition in \c chartsplugin.h:
-\snippet declarative/tutorials/extending/chapter5-plugins/musicplugin.h 0
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.h 0
-And its implementation in \c musicplugin.cpp:
+And its implementation in \c chartsplugin.cpp:
-\snippet declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp 0
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
Then, we write a \c .pro project file that defines the project as a plugin library
and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
-\quotefile declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
+\quotefile declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
Finally, we add a \c qmldir file that is automatically parsed by the QML engine.
-Here, we specify that a plugin named "chapter5-plugin" (the name
+Here, we specify that a plugin named "chapter6-plugin" (the name
of the example project) can be found in the "lib" subdirectory:
-\quotefile declarative/tutorials/extending/chapter5-plugins/qmldir
+\quotefile declarative/tutorials/extending/chapter6-plugins/qmldir
Now we have a plugin, and instead of having a main.cpp and an executable, we can build
the project and then load the QML file in the \l {QML Viewer}:
@@ -345,15 +442,16 @@ the project and then load the QML file in the \l {QML Viewer}:
(On Mac OS X, you can launch the "QMLViewer" application instead.)
-Notice the "import Music 1.0" statement has disappeared from \c app.qml. This is
+Notice the "import Charts 1.0" statement has disappeared from \c app.qml. This is
because the \c qmldir file is in the same directory as \c app.qml: this is equivalent to
-having Musician.qml and Instrument.qml files inside the project directory, which could both
+having PieChart.qml and PieSlice.qml files inside the project directory, which could both
be used by \c app.qml without import statements.
*/
+
/*!
-\page qml-extending-tutorial6.html
-\title Chapter 6: In Summary
+\page qml-extending-tutorial7.html
+\title Chapter 7: In Summary
In this tutorial, we've shown the basic steps for creating a QML extension:
@@ -362,47 +460,33 @@ In this tutorial, we've shown the basic steps for creating a QML extension:
\o Add callable methods using Q_INVOKABLE or Qt slots, and connect to Qt signals with an \c onSignal syntax
\o Add property bindings by defining \l{Qt's Property System}{NOTIFY} signals
\o Define custom property types if the built-in types are not sufficient
+\o Define list property types using QDeclarativeListProperty
\o Create a plugin library by defining a Qt plugin and writing a \c qmldir file
\endlist
The \l {Extending QML in C++} reference documentation shows other useful features that can be added to
-QML extensions. For example, we could use \l{Object and List Property Types}{list properties} to allow multiple instruments for a \c Musician:
-
-\code
- Musician {
- instruments: [
- Instrument { type: "Guitar" }
- Instrument { type: "Drums" }
- Instrument { type: "Keyboard" }
- ]
- }
-\endcode
-
-Or use \l{Default Property}{default properties} and avoid an
-\c instruments property altogether:
+QML extensions. For example, we could use \l{Default Property}{default properties} to allow
+slices to be added without using the \c slices property:
\code
- Musician {
- Instrument { type: "Guitar" }
- Instrument { type: "Drums" }
- Instrument { type: "Keyboard" }
+ PieChart {
+ PieSlice { ... }
+ PieSlice { ... }
+ PieSlice { ... }
}
\endcode
-Or even change the \c instrument of a \c Musician from time to time using \l{Property Value Sources}{property value sources}:
+Or randomly add and remove slices from time to time using \l{Property Value Sources}{property value sources}:
\code
- Musician {
- InstrumentRandomizer on instrument {}
+ PieChart {
+ PieSliceRandomizer on slices {}
}
\endcode
See the \l{Extending QML in C++}{reference documentation} for more information.
-Additionally, \l {Integrating QML with existing Qt UI code} shows how to create
-and integrate with QML extensions that have drawing and graphical capabilities (through QGraphicsWidget).
-
*/
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter1.png b/doc/src/declarative/pics/extending-tutorial-chapter1.png
new file mode 100644
index 0000000000..9f5836b09c
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter1.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter2.png b/doc/src/declarative/pics/extending-tutorial-chapter2.png
new file mode 100644
index 0000000000..5c8f222aad
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter2.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter3.png b/doc/src/declarative/pics/extending-tutorial-chapter3.png
new file mode 100644
index 0000000000..825553fc5f
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter3.png
Binary files differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter5.png b/doc/src/declarative/pics/extending-tutorial-chapter5.png
new file mode 100644
index 0000000000..0c2e69e1b4
--- /dev/null
+++ b/doc/src/declarative/pics/extending-tutorial-chapter5.png
Binary files differ
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 9126a79af6..3f1b184d4b 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -314,7 +314,7 @@ Item {
\section2 Signal Handlers
-Signal handlers allow actions to be taken in reponse to an event. For instance,
+Signal handlers allow actions to be taken in response to an event. For instance,
the \l MouseArea element has signal handlers to handle mouse press, release
and click:
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index b44e6f233f..a2f4d3ab56 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -429,4 +429,77 @@ Rectangle {
}
\endcode
+\section1 Accessing Views and Models from Delegates
+
+You can access the view for which a delegate is used, and its
+properties, by using ListView.view in a delegate on a ListView, or
+GridView.view in a delegate on a GridView, etc. In particular, you can
+access the model and its properties by using ListView.view.model.
+
+This is useful when you want to use the same delegate for a number of
+views, for example, but you want decorations or other features to be
+different for each view, and you would like these different settings to
+be properties of each of the views. Similarly, it might be of interest
+to access or show some properties of the model.
+
+In the following example, the delegate shows the property \e{language}
+of the model, and the color of one of the fields depends on the
+property \e{fruit_color} of the view.
+
+\code
+Rectangle {
+ width: 200; height: 200
+
+ ListModel {
+ id: fruitModel
+ property string language: "en"
+ ListElement {
+ name: "Apple"
+ cost: 2.45
+ }
+ ListElement {
+ name: "Orange"
+ cost: 3.25
+ }
+ ListElement {
+ name: "Banana"
+ cost: 1.95
+ }
+ }
+
+ Component {
+ id: fruitDelegate
+ Row {
+ Text { text: " Fruit: " + name; color: ListView.view.fruit_color }
+ Text { text: " Cost: $" + cost }
+ Text { text: " Language: " + ListView.view.model.language }
+ }
+ }
+
+ ListView {
+ property color fruit_color: "green"
+ model: fruitModel
+ delegate: fruitDelegate
+ anchors.fill: parent
+ }
+}
+\endcode
+
+Another important case is when some action (e.g. mouse click) in the
+delegate should update data in the model. In this case you can define
+a function in the model, e.g.:
+
+\code
+ setData(int row, const QString & field_name, QVariant new_value),
+\endcode
+
+...and call it from the delegate using:
+
+\code
+ ListView.view.model.setData(index, field, value)
+\endcode
+
+...assuming that \e{field} holds the name of the field which should be
+updated, and that \e{value} holds the new value.
+
*/
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc
index 26c1e8959c..be8c029aef 100644
--- a/doc/src/declarative/qdeclarativeperformance.qdoc
+++ b/doc/src/declarative/qdeclarativeperformance.qdoc
@@ -115,4 +115,25 @@ provide an image that includes the frame and the shadow.
Avoid running JavaScript during animation. For example, running a complex
JavaScript expression for each frame of an x property animation.
+\section1 Rendering
+
+Often using a different graphics system will give superior performance to the native
+graphics system (this is especially the case on X11). This can be configured using
+QApplication::setGraphicsSystem() or via the command line using the \c -graphicssystem
+switch.
+
+You can enable OpenGL acceleration using the \c opengl graphics system, or by setting a
+QGLWidget as the viewport of your QDeclarativeView.
+
+You may need to try various options to find what works the best for your application.
+For embedded X11-based devices one recommended combination is to use the raster graphics
+system with a QGLWidget for the viewport. While this doesn't guarantee the \bold fastest
+performance for all use-cases, it typically has \bold{consistently good} performance for
+all use-cases. In contrast, only using the raster paint engine may result in very good
+performance for parts of your application and very poor performance elsewhere.
+
+The QML Viewer uses the raster graphics system by default for X11 and OS X. It also
+includes a \c -opengl command line option which sets a QGLWidget as the viewport of the
+view. On OS X, a QGLWidget is always used.
+
*/
diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc
index ae54d58f2f..68d56bf1c3 100644
--- a/doc/src/declarative/qtprogrammers.qdoc
+++ b/doc/src/declarative/qtprogrammers.qdoc
@@ -27,8 +27,6 @@
/*!
- INCOMPLETE
-
\page qtprogrammers.html
\target qtprogrammers
\title QML for Qt programmers
@@ -146,4 +144,14 @@ transition from an arbitrary Text item, or characters within a Text item, so you
item would need to be sufficiently flexible to allow such animation.
\section1 QML Items Compared With QGraphicsWidgets
+
+The main difference between QML items and QGraphicsWidgets is how they are intended to be used. The technical implementation details are much the same, but in practice they are different because QML items are made for declarative and compositional use, and QGraphicsWidgets are made for imperative and more integrated use. Both QML items and QGraphicsWidgets inherit from QGraphicsObject, and can co-exist. The differences are in the layouting system and the interfacing with other components. Note that, as QGraphicsWidgets tend more to be all-in-one packages, the equivalent of a QGraphicsWidget may be many QML items composed across several QML files, but it can still be loaded and used as a single QGraphicsObject from C++.
+
+QGraphicsWidgets are usually designed to be laid out with QGraphicsLayouts. QML does not use QGraphicsLayouts, as the Qt layouts do not mix well with animated and fluid UIs, so the geometry interface is one of the main differences. When writing QML elements, you allow the designers to place their bounding rectangle using absolute geometry, bindings or anchors (all setup for you when you inherit QDeclarativeItem) and you do not use layouts or size hints. If size hints are appropriate, then place them in the QML documentation so that the designers know how to use the item best, but still have complete control over the look and feel.
+
+The other main difference is that QGraphicsWidgets tend to follow the widget model, in that they are a self-contained bundle of UI and logic. In contrast, QML primitives are usually a single purpose item that does not fulfill a use case on its own, but is composed into the equivalent of the widget inside the QML file. So when writing QML Items, try to avoid doing UI logic or composing visual elements inside the items. Try instead to write more general purpose primitives, so that the look and feel (which involves the UI logic) can be written in QML.
+
+Both differences are caused by the different method of interaction. QGraphicsWidget is a QGraphicsObject subclass which makes fluid UI development from C++ easier, and QDeclarativeItem is a QGraphicsObject subclass which makes fluid UI development from QML easier. The difference therefore is primarily one of the interface exposed, and the design of the items that come with it (the Declarative primitives for QML and the nothing for QGraphicsWidget, because you need to write your own UI logic into the subclass).
+
+If you wish to use both QML and C++ to write the UI, for example to ease the transition period, it is recommended to use QDeclarativeItem subclasses (although you can use QGraphicsWidgets as well). To allow for easier use from C++ make the root item of each C++ component a LayoutItem, and load individual 'widgets' of QML (possibly comprised of multiple files, and containing a self-contained bundle of UI and logic) into your scene to replace individual QGraphicsWidgets one at a time.
*/
diff --git a/doc/src/examples/movie.qdoc b/doc/src/examples/movie.qdoc
index 733f52dcc0..4d7b3e0cbc 100644
--- a/doc/src/examples/movie.qdoc
+++ b/doc/src/examples/movie.qdoc
@@ -30,8 +30,8 @@
\title Movie Example
The Movie example demonstrates how to use QMovie and QLabel to
- display animations. Now that Qt comes with \l{Phonon
- Overview}{Phonon} (the multimedia framework), QMovie is mostly
+ display animations. Now that Qt comes with the \l{Phonon multimedia
+ framework} {Phonon multimedia framework}, QMovie is mostly
useful if one wants to play a simple animation without the added
complexity of a multimedia framework to install and deploy.
diff --git a/doc/src/examples/trafficinfo.qdoc b/doc/src/examples/trafficinfo.qdoc
index fe69d52e50..bc061782b2 100644
--- a/doc/src/examples/trafficinfo.qdoc
+++ b/doc/src/examples/trafficinfo.qdoc
@@ -145,5 +145,5 @@
The rest of the code in this example is just for representing the time and
station information to the user, and uses techniques described in the
- \l{Widgets Examples}.
+ \l{Widget Examples}.
*/
diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc
index 4a1b631e12..c5dd27c572 100644
--- a/doc/src/frameworks-technologies/dnd.qdoc
+++ b/doc/src/frameworks-technologies/dnd.qdoc
@@ -45,7 +45,7 @@
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
- \l{Using Drag and Drop with Item Views} and \l{Graphics View
+ \l{Using drag & drop with item views} and \l{Graphics View
Framework}.
\section1 Drag and Drop Classes
diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc
index 94b9f0dd8b..131f06351c 100644
--- a/doc/src/frameworks-technologies/model-view-programming.qdoc
+++ b/doc/src/frameworks-technologies/model-view-programming.qdoc
@@ -900,7 +900,7 @@
after its application through the use of certain types of selection
commands. These are discussed later in this section.
- \section3 Current item &amp selected items
+ \section3 Current item and 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
@@ -1257,7 +1257,7 @@
reimplement the \l{QAbstractItemModel::columnCount()}{columnCount()}
function.
- \section3 Model headers &amp data
+ \section3 Model headers and 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
@@ -1350,7 +1350,7 @@
\snippet doc/src/snippets/stringlistmodel/model.cpp 1
- \section3 Inserting &amp removing rows
+ \section3 Inserting and 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
@@ -1634,7 +1634,7 @@
contain the text given in the search string. This pattern can also be
used in the list and table widgets.
- \section1 Using drag &amp drop with item views
+ \section1 Using drag & 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
@@ -1714,7 +1714,7 @@
of QAbstractItemModel::removeRows(), either directly or by inheriting the
implementation from its base class.
- \section3 Enabling drag &amp drop for items
+ \section3 Enabling drag & 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
@@ -2124,12 +2124,12 @@
children may be displayed incorrectly in some views until the user
attempts to view the non-existent child items.
- \section2 Navigation &amp model index creation
+ \section2 Navigation and 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.
- \section3 Parents &amp children
+ \section3 Parents and 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
@@ -2153,7 +2153,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.
- \section2 Drag &amp drop support and MIME type handling
+ \section2 Drag & 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
@@ -2282,7 +2282,7 @@
\endlist
For more information about drag and drop with item views, refer to
- \l{Using Drag and Drop with Item Views}.
+ \l{Using drag & drop with item views}.
\section3 Convenience views
@@ -2293,7 +2293,7 @@
the existing contents with the data being transferred, the underlying model
will set the data of the target items rather than insert new rows and columns
into the model. For more information on drag and drop in convenience views,
- you can see \l{Using Drag and Drop with Item Views}.
+ you can see \l{Using drag & drop with item views}.
\section2 Performance optimization for large amounts of data
diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc
index 023b4ce2ab..5119638141 100644
--- a/doc/src/frameworks-technologies/phonon.qdoc
+++ b/doc/src/frameworks-technologies/phonon.qdoc
@@ -34,6 +34,7 @@
\tableofcontents
+ \target Phonon Overview
\section1 Introduction
Qt uses the Phonon multimedia framework to provide functionality
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index b6766d5f41..a32d120e20 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -343,8 +343,8 @@
/*!
\page examples-draganddrop.html
\ingroup all-examples
- \title Drag &amp Drop Examples
- \brief How to access your platform's native darg &amp drop functionality
+ \title Drag &amp; Drop Examples
+ \brief How to access your platform's native darg &amp; drop functionality
\image draganddrop-examples.png
diff --git a/doc/src/images/qml-mousearea-example.png b/doc/src/images/qml-mousearea-example.png
index c6e52d62f4..c0eef7f9c7 100644
--- a/doc/src/images/qml-mousearea-example.png
+++ b/doc/src/images/qml-mousearea-example.png
Binary files differ
diff --git a/doc/src/images/qml-xmllistmodel-example.png b/doc/src/images/qml-xmllistmodel-example.png
new file mode 100644
index 0000000000..be2d15d342
--- /dev/null
+++ b/doc/src/images/qml-xmllistmodel-example.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 18a174683a..92721c5351 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,7 +44,7 @@
<li><a href="installation.html">Installation &amp; first steps</a></li>
<li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
- <li><a href="examples.html">Examples</a></li>
+ <li><a href="all-examples.html">Examples</a></li>
<li><a href="qt4-7-intro.html">Whats new in Qt 4.7</a></li>
</ul>
</div>
@@ -56,30 +56,29 @@
<div class="indexboxcont indexboxbar ">
<div class="sectionlist tricol">
<ul>
- <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>
+ <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 Declarations</a></li>
</ul>
</div>
<div class="sectionlist tricol">
<ul>
- <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>
+ <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
+ <li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
+ <li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
+ <li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
+ <li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
</ul>
</div>
<div class="sectionlist">
<ul>
- <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>
+ <li><a href="declarativeui.html">Qt Quick</a></li>
+ <li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
+ <li><a href="qdeclarativeelements.html">QML Elements</a></li>
+ <li><a href="qt-gui-concepts.html">UI components</a></li>
+ <li><a href="declarativeui.html">Qt & GUI design</a></li>
</ul>
</div>
</div>
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index e5f0e627ce..701707eb88 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -51,6 +51,7 @@
\o \l {Exception Safety with Symbian}
\o \l {Platform Notes - Symbian} {Qt for the Symbian platform - state of support}
\o \l {qmake Platform Notes#Symbian platform} {Qt for Symbian extensions for qmake}
+ \o \l {Symbian Platform Security Requirements} {Symbian Platform Security Requirements}
\endlist
\o
\list
@@ -60,6 +61,22 @@
*/
/*!
+ \page symbian-platform-security-requirements.html
+
+ \title Symbian Platform Security Requirements
+ \ingroup qtsymbian
+
+ On Symbian, processes that access media via the network must
+ have the \c NetworkServices platform security capability. If the client
+ process lacks this capability, operations will result in errors.
+ This failure is indicated by a state() of Phonon::ErrorState.
+
+ Platform security capabilities are added via the
+ \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY}
+ qmake variable.
+*/
+
+/*!
\page symbian-with-qt-introduction.html
\title The Symbian platform - Introduction to Qt
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 985f3da7f1..c46159ce19 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -263,7 +263,7 @@ make
//! [40]
//! [41]
-cd src/s60installs
+cd src
make sis
//! [41]
diff --git a/doc/src/snippets/declarative/mousearea.qml b/doc/src/snippets/declarative/mousearea.qml
index 8e7c73766d..fb6cba0694 100644
--- a/doc/src/snippets/declarative/mousearea.qml
+++ b/doc/src/snippets/declarative/mousearea.qml
@@ -83,17 +83,18 @@ Rectangle {
id: container
width: 600; height: 200
- Image {
- id: pic
- source: "pics/qt.png"
- opacity: (600.0 - pic.x) / 600
+ Rectangle {
+ id: rect
+ width: 50; height: 50
+ color: "red"
+ opacity: (600.0 - rect.x) / 600
MouseArea {
anchors.fill: parent
- drag.target: pic
+ drag.target: rect
drag.axis: Drag.XAxis
drag.minimumX: 0
- drag.maximumX: container.width - pic.width
+ drag.maximumX: container.width - rect.width
}
}
}
diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
index afa7de03a8..9f5d28b1b4 100644
--- a/doc/src/template/style/OfflineStyle.css
+++ b/doc/src/template/style/OfflineStyle.css
@@ -1,588 +1,26 @@
@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;
+ background: none;
+
}
.wrapper .bd
{
+ background: none;
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;
- /* color: #44a51c;*/
- 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;
+ background-color: #FFFFFF;
+
}
.offline .footer {
@@ -811,22 +249,3 @@ ul.sf-menu li li li.sfHover ul {
}
/* 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/style.css b/doc/src/template/style/style.css
index 184a83234b..9f809212c8 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -1,6 +1,8 @@
@media screen
{
- html
+
+/* basic elements */
+ html
{
color: #000000;
background: #FFFFFF;
@@ -18,8 +20,7 @@
fieldset, img
{
border: 0;
- height:100%;
- width:100%
+ max-width:100%;
}
address, caption, cite, code, dfn, em, strong, th, var, optgroup
{
@@ -41,7 +42,6 @@
h1, h2, h3, h4, h5, h6
{
font-size: 100%;
-/* font-weight: normal; */
}
q:before, q:after
{
@@ -52,11 +52,7 @@
border: 0;
font-variant: normal;
}
- sup
- {
- vertical-align: baseline;
- }
- sub
+ sup, sub
{
vertical-align: baseline;
}
@@ -64,19 +60,6 @@
{
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;
@@ -92,9 +75,19 @@
{
font-size: 100%;
}
+ strong
+ {
+ font-weight: bold;
+ }
+ em
+ {
+ font-style: italic;
+ }
+
+ /* adding Qt theme */
html
{
- background-color: #e5e5e5;
+ /* background-color: #e5e5e5;*/
}
body
{
@@ -102,73 +95,115 @@
font: normal 13px/1.2 Verdana;
color: #363534;
}
- strong
+ a
{
- font-weight: bold;
+ color: #00732f;
+ text-decoration: none;
}
- em
+ hr
{
- font-style: italic;
+ background-color: #E6E6E6;
+ border: 1px solid #E6E6E6;
+ height: 1px;
+ width: 100%;
+ text-align: left;
+ margin: 15px 0px 15px 0px;
}
- a
+
+ pre
{
- color: #00732f;
- text-decoration: none;
+ border: 1px solid #DDDDDD;
+ -moz-border-radius: 7px 7px 7px 7px;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ overflow-x: auto;
}
- .header, .footer, .wrapper
+ table, pre
{
- min-width: 600px;
- max-width: 1500px;
- margin: 0 30px;
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #E6E6E6;
+ border-collapse: separate;
+ font-size: 11px;
+ margin-bottom: 25px;
}
- .wrapper
+ pre.highlightedCode {
+ display: block;
+ overflow:hidden;
+ }
+ thead
{
- background: url(../images/bg_r.png) repeat-y 100% 0;
+ margin-top: 5px;
+ font:600 12px/1.2 Arial;
}
- .wrapper .hd
+ th
{
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 0;
- overflow: hidden;
+ padding: 5px 15px 5px 15px;
+ background-color: #E1E1E1;
+ border-left: 1px solid #E6E6E6;
}
- .offline .wrapper .hd
+ td
{
- background: url(../images/page.png) no-repeat 0 -15px;
+ padding: 3px 15px 3px 20px;
}
- .wrapper .hd span
+ tr.odd td:hover, tr.even td:hover {}
+
+ td.rightAlign
+ {
+ padding: 3px 5px 3px 10px;
+ }
+ table tr.odd
{
- height: 15px;
- display: block;
- overflow: hidden;
- background: url(../images/page.png) no-repeat 100% -30px;
+ border-left: 1px solid #E6E6E6;
+ background-color: #F6F6F6;
+ color: #66666E;
}
- .wrapper .bd
+ table tr.even
{
- background: url(../images/bg_l.png) repeat-y 0 0;
- position: relative;
+ border-left: 1px solid #E6E6E6;
+ background-color: #ffffff;
+ color: #66666E;
}
- .offline .wrapper .bd
+ table tr.odd td:hover, table tr.even td:hover
{
- background: url(../images/bg_l_blank.png) repeat-y 0 0;
+ /* background-color: #E6E6E6;*/ /* disabled until further notice */
}
- .wrapper .ft
+
+ span.comment
{
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 -75px;
- overflow: hidden;
+ color: #8B0000;
+ font-style: italic;
}
- .offline .wrapper .ft
+ span.string, span.char
{
- background: url(../images/page.png) no-repeat 0 -90px;
+ color: #254117;
}
- .wrapper .ft span
+
+
+/* end basic elements */
+
+/* font style elements */
+ .heading
{
- height: 15px;
- display: block;
- background: url(../images/page.png) no-repeat 100% -60px;
- overflow: hidden;
+ font: normal bold 16px/1.0 Arial;
+ padding-bottom: 15px;
+ }
+ .subtitle
+ {
+ font-size: 13px;
+ }
+ .small-subtitle
+ {
+ font-size: 13px;
+ }
+/* end font style elements */
+
+/* global settings*/
+ .header, .footer, .wrapper
+ {
+ min-width: 600px;
+ max-width: 1500px;
+ margin: 0 30px;
}
.header, .footer
{
@@ -176,6 +211,17 @@
clear: both;
overflow: hidden;
}
+ .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+/* end global settings*/
+/* header elements */
.header
{
height: 115px;
@@ -203,7 +249,247 @@
text-indent: -999em;
background: url(../images/sprites-combined.png) no-repeat -78px -235px;
}
+ .content a:visited
+ {
+ color: #4c0033;
+ text-decoration: none;
+ }
+ .content a:visited:hover
+ {
+ color: #4c0033;
+ text-decoration: underline;
+ }
+
+ #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;
+ }
+
+
+
+/* end header elements */
+/* content and sidebar elements */
+ .wrapper
+ {
+ background: url(../images/bg_r.png) repeat-y 100% 0;
+ }
+ .wrapper .hd
+ {
+ padding-left: 216px;
+ height: 15px;
+ background: url(../images/page.png) no-repeat 0 0;
+ overflow: hidden;
+ }
+
+
+
+
+ .wrapper .hd span
+ {
+ height: 15px;
+ display: block;
+ overflow: hidden;
+ background: url(../images/page.png) no-repeat 100% -30px;
+ }
+ .wrapper .bd
+ {
+ background: url(../images/bg_l.png) repeat-y 0 0;
+ position: relative;
+ }
+
+
+
+
+ .wrapper .ft
+ {
+ padding-left: 216px;
+ height: 15px;
+ background: url(../images/page.png) no-repeat 0 -75px;
+ overflow: hidden;
+ }
+
+
+
+
+ .wrapper .ft span
+ {
+ height: 15px;
+ display: block;
+ background: url(../images/page.png) no-repeat 100% -60px;
+ overflow: hidden;
+ }
+ .navTop{
+ float:right;
+ display:block;
+ padding-right:15px;
+
+ }
+
+
+
+/* end content and sidebar elements */
+/* sidebar elements */
.sidebar
{
float: left;
@@ -212,10 +498,10 @@
font-size: 11px;
}
- .offline .sidebar, .offline .feedback, .offline .t_button
- {
- display: none;
- }
+
+
+
+
.sidebar .searchlabel
{
@@ -258,9 +544,8 @@
.sidebar .box h2
{
- font: 600 16px/1.2 Arial;
+ font: bold 16px/1.2 Arial;
padding: 0;
-/* min-height: 32px;*/
}
.sidebar .box h2 span
{
@@ -273,10 +558,6 @@
}
.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
{
@@ -284,10 +565,6 @@
}
.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
{
@@ -295,10 +572,6 @@
}
.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
@@ -315,7 +588,6 @@
}
.sidebar .box ul
{
- /*padding:10px;*/
padding-bottom:5px;
padding-left:10px;
padding-top:5px;
@@ -342,16 +614,40 @@
color:#AAD2F0;
font-style:italic;
}
+ .sidebar .search form input.loading
+ {
+ background:url("../images/spinner.gif") no-repeat scroll right center transparent;
+ }
+.floatingResult{
+ z-index:1;
+ position:relative;
+ padding-top:0px;
+ background-color:white;
+ border:solid 1px black;
+ height:250px;
+ width:600px;
+ overflow-x:hidden;
+ overflow-y:auto;
+}
+
+ .floatingResult:hover{
+ display:block;
+ }
+ .floatingResult:hover{
+ }
+
+/* end sidebar elements */
+/* content elements */
.wrap
{
margin: 0 5px 0 208px;
overflow: visible;
}
- .offline .wrap
- {
- margin: 0 5px 0 5px;
- }
+
+
+
+
.wrap .toolbar
{
background-color: #fafafa;
@@ -437,8 +733,11 @@
color: #00732F;
}
- .offline .wrap .breadcrumb
+
+ .wrap .content
{
+ padding: 30px;
+ word-wrap:break-word;
}
.wrap .breadcrumb ul
@@ -466,48 +765,51 @@
padding-left: 0;
margin-left: 0;
}
- .wrap .content
- {
- padding: 30px;
- word-wrap:break-word;
- }
+
+
+
+ .wrap .content ol li {
+ background:none;
+ font:normal 10pt/1 Verdana;
+
+ margin-bottom:10px;
+ margin-left:12px;
+ /*list-style-type:disc;*/
+ }
+
.wrap .content li
{
- /*padding-left: 12px;*/
background: url(../images/bullet_sq.png) no-repeat 0 5px;
font: normal 400 10pt/1 Verdana;
- /* color: #44a51c;*/
margin-bottom: 10px;
padding-left:12px;
}
- .content li:hover
- {
- /* text-decoration: underline;*/
- }
- .offline .wrap .content
- {
- padding-top: 15px;
- }
+
+
+
+
+
+
+
+
+ .content li:hover {}
.wrap .content h1
{
- font: 600 18px/1.2 Arial;
+ font: bold 18px/1.2 Arial;
}
.wrap .content h2
{
-
border-bottom:1px solid #DDDDDD;
font:600 16px/1.2 Arial;
margin-top:15px;
- width:100%;
-
+ width:100%;
}
.wrap .content h3
{
- font: 600 14px/1.2 Arial;
- /*border-bottom:1px solid #DDDDDD;*/
+ font: bold 14px/1.2 Arial;
font:600 16px/1.2 Arial;
margin-top:15px;
width:100%;
@@ -516,7 +818,6 @@
{
line-height: 20px;
padding: 5px;
- /* text-align:justify;*/
}
.wrap .content table p
{
@@ -533,25 +834,6 @@
color: #4c0033;
text-decoration: underline;
}
- .content a:visited
- {
- color: #4c0033;
- text-decoration: none;
- }
- .content a:visited:hover
- {
- 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: none;
@@ -568,267 +850,36 @@
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;
+ .alphaChar{
+ width:100%;
+ background-color:#F6F6F6;
+ border:1px solid #E6E6E6;
+ -moz-border-radius: 7px 7px 7px 7px;
+ font-size:12pt;
+ padding-left:10px;
+ margin-top:10px;
+ margin-bottom:10px;
}
- #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;
- }
+ .flowList{
+ vertical-align:top;
+ }
- hr
- {
- background-color: #E6E6E6;
- border: 1px solid #E6E6E6;
- height: 1px;
- width: 100%;
- text-align: left;
- margin: 15px 0px 15px 0px;
- }
+ .flowList dl{
+ }
+ .flowList dd{
+ display:inline-block;
+ margin-left:10px;
+ width:250px;
+ }
+ .wrap .content .flowList p{
+ padding:0px;
+ }
.content .alignedsummary
{
margin: 15px;
}
- pre
- {
- border: 1px solid #DDDDDD;
- -moz-border-radius: 7px 7px 7px 7px;
- 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 5px 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
{
@@ -856,7 +907,6 @@
*.qmlitem p
{
}
-
#feedbackBox
{
display: none;
@@ -934,16 +984,14 @@
.toc h3, .generic a
{
- font: 600 12px/1.2 Arial;
+ font: bold 12px/1.2 Arial;
}
.generic{
- /*max-width:75%;*/
}
.generic td{
padding:5px;
}
-
.generic .alphaChar{
margin-top:5px;
}
@@ -991,6 +1039,16 @@
padding-left: 0px;
}
+ .wrap .content .toc h3{
+ border-bottom:0px;
+ margin-top:0px;
+ }
+
+ .wrap .content .toc h3 a:hover{
+ color:#00732F;
+ text-decoration:none;
+ }
+
.wrap .content .toc .level2
{
@@ -1007,7 +1065,6 @@
font: normal 10px/1.2 Verdana;
background: url(../images/bullet_dn.png) no-repeat 0 5px;
}
-
.relpage
{
-moz-border-radius: 7px 7px 7px 7px;
@@ -1071,6 +1128,24 @@
.functionIndex a{
display:inline-block;
}
+
+/* end content elements */
+/* footer elements */
+
+ .footer
+ {
+ min-height: 100px;
+ color: #797775;
+ font: normal 9px/1 Verdana;
+ text-align: center;
+ padding-top: 40px;
+ background-color: #E6E7E8;
+ margin: 0;
+ }
+/* end footer elements */
+
+
+
/* start index box */
.indexbox
@@ -1082,15 +1157,15 @@
.indexboxcont
{
display: block;
- /* overflow: hidden;*/
+
}
.indexboxbar
{
background: transparent url(../images/horBar.png ) repeat-x left bottom;
margin-bottom: 25px;
- /* background-image: none;
- border-bottom: 1px solid #e2e2e2;*/
+
+
}
.indexboxcont .section
@@ -1141,7 +1216,7 @@
.content .indexboxcont li
{
- font: normal 600 13px/1 Verdana;
+ font: normal bold 13px/1 Verdana;
}
.indexbox a:hover, .indexbox a:visited:hover
@@ -1190,87 +1265,285 @@
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;
--moz-border-radius: 7px 7px 7px 7px;
-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;
-}
-.floatingResult{
- z-index:1;
- position:relative;
- padding-top:0px;
- background-color:white;
- border:solid 1px black;
- height:250px;
- width:600px;
- overflow-x:hidden;
- overflow-y:auto;
-}
+/* start of offline spec*/
+ .offline .wrapper .hd
+ {
+ background: url(../images/page.png) no-repeat 0 -15px;
+ }
+ .offline .wrapper .bd
+ {
+ background: url(../images/bg_l_blank.png) repeat-y 0 0;
+ }
+ .offline .wrapper .ft
+ {
+ background: url(../images/page.png) no-repeat 0 -90px;
+ }
+ .offline .sidebar,
+ .offline .feedback,
+ .offline .t_button,
+ .offline #narrowsearch,
+ .offline #narrowmenu
+ {
+ display: none;
+ }
+ .offline .wrap
+ {
+ margin: 0 5px 0 5px;
+ }
+ .offline .wrap .breadcrumb
+ {
+ }
- .floatingResult:hover{
- display:block;
- }
- .floatingResult:hover{
- /*display:none;*/
- }
+ .offline .wrap .content
+ {
+ padding-top: 15px;
+ }
- .wrap .content ol li {
- background:none;
- font:400 10pt/1 Verdana;
- margin-bottom:10px;
- margin-left:12px;
+
+/* end of offline spec*/
+
+/* start of creator spec*/
+ .creator
+ {
+ margin-left:0px;
+ margin-right:0px;
+ padding-left:0px;
+ padding-right:0px;
}
- .wrap .content ol li {
+ .creator .wrap .content ol li {
list-style-type:decimal;
}
- .navTop{
- float:right;
- display:block;
- padding-right:15px;
- /*margin-top:10px;*/
+ .creator .header .icon,
+ .creator .feedback,
+ .creator .t_button,
+ .creator .feedback,
+ .creator #feedbackBox,
+ .creator #feedback,
+ .creator #blurpage,
+ .creator .indexbox .indexIcon span,
+ .creator .wrapper .hd,
+ .creator .indexbox .indexIcon,
+ .creator .header #nav-logo,
+ .creator #offlinemenu,
+ .creator #offlinesearch,
+ .creator .header #nav-topright,
+ .creator .header #shortCut ,
+ .creator .wrapper .hd,
+ .creator .wrapper .ft,
+ .creator .sidebar,
+ .creator .wrap .feedback
+ {
+ display:none;
+ }
+
+ body.creator
+ {
+ background: none;
+
+ font: normal 13px/1.2 Verdana;
+ color: #363534;
+ background-color: #FFFFFF;
+ }
+
+
+
+ .creator .header, .footer, .wrapper
+ {
+ max-width: 1500px;
+ margin: 0px;
+ }
+
+ .creator .wrapper
+ {
+ position:relative;
+ top:50px;
+ }
+ .creator .wrapper .bd
+ {
+
+ background:#FFFFFF;
}
+
+
+ .creator .header, .footer
+ {
+ display: block;
+ clear: both;
+ overflow: hidden;
+ }
+ .creator .wrap .content p
+
+ {
+ line-height: 20px;
+ padding: 5px;
+ }
+
+ .creator .header .qtref span
+ {
+ background:none;
+ }
+
+
- .wrap .content .toc h3{
- border-bottom:0px;
- margin-top:0px;
+ .creator .footer
+ {
+ border-top:1px solid #E5E5E5;
+ min-height: 100px;
+ margin:0px;
+ }
+
+ .creator .wrap
+ {
+
+ padding:0 5px 0 5px;
+ margin: 0px;
+ }
+ .creator .wrap .toolbar
+ {
+
+
+ border-bottom:1px solid #E5E5E5;
+ width:100%,
+ }
+ .creator .wrap .breadcrumb ul li a
+ {
+ /* color: #363534;*/
+ color: #00732F;
+ }
+
+ .creator .wrap .content
+ {
+ padding: 0px;
+ word-wrap:break-word;
+ }
+
+ .creator .wrap .content ol li {
+ background:none;
+ font: inherit;
+ padding-left: 0px;
+ }
+
+ .creator .wrap .content .descr ol li {
+ margin-left: 45px;
+
+ }
+ .creator .content .alignedsummary
+ {
+ margin: 5px;
+ width:100%;
+ }
+ .creator .generic{
+ max-width:75%;
+ }
+ .creator .generic td{
+ padding:0;
}
+ .creator .indexboxbar
+ {
+ border-bottom:1px solid #E5E5E5;
+ margin-bottom: 25px;
+ background: none;
+ }
- .wrap .content .toc h3 a:hover{
- color:#00732F;
- text-decoration:none;
+
+
+ .creator .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;
+ }
+
+
+ .creator .header .content
+ {
+ }
+ .creator .header .qtref
+ {
+ color: #00732F;
+ position: static;
+ float: left;
+ margin-left: 5px;
+ font: bold 18px/1 Arial;
+ }
+
+ .creator .header .qtref:visited
+ {
+ color: #00732F;
+ }
+ .creator .header .qtref:hover
+ {
+ color: #00732F;
+ text-decoration:none;
+ }
+ .creator .header .qtref span
+ {
+ background-image: none;
+ text-indent: 0;
+ text-decoration:none;
+ }
+
+
+
+
+
+
+ .creator .wrap .toolbar
+ {
+ display:block;
+ padding-top:0px;
+ }
+
+
+
+ .creator .wrap .breadcrumb ul li {
+ font-weight: normal;
+ }
+
+ .creator .wrap .breadcrumb ul li a {
+ /*color: #44a51c;*/
+ }
+
+ .creator .wrap .breadcrumb ul li.last a {
+ /*color: #363534;*/
+ }
+
+ .creator #narrowmenu ul
+ {
+ border-bottom:solid 1px #E5E5E5;
+ border-left:solid 1px #E5E5E5;
+ border-right:solid 1px #E5E5E5;
}
+
+ .creator #narrowmenu li ul {
+ margin-top:-15px;
+ }
+
+
+ .creator .toc {
+ margin:10px 20px 10px 10px;
+ }
+/* end of creator spec*/
+}
+
/* end of screen media */
/* start of print media */
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
index 995192a17e..18d027e689 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
@@ -54,7 +54,7 @@ class ColorImageProvider : public QDeclarativeImageProvider
{
public:
ColorImageProvider()
- : QDeclarativeImageProvider(Pixmap)
+ : QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap)
{
}
diff --git a/examples/declarative/touchinteraction/mousearea/mousearea-example.qml b/examples/declarative/touchinteraction/mousearea/mousearea-example.qml
index 64f72a9a2a..85ea2dcd21 100644
--- a/examples/declarative/touchinteraction/mousearea/mousearea-example.qml
+++ b/examples/declarative/touchinteraction/mousearea/mousearea-example.qml
@@ -44,59 +44,69 @@ Rectangle {
id: box
width: 350; height: 250
- function showInfo(text) {
- statusText.text = text
- }
-
Rectangle {
+ id: redSquare
width: 80; height: 80
+ anchors.top: parent.top; anchors.left: parent.left; anchors.margins: 10
color: "red"
Text { text: "Click"; font.pixelSize: 16; anchors.centerIn: parent }
MouseArea {
- anchors.fill: parent
+ anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onPressed: box.showInfo('Pressed (x=' + mouse.x + ' y=' + mouse.y + ' button='
- + (mouse.button == Qt.RightButton ? 'right' : 'left')
- + ' Shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')')
- onReleased: box.showInfo('Released (x=' + mouse.x + ' y=' + mouse.y
- + ' isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')')
- onClicked: box.showInfo('Clicked (x=' + mouse.x + ' y=' + mouse.y + ' wasHeld=' + mouse.wasHeld + ')')
- onDoubleClicked: box.showInfo('Double clicked (x=' + mouse.x + ' y=' + mouse.y + ')')
- onPressAndHold: box.showInfo('Press and hold')
- onEntered: box.showInfo('Entered (pressed=' + pressed + ')')
- onExited: box.showInfo('Exited (pressed=' + pressed + ')')
+ onEntered: info.text = 'Entered'
+ onExited: info.text = 'Exited (pressed=' + pressed + ')'
+
+ onPressed: {
+ info.text = 'Pressed (button=' + (mouse.button == Qt.RightButton ? 'right' : 'left')
+ + ' shift=' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')'
+ var posInBox = redSquare.mapToItem(box, mouse.x, mouse.y)
+ posInfo.text = + mouse.x + ',' + mouse.y + ' in square'
+ + ' (' + posInBox.x + ',' + posInBox.y + ' in window)'
+ }
+
+ onReleased: {
+ info.text = 'Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')'
+ posInfo.text = ''
+ }
+
+ onPressAndHold: info.text = 'Press and hold'
+ onClicked: info.text = 'Clicked (wasHeld=' + mouse.wasHeld + ')'
+ onDoubleClicked: info.text = 'Double clicked'
}
}
Rectangle {
- width: 80; height: 80; anchors.right: parent.right
+ id: blueSquare
+ width: 80; height: 80
+ x: box.width - width - 10; y: 10 // making this item draggable, so don't use anchors
color: "blue"
Text { text: "Drag"; font.pixelSize: 16; color: "white"; anchors.centerIn: parent }
MouseArea {
anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.XAxis
+ drag.target: blueSquare
+ drag.axis: Drag.XandYAxis
drag.minimumX: 0
- drag.maximumX: 150
-
- onPressed: box.showInfo('Pressed')
- onReleased: box.showInfo('Released (isClick=' + mouse.isClick + ' wasHeld=' + mouse.wasHeld + ')')
- onClicked: box.showInfo('Clicked' + ' (wasHeld=' + mouse.wasHeld + ')')
- onDoubleClicked: box.showInfo('Double clicked')
- onPressAndHold: box.showInfo('Press and hold')
+ drag.maximumX: box.width - parent.width
+ drag.minimumY: 0
+ drag.maximumY: box.height - parent.width
}
}
Text {
- id: statusText
- anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+ id: info
+ anchors.bottom: posInfo.top; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
onTextChanged: console.log(text)
}
+
+ Text {
+ id: posInfo
+ anchors.bottom: parent.bottom; anchors.horizontalCenter: parent.horizontalCenter; anchors.margins: 30
+ }
}
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/app.qml b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
index 9af155cdc1..ada088d6d9 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/app.qml
+++ b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
@@ -38,21 +38,23 @@
**
****************************************************************************/
//![0]
-import Music 1.0
+import Charts 1.0
import Qt 4.7
-Rectangle {
+Item {
width: 300; height: 200
- Musician {
- id: aMusician
- name: "Reddy the Rocker"
- instrument: "Guitar"
+ PieChart {
+ id: aPieChart
+ anchors.centerIn: parent
+ width: 100; height: 100
+ name: "A simple pie chart"
+ color: "red"
}
Text {
- anchors.fill: parent
- text: aMusician.name + " plays the " + aMusician.instrument
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: aPieChart.name
}
}
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
index bd05ebe2cc..0f0416718c 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
+++ b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
@@ -1,5 +1,5 @@
QT += declarative
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/main.cpp b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
index 8ef6965ea8..a5dbab32d2 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
@@ -38,7 +38,7 @@
**
****************************************************************************/
//![0]
-#include "musician.h"
+#include "piechart.h"
#include <qdeclarative.h>
#include <QDeclarativeView>
#include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
new file mode 100644
index 0000000000..3b9ef7160a
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
@@ -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 documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+
+//![0]
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+//![0]
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+//![1]
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+//![1]
+
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/musician.h b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
index f9a0537502..aae7b26dd3 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/musician.h
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
@@ -37,30 +37,33 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
+#ifndef PIECHART_H
+#define PIECHART_H
//![0]
-#include <QObject>
+#include <QDeclarativeItem>
+#include <QColor>
-class Musician : public QObject
+class PieChart : public QDeclarativeItem
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
public:
- Musician(QObject *parent = 0);
+ PieChart(QDeclarativeItem *parent = 0);
QString name() const;
void setName(const QString &name);
- QString instrument() const;
- void setInstrument(const QString &instrument);
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
QString m_name;
- QString m_instrument;
+ QColor m_color;
};
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/app.qml b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
index 02d33c2f1b..0b55f7c02a 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/app.qml
+++ b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
@@ -38,23 +38,29 @@
**
****************************************************************************/
//![0]
-import Music 1.0
+import Charts 1.0
import Qt 4.7
-Rectangle {
- width: 200; height: 200
+Item {
+ width: 300; height: 200
- Musician {
- id: aMusician
- name: "Reddy the Rocker"
- instrument: "Guitar"
+ PieChart {
+ id: aPieChart
+ anchors.centerIn: parent
+ width: 100; height: 100
+ color: "red"
- onPerformanceEnded: console.log("The performance has now ended")
+ onChartCleared: console.log("The chart has been cleared")
}
MouseArea {
anchors.fill: parent
- onClicked: aMusician.perform()
+ onClicked: aPieChart.clearChart()
+ }
+
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: "Click anywhere to clear the chart"
}
}
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
index bd05ebe2cc..0f0416718c 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
+++ b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
@@ -1,5 +1,5 @@
QT += declarative
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/main.cpp b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
index 8ef6965ea8..a5dbab32d2 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
@@ -38,7 +38,7 @@
**
****************************************************************************/
//![0]
-#include "musician.h"
+#include "piechart.h"
#include <qdeclarative.h>
#include <QDeclarativeView>
#include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
new file mode 100644
index 0000000000..11ff7c8bff
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+//![0]
+void PieChart::clearChart()
+{
+ setColor(QColor(Qt::transparent));
+ update();
+
+ emit chartCleared();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/musician.h b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
index 0b0addb997..246fd9f929 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/musician.h
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
@@ -37,42 +37,44 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
+#ifndef PIECHART_H
+#define PIECHART_H
-#include <QObject>
+#include <QDeclarativeItem>
+#include <QColor>
//![0]
-class Musician : public QObject
+class PieChart : public QDeclarativeItem
{
//![0]
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
//![1]
- Q_PROPERTY(QString instrument READ instrument WRITE setInstrument NOTIFY instrumentChanged)
public:
//![1]
- Musician(QObject *parent = 0);
+ PieChart(QDeclarativeItem *parent = 0);
QString name() const;
void setName(const QString &name);
- QString instrument() const;
- void setInstrument(const QString &instrument);
+ QColor color() const;
+ void setColor(const QColor &color);
- Q_INVOKABLE void perform();
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
//![2]
+ Q_INVOKABLE void clearChart();
+
signals:
- void instrumentChanged();
+ void chartCleared();
//![2]
private:
QString m_name;
- QString m_instrument;
+ QColor m_color;
//![3]
};
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
index 8bf6ecfaf6..2ff6ae1965 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
@@ -38,35 +38,37 @@
**
****************************************************************************/
//![0]
-import Music 1.0
+import Charts 1.0
import Qt 4.7
-Rectangle {
- width: 200; height: 200
+Item {
+ width: 300; height: 200
- Musician {
- id: reddy
- name: "Reddy the Rocker"
- instrument: "Guitar"
- }
+ Row {
+ anchors.centerIn: parent
+ spacing: 20
+
+ PieChart {
+ id: chartA
+ width: 100; height: 100
+ color: "red"
+ }
- Musician {
- id: craig
- name: "Craig the Copycat"
- instrument: reddy.instrument
+ PieChart {
+ id: chartB
+ width: 100; height: 100
+ color: chartA.color
+ }
}
MouseArea {
anchors.fill: parent
- onClicked: {
- reddy.perform()
- craig.perform()
-
- reddy.instrument = "Drums"
+ onClicked: { chartA.color = "blue" }
+ }
- reddy.perform()
- craig.perform()
- }
+ Text {
+ anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+ text: "Click anywhere to change the chart color"
}
}
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
index bd05ebe2cc..0f0416718c 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
@@ -1,5 +1,5 @@
QT += declarative
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
index 8ef6965ea8..a5dbab32d2 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
@@ -38,7 +38,7 @@
**
****************************************************************************/
//![0]
-#include "musician.h"
+#include "piechart.h"
#include <qdeclarative.h>
#include <QDeclarativeView>
#include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
new file mode 100644
index 0000000000..85a9762994
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+ return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+ m_name = name;
+}
+
+QColor PieChart::color() const
+{
+ return m_color;
+}
+
+//![0]
+void PieChart::setColor(const QColor &color)
+{
+ if (color != m_color) {
+ m_color = color;
+ update(); // repaint with the new color
+ emit colorChanged();
+ }
+}
+//![0]
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+void PieChart::clearChart()
+{
+ setColor(QColor(Qt::transparent));
+ update();
+}
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
new file mode 100644
index 0000000000..164cebb65e
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+//![0]
+ Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+public:
+//![1]
+
+ PieChart(QDeclarativeItem *parent = 0);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+ Q_INVOKABLE void clearChart();
+
+//![2]
+signals:
+ void colorChanged();
+//![2]
+
+private:
+ QString m_name;
+ QColor m_color;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
index d76f80120f..fcd38068c5 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
@@ -38,17 +38,23 @@
**
****************************************************************************/
//![0]
-import Music 1.0
+import Charts 1.0
import Qt 4.7
Item {
+ width: 300; height: 200
- Musician {
- id: reddy
- name: "Reddy the Rocker"
- instrument: Instrument { type: "Guitar" }
+ PieChart {
+ id: chart
+ anchors.centerIn: parent
+ width: 100; height: 100
+
+ pieSlice: PieSlice {
+ anchors.fill: parent
+ color: "red"
+ }
}
- Component.onCompleted: console.log("Reddy plays the " + reddy.instrument.type)
+ Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color)
}
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
index aea07a0ef5..c3f5402aea 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
@@ -1,7 +1,7 @@
QT += declarative
-HEADERS += musician.h \
- instrument.h
-SOURCES += musician.cpp \
- instrument.cpp \
+HEADERS += piechart.h \
+ pieslice.h
+SOURCES += piechart.cpp \
+ pieslice.cpp \
main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
index d94cb036cb..fd518a255a 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
@@ -37,8 +37,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
+#include "piechart.h"
+#include "pieslice.h"
#include <qdeclarative.h>
#include <QDeclarativeView>
@@ -50,10 +50,10 @@ int main(int argc, char *argv[])
//![0]
QApplication app(argc, argv);
- qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
//![1]
- qmlRegisterType<Instrument>("Music", 1, 0, "Instrument");
+ qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
//![1]
QDeclarativeView view;
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/musician.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
index 0ce0022251..70988542d3 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/musician.cpp
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
@@ -37,38 +37,36 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musician.h"
-#include <QDebug>
+#include "piechart.h"
+#include "pieslice.h"
-Musician::Musician(QObject *parent)
- : QObject(parent)
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
{
+ // this doesn't need to disable QGraphicsItem::ItemHasNoContents
+ // anymore since the drawing is now done in PieSlice
}
-QString Musician::name() const
+QString PieChart::name() const
{
return m_name;
}
-void Musician::setName(const QString &name)
+void PieChart::setName(const QString &name)
{
m_name = name;
}
-QString Musician::instrument() const
+PieSlice *PieChart::pieSlice() const
{
- return m_instrument;
-}
-
-void Musician::setInstrument(const QString &instrument)
-{
- m_instrument = instrument;
+ return m_pieSlice;
}
//![0]
-void Musician::perform()
+void PieChart::setPieSlice(PieSlice *pieSlice)
{
- qWarning() << m_name << "is playing the" << m_instrument;
- emit performanceEnded();
+ m_pieSlice = pieSlice;
+ pieSlice->setParentItem(this);
}
//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
index 8f67f61cc0..448ca7b67b 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
@@ -37,18 +37,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
+#ifndef PIECHART_H
+#define PIECHART_H
-#include <QObject>
+#include <QDeclarativeItem>
-class Instrument;
+class PieSlice;
//![0]
-class Musician : public QObject
+class PieChart : public QDeclarativeItem
{
Q_OBJECT
- Q_PROPERTY(Instrument* instrument READ instrument WRITE setInstrument)
+ Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice)
//![0]
Q_PROPERTY(QString name READ name WRITE setName)
@@ -56,19 +56,19 @@ class Musician : public QObject
public:
//![1]
- Musician(QObject *parent = 0);
+ PieChart(QDeclarativeItem *parent = 0);
QString name() const;
void setName(const QString &name);
//![2]
- Instrument *instrument() const;
- void setInstrument(Instrument *instrument);
+ PieSlice *pieSlice() const;
+ void setPieSlice(PieSlice *pieSlice);
//![2]
private:
QString m_name;
- Instrument *m_instrument;
+ PieSlice *m_pieSlice;
//![3]
};
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
index e62efb197d..7a420fd285 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
@@ -37,31 +37,32 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
+#include "pieslice.h"
-Musician::Musician(QObject *parent)
- : QObject(parent)
-{
-}
+#include <QPainter>
-QString Musician::name() const
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
{
- return m_name;
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
}
-void Musician::setName(const QString &name)
+QColor PieSlice::color() const
{
- m_name = name;
+ return m_color;
}
-Instrument *Musician::instrument() const
+void PieSlice::setColor(const QColor &color)
{
- return m_instrument;
+ m_color = color;
}
-void Musician::setInstrument(Instrument *instrument)
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
- m_instrument = instrument;
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
}
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
index 9971207f0f..085a9b8fe6 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
@@ -37,25 +37,28 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef INSTRUMENT_H
-#define INSTRUMENT_H
+#ifndef PIESLICE_H
+#define PIESLICE_H
-#include <QObject>
+#include <QDeclarativeItem>
+#include <QColor>
//![0]
-class Instrument : public QObject
+class PieSlice : public QDeclarativeItem
{
Q_OBJECT
- Q_PROPERTY(QString type READ type WRITE setType)
+ Q_PROPERTY(QColor color READ color WRITE setColor)
public:
- Instrument(QObject *parent = 0);
+ PieSlice(QDeclarativeItem *parent = 0);
- QString type() const;
- void setType(const QString &type);
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
- QString m_type;
+ QColor m_color;
};
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml b/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
new file mode 100644
index 0000000000..f759bc90e5
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/app.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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import Qt 4.7
+
+Item {
+ width: 300; height: 200
+
+ PieChart {
+ anchors.centerIn: parent
+ width: 100; height: 100
+
+ slices: [
+ PieSlice {
+ anchors.fill: parent
+ color: "red"
+ fromAngle: 0; angleSpan: 110
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "black"
+ fromAngle: 110; angleSpan: 50
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "blue"
+ fromAngle: 160; angleSpan: 100
+ }
+ ]
+ }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
new file mode 100644
index 0000000000..c3f5402aea
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
@@ -0,0 +1,7 @@
+QT += declarative
+
+HEADERS += piechart.h \
+ pieslice.h
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
index 9ca96f6386..f73c49fd24 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
@@ -37,20 +37,22 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "instrument.h"
+#include "piechart.h"
+#include "pieslice.h"
-Instrument::Instrument(QObject *parent)
- : QObject(parent)
-{
-}
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
-QString Instrument::type() const
+int main(int argc, char *argv[])
{
- return m_type;
-}
+ QApplication app(argc, argv);
-void Instrument::setType(const QString &type)
-{
- m_type = type;
-}
+ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+ qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
index 5f9ead4bfe..2515b64280 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
@@ -37,40 +37,36 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musician.h"
-#include <QDebug>
+#include "piechart.h"
+#include "pieslice.h"
-Musician::Musician(QObject *parent)
- : QObject(parent)
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
{
}
-QString Musician::name() const
+QString PieChart::name() const
{
return m_name;
}
-void Musician::setName(const QString &name)
+void PieChart::setName(const QString &name)
{
m_name = name;
}
-QString Musician::instrument() const
+//![0]
+QDeclarativeListProperty<PieSlice> PieChart::slices()
{
- return m_instrument;
+ return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
}
-//![0]
-void Musician::setInstrument(const QString &instrument)
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
{
- if (instrument != m_instrument) {
- m_instrument = instrument;
- emit instrumentChanged();
+ PieChart *chart = qobject_cast<PieChart *>(list->object);
+ if (chart) {
+ slice->setParentItem(chart);
+ chart->m_slices.append(slice);
}
}
//![0]
-
-void Musician::perform()
-{
- qWarning() << m_name << "is playing the" << m_instrument;
-}
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/musician.h b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
index 86849ba237..44242513c0 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/musician.h
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
@@ -37,45 +37,39 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
+#ifndef PIECHART_H
+#define PIECHART_H
-#include <QObject>
+#include <QDeclarativeItem>
+
+class PieSlice;
//![0]
-class Musician : public QObject
+class PieChart : public QDeclarativeItem
{
-//![0]
Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
+//![0]
Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
//![1]
public:
//![1]
-
- Musician(QObject *parent = 0);
+ PieChart(QDeclarativeItem *parent = 0);
QString name() const;
void setName(const QString &name);
- QString instrument() const;
- void setInstrument(const QString &instrument);
-
-//![2]
- Q_INVOKABLE void perform();
-
-signals:
- void performanceEnded();
//![2]
+ QDeclarativeListProperty<PieSlice> slices();
private:
- QString m_name;
- QString m_instrument;
+ static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
-//![3]
+ QString m_name;
+ QList<PieSlice *> m_slices;
};
-//![3]
+//![2]
#endif
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
new file mode 100644
index 0000000000..65120f53e3
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+ return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+ return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+ m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+ return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+ m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
new file mode 100644
index 0000000000..7cd0c7474d
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieSlice : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+ Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+//![0]
+
+public:
+ PieSlice(QDeclarativeItem *parent = 0);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ int fromAngle() const;
+ void setFromAngle(int angle);
+
+ int angleSpan() const;
+ void setAngleSpan(int span);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QColor m_color;
+ int m_fromAngle;
+ int m_angleSpan;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp
deleted file mode 100644
index 9ca96f6386..0000000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** 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:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "instrument.h"
-
-Instrument::Instrument(QObject *parent)
- : QObject(parent)
-{
-}
-
-QString Instrument::type() const
-{
- return m_type;
-}
-
-void Instrument::setType(const QString &type)
-{
- m_type = type;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h b/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h
deleted file mode 100644
index ce1e7ce808..0000000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** 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:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef INSTRUMENT_H
-#define INSTRUMENT_H
-
-#include <QObject>
-
-class Instrument : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString type READ type WRITE setType)
-
-public:
- Instrument(QObject *parent = 0);
-
- QString type() const;
- void setType(const QString &type);
-
-private:
- QString m_type;
-};
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp
deleted file mode 100644
index e62efb197d..0000000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** 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:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
-
-Musician::Musician(QObject *parent)
- : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
- return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
- m_name = name;
-}
-
-Instrument *Musician::instrument() const
-{
- return m_instrument;
-}
-
-void Musician::setInstrument(Instrument *instrument)
-{
- m_instrument = instrument;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/qmldir b/examples/declarative/tutorials/extending/chapter5-plugins/qmldir
deleted file mode 100644
index c3afd6b054..0000000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin chapter5-plugins lib
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
index 9c050b873c..38ceefa356 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
@@ -37,17 +37,32 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
import Qt 4.7
Item {
+ width: 300; height: 200
- Musician {
- id: reddy
- name: "Reddy the Rocker"
- instrument: Instrument { type: "Guitar" }
- }
+ PieChart {
+ anchors.centerIn: parent
+ width: 100; height: 100
- Component.onCompleted: console.log("Reddy plays the " + reddy.instrument.type)
+ slices: [
+ PieSlice {
+ anchors.fill: parent
+ color: "red"
+ fromAngle: 0; angleSpan: 110
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "black"
+ fromAngle: 110; angleSpan: 50
+ },
+ PieSlice {
+ anchors.fill: parent
+ color: "blue"
+ fromAngle: 160; angleSpan: 100
+ }
+ ]
+ }
}
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 483da8fc9a..1ffbf29925 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -6,13 +6,13 @@ DESTDIR = lib
OBJECTS_DIR = tmp
MOC_DIR = tmp
-HEADERS += musician.h \
- instrument.h \
- musicplugin.h
+HEADERS += piechart.h \
+ pieslice.h \
+ chartsplugin.h
-SOURCES += musician.cpp \
- instrument.cpp \
- musicplugin.cpp
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ chartsplugin.cpp
symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index 76acf0144d..5aa2a4bcbe 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
@@ -37,18 +37,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musicplugin.h"
+#include "chartsplugin.h"
//![0]
-#include "musician.h"
-#include "instrument.h"
+#include "piechart.h"
+#include "pieslice.h"
#include <QtDeclarative/qdeclarative.h>
-void MusicPlugin::registerTypes(const char *uri)
+void ChartsPlugin::registerTypes(const char *uri)
{
- qmlRegisterType<Musician>(uri, 1, 0, "Musician");
- qmlRegisterType<Instrument>(uri, 1, 0, "Instrument");
+ qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
+ qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
}
-Q_EXPORT_PLUGIN2(musicplugin, MusicPlugin);
+Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
index d6a5392431..797d1e7a85 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
@@ -37,13 +37,13 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICPLUGIN_H
-#define MUSICPLUGIN_H
+#ifndef CHARTSPLUGIN_H
+#define CHARTSPLUGIN_H
//![0]
#include <QtDeclarative/QDeclarativeExtensionPlugin>
-class MusicPlugin : public QDeclarativeExtensionPlugin
+class ChartsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/musician.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
index 6c42f310b9..4e6ee5c698 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/musician.cpp
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
@@ -37,30 +37,35 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "musician.h"
+#include "piechart.h"
+#include "pieslice.h"
-Musician::Musician(QObject *parent)
- : QObject(parent)
+PieChart::PieChart(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
{
}
-QString Musician::name() const
+QString PieChart::name() const
{
return m_name;
}
-void Musician::setName(const QString &name)
+void PieChart::setName(const QString &name)
{
m_name = name;
}
-QString Musician::instrument() const
+QDeclarativeListProperty<PieSlice> PieChart::slices()
{
- return m_instrument;
+ return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
}
-void Musician::setInstrument(const QString &instrument)
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
{
- m_instrument = instrument;
+ PieChart *chart = qobject_cast<PieChart *>(list->object);
+ if (chart) {
+ slice->setParentItem(chart);
+ chart->m_slices.append(slice);
+ }
}
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musician.h b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
index b92063131c..d6e443993a 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musician.h
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
@@ -37,31 +37,32 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
+#ifndef PIECHART_H
+#define PIECHART_H
-#include <QObject>
+#include <QDeclarativeItem>
-class Instrument;
+class PieSlice;
-class Musician : public QObject
+class PieChart : public QDeclarativeItem
{
Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(Instrument* instrument READ instrument WRITE setInstrument)
public:
- Musician(QObject *parent = 0);
+ PieChart(QDeclarativeItem *parent = 0);
QString name() const;
void setName(const QString &name);
- Instrument *instrument() const;
- void setInstrument(Instrument *instrument);
+ QDeclarativeListProperty<PieSlice> slices();
private:
+ static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
+
QString m_name;
- Instrument *m_instrument;
+ QList<PieSlice *> m_slices;
};
#endif
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
new file mode 100644
index 0000000000..65120f53e3
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+ : QDeclarativeItem(parent)
+{
+ // need to disable this flag to draw inside a QDeclarativeItem
+ setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+ return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+ m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+ return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+ m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+ return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+ m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ QPen pen(m_color, 2);
+ painter->setPen(pen);
+ painter->setRenderHints(QPainter::Antialiasing, true);
+ painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
new file mode 100644
index 0000000000..a3afd25d60
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** 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:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieSlice : public QDeclarativeItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor)
+ Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+ Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+
+public:
+ PieSlice(QDeclarativeItem *parent = 0);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ int fromAngle() const;
+ void setFromAngle(int angle);
+
+ int angleSpan() const;
+ void setAngleSpan(int span);
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+ QColor m_color;
+ int m_fromAngle;
+ int m_angleSpan;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/qmldir b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
new file mode 100644
index 0000000000..a83bf85ddb
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
@@ -0,0 +1 @@
+plugin chapter6-plugins lib
diff --git a/examples/declarative/tutorials/extending/extending.pro b/examples/declarative/tutorials/extending/extending.pro
index 0c86fed2d1..967473fda0 100644
--- a/examples/declarative/tutorials/extending/extending.pro
+++ b/examples/declarative/tutorials/extending/extending.pro
@@ -5,5 +5,6 @@ SUBDIRS += \
chapter2-methods \
chapter3-bindings \
chapter4-customPropertyTypes \
- chapter5-plugins
+ chapter5-listproperties \
+ chapter6-plugins
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
index 68f87122c1..80567efff9 100644
--- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -55,7 +55,7 @@ Rectangle {
Image {
id: background
anchors.fill: parent
- source: "../shared/pics/background.jpg"
+ source: "../shared/pics/background.png"
fillMode: Image.PreserveAspectCrop
}
}
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index 5b5827bc7c..c92db4417c 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -41,12 +41,12 @@
#ifndef SESSIONWIDGET_H
#define SESSIONWIDGET_H
+#include <qnetworksession.h>
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
#include "ui_sessionwidget_maemo.h"
#else
#include "ui_sessionwidget.h"
#endif
-#include <qnetworksession.h>
QT_USE_NAMESPACE
diff --git a/examples/network/bearermonitor/sessionwidget_maemo.ui b/examples/network/bearermonitor/sessionwidget_maemo.ui
index ca682463e7..8867509d01 100644
--- a/examples/network/bearermonitor/sessionwidget_maemo.ui
+++ b/examples/network/bearermonitor/sessionwidget_maemo.ui
@@ -214,6 +214,54 @@
</item>
</layout>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="errorStringLayout_2">
+ <item>
+ <widget class="QLabel" name="rxData">
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="txData">
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="errorStringLayout_3">
+ <item>
+ <widget class="QLabel" name="errorStringLabel_2">
+ <property name="text">
+ <string>Active Time:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="activeTime">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>0 seconds</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
<item>
diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf
index 5324e65997..0a18b478ce 100644
--- a/mkspecs/features/uic.prf
+++ b/mkspecs/features/uic.prf
@@ -86,20 +86,20 @@ defineReplace(imageCollectionCmd) {
for(image, $$list($$split(1))) {
EMBEDDED_IMAGES += $$image
count(EMBEDDED_IMAGES, 5) {
- isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > images.tmp $$escape_expand(\\n\\t)
- else: RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t)
+ isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
+ else: RET += echo $$EMBEDDED_IMAGES >> $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
unset(EMBEDDED_IMAGES)
}
}
- !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t)
+ !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
!isEmpty(RET) {
- RET += $$QMAKE_UIC3 -embed $$TARGET -f images.tmp -o $$2 $$escape_expand(\\n\\t)
+ RET += $$QMAKE_UIC3 -embed $$TARGET -f $${UI_DIR}/images.tmp -o $$2 $$escape_expand(\\n\\t)
return($$RET)
}
return($$QMAKE_UIC3 -embed $$TARGET $$1 -o $$2)
}
-image_collection.output = qmake_image_collection$${first(QMAKE_EXT_CPP)}
+image_collection.output = $${UI_DIR}/qmake_image_collection$${first(QMAKE_EXT_CPP)}
image_collection.variable_out = SOURCES
image_collection.input = IMAGES
image_collection.CONFIG += combine
@@ -109,7 +109,7 @@ image_collection.name = UIC3 Image collection in ${QMAKE_FILE_OUT}
silent:image_collection.commands = @echo uic3 -embed ${QMAKE_FILE_IN} && $$image_collection.commands
} else {
image_collection.commands = ${QMAKE_FUNC_imageCollectionCmd}
- silent:image_collection.commands = @echo uic3 -embed $$TARGET -f images.tmp && $image_collection.commands
+ silent:image_collection.commands = @echo uic3 -embed $$TARGET -f $${UI_DIR}/images.tmp && $image_collection.commands
}
QMAKE_EXTRA_COMPILERS += image_collection
diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf
index cced09029e..a977e7ac42 100644
--- a/mkspecs/linux-g++-maemo/qmake.conf
+++ b/mkspecs/linux-g++-maemo/qmake.conf
@@ -27,7 +27,4 @@ QMAKE_CXXFLAGS_RELEASE += -g -fno-omit-frame-pointer -fno-optimize-sibling-call
# Work round PowerVR SGX 1.3 driver bug with glScissor & FBOs:
DEFINES += QT_GL_NO_SCISSOR_TEST
-# Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:
-DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024
-
load(qt_config)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d6b3e09d5b..45a96f51f8 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1756,6 +1756,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
QStringList tmp_dep = project->values((*it) + ".depends");
QString tmp_dep_cmd;
+ QString dep_cd_cmd;
if(!project->isEmpty((*it) + ".depend_command")) {
int argv0 = -1;
QStringList cmdline = project->values((*it) + ".depend_command");
@@ -1774,6 +1775,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
cmdline[argv0] = escapeFilePath(cmdline.at(argv0));
}
}
+ dep_cd_cmd = QLatin1String("cd ")
+ + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ + QLatin1String(" && ");
}
QStringList &vars = project->values((*it) + ".variables");
if(tmp_out.isEmpty() || tmp_cmd.isEmpty())
@@ -1875,7 +1879,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
tmp_out);
- dep_cmd = fixEnvVariables(dep_cmd);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1973,7 +1977,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
- dep_cmd = fixEnvVariables(dep_cmd);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index be22dc3150..11d2428a9e 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -50,7 +50,7 @@ MediaSource::MediaSource(const QString &filename)
const QFileInfo fileInfo(filename);
if (fileInfo.exists()) {
bool localFs = QAbstractFileEngine::LocalDiskFlag & QFSFileEngine(filename).fileFlags(QAbstractFileEngine::LocalDiskFlag);
- if (localFs) {
+ if (localFs && !filename.startsWith(QLatin1String(":/")) && !filename.startsWith(QLatin1String("qrc://"))) {
d->url = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
} else {
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
new file mode 100644
index 0000000000..575412da09
--- /dev/null
+++ b/src/3rdparty/sqlite.pri
@@ -0,0 +1,4 @@
+CONFIG(release, debug|release):DEFINES *= NDEBUG
+DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
+INCLUDEPATH += $$PWD/sqlite
+SOURCES += $$PWD/sqlite/sqlite3.c
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ed2ae6ef13..5cd7f0e35d 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -470,6 +470,7 @@
\value TextIncludeTrailingSpaces Same as IncludeTrailingSpaces
\value TextJustificationForced Ensures that text lines are justified.
+ \omitvalue TextBypassShaping
\omitvalue BreakAnywhere
\omitvalue DontClip
\omitvalue DontPrint
@@ -1730,7 +1731,7 @@
\value Key_MediaLast
\value Key_unknown
- \value Key_Call A key to answer or initiate a call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+ \value Key_Call A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
\value Key_Camera A key to activate the camera shutter
\value Key_CameraFocus A key to focus the camera
\value Key_Context1
@@ -1738,7 +1739,7 @@
\value Key_Context3
\value Key_Context4
\value Key_Flip
- \value Key_Hangup A key to end an ongoing call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+ \value Key_Hangup A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
\value Key_No
\value Key_Select
\value Key_Yes
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 4a25562605..1dd51ea8b2 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -155,10 +155,10 @@ public:
if ((first - buf) < size) {
// underflow, the existing valid data needs to move to the end of the (potentially bigger) buffer
makeSpace(len + size, freeSpaceAtStart);
- memcpy(first - size, block, size);
}
first -= size;
len += size;
+ memcpy(first, block, size);
}
private:
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 9bc406362f..739ac4dbd4 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1399,10 +1399,10 @@ QString QProcess::nativeArguments() const
\since 4.7
\overload
- Sets additional native command line arguments for the program.
+ Sets additional native command line \a arguments for the program.
On operating systems where the system API for passing command line
- arguments to a subprocess natively uses a single string, one can
+ \a arguments to a subprocess natively uses a single string, one can
conceive command lines which cannot be passed via QProcess's portable
list-based API. In such cases this function must be used to set a
string which is \e appended to the string composed from the usual
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 84152591da..e3fce1809e 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1197,7 +1197,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
\l{QAbstractItemModel::}{endInsertRows()} must be called.
\sa {Model Classes}, {Model Subclassing Reference}, QModelIndex,
- QAbstractItemView, {Using Drag and Drop with Item Views},
+ QAbstractItemView, {Using drag & drop with item views},
{Simple DOM Model Example}, {Simple Tree Model Example},
{Editable Tree Model Example}, {Fetch More Example}
*/
@@ -1761,7 +1761,7 @@ QMimeData *QAbstractItemModel::mimeData(const QModelIndexList &indexes) const
where to place the data. This can occur in a tree when data is dropped on
a parent. Models will usually append the data to the parent in this case.
- \sa supportedDropActions(), {Using Drag and Drop with Item Views}
+ \sa supportedDropActions(), {Using drag & drop with item views}
*/
bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent)
@@ -1798,8 +1798,8 @@ bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
reimplement the dropMimeData() function to handle the additional
operations.
- \sa dropMimeData(), Qt::DropActions, {Using Drag and Drop with Item
- Views}
+ \sa dropMimeData(), Qt::DropActions, {Using drag & drop with item
+ views}
*/
Qt::DropActions QAbstractItemModel::supportedDropActions() const
{
@@ -1815,7 +1815,7 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const
supportedDragActions() is used by QAbstractItemView::startDrag() as the
default values when a drag occurs.
- \sa Qt::DropActions, {Using Drag and Drop with Item Views}
+ \sa Qt::DropActions, {Using drag & drop with item views}
*/
Qt::DropActions QAbstractItemModel::supportedDragActions() const
{
@@ -1831,7 +1831,7 @@ Qt::DropActions QAbstractItemModel::supportedDragActions() const
Sets the supported drag \a actions for the items in the model.
- \sa supportedDragActions(), {Using Drag and Drop with Item Views}
+ \sa supportedDragActions(), {Using drag & drop with item views}
*/
void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions)
{
@@ -2547,7 +2547,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
For example, as shown in the diagram, we move three rows from
row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4.
- We move those items to above row 2 in the destination, so \a destinationRow is 2.
+ We move those items to above row 2 in the destination, so \a destinationChild is 2.
\snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6
@@ -2558,7 +2558,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
\o To append rows to another parent, move them to after the last row.
For example, as shown in the diagram, we move three rows to a
- collection of 6 existing rows (ending in row 5), so \a destinationStart is 6:
+ collection of 6 existing rows (ending in row 5), so \a destinationChild is 6:
\snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index e86efb218e..2a52044d8e 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -47,8 +47,6 @@
#include <unistd.h>
#include <errno.h>
-#include <net/if.h>
-
QT_BEGIN_NAMESPACE
#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
@@ -100,16 +98,19 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
class QSelectMutexGrabber
{
public:
- QSelectMutexGrabber(int fd, QMutex *mutex)
+ QSelectMutexGrabber(int writeFd, int readFd, QMutex *mutex)
: m_mutex(mutex)
{
if (m_mutex->tryLock())
return;
char dummy = 0;
- qt_pipe_write(fd, &dummy, 1);
+ qt_pipe_write(writeFd, &dummy, 1);
m_mutex->lock();
+
+ char buffer;
+ while (::read(readFd, &buffer, 1) > 0) {}
}
~QSelectMutexGrabber()
@@ -403,10 +404,6 @@ void QSelectThread::run()
ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
savedSelectErrno = errno;
- char buffer;
-
- while (::read(m_pipeEnds[0], &buffer, 1) > 0) {}
-
if(ret == 0) {
// do nothing
} else if (ret < 0) {
@@ -481,7 +478,8 @@ void QSelectThread::run()
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
}
- m_waitCond.wait(&m_mutex);
+ if (FD_ISSET(m_pipeEnds[0], &readfds))
+ m_waitCond.wait(&m_mutex);
}
m_mutex.unlock();
@@ -495,7 +493,9 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
start();
}
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
Q_ASSERT(!m_AOStatuses.contains(notifier));
@@ -506,7 +506,9 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
{
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_AOStatuses.remove(notifier);
@@ -515,7 +517,9 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
void QSelectThread::restart()
{
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ Q_ASSERT(QThread::currentThread() == this->thread());
+
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_waitCond.wakeAll();
}
@@ -571,17 +575,13 @@ void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set
* check if socket is in exception set
* then signal RequestComplete for it
*/
- qWarning("exception on %d [will do setdefaultif(0) - hack]", i.key()->socket());
+ qWarning("exception on %d [will close the socket handle - hack]", i.key()->socket());
// quick fix; there is a bug
// when doing read on socket
// errors not preoperly mapped
// after offline-ing the device
// on some devices we do get exception
- // close all exiting sockets
- // and reset default IAP
- if(::setdefaultif(0) != KErrNone) // well we can't do much about it
- qWarning("setdefaultif(0) failed");
-
+ ::close(i.key()->socket());
toRemove.append(i.key());
TRequestStatus *status = i.value();
QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 57f79a0f2f..b2cf49b67b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6954,7 +6954,7 @@ bool QString::isRightToLeft() const
/*! \fn bool QString::isRightToLeft() const
- \internal
+ Returns true if the string is read right to left.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index dce6f0e40a..14a4f08d6f 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2438,8 +2438,11 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
if (removedVisible && d->visibleItems.isEmpty()) {
d->timeline.clear();
d->setPosition(0);
- if (d->itemCount == 0)
+ if (d->itemCount == 0) {
+ d->updateHeader();
+ d->updateFooter();
update();
+ }
}
emit countChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 34d33f52d0..90738c8e2d 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -324,17 +324,34 @@ qreal QDeclarativeImage::paintedHeight() const
/*!
\qmlproperty QSize Image::sourceSize
- This property holds the size of the loaded image, in pixels.
+ This property holds the actual width and height of the loaded image.
- This is used to control the storage used by a loaded image. Unlike
- the width and height properties, which scale the painting of the image, this property
- affects the number of pixels stored.
+ Unlike the \l {Item::}{width} and \l {Item::}{height} properties, which scale
+ the painting of the image, this property sets the actual number of pixels
+ stored for the loaded image so that large images do not use more
+ memory than necessary. For example, this ensures the image is memory is no
+ larger than 1024x1024 pixels, regardless of the Image's \l {Item::}{width} and
+ \l {Item::}{height} values:
+
+ \code
+ Rectangle {
+ width: ...
+ height: ...
+
+ Image {
+ anchors.fill: parent
+ source: "reallyBigImage.jpg"
+ sourceSize.width: 1024
+ sourceSize.height: 1024
+ }
+ }
+ \endcode
If the image's actual size is larger than the sourceSize, the image is scaled down.
If only one dimension of the size is set to greater than 0, the
other dimension is set in proportion to preserve the source image's aspect ratio.
(The \l fillMode is independent of this.)
-
+
If the source is an instrinsically scalable image (eg. SVG), this property
determines the size of the loaded image regardless of intrinsic size.
Avoid changing this property dynamically; rendering an SVG is \e slow compared
@@ -344,34 +361,8 @@ qreal QDeclarativeImage::paintedHeight() const
be no greater than this property specifies. For some formats (currently only JPEG),
the whole image will never actually be loaded into memory.
- \note \e{Changing this property dynamically will lead to the image source being reloaded,
- potentially even from the network if it is not in the disk cache.}
-
- Here is an example that ensures the size of the image in memory is
- no larger than 1024x1024 pixels, regardless of the size of the Image element.
-
- \code
- Image {
- anchors.fill: parent
- source: "images/reallyBigImage.jpg"
- sourceSize.width: 1024
- sourceSize.height: 1024
- }
- \endcode
-
- The example below ensures the memory used by the image is no more than necessary
- to display the image at the size of the Image element.
- Of course if the Image element is resized a costly reload will be required, so
- use this technique \e only when the Image size is fixed.
-
- \code
- Image {
- anchors.fill: parent
- source: "images/reallyBigImage.jpg"
- sourceSize.width: width
- sourceSize.height: height
- }
- \endcode
+ \note \e {Changing this property dynamically causes the image source to be reloaded,
+ potentially even from the network, if it is not in the disk cache.}
*/
void QDeclarativeImage::updatePaintedGeometry()
@@ -415,6 +406,8 @@ void QDeclarativeImage::geometryChanged(const QRectF &newGeometry, const QRectF
Image can handle any image format supported by Qt, loaded from any URL scheme supported by Qt.
The URL may be absolute, or relative to the URL of the component.
+
+ \sa QDeclarativeImageProvider
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index f5ea537493..b9498f172c 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1388,26 +1388,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
*/
/*!
- \property QDeclarativeItem::baseline
- \internal
-*/
-
-/*!
- \property QDeclarativeItem::focus
- \internal
-*/
-
-/*!
- \property QDeclarativeItem::wantsFocus
- \internal
-*/
-
-/*!
- \property QDeclarativeItem::transformOrigin
- \internal
-*/
-
-/*!
\fn void QDeclarativeItem::childrenRectChanged(const QRectF &)
\internal
*/
@@ -1609,7 +1589,7 @@ QDeclarativeItem *QDeclarativeItem::parentItem() const
bool QDeclarativeItem::isComponentComplete() const
{
Q_D(const QDeclarativeItem);
- return d->_componentComplete;
+ return d->componentComplete;
}
void QDeclarativeItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
@@ -1750,7 +1730,7 @@ QRectF QDeclarativeItem::childrenRect()
Q_D(QDeclarativeItem);
if (!d->_contents) {
d->_contents = new QDeclarativeContents(this);
- if (d->_componentComplete)
+ if (d->componentComplete)
d->_contents->complete();
}
return d->_contents->rectF();
@@ -1970,6 +1950,9 @@ QVariant QDeclarativeItem::inputMethodQuery(Qt::InputMethodQuery query) const
return v;
}
+/*!
+ \internal
+ */
void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
{
Q_D(QDeclarativeItem);
@@ -1980,6 +1963,9 @@ void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
d->doneEventPreHandler = true;
}
+/*!
+ \internal
+ */
void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
{
Q_D(QDeclarativeItem);
@@ -1990,6 +1976,9 @@ void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
d->doneEventPreHandler = true;
}
+/*!
+ \internal
+ */
void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
{
Q_D(QDeclarativeItem);
@@ -2000,7 +1989,6 @@ void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
d->doneEventPreHandler = true;
}
-
/*!
\internal
*/
@@ -2097,7 +2085,7 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
relationship with other items.
Margins apply to top, bottom, left, right, and fill anchors.
- The margins property can be used to set all of the various margins at once, to the same value.
+ The \c anchors.margins property can be used to set all of the various margins at once, to the same value.
Offsets apply for horizontal center, vertical center, and baseline anchors.
@@ -2132,10 +2120,12 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
\endqml
\endtable
- anchors.fill provides a convenient way for one item to have the
+ \c anchors.fill provides a convenient way for one item to have the
same geometry as another item, and is equivalent to connecting all
four directional anchors.
+ To clear an anchor value, set it to \c undefined.
+
\note You can only anchor an item to siblings or a parent.
For more information see \l {anchor-layout}{Anchor Layouts}.
@@ -2154,19 +2144,19 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
qreal QDeclarativeItem::baselineOffset() const
{
Q_D(const QDeclarativeItem);
- if (!d->_baselineOffset.isValid()) {
+ if (!d->baselineOffset.isValid()) {
return 0.0;
} else
- return d->_baselineOffset;
+ return d->baselineOffset;
}
void QDeclarativeItem::setBaselineOffset(qreal offset)
{
Q_D(QDeclarativeItem);
- if (offset == d->_baselineOffset)
+ if (offset == d->baselineOffset)
return;
- d->_baselineOffset = offset;
+ d->baselineOffset = offset;
for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
@@ -2295,7 +2285,7 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
bool QDeclarativeItem::keepMouseGrab() const
{
Q_D(const QDeclarativeItem);
- return d->_keepMouse;
+ return d->keepMouse;
}
/*!
@@ -2319,7 +2309,7 @@ bool QDeclarativeItem::keepMouseGrab() const
void QDeclarativeItem::setKeepMouseGrab(bool keep)
{
Q_D(QDeclarativeItem);
- d->_keepMouse = keep;
+ d->keepMouse = keep;
}
/*!
@@ -2416,6 +2406,8 @@ QDeclarativeItem *QDeclarativeItem::childAt(qreal x, qreal y) const
void QDeclarativeItemPrivate::focusChanged(bool flag)
{
Q_Q(QDeclarativeItem);
+ if (!(flags & QGraphicsItem::ItemIsFocusScope) && parent)
+ emit q->wantsFocusChanged(flag); //see also QDeclarativeItemPrivate::subFocusItemChange()
emit q->focusChanged(flag);
}
@@ -2499,7 +2491,7 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi
\qmlproperty bool Item::clip
This property holds whether clipping is enabled.
- if clipping is enabled, an item will clip its own painting, as well
+ If clipping is enabled, an item will clip its own painting, as well
as the painting of its children, to its bounding rectangle.
Non-rectangular clipping regions are not supported for performance reasons.
@@ -2539,11 +2531,6 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi
\sa {qmlstates}{States}
*/
-/*!
- \property QDeclarativeItem::state
- \internal
-*/
-
/*! \internal */
QString QDeclarativeItemPrivate::state() const
{
@@ -2566,11 +2553,6 @@ void QDeclarativeItemPrivate::setState(const QString &state)
For more information see \l Transform.
*/
-/*!
- \property QDeclarativeItem::transform
- \internal
-*/
-
/*! \internal */
QDeclarativeListProperty<QGraphicsTransform> QDeclarativeItem::transform()
{
@@ -2590,7 +2572,7 @@ QDeclarativeListProperty<QGraphicsTransform> QDeclarativeItem::transform()
void QDeclarativeItem::classBegin()
{
Q_D(QDeclarativeItem);
- d->_componentComplete = false;
+ d->componentComplete = false;
if (d->_stateGroup)
d->_stateGroup->classBegin();
if (d->_anchors)
@@ -2608,7 +2590,7 @@ void QDeclarativeItem::classBegin()
void QDeclarativeItem::componentComplete()
{
Q_D(QDeclarativeItem);
- d->_componentComplete = true;
+ d->componentComplete = true;
if (d->_stateGroup)
d->_stateGroup->componentComplete();
if (d->_anchors) {
@@ -2626,7 +2608,7 @@ QDeclarativeStateGroup *QDeclarativeItemPrivate::_states()
Q_Q(QDeclarativeItem);
if (!_stateGroup) {
_stateGroup = new QDeclarativeStateGroup;
- if (!_componentComplete)
+ if (!componentComplete)
_stateGroup->classBegin();
QObject::connect(_stateGroup, SIGNAL(stateChanged(QString)),
q, SIGNAL(stateChanged(QString)));
@@ -2859,6 +2841,26 @@ void QDeclarativeItem::setSmooth(bool smooth)
}
/*!
+ \property QDeclarativeItem::focus
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transform
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::transformOrigin
+ \internal
+*/
+
+/*!
+ \property QDeclarativeItem::wantsFocus
+ \internal
+*/
+
+/*!
\internal
Return the width of the item
*/
@@ -3107,7 +3109,10 @@ void QDeclarativeItem::setSize(const QSizeF &size)
/*! \internal */
bool QDeclarativeItem::wantsFocus() const
{
- return focusItem() != 0;
+ Q_D(const QDeclarativeItem);
+ return focusItem() == this ||
+ (d->flags & QGraphicsItem::ItemIsFocusScope && focusItem() != 0) ||
+ (!parentItem() && focusItem() != 0);
}
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index fb416c2fd2..bc5d80910d 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -120,11 +120,11 @@ class Q_DECLARATIVE_EXPORT QDeclarativeItemPrivate : public QGraphicsItemPrivate
public:
QDeclarativeItemPrivate()
: _anchors(0), _contents(0),
- _baselineOffset(0),
+ baselineOffset(0),
_anchorLines(0),
_stateGroup(0), origin(QDeclarativeItem::Center),
widthValid(false), heightValid(false),
- _componentComplete(true), _keepMouse(false),
+ componentComplete(true), keepMouse(false),
smooth(false), transformOriginDirty(true), doneEventPreHandler(false), keyHandler(0),
mWidth(0), mHeight(0), implicitWidth(0), implicitHeight(0)
{
@@ -144,12 +144,10 @@ public:
QDeclarative_setParent_noEvent(q, parent);
q->setParentItem(parent);
}
- _baselineOffset.invalidate();
+ baselineOffset.invalidate();
mouseSetsFocus = false;
}
- QString _id;
-
// Private Properties
qreal width() const;
void setWidth(qreal);
@@ -203,7 +201,7 @@ public:
if (!_anchors) {
Q_Q(QDeclarativeItem);
_anchors = new QDeclarativeAnchors(q);
- if (!_componentComplete)
+ if (!componentComplete)
_anchors->classBegin();
}
return _anchors;
@@ -211,7 +209,7 @@ public:
QDeclarativeAnchors *_anchors;
QDeclarativeContents *_contents;
- QDeclarativeNullableValue<qreal> _baselineOffset;
+ QDeclarativeNullableValue<qreal> baselineOffset;
struct AnchorLines {
AnchorLines(QGraphicsObject *);
@@ -260,8 +258,8 @@ public:
QDeclarativeItem::TransformOrigin origin:4;
bool widthValid:1;
bool heightValid:1;
- bool _componentComplete:1;
- bool _keepMouse:1;
+ bool componentComplete:1;
+ bool keepMouse:1;
bool smooth:1;
bool transformOriginDirty : 1;
bool doneEventPreHandler : 1;
@@ -286,7 +284,9 @@ public:
// Reimplemented from QGraphicsItemPrivate
virtual void subFocusItemChange()
{
- emit q_func()->wantsFocusChanged(subFocusItem != 0);
+ if (flags & QGraphicsItem::ItemIsFocusScope || !parent)
+ emit q_func()->wantsFocusChanged(subFocusItem != 0);
+ //see also QDeclarativeItemPrivate::focusChanged
}
// Reimplemented from QGraphicsItemPrivate
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 91e9995ca3..fa422fd7e1 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -494,7 +494,7 @@ public:
QSmoothedAnimation *highlightSizeAnimator;
QDeclarativeViewSection *sectionCriteria;
QString currentSection;
- static const int sectionCacheSize = 3;
+ static const int sectionCacheSize = 4;
QDeclarativeItem *sectionCache[sectionCacheSize];
qreal spacing;
qreal highlightMoveSpeed;
@@ -1029,6 +1029,11 @@ void QDeclarativeListViewPrivate::updateCurrent(int modelIndex)
}
currentItem->item->setFocus(true);
currentItem->attached->setIsCurrentItem(true);
+ // Avoid showing section delegate twice. We still need the section heading so that
+ // currentItem positioning works correctly.
+ // This is slightly sub-optimal, but section heading caching minimizes the impact.
+ if (currentItem->section)
+ currentItem->section->setVisible(false);
}
updateHighlight();
emit q->currentIndexChanged();
@@ -1072,7 +1077,7 @@ void QDeclarativeListViewPrivate::updateFooter()
}
if (footer) {
if (visibleItems.count()) {
- qreal endPos = endPosition();
+ qreal endPos = endPosition() + 1;
if (lastVisibleIndex() == model->count()-1) {
footer->setPosition(endPos);
} else {
@@ -1727,7 +1732,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
highlight is not moved by the view, and any movement must be implemented
by the highlight.
- Here is a highlight with its motion defined by a \l {SpringAniamtion} item:
+ Here is a highlight with its motion defined by a \l {SpringAnimation} item:
\snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem
@@ -2888,8 +2893,11 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
d->visiblePos = d->header ? d->header->size() : 0;
d->timeline.clear();
d->setPosition(0);
- if (d->itemCount == 0)
+ if (d->itemCount == 0) {
+ d->updateHeader();
+ d->updateFooter();
update();
+ }
}
emit countChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index e745ca66b0..cc7f8e5c29 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -118,9 +118,9 @@ void QDeclarativeLoaderPrivate::initResize()
be instantiated may be specified directly by the \l sourceComponent
property, or loaded from a URL via the \l source property.
- Loader can be used to delay the creation of a component until it is required.
- For example, this loads "Page1.qml" as a component into the Loader element
- when the \l MouseArea is clicked:
+ Loader can be used to delay the creation of a component until it
+ is required. For example, this loads "Page1.qml" as a component
+ into the Loader element, when the \l MouseArea is clicked:
\code
import Qt 4.7
@@ -165,7 +165,6 @@ void QDeclarativeLoaderPrivate::initResize()
/*!
\internal
\class QDeclarativeLoader
- \qmlclass Loader
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 7b65ca7e63..b7b0c9e186 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -767,10 +767,16 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
\i \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes.
\endlist
- The following example displays an image that can be dragged along the X-axis. The opacity
- of the image is reduced when it is dragged to the right.
+ The following example displays a \l Rectangle that can be dragged along the X-axis. The opacity
+ of the rectangle is reduced when it is dragged to the right.
\snippet doc/src/snippets/declarative/mousearea.qml drag
+
+ \note Items cannot be dragged if they are anchored for the requested
+ \c drag.axis. For example, if \c anchors.left or \c anchors.right was set
+ for \c rect in the above example, it cannot be dragged along the X-axis.
+ This can be avoided by settng the anchor value to \c undefined in
+ an \l onPressed handler.
*/
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 9a281e59b7..ba4fa21ed0 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1127,6 +1127,15 @@ int QDeclarativeText::resourcesLoading() const
return d->doc ? d->doc->resourcesLoading() : 0;
}
+/*!
+ \qmlproperty bool Text::clip
+ This property holds whether the text is clipped.
+
+ Note that if the text does not fit in the bounding rectangle it will be abruptly chopped.
+
+ If you want to display potentially long text in a limited space, you probably want to use \c elide instead.
+*/
+
void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
Q_D(QDeclarativeText);
@@ -1146,13 +1155,10 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
bool needClip = clip() && (d->imgCache.width() > width() ||
d->imgCache.height() > height());
- if (needClip) {
- p->save();
- p->setClipRect(boundingRect(), Qt::IntersectClip);
- }
- p->drawPixmap(br.x(), br.y(), d->imgCache);
if (needClip)
- p->restore();
+ p->drawPixmap(0, 0, width(), height(), d->imgCache, -br.x(), -br.y(), width(), height());
+ else
+ p->drawPixmap(br.x(), br.y(), d->imgCache);
if (d->smooth) {
p->setRenderHint(QPainter::Antialiasing, oldAA);
@@ -1166,7 +1172,7 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
if (needClip) {
p->save();
- p->setClipRect(boundingRect(), Qt::IntersectClip);
+ p->setClipRect(0, 0, width(), height(), Qt::IntersectClip);
}
if (d->richText) {
QAbstractTextDocumentLayout::PaintContext context;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index f3eef23755..d13e13986e 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -202,8 +202,9 @@ QString QDeclarativeTextEdit::text() const
Sets the font size in pixels.
- Using this function makes the font device dependent.
- Use \l font.pointSize to set the size of the font in a device independent manner.
+ Using this function makes the font device dependent. Use
+ \l{TextEdit::font.pointSize} to set the size of the font in a
+ device independent manner.
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index f6af1f48b5..2a5d73d97a 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -275,6 +275,8 @@ void QDeclarativeTextInput::setSelectionColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::Highlight, d->selectionColor);
d->control->setPalette(p);
+ clearCache();
+ update();
emit selectionColorChanged(color);
}
@@ -299,6 +301,8 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::HighlightedText, d->selectedTextColor);
d->control->setPalette(p);
+ clearCache();
+ update();
emit selectedTextColorChanged(color);
}
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 882e981555..e096305c97 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -54,27 +54,20 @@
QT_BEGIN_NAMESPACE
-QDeclarativeBindingData::QDeclarativeBindingData()
-: updating(false), enabled(false)
+void QDeclarativeBindingPrivate::refresh()
{
+ Q_Q(QDeclarativeBinding);
+ q->update();
}
-QDeclarativeBindingData::~QDeclarativeBindingData()
-{
- removeError();
-}
-
-void QDeclarativeBindingData::refresh()
+QDeclarativeBindingPrivate::QDeclarativeBindingPrivate()
+: updating(false), enabled(false), deleted(0)
{
- if (enabled && !updating && q) {
- QDeclarativeBinding *b = static_cast<QDeclarativeBinding *>(QDeclarativeExpressionPrivate::get(q));
- b->update();
- }
}
-QDeclarativeBindingPrivate::QDeclarativeBindingPrivate()
-: QDeclarativeExpressionPrivate(new QDeclarativeBindingData)
+QDeclarativeBindingPrivate::~QDeclarativeBindingPrivate()
{
+ if (deleted) *deleted = true;
}
QDeclarativeBinding::QDeclarativeBinding(void *data, QDeclarativeRefCount *rc, QObject *obj,
@@ -109,7 +102,7 @@ QDeclarativeBinding::~QDeclarativeBinding()
void QDeclarativeBinding::setTarget(const QDeclarativeProperty &prop)
{
Q_D(QDeclarativeBinding);
- d->bindingData()->property = prop;
+ d->property = prop;
update();
}
@@ -117,50 +110,53 @@ void QDeclarativeBinding::setTarget(const QDeclarativeProperty &prop)
QDeclarativeProperty QDeclarativeBinding::property() const
{
Q_D(const QDeclarativeBinding);
- return d->bindingData()->property;
+ return d->property;
}
void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
{
Q_D(QDeclarativeBinding);
- QDeclarativeBindingData *data = d->bindingData();
-
- if (!data->enabled || !data->context() || !data->context()->isValid())
+ if (!d->enabled || !d->context() || !d->context()->isValid())
return;
- data->addref();
-
- if (!data->updating) {
- data->updating = true;
+ if (!d->updating) {
+ d->updating = true;
+ bool wasDeleted = false;
+ d->deleted = &wasDeleted;
- if (data->property.propertyType() == qMetaTypeId<QDeclarativeBinding *>()) {
+ if (d->property.propertyType() == qMetaTypeId<QDeclarativeBinding *>()) {
- int idx = data->property.index();
+ int idx = d->property.index();
Q_ASSERT(idx != -1);
-
QDeclarativeBinding *t = this;
int status = -1;
void *a[] = { &t, 0, &status, &flags };
- QMetaObject::metacall(data->property.object(),
+ QMetaObject::metacall(d->property.object(),
QMetaObject::WriteProperty,
idx, a);
+ if (wasDeleted)
+ return;
+
} else {
- QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context()->engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context()->engine);
bool isUndefined = false;
QVariant value;
QScriptValue scriptValue = d->scriptValue(0, &isUndefined);
- if (data->property.propertyTypeCategory() == QDeclarativeProperty::List) {
+ if (wasDeleted)
+ return;
+
+ if (d->property.propertyTypeCategory() == QDeclarativeProperty::List) {
value = ep->scriptValueToVariant(scriptValue, qMetaTypeId<QList<QObject *> >());
} else if (scriptValue.isNull() &&
- data->property.propertyTypeCategory() == QDeclarativeProperty::Object) {
+ d->property.propertyTypeCategory() == QDeclarativeProperty::Object) {
value = QVariant::fromValue((QObject *)0);
} else {
- value = ep->scriptValueToVariant(scriptValue, data->property.propertyType());
+ value = ep->scriptValueToVariant(scriptValue, d->property.propertyType());
if (value.userType() == QMetaType::QObjectStar && !qvariant_cast<QObject*>(value)) {
// If the object is null, we extract the predicted type. While this isn't
// 100% reliable, in many cases it gives us better error messages if we
@@ -172,73 +168,78 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
}
- if (data->error.isValid()) {
+ if (d->error.isValid()) {
- } else if (isUndefined && data->property.isResettable()) {
+ } else if (isUndefined && d->property.isResettable()) {
- data->property.reset();
+ d->property.reset();
- } else if (isUndefined && data->property.propertyType() == qMetaTypeId<QVariant>()) {
+ } else if (isUndefined && d->property.propertyType() == qMetaTypeId<QVariant>()) {
- QDeclarativePropertyPrivate::write(data->property, QVariant(), flags);
+ QDeclarativePropertyPrivate::write(d->property, QVariant(), flags);
} else if (isUndefined) {
- QUrl url = QUrl(data->url);
- int line = data->line;
+ QUrl url = QUrl(d->url);
+ int line = d->line;
if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
- data->error.setUrl(url);
- data->error.setLine(line);
- data->error.setColumn(-1);
- data->error.setDescription(QLatin1String("Unable to assign [undefined] to ")
- + QLatin1String(QMetaType::typeName(data->property.propertyType()))
- + QLatin1String(" ") + data->property.name());
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign [undefined] to ") +
+ QLatin1String(QMetaType::typeName(d->property.propertyType())) +
+ QLatin1String(" ") + d->property.name());
} else if (!scriptValue.isRegExp() && scriptValue.isFunction()) {
- QUrl url = QUrl(data->url);
- int line = data->line;
+ QUrl url = QUrl(d->url);
+ int line = d->line;
if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
- data->error.setUrl(url);
- data->error.setLine(line);
- data->error.setColumn(-1);
- data->error.setDescription(QLatin1String("Unable to assign a function to a property."));
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign a function to a property."));
+
+ } else if (d->property.object() &&
+ !QDeclarativePropertyPrivate::write(d->property, value, flags)) {
- } else if (data->property.object() &&
- !QDeclarativePropertyPrivate::write(data->property, value, flags)) {
+ if (wasDeleted)
+ return;
- QUrl url = QUrl(data->url);
- int line = data->line;
+ QUrl url = QUrl(d->url);
+ int line = d->line;
if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
const char *valueType = 0;
if (value.userType() == QVariant::Invalid) valueType = "null";
else valueType = QMetaType::typeName(value.userType());
- data->error.setUrl(url);
- data->error.setLine(line);
- data->error.setColumn(-1);
- data->error.setDescription(QLatin1String("Unable to assign ") +
- QLatin1String(valueType) +
- QLatin1String(" to ") +
- QLatin1String(QMetaType::typeName(data->property.propertyType())));
+ d->error.setUrl(url);
+ d->error.setLine(line);
+ d->error.setColumn(-1);
+ d->error.setDescription(QLatin1String("Unable to assign ") +
+ QLatin1String(valueType) +
+ QLatin1String(" to ") +
+ QLatin1String(QMetaType::typeName(d->property.propertyType())));
}
- if (data->error.isValid()) {
- if (!data->addError(ep)) ep->warning(this->error());
+ if (wasDeleted)
+ return;
+
+ if (d->error.isValid()) {
+ if (!d->addError(ep)) ep->warning(this->error());
} else {
- data->removeError();
+ d->removeError();
}
}
- data->updating = false;
+ d->updating = false;
+ d->deleted = 0;
} else {
- qmlInfo(data->property.object()) << tr("Binding loop detected for property \"%1\"").arg(data->property.name());
+ qmlInfo(d->property.object()) << tr("Binding loop detected for property \"%1\"").arg(d->property.name());
}
-
- data->release();
}
void QDeclarativeBindingPrivate::emitValueChanged()
@@ -250,13 +251,13 @@ void QDeclarativeBindingPrivate::emitValueChanged()
void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
{
Q_D(QDeclarativeBinding);
- d->bindingData()->enabled = e;
+ d->enabled = e;
setNotifyOnValueChanged(e);
QDeclarativeAbstractBinding::setEnabled(e, flags);
if (e) {
- addToObject(d->bindingData()->property.object());
+ addToObject(d->property.object());
update(flags);
} else {
removeFromObject();
@@ -266,14 +267,14 @@ void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteF
int QDeclarativeBinding::propertyIndex()
{
Q_D(QDeclarativeBinding);
- return QDeclarativePropertyPrivate::bindingIndex(d->bindingData()->property);
+ return QDeclarativePropertyPrivate::bindingIndex(d->property);
}
bool QDeclarativeBinding::enabled() const
{
Q_D(const QDeclarativeBinding);
- return d->bindingData()->enabled;
+ return d->enabled;
}
QString QDeclarativeBinding::expression() const
diff --git a/src/declarative/qml/qdeclarativebinding_p_p.h b/src/declarative/qml/qdeclarativebinding_p_p.h
index 617ec4bd73..6926158edb 100644
--- a/src/declarative/qml/qdeclarativebinding_p_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p_p.h
@@ -60,30 +60,24 @@
QT_BEGIN_NAMESPACE
-class QDeclarativeBindingData : public QDeclarativeExpressionData
-{
-public:
- QDeclarativeBindingData();
- virtual ~QDeclarativeBindingData();
-
- bool updating:1;
- bool enabled:1;
-
- QDeclarativeProperty property;
-
- virtual void refresh();
-};
-
class QDeclarativeBindingPrivate : public QDeclarativeExpressionPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeBinding)
public:
QDeclarativeBindingPrivate();
-
- QDeclarativeBindingData *bindingData() { return static_cast<QDeclarativeBindingData *>(data); }
- const QDeclarativeBindingData *bindingData() const { return static_cast<const QDeclarativeBindingData *>(data); }
+ ~QDeclarativeBindingPrivate();
virtual void emitValueChanged();
+
+protected:
+ virtual void refresh();
+
+private:
+ bool updating:1;
+ bool enabled:1;
+ QDeclarativeProperty property;
+
+ bool *deleted;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 1f5aaf1cae..c5a039a3c9 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -198,6 +198,7 @@ public:
// context
QDeclarativeComponentAttached *componentAttached;
+ // Return the outermost id for obj, if any.
QString findObjectId(const QObject *obj) const;
static QDeclarativeContextData *get(QDeclarativeContext *context) {
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 00bc1b7aef..f2eb770098 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -125,7 +125,7 @@ QT_BEGIN_NAMESPACE
QObject. See the QObject documentation for further details.
*/
/*!
- \qmlproperty string QtObject::objectName
+ \qmlproperty string QML:QtObject::objectName
This property allows you to give a name to this specific object instance.
See \l{scripting.html#accessing-child-qobjects}{Accessing Child QObjects}
@@ -219,7 +219,7 @@ of their use.
QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
-: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false),
+: captureProperties(false), rootContext(0), isDebugging(false),
outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0),
objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0),
inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
@@ -237,8 +237,8 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
}
/*!
-\qmlmethod url Qt::resolvedUrl(url)
-Returns \c url resolved relative to the URL of the caller.
+ \qmlmethod url Qt::resolvedUrl(url)
+ Returns \c url resolved relative to the URL of the caller.
*/
QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
{
@@ -1090,8 +1090,6 @@ If you are certain the files will be local, you could simplify to:
To create a QML object from an arbitrary string of QML (instead of a file),
use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
-
-\sa {Dynamic Object Management}
*/
QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1139,8 +1137,6 @@ Each object in this array has the members \c lineNumber, \c columnNumber, \c fil
Note that this function returns immediately, and therefore may not work if
the \a qml string loads new components (that is, external QML files that have not yet been loaded).
If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
-
-\sa {Dynamic Object Management}
*/
QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index f457b536e2..a5c8c388d1 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -162,7 +162,6 @@ public:
QPODVector<CapturedProperty> capturedProperties;
QDeclarativeContext *rootContext;
- QDeclarativeExpression *currentExpression;
bool isDebugging;
bool outputWarningsToStdErr;
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index 96cdec15e9..9935e384a7 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -71,109 +71,95 @@ bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e)
return true;
}
-QDeclarativeExpressionData::QDeclarativeExpressionData()
-: q(0), dataRef(0), expressionFunctionValid(false), expressionRewritten(false), me(0),
- trackChange(false), isShared(false), line(-1), guardList(0), guardListLength(0)
+QDeclarativeQtScriptExpression::QDeclarativeQtScriptExpression()
+: dataRef(0), expressionFunctionMode(ExplicitContext), scopeObject(0), trackChange(false),
+ guardList(0), guardListLength(0), guardObject(0), guardObjectNotifyIndex(-1), deleted(0)
{
}
-QDeclarativeExpressionData::~QDeclarativeExpressionData()
+QDeclarativeQtScriptExpression::~QDeclarativeQtScriptExpression()
{
if (guardList) { delete [] guardList; guardList = 0; }
if (dataRef) dataRef->release();
+ if (deleted) *deleted = true;
}
QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate()
-: data(new QDeclarativeExpressionData)
+: expressionFunctionValid(true), line(-1)
{
- data->q = this;
-}
-
-QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate(QDeclarativeExpressionData *d)
-: data(d)
-{
- data->q = this;
}
QDeclarativeExpressionPrivate::~QDeclarativeExpressionPrivate()
{
- if (data) {
- delete [] data->guardList;
- data->guardList = 0;
- data->guardListLength = 0;
- data->q = 0;
- data->release();
- data = 0;
- }
}
void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, const QString &expr,
QObject *me)
{
- data->expression = expr;
+ expression = expr;
- data->QDeclarativeAbstractExpression::setContext(ctxt);
- data->me = me;
+ QDeclarativeAbstractExpression::setContext(ctxt);
+ scopeObject = me;
+ expressionFunctionValid = false;
}
-void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *expr, QDeclarativeRefCount *rc,
- QObject *me, const QString &url, int lineNumber)
+void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *expr,
+ QDeclarativeRefCount *rc,
+ QObject *me, const QString &srcUrl, int lineNumber)
{
- data->url = url;
- data->line = lineNumber;
+ url = srcUrl;
+ line = lineNumber;
- if (data->dataRef) data->dataRef->release();
- data->dataRef = rc;
- if (data->dataRef) data->dataRef->addref();
+ if (dataRef) dataRef->release();
+ dataRef = rc;
+ if (dataRef) dataRef->addref();
quint32 *exprData = (quint32 *)expr;
QDeclarativeCompiledData *dd = (QDeclarativeCompiledData *)rc;
- data->expressionRewritten = true;
- data->expression = QString::fromRawData((QChar *)(exprData + 2), exprData[1]);
+ expression = QString::fromRawData((QChar *)(exprData + 2), exprData[1]);
int progIdx = *(exprData);
- bool isShared = progIdx & 0x80000000;
+ bool isSharedProgram = progIdx & 0x80000000;
progIdx &= 0x7FFFFFFF;
QDeclarativeEngine *engine = ctxt->engine;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
- if (isShared) {
+ if (isSharedProgram) {
if (!dd->cachedClosures.at(progIdx)) {
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(ep->contextClass->newSharedContext());
scriptContext->pushScope(ep->globalClass->staticGlobalObject());
- dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url, data->line));
+ dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(expression, url, line));
scriptEngine->popContext();
}
- data->expressionFunction = *dd->cachedClosures.at(progIdx);
- data->isShared = true;
- data->expressionFunctionValid = true;
+ expressionFunction = *dd->cachedClosures.at(progIdx);
+ expressionFunctionMode = SharedContext;
+ expressionFunctionValid = true;
} else {
#if !defined(Q_OS_SYMBIAN) //XXX Why doesn't this work?
if (!dd->cachedPrograms.at(progIdx)) {
- dd->cachedPrograms[progIdx] =
- new QScriptProgram(data->expression, data->url, data->line);
+ dd->cachedPrograms[progIdx] = new QScriptProgram(expression, url, line);
}
- data->expressionFunction = evalInObjectScope(ctxt, me, *dd->cachedPrograms.at(progIdx),
- &data->expressionContext);
+ expressionFunction = evalInObjectScope(ctxt, me, *dd->cachedPrograms.at(progIdx),
+ &expressionContext);
#else
- data->expressionFunction = evalInObjectScope(ctxt, me, data->expression,
- &data->expressionContext);
+ expressionFunction = evalInObjectScope(ctxt, me, expression, &expressionContext);
#endif
- data->expressionFunctionValid = true;
+ expressionFunctionMode = ExplicitContext;
+ expressionFunctionValid = true;
}
- data->QDeclarativeAbstractExpression::setContext(ctxt);
- data->me = me;
+ QDeclarativeAbstractExpression::setContext(ctxt);
+ scopeObject = me;
}
QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContextData *context, QObject *object,
@@ -240,6 +226,8 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
\endcode
*/
+static int QDeclarativeExpression_notifyIdx = -1;
+
/*!
Create an invalid QDeclarativeExpression.
@@ -249,6 +237,11 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
QDeclarativeExpression::QDeclarativeExpression()
: QObject(*new QDeclarativeExpressionPrivate, 0)
{
+ Q_D(QDeclarativeExpression);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
}
/*! \internal */
@@ -260,6 +253,10 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, vo
{
Q_D(QDeclarativeExpression);
d->init(ctxt, expr, rc, me, url, lineNumber);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
}
/*!
@@ -277,6 +274,10 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt,
{
Q_D(QDeclarativeExpression);
d->init(QDeclarativeContextData::get(ctxt), expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
}
/*!
@@ -288,6 +289,10 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QO
{
Q_D(QDeclarativeExpression);
d->init(ctxt, expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
}
/*! \internal */
@@ -297,6 +302,10 @@ QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContextData *ctxt, QO
{
Q_D(QDeclarativeExpression);
d->init(ctxt, expression, scope);
+
+ if (QDeclarativeExpression_notifyIdx == -1)
+ QDeclarativeExpression_notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
+ d->setNotifyObject(this, QDeclarativeExpression_notifyIdx);
}
/*!
@@ -313,7 +322,7 @@ QDeclarativeExpression::~QDeclarativeExpression()
QDeclarativeEngine *QDeclarativeExpression::engine() const
{
Q_D(const QDeclarativeExpression);
- return d->data->context()?d->data->context()->engine:0;
+ return d->context()?d->context()->engine:0;
}
/*!
@@ -323,7 +332,7 @@ QDeclarativeEngine *QDeclarativeExpression::engine() const
QDeclarativeContext *QDeclarativeExpression::context() const
{
Q_D(const QDeclarativeExpression);
- QDeclarativeContextData *data = d->data->context();
+ QDeclarativeContextData *data = d->context();
return data?data->asQDeclarativeContext():0;
}
@@ -333,7 +342,7 @@ QDeclarativeContext *QDeclarativeExpression::context() const
QString QDeclarativeExpression::expression() const
{
Q_D(const QDeclarativeExpression);
- return d->data->expression;
+ return d->expression;
}
/*!
@@ -343,12 +352,10 @@ void QDeclarativeExpression::setExpression(const QString &expression)
{
Q_D(QDeclarativeExpression);
- d->clearGuards();
-
- d->data->expression = expression;
- d->data->expressionFunctionValid = false;
- d->data->expressionRewritten = false;
- d->data->expressionFunction = QScriptValue();
+ d->resetNotifyOnChange();
+ d->expression = expression;
+ d->expressionFunctionValid = false;
+ d->expressionFunction = QScriptValue();
}
void QDeclarativeExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine,
@@ -378,59 +385,108 @@ void QDeclarativeExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine
}
}
-QScriptValue QDeclarativeExpressionPrivate::eval(QObject *secondaryScope, bool *isUndefined)
+bool QDeclarativeQtScriptExpression::notifyOnValueChange() const
{
- QDeclarativeExpressionData *data = this->data;
- QDeclarativeEngine *engine = data->context()->engine;
- QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ return trackChange;
+}
- QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+void QDeclarativeQtScriptExpression::setNotifyOnValueChange(bool notify)
+{
+ trackChange = notify;
+ if (!notify && guardList)
+ clearGuards();
+}
- if (!data->expressionFunctionValid) {
+void QDeclarativeQtScriptExpression::resetNotifyOnChange()
+{
+ clearGuards();
+}
- QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
- data->expressionContext = ep->contextClass->newContext(data->context(), data->me);
- scriptContext->pushScope(data->expressionContext);
- scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+void QDeclarativeQtScriptExpression::setNotifyObject(QObject *object, int notifyIndex)
+{
+ if (guardList) clearGuards();
+
+ if (!object || notifyIndex == -1) {
+ guardObject = 0;
+ notifyIndex = -1;
+ } else {
+ guardObject = object;
+ guardObjectNotifyIndex = notifyIndex;
+
+ }
+}
+
+QScriptValue QDeclarativeQtScriptExpression::scriptValue(QObject *secondaryScope, bool *isUndefined)
+{
+ Q_ASSERT(context() && context()->engine);
+ Q_ASSERT(!trackChange || (guardObject && guardObjectNotifyIndex != -1));
+
+ if (!expressionFunction.isValid()) {
+ if (isUndefined) *isUndefined = true;
+ return QScriptValue();
+ }
+
+ DeleteWatcher watcher(this);
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context()->engine);
+
+ bool lastCaptureProperties = ep->captureProperties;
+ QPODVector<QDeclarativeEnginePrivate::CapturedProperty> lastCapturedProperties;
+ ep->captureProperties = trackChange;
+ ep->capturedProperties.copyAndClear(lastCapturedProperties);
+
+ QScriptValue value = eval(secondaryScope, isUndefined);
+
+ if (!watcher.wasDeleted() && trackChange) {
+ if (ep->capturedProperties.count() == 0) {
+
+ if (guardList) clearGuards();
- if (data->expressionRewritten) {
- data->expressionFunction = scriptEngine->evaluate(data->expression,
- data->url, data->line);
} else {
- QDeclarativeRewrite::RewriteBinding rewriteBinding;
- bool ok = true;
- const QString code = rewriteBinding(data->expression, &ok);
- if (!ok) {
- scriptEngine->popContext();
- return QScriptValue();
- }
- data->expressionFunction = scriptEngine->evaluate(code, data->url, data->line);
- }
+ updateGuards(ep->capturedProperties);
- scriptEngine->popContext();
- data->expressionFunctionValid = true;
+ }
}
+ lastCapturedProperties.copyAndClear(ep->capturedProperties);
+ ep->captureProperties = lastCaptureProperties;
+
+ return value;
+}
+
+QScriptValue QDeclarativeQtScriptExpression::eval(QObject *secondaryScope, bool *isUndefined)
+{
+ Q_ASSERT(context() && context()->engine);
+
+ DeleteWatcher watcher(this);
+
+ QDeclarativeEngine *engine = context()->engine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
QDeclarativeContextData *oldSharedContext = 0;
QObject *oldSharedScope = 0;
QObject *oldOverride = 0;
- if (data->isShared) {
+ bool isShared = (expressionFunctionMode == SharedContext);
+
+ if (isShared) {
oldSharedContext = ep->sharedContext;
oldSharedScope = ep->sharedScope;
- ep->sharedContext = data->context();
- ep->sharedScope = data->me;
+ ep->sharedContext = context();
+ ep->sharedScope = scopeObject;
} else {
- oldOverride = ep->contextClass->setOverrideObject(data->expressionContext, secondaryScope);
+ oldOverride = ep->contextClass->setOverrideObject(expressionContext, secondaryScope);
}
- QScriptValue svalue = data->expressionFunction.call();
+ QScriptValue svalue = expressionFunction.call(); // This could cause this to be deleted
- if (data->isShared) {
+ if (isShared) {
ep->sharedContext = oldSharedContext;
ep->sharedScope = oldSharedScope;
- } else {
- ep->contextClass->setOverrideObject(data->expressionContext, oldOverride);
+ } else if (!watcher.wasDeleted()) {
+ ep->contextClass->setOverrideObject(expressionContext, oldOverride);
}
if (isUndefined)
@@ -438,63 +494,134 @@ QScriptValue QDeclarativeExpressionPrivate::eval(QObject *secondaryScope, bool *
// Handle exception
if (scriptEngine->hasUncaughtException()) {
- exceptionToError(scriptEngine, data->error);
+ if (!watcher.wasDeleted())
+ QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error);
+
scriptEngine->clearExceptions();
return QScriptValue();
} else {
- data->error = QDeclarativeError();
+ if (!watcher.wasDeleted())
+ error = QDeclarativeError();
+
return svalue;
}
}
-QScriptValue QDeclarativeExpressionPrivate::scriptValue(QObject *secondaryScope, bool *isUndefined)
+void QDeclarativeQtScriptExpression::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties)
{
- Q_Q(QDeclarativeExpression);
- Q_ASSERT(q->engine());
+ Q_ASSERT(guardObject);
+ Q_ASSERT(guardObjectNotifyIndex != -1);
- if (data->expression.isEmpty())
- return QScriptValue();
+ if (properties.count() != guardListLength) {
+ QDeclarativeNotifierEndpoint *newGuardList = new QDeclarativeNotifierEndpoint[properties.count()];
- QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(q->engine());
+ for (int ii = 0; ii < qMin(guardListLength, properties.count()); ++ii)
+ guardList[ii].copyAndClear(newGuardList[ii]);
- QDeclarativeExpression *lastCurrentExpression = ep->currentExpression;
- bool lastCaptureProperties = ep->captureProperties;
- QPODVector<QDeclarativeEnginePrivate::CapturedProperty> lastCapturedProperties;
- ep->capturedProperties.copyAndClear(lastCapturedProperties);
+ delete [] guardList;
+ guardList = newGuardList;
+ guardListLength = properties.count();
+ }
- ep->currentExpression = q;
- ep->captureProperties = data->trackChange;
+ bool outputWarningHeader = false;
+ bool noChanges = true;
+ for (int ii = 0; ii < properties.count(); ++ii) {
+ QDeclarativeNotifierEndpoint &guard = guardList[ii];
+ const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
- // This object might be deleted during the eval
- QDeclarativeExpressionData *localData = data;
- localData->addref();
+ guard.target = guardObject;
+ guard.targetMethod = guardObjectNotifyIndex;
- QScriptValue value = eval(secondaryScope, isUndefined);
+ if (property.notifier != 0) {
- ep->currentExpression = lastCurrentExpression;
- ep->captureProperties = lastCaptureProperties;
+ if (!noChanges && guard.isConnected(property.notifier)) {
+ // Nothing to do
- // Check if we were deleted
- if (localData->q) {
- if ((!data->trackChange || !ep->capturedProperties.count()) && data->guardList) {
- clearGuards();
- } else if(data->trackChange) {
- updateGuards(ep->capturedProperties);
+ } else {
+ noChanges = false;
+
+ bool existing = false;
+ for (int jj = 0; !existing && jj < ii; ++jj)
+ if (guardList[jj].isConnected(property.notifier))
+ existing = true;
+
+ if (existing) {
+ // duplicate
+ guard.disconnect();
+ } else {
+ guard.connect(property.notifier);
+ }
+ }
+
+
+ } else if (property.notifyIndex != -1) {
+
+ if (!noChanges && guard.isConnected(property.object, property.notifyIndex)) {
+ // Nothing to do
+
+ } else {
+ noChanges = false;
+
+ bool existing = false;
+ for (int jj = 0; !existing && jj < ii; ++jj)
+ if (guardList[jj].isConnected(property.object, property.notifyIndex))
+ existing = true;
+
+ if (existing) {
+ // duplicate
+ guard.disconnect();
+ } else {
+ guard.connect(property.object, property.notifyIndex);
+ }
+ }
+
+ } else {
+ if (!outputWarningHeader) {
+ outputWarningHeader = true;
+ qWarning() << "QDeclarativeExpression: Expression" << expression
+ << "depends on non-NOTIFYable properties:";
+ }
+
+ const QMetaObject *metaObj = property.object->metaObject();
+ QMetaProperty metaProp = metaObj->property(property.coreIndex);
+
+ qWarning().nospace() << " " << metaObj->className() << "::" << metaProp.name();
}
}
+}
- localData->release();
+QScriptValue QDeclarativeExpressionPrivate::scriptValue(QObject *secondaryScope, bool *isUndefined)
+{
+ if (!expressionFunctionValid) {
+ QDeclarativeEngine *engine = context()->engine;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- lastCapturedProperties.copyAndClear(ep->capturedProperties);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
- return value;
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
+ expressionContext = ep->contextClass->newContext(context(), scopeObject);
+ scriptContext->pushScope(expressionContext);
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
+
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
+ bool ok = true;
+ const QString code = rewriteBinding(expression, &ok);
+ if (ok)
+ expressionFunction = scriptEngine->evaluate(code, url, line);
+
+ scriptEngine->popContext();
+ expressionFunctionMode = ExplicitContext;
+ expressionFunctionValid = true;
+ }
+
+ return QDeclarativeQtScriptExpression::scriptValue(secondaryScope, isUndefined);
}
QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
{
Q_Q(QDeclarativeExpression);
- if (!data || !data->context() || !data->context()->isValid()) {
+ if (!context() || !context()->isValid()) {
qWarning("QDeclarativeExpression: Attempted to evaluate an expression in an invalid context");
return QVariant();
}
@@ -526,7 +653,7 @@ value changes.
bool QDeclarativeExpression::notifyOnValueChanged() const
{
Q_D(const QDeclarativeExpression);
- return d->data->trackChange;
+ return d->notifyOnValueChange();
}
/*!
@@ -548,7 +675,7 @@ bool QDeclarativeExpression::notifyOnValueChanged() const
void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange)
{
Q_D(QDeclarativeExpression);
- d->data->trackChange = notifyOnChange;
+ d->setNotifyOnValueChange(notifyOnChange);
}
/*!
@@ -558,7 +685,7 @@ void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange)
QString QDeclarativeExpression::sourceFile() const
{
Q_D(const QDeclarativeExpression);
- return d->data->url;
+ return d->url;
}
/*!
@@ -568,7 +695,7 @@ QString QDeclarativeExpression::sourceFile() const
int QDeclarativeExpression::lineNumber() const
{
Q_D(const QDeclarativeExpression);
- return d->data->line;
+ return d->line;
}
/*!
@@ -578,8 +705,8 @@ int QDeclarativeExpression::lineNumber() const
void QDeclarativeExpression::setSourceLocation(const QString &url, int line)
{
Q_D(QDeclarativeExpression);
- d->data->url = url;
- d->data->line = line;
+ d->url = url;
+ d->line = line;
}
/*!
@@ -591,7 +718,7 @@ void QDeclarativeExpression::setSourceLocation(const QString &url, int line)
QObject *QDeclarativeExpression::scopeObject() const
{
Q_D(const QDeclarativeExpression);
- return d->data->me;
+ return d->scopeObject;
}
/*!
@@ -603,7 +730,7 @@ QObject *QDeclarativeExpression::scopeObject() const
bool QDeclarativeExpression::hasError() const
{
Q_D(const QDeclarativeExpression);
- return d->data->error.isValid();
+ return d->error.isValid();
}
/*!
@@ -615,7 +742,7 @@ bool QDeclarativeExpression::hasError() const
void QDeclarativeExpression::clearError()
{
Q_D(QDeclarativeExpression);
- d->data->error = QDeclarativeError();
+ d->error = QDeclarativeError();
}
/*!
@@ -628,7 +755,7 @@ void QDeclarativeExpression::clearError()
QDeclarativeError QDeclarativeExpression::error() const
{
Q_D(const QDeclarativeExpression);
- return d->data->error;
+ return d->error;
}
/*! \internal */
@@ -637,98 +764,11 @@ void QDeclarativeExpressionPrivate::_q_notify()
emitValueChanged();
}
-void QDeclarativeExpressionPrivate::clearGuards()
-{
- delete [] data->guardList;
- data->guardList = 0;
- data->guardListLength = 0;
-}
-
-void QDeclarativeExpressionPrivate::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties)
+void QDeclarativeQtScriptExpression::clearGuards()
{
- Q_Q(QDeclarativeExpression);
-
- static int notifyIdx = -1;
- if (notifyIdx == -1)
- notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("_q_notify()");
-
- if (properties.count() != data->guardListLength) {
- QDeclarativeNotifierEndpoint *newGuardList =
- new QDeclarativeNotifierEndpoint[properties.count()];
-
- for (int ii = 0; ii < qMin(data->guardListLength, properties.count()); ++ii)
- data->guardList[ii].copyAndClear(newGuardList[ii]);
-
- delete [] data->guardList;
- data->guardList = newGuardList;
- data->guardListLength = properties.count();
- }
-
- bool outputWarningHeader = false;
- bool noChanges = true;
- for (int ii = 0; ii < properties.count(); ++ii) {
- QDeclarativeNotifierEndpoint &guard = data->guardList[ii];
- const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
-
- guard.target = q;
- guard.targetMethod = notifyIdx;
-
- if (property.notifier != 0) {
-
- if (!noChanges && guard.isConnected(property.notifier)) {
- // Nothing to do
-
- } else {
- noChanges = false;
-
- bool existing = false;
- for (int jj = 0; !existing && jj < ii; ++jj)
- if (data->guardList[jj].isConnected(property.notifier))
- existing = true;
-
- if (existing) {
- // duplicate
- guard.disconnect();
- } else {
- guard.connect(property.notifier);
- }
- }
-
-
- } else if (property.notifyIndex != -1) {
-
- if (!noChanges && guard.isConnected(property.object, property.notifyIndex)) {
- // Nothing to do
-
- } else {
- noChanges = false;
-
- bool existing = false;
- for (int jj = 0; !existing && jj < ii; ++jj)
- if (data->guardList[jj].isConnected(property.object, property.notifyIndex))
- existing = true;
-
- if (existing) {
- // duplicate
- guard.disconnect();
- } else {
- guard.connect(property.object, property.notifyIndex);
- }
- }
-
- } else {
- if (!outputWarningHeader) {
- outputWarningHeader = true;
- qWarning() << "QDeclarativeExpression: Expression" << q->expression()
- << "depends on non-NOTIFYable properties:";
- }
-
- const QMetaObject *metaObj = property.object->metaObject();
- QMetaProperty metaProp = metaObj->property(property.coreIndex);
-
- qWarning().nospace() << " " << metaObj->className() << "::" << metaProp.name();
- }
- }
+ delete [] guardList;
+ guardList = 0;
+ guardListLength = 0;
}
/*!
diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h
index 4ff3162af7..b629e204f1 100644
--- a/src/declarative/qml/qdeclarativeexpression_p.h
+++ b/src/declarative/qml/qdeclarativeexpression_p.h
@@ -107,56 +107,73 @@ private:
QDeclarativeDelayedError **prevError;
};
-class QDeclarativeExpressionData : public QDeclarativeAbstractExpression, public QDeclarativeDelayedError, public QDeclarativeRefCount
+class QDeclarativeQtScriptExpression : public QDeclarativeAbstractExpression,
+ public QDeclarativeDelayedError
{
public:
- QDeclarativeExpressionData();
- virtual ~QDeclarativeExpressionData();
+ enum Mode { SharedContext, ExplicitContext };
- QDeclarativeExpressionPrivate *q;
+ QDeclarativeQtScriptExpression();
+ virtual ~QDeclarativeQtScriptExpression();
QDeclarativeRefCount *dataRef;
+
QString expression;
- bool expressionFunctionValid:1;
- bool expressionRewritten:1;
+
+ Mode expressionFunctionMode;
QScriptValue expressionFunction;
- QScriptValue expressionContext;
- QObject *me;
- bool trackChange;
+ QScriptValue expressionContext; // Only used in ExplicitContext
+ QObject *scopeObject; // Only used in SharedContext
- bool isShared;
+ bool notifyOnValueChange() const;
+ void setNotifyOnValueChange(bool);
+ void resetNotifyOnChange();
+ void setNotifyObject(QObject *, int );
- QString url; // This is a QString for a reason. QUrls are slooooooow...
- int line;
+ QScriptValue scriptValue(QObject *secondaryScope, bool *isUndefined);
+
+ class DeleteWatcher {
+ public:
+ inline DeleteWatcher(QDeclarativeQtScriptExpression *data);
+ inline ~DeleteWatcher();
+ inline bool wasDeleted() const;
+ private:
+ bool *m_wasDeleted;
+ bool m_wasDeletedStorage;
+ QDeclarativeQtScriptExpression *m_d;
+ };
+
+private:
+ void clearGuards();
+ QScriptValue eval(QObject *secondaryScope, bool *isUndefined);
+ void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties);
+
+ bool trackChange;
QDeclarativeNotifierEndpoint *guardList;
int guardListLength;
+
+ QObject *guardObject;
+ int guardObjectNotifyIndex;
+ bool *deleted;
};
class QDeclarativeExpression;
class QString;
-class QDeclarativeExpressionPrivate : public QObjectPrivate
+class QDeclarativeExpressionPrivate : public QObjectPrivate, public QDeclarativeQtScriptExpression
{
Q_DECLARE_PUBLIC(QDeclarativeExpression)
public:
QDeclarativeExpressionPrivate();
- QDeclarativeExpressionPrivate(QDeclarativeExpressionData *);
~QDeclarativeExpressionPrivate();
void init(QDeclarativeContextData *, const QString &, QObject *);
void init(QDeclarativeContextData *, void *, QDeclarativeRefCount *, QObject *, const QString &, int);
- QDeclarativeExpressionData *data;
-
QVariant value(QObject *secondaryScope = 0, bool *isUndefined = 0);
QScriptValue scriptValue(QObject *secondaryScope = 0, bool *isUndefined = 0);
- QScriptValue eval(QObject *secondaryScope, bool *isUndefined = 0);
-
- void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties);
- void clearGuards();
-
static QDeclarativeExpressionPrivate *get(QDeclarativeExpression *expr) {
return static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr));
}
@@ -172,8 +189,32 @@ public:
int, QScriptValue *);
static QScriptValue evalInObjectScope(QDeclarativeContextData *, QObject *, const QScriptProgram &,
QScriptValue *);
+
+ bool expressionFunctionValid:1;
+
+ QString url; // This is a QString for a reason. QUrls are slooooooow...
+ int line;
};
+QDeclarativeQtScriptExpression::DeleteWatcher::DeleteWatcher(QDeclarativeQtScriptExpression *data)
+: m_wasDeletedStorage(false), m_d(data)
+{
+ if (!m_d->deleted)
+ m_d->deleted = &m_wasDeletedStorage;
+ m_wasDeleted = m_d->deleted;
+}
+
+QDeclarativeQtScriptExpression::DeleteWatcher::~DeleteWatcher()
+{
+ if (false == *m_wasDeleted && m_wasDeleted == m_d->deleted)
+ m_d->deleted = 0;
+}
+
+bool QDeclarativeQtScriptExpression::DeleteWatcher::wasDeleted() const
+{
+ return *m_wasDeleted;
+}
+
QT_END_NAMESPACE
#endif // QDECLARATIVEEXPRESSION_P_H
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index f38da4e350..a294c386cb 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -180,9 +180,13 @@ QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() cons
Implement this method to return the image with \a id. The default
implementation returns an empty image.
- If \a requestedSize is a valid size, the image returned should be of that size.
+ The \a requestedSize corresponds to the \l {Image::sourceSize} requested by
+ an Image element. If \a requestedSize is a valid size, the image
+ returned should be of that size.
- In all cases, \a size must be set to the original size of the image.
+ In all cases, \a size must be set to the original size of the image. This
+ is used to set the \l {Item::}{width} and \l {Item::}{height} of image
+ elements that should be automatically sized to the loaded image.
\note this method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
@@ -201,9 +205,13 @@ QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, c
Implement this method to return the pixmap with \a id. The default
implementation returns an empty pixmap.
- If \a requestedSize is a valid size, the image returned should be of that size.
+ The \a requestedSize corresponds to the \l {Image::sourceSize} requested by
+ an Image element. If \a requestedSize is a valid size, the image
+ returned should be of that size.
- In all cases, \a size must be set to the original size of the image.
+ In all cases, \a size must be set to the original size of the image. This
+ is used to set the \l {Item::}{width} and \l {Item::}{height} of image
+ elements that should be automatically sized to the loaded image.
\note this method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp
index 7c89672da5..9598d98292 100644
--- a/src/declarative/qml/qdeclarativelist.cpp
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -306,7 +306,7 @@ int QDeclarativeListReference::count() const
/*!
\class QDeclarativeListProperty
\since 4.7
-\brief The QDeclarativeListProperty class allows applications to explose list-like
+\brief The QDeclarativeListProperty class allows applications to expose list-like
properties to QML.
QML has many list properties, where more than one object value can be assigned.
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 51e6f992e4..55904495b6 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -1039,7 +1039,7 @@ public:
/*!
\qmlproperty Item AnchorChanges::target
- This property holds the Item whose anchors will change
+ This property holds the \l Item for which the anchor changes will be applied.
*/
QDeclarativeAnchorChanges::QDeclarativeAnchorChanges(QObject *parent)
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 00169db812..9f4df22722 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -508,8 +508,8 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
\since 4.7
\brief The XmlListModel element is used to specify a model using XPath expressions.
- XmlListModel is used to create a model from XML data. XmlListModel can be used as a data source
- for the view classes (such as ListView, PathView, GridView) and other classes that interact with model
+ XmlListModel is used to create a model from XML data. It can be used as a data source
+ for view elements (such as ListView, PathView, GridView) and other elements that interact with model
data (such as \l Repeater).
For example, if there is a XML document at http://www.mysite.com/feed.xml like this:
@@ -520,11 +520,11 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
...
<channel>
<item>
- <title>Item A</title>
+ <title>A blog post</title>
<pubDate>Sat, 07 Sep 2010 10:00:01 GMT</pubDate>
</item>
<item>
- <title>Item B</title>
+ <title>Another blog post</title>
<pubDate>Sat, 07 Sep 2010 15:35:01 GMT</pubDate>
</item>
</channel>
@@ -560,10 +560,17 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
ListView {
width: 180; height: 300
model: xmlModel
- delegate: Text { title + " (" + pubDate + ")" }
+ delegate: Text { text: title + " (" + pubDate + ")" }
}
\endqml
+ \image qml-xmllistmodel-example.png
+
+ The XmlListModel data is loaded asynchronously, and \l status
+ is set to \l XmlListModel::Ready when loading is complete.
+ Note this means when XmlListModel is used for a view, the view is not
+ populated until the model is loaded.
+
\section2 Using key XML roles
@@ -589,7 +596,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
with a combined value of all key roles that is not already present in
the model.
- \sa {demos/declarative/rssnews}{RSS News demo}
+ \sa {RSS News}
*/
QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index e406cba159..ad8801a094 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -180,7 +180,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
QSize QVistaBackButton::sizeHint() const
{
ensurePolished();
- int width = 32, height = 32;
+ int size = int(QStyleHelper::dpiScaled(32));
+ int width = size, height = size;
/*
HANDLE theme = pOpenThemeData(0, L"Navigation");
SIZE size;
@@ -213,8 +214,8 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
HANDLE theme = pOpenThemeData(0, L"Navigation");
//RECT rect;
RECT clipRect;
- int xoffset = QWidget::mapToParent(r.topLeft()).x();
- int yoffset = QWidget::mapToParent(r.topLeft()).y();
+ int xoffset = QWidget::mapToParent(r.topLeft()).x() - 1;
+ int yoffset = QWidget::mapToParent(r.topLeft()).y() - 1;
clipRect.top = r.top() + yoffset;
clipRect.bottom = r.bottom() + yoffset;
@@ -245,6 +246,11 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
is_vista = resolveSymbols();
if (is_vista)
backButton_ = new QVistaBackButton(wizard);
+
+ // Handle diff between Windows 7 and Vista
+ iconSpacing = QStyleHelper::dpiScaled(7);
+ textSpacing = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ?
+ iconSpacing : QStyleHelper::dpiScaled(20);
}
QVistaHelper::~QVistaHelper()
@@ -308,18 +314,15 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
void QVistaHelper::drawTitleBar(QPainter *painter)
{
- if (vistaState() == VistaAero)
- drawBlackRect(
- QRect(0, 0, wizard->width(), titleBarSize() + topOffset()),
- painter->paintEngine()->getDC());
+ HDC hdc = painter->paintEngine()->getDC();
+ if (vistaState() == VistaAero)
+ drawBlackRect(QRect(0, 0, wizard->width(),
+ titleBarSize() + topOffset()), hdc);
Q_ASSERT(backButton_);
const int btnTop = backButton_->mapToParent(QPoint()).y();
const int btnHeight = backButton_->size().height();
- const int verticalCenter = (btnTop + btnHeight / 2);
-
- wizard->windowIcon().paint(
- painter, QRect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize()));
+ const int verticalCenter = (btnTop + btnHeight / 2) - 1;
const QString text = wizard->window()->windowTitle();
const QFont font = QApplication::font("QWorkspaceTitleBar");
@@ -327,14 +330,25 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
const QRect brect = fontMetrics.boundingRect(text);
int textHeight = brect.height();
int textWidth = brect.width();
+ int glowOffset = 0;
+
if (vistaState() == VistaAero) {
textHeight += 2 * glowSize();
textWidth += 2 * glowSize();
+ glowOffset = glowSize();
}
+
drawTitleText(
painter, text,
- QRect(titleOffset(), verticalCenter - textHeight / 2, textWidth, textHeight),
- painter->paintEngine()->getDC());
+ QRect(titleOffset() - glowOffset, verticalCenter - textHeight / 2, textWidth, textHeight),
+ hdc);
+
+ if (!wizard->windowIcon().isNull()) {
+ QRect rect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize());
+ HICON hIcon = wizard->windowIcon().pixmap(iconSize()).toWinHICON();
+ DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT);
+ DestroyIcon(hIcon);
+ }
}
void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible)
@@ -734,7 +748,7 @@ bool QVistaHelper::resolveSymbols()
int QVistaHelper::titleOffset()
{
- int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + padding();
+ int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing;
return leftMargin() + iconOffset;
}
diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h
index 5f3b6c2bcb..caf018d0e7 100644
--- a/src/gui/dialogs/qwizard_win_p.h
+++ b/src/gui/dialogs/qwizard_win_p.h
@@ -61,6 +61,7 @@
#include <qwidget.h>
#include <qabstractbutton.h>
#include <QtGui/private/qwidget_p.h>
+#include <QtGui/private/qstylehelper_p.h>
QT_BEGIN_NAMESPACE
@@ -100,9 +101,14 @@ public:
enum VistaState { VistaAero, VistaBasic, Classic, Dirty };
static VistaState vistaState();
static int titleBarSize() { return frameSize() + captionSize(); }
- static int topPadding() { return 8; }
- static int topOffset() { return titleBarSize() + (vistaState() == VistaAero ? 13 : 3); }
-
+ static int topPadding() { // padding under text
+ return int(QStyleHelper::dpiScaled(
+ QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ? 4 : 6));
+ }
+ static int topOffset() {
+ static int aeroOffset = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ?
+ QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
+ return (titleBarSize() + (vistaState() == VistaAero ? aeroOffset : 3)); }
private:
static HFONT getCaptionFont(HANDLE hTheme);
bool drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc);
@@ -111,11 +117,10 @@ private:
static int frameSize() { return GetSystemMetrics(SM_CYSIZEFRAME); }
static int captionSize() { return GetSystemMetrics(SM_CYCAPTION); }
- static int backButtonSize() { return 31; } // ### should be queried from back button itself
+ static int backButtonSize() { return int(QStyleHelper::dpiScaled(30)); }
static int iconSize() { return 16; } // Standard Aero
- static int padding() { return 7; } // Standard Aero
- static int leftMargin() { return backButtonSize() + padding(); }
static int glowSize() { return 10; }
+ int leftMargin() { return backButton_->isVisible() ? backButtonSize() + iconSpacing : 0; }
int titleOffset();
bool resolveSymbols();
@@ -139,6 +144,10 @@ private:
QRect rtTitle;
QWizard *wizard;
QVistaBackButton *backButton_;
+
+ int titleBarOffset; // Extra spacing above the text
+ int iconSpacing; // Space between button and icon
+ int textSpacing; // Space between icon and text
};
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp
index 83db3ec124..062b5ac5f9 100644
--- a/src/gui/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp
@@ -94,14 +94,13 @@ public:
#endif
};
+Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget);
+
QLayoutStyleInfo QGraphicsGridLayoutPrivate::styleInfo() const
{
- static QWidget *wid = 0;
- if (!wid)
- wid = new QWidget;
QGraphicsItem *item = parentItem();
QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
- return QLayoutStyleInfo(style, wid);
+ return QLayoutStyleInfo(style, globalStyleInfoWidget());
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 848de2cb22..bf36d9bb40 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -133,7 +133,8 @@
\img graphicsview-parentchild.png
- \section1 Transformation
+ \target Transformations
+ \section1 Transformations
QGraphicsItem supports projective transformations in addition to its base
position, pos(). There are several ways to change an item's transformation.
@@ -3257,6 +3258,8 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
}
// Update the child focus chain.
+ if (scene && scene->focusItem())
+ scene->focusItem()->d_ptr->clearSubFocus();
f->d_ptr->setSubFocus();
// Update the scene's focus item.
@@ -7637,9 +7640,9 @@ int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObjec
QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)
{
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
- if (index >= 0 && index < d->children.count())
+ if (index >= 0 && index < d->children.count())
return d->children.at(index)->toGraphicsObject();
- else
+ else
return 0;
}
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index b82872240c..37408efc69 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -171,14 +171,13 @@ int QGraphicsLinearLayoutPrivate::gridColumn(int index) const
return int(qMin(uint(index), uint(engine.columnCount())));
}
+Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget)
+
QLayoutStyleInfo QGraphicsLinearLayoutPrivate::styleInfo() const
{
- static QWidget *wid = 0;
- if (!wid)
- wid = new QWidget;
QGraphicsItem *item = parentItem();
QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
- return QLayoutStyleInfo(style, wid);
+ return QLayoutStyleInfo(style, globalStyleInfoWidget());
}
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 28070da86c..f7850cad80 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -761,7 +761,7 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new
QGraphicsWidget *firstOld = 0;
bool wasPreviousNew = true;
-
+
while (w != q) {
bool isCurrentNew = q->isAncestorOf(w);
if (isCurrentNew) {
@@ -796,7 +796,7 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new
newScene = newParent->scene();
if (oldScene && newScene != oldScene)
- oldScene->d_func()->tabFocusFirst = firstOld;
+ oldScene->d_func()->tabFocusFirst = (firstOld && firstOld->scene() == oldScene) ? firstOld : 0;
QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0;
QGraphicsWidget *topLevel = 0;
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 4fb93fc2c4..97499f3c82 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1363,7 +1363,7 @@ bool QAbstractItemView::dragEnabled() const
Note that the model used needs to provide support for drag and drop operations.
- \sa setDragDropMode() {Using Drag and Drop with Item Views}
+ \sa setDragDropMode() {Using drag & drop with item views}
*/
/*!
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index 5dbd1f08b8..4748f89eb7 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -100,69 +100,80 @@ public:
QIcon getMacIcon(const QFileInfo &fi) const;
#endif
QFileIconProvider *q_ptr;
- QString homePath;
+ const QString homePath;
private:
- QIcon file;
- QIcon fileLink;
- QIcon directory;
- QIcon directoryLink;
- QIcon harddisk;
- QIcon floppy;
- QIcon cdrom;
- QIcon ram;
- QIcon network;
- QIcon computer;
- QIcon desktop;
- QIcon trashcan;
- QIcon generic;
- QIcon home;
+ mutable QIcon file;
+ mutable QIcon fileLink;
+ mutable QIcon directory;
+ mutable QIcon directoryLink;
+ mutable QIcon harddisk;
+ mutable QIcon floppy;
+ mutable QIcon cdrom;
+ mutable QIcon ram;
+ mutable QIcon network;
+ mutable QIcon computer;
+ mutable QIcon desktop;
+ mutable QIcon trashcan;
+ mutable QIcon generic;
+ mutable QIcon home;
};
-QFileIconProviderPrivate::QFileIconProviderPrivate()
+QFileIconProviderPrivate::QFileIconProviderPrivate() :
+ homePath(QDir::home().absolutePath())
{
- QStyle *style = QApplication::style();
- file = style->standardIcon(QStyle::SP_FileIcon);
- directory = style->standardIcon(QStyle::SP_DirIcon);
- fileLink = style->standardIcon(QStyle::SP_FileLinkIcon);
- directoryLink = style->standardIcon(QStyle::SP_DirLinkIcon);
- harddisk = style->standardIcon(QStyle::SP_DriveHDIcon);
- floppy = style->standardIcon(QStyle::SP_DriveFDIcon);
- cdrom = style->standardIcon(QStyle::SP_DriveCDIcon);
- network = style->standardIcon(QStyle::SP_DriveNetIcon);
- computer = style->standardIcon(QStyle::SP_ComputerIcon);
- desktop = style->standardIcon(QStyle::SP_DesktopIcon);
- trashcan = style->standardIcon(QStyle::SP_TrashIcon);
- home = style->standardIcon(QStyle::SP_DirHomeIcon);
- homePath = QDir::home().absolutePath();
}
QIcon QFileIconProviderPrivate::getIcon(QStyle::StandardPixmap name) const
{
switch (name) {
case QStyle::SP_FileIcon:
+ if (file.isNull())
+ file = QApplication::style()->standardIcon(name);
return file;
case QStyle::SP_FileLinkIcon:
+ if (fileLink.isNull())
+ fileLink = QApplication::style()->standardIcon(name);
return fileLink;
case QStyle::SP_DirIcon:
+ if (directory.isNull())
+ directory = QApplication::style()->standardIcon(name);
return directory;
case QStyle::SP_DirLinkIcon:
+ if (directoryLink.isNull())
+ directoryLink = QApplication::style()->standardIcon(name);
return directoryLink;
case QStyle::SP_DriveHDIcon:
+ if (harddisk.isNull())
+ harddisk = QApplication::style()->standardIcon(name);
return harddisk;
case QStyle::SP_DriveFDIcon:
+ if (floppy.isNull())
+ floppy = QApplication::style()->standardIcon(name);
return floppy;
case QStyle::SP_DriveCDIcon:
+ if (cdrom.isNull())
+ cdrom = QApplication::style()->standardIcon(name);
return cdrom;
case QStyle::SP_DriveNetIcon:
+ if (network.isNull())
+ network = QApplication::style()->standardIcon(name);
return network;
case QStyle::SP_ComputerIcon:
+ if (computer.isNull())
+ computer = QApplication::style()->standardIcon(name);
return computer;
case QStyle::SP_DesktopIcon:
+ if (desktop.isNull())
+ desktop = QApplication::style()->standardIcon(name);
return desktop;
case QStyle::SP_TrashIcon:
+ if (trashcan.isNull())
+ trashcan = QApplication::style()->standardIcon(name);
return trashcan;
case QStyle::SP_DirHomeIcon:
+ if (home.isNull())
+ home = QApplication::style()->standardIcon(name);
return home;
default:
return QIcon();
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 94211fd092..aaf479fe25 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -5294,6 +5294,7 @@ bool QApplication::keypadNavigationEnabled()
\sa QCoreApplication::instance()
*/
+#ifndef QT_NO_IM
// ************************************************************************
// Input Method support
// ************************************************************************
@@ -5359,6 +5360,7 @@ QInputContext *QApplication::inputContext() const
#endif
return d->inputContext;
}
+#endif // QT_NO_IM
//Returns the current platform used by keyBindings
uint QApplicationPrivate::currentPlatform(){
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index d31d9e518a..799d4c2935 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -267,8 +267,11 @@ public:
virtual void commitData(QSessionManager& sm);
virtual void saveState(QSessionManager& sm);
#endif
+
+#ifndef QT_NO_IM
void setInputContext(QInputContext *);
QInputContext *inputContext() const;
+#endif
static QLocale keyboardInputLocale();
static Qt::LayoutDirection keyboardInputDirection();
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 9e8a128676..ec26e812f4 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2485,7 +2485,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
if (OkCommand)
QApplication::postEvent(widget, new QEvent(QEvent::OkRequest));
if (CancelCommand)
- QApplication::postEvent(widget, new QEvent(QEvent::Close));
+ widget->showMinimized();
else
#ifndef QT_NO_MENUBAR
QMenuBar::wceCommands(LOWORD(wParam));
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 86528160eb..679514946c 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -85,6 +85,8 @@ QT_END_NAMESPACE
- (BOOL)canBecomeKeyWindow
{
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+ if (!widget)
+ return NO; // This should happen only for qt_root_win
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
@@ -94,6 +96,8 @@ QT_END_NAMESPACE
- (BOOL)canBecomeMainWindow
{
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+ if (!widget)
+ return NO; // This should happen only for qt_root_win
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 5c90e2ece5..1935531736 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -269,6 +269,28 @@ static int qCocoaViewCount = 0;
dropData = new QCocoaDropData(dropPasteboard);
}
+- (void)changeDraggingCursor:(NSDragOperation)newOperation
+{
+ static SEL action = nil;
+ static bool operationSupported = false;
+ if (action == nil) {
+ action = NSSelectorFromString(@"operationNotAllowedCursor");
+ if ([NSCursor respondsToSelector:action]) {
+ operationSupported = true;
+ }
+ }
+ if (operationSupported) {
+ NSCursor *notAllowedCursor = [NSCursor performSelector:action];
+ bool isNotAllowedCursor = ([NSCursor currentCursor] == notAllowedCursor);
+ if (newOperation == NSDragOperationNone && !isNotAllowedCursor) {
+ [notAllowedCursor push];
+ } else if (newOperation != NSDragOperationNone && isNotAllowedCursor) {
+ [notAllowedCursor pop];
+ }
+
+ }
+}
+
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
// NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly
@@ -300,6 +322,7 @@ static int qCocoaViewCount = 0;
if (!qDEEvent.isAccepted()) {
// widget is not interested in this drag, so ignore this drop data.
[self removeDropData];
+ [self changeDraggingCursor:NSDragOperationNone];
return NSDragOperationNone;
} else {
// save the mouse position, used by draggingExited handler.
@@ -321,6 +344,7 @@ static int qCocoaViewCount = 0;
nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDMEvent.dropAction());
}
QT_PREPEND_NAMESPACE(qt_mac_copy_answer_rect)(qDMEvent);
+ [self changeDraggingCursor:nsActions];
return nsActions;
}
}
@@ -335,16 +359,21 @@ static int qCocoaViewCount = 0;
if (dragEnterSequence != [sender draggingSequenceNumber])
[self draggingEntered:sender];
// drag enter event was rejected, so ignore the move event.
- if (dropData == 0)
+ if (dropData == 0) {
+ [self changeDraggingCursor:NSDragOperationNone];
return NSDragOperationNone;
+ }
// return last value, if we are still in the answerRect.
NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint];
NSPoint localPoint = [self convertPoint:windowPoint fromView:nil];
NSDragOperation nsActions = [sender draggingSourceOperationMask];
QPoint posDrag(localPoint.x, localPoint.y);
if (qt_mac_mouse_inside_answer_rect(posDrag)
- && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) == nsActions)
- return QT_PREPEND_NAMESPACE(qt_mac_mapDropActions)(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastAction));
+ && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) == nsActions) {
+ NSDragOperation operation = QT_PREPEND_NAMESPACE(qt_mac_mapDropActions)(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastAction));
+ [self changeDraggingCursor:operation];
+ return operation;
+ }
// send drag move event to the widget
QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) = nsActions;
Qt::DropActions qtAllowed = QT_PREPEND_NAMESPACE(qt_mac_mapNSDragOperations)(nsActions);
@@ -373,6 +402,7 @@ static int qCocoaViewCount = 0;
qDMEvent.setDropAction(Qt::IgnoreAction);
}
qt_mac_copy_answer_rect(qDMEvent);
+ [self changeDraggingCursor:operation];
return operation;
}
@@ -388,6 +418,8 @@ static int qCocoaViewCount = 0;
QApplication::sendEvent(qwidget, &de);
[self removeDropData];
}
+ [self changeDraggingCursor:NSDragOperationEvery];
+
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 33aaa24f8b..b6b63ca3ca 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -106,6 +106,7 @@ Q_GUI_EXPORT
- (void) qt_clearQWidget;
- (BOOL)qt_leftButtonIsRightButton;
- (void)qt_setLeftButtonIsRightButton:(BOOL)isSwapped;
+- (void)changeDraggingCursor:(NSDragOperation)newOperation;
+ (DnDParams*)currentMouseEvent;
@end
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 82644220d8..de80f86bad 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -41,6 +41,7 @@
#include "qgesture.h"
#include "private/qgesture_p.h"
+#include "private/qstandardgestures_p.h"
#ifndef QT_NO_GESTURES
@@ -744,6 +745,34 @@ void QTapAndHoldGesture::setPosition(const QPointF &value)
d_func()->position = value;
}
+/*!
+ Set the timeout, in milliseconds, before the gesture triggers.
+
+ The recognizer will detect a touch down and and if \a msecs
+ later the touch is still down, it will trigger the QTapAndHoldGesture.
+ The default value is 700 milliseconds.
+*/
+// static
+void QTapAndHoldGesture::setTimeout(int msecs)
+{
+ QTapAndHoldGesturePrivate::Timeout = msecs;
+}
+
+/*!
+ Gets the timeout, in milliseconds, before the gesture triggers.
+
+ The recognizer will detect a touch down and and if timeout()
+ later the touch is still down, it will trigger the QTapAndHoldGesture.
+ The default value is 700 milliseconds.
+*/
+// static
+int QTapAndHoldGesture::timeout()
+{
+ return QTapAndHoldGesturePrivate::Timeout;
+}
+
+int QTapAndHoldGesturePrivate::Timeout = 700; // in ms
+
QT_END_NAMESPACE
#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 8c10895140..8f410b17e6 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -252,6 +252,9 @@ public:
QPointF position() const;
void setPosition(const QPointF &pos);
+ static void setTimeout(int msecs);
+ static int timeout();
+
friend class QTapAndHoldGestureRecognizer;
};
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index f5474c1fe4..29b923e156 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -177,6 +177,7 @@ public:
QPointF position;
int timerId;
+ static int Timeout;
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index e43a560503..fe9dd8af6c 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -71,7 +71,7 @@
QT_BEGIN_NAMESPACE
QGestureManager::QGestureManager(QObject *parent)
- : QObject(parent), state(NotGesture), m_lastCustomGestureId(0)
+ : QObject(parent), state(NotGesture), m_lastCustomGestureId(Qt::CustomGesture)
{
qRegisterMetaType<Qt::GestureState>();
@@ -119,7 +119,7 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
if (type == Qt::CustomGesture) {
// generate a new custom gesture id
++m_lastCustomGestureId;
- type = Qt::GestureType(Qt::CustomGesture + m_lastCustomGestureId);
+ type = Qt::GestureType(m_lastCustomGestureId);
}
m_recognizers.insertMulti(type, recognizer);
delete dummy;
diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index f5004b09ff..377dfe3187 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -76,6 +76,10 @@ struct AygSIPINFO
#define SHIDIF_SIZEDLGFULLSCREEN 0x0004
#endif
+#ifndef SHDB_HIDE
+#define SHDB_HIDE 0x0002
+#endif
+
#ifndef SHFS_SHOWTASKBAR
#define SHFS_SHOWTASKBAR 0x0001
#endif
@@ -112,10 +116,12 @@ struct AygSIPINFO
typedef BOOL (*AygInitDialog)(AygSHINITDLGINFO*);
typedef BOOL (*AygFullScreen)(HWND, DWORD);
typedef BOOL (*AygSHSipInfo)(UINT, UINT, PVOID, UINT);
+typedef BOOL (*AygSHDoneButton)(HWND, DWORD);
static AygInitDialog ptrAygInitDialog = 0;
static AygFullScreen ptrAygFullScreen = 0;
static AygSHSipInfo ptrAygSHSipInfo = 0;
+static AygSHDoneButton ptrAygSHDoneButton = 0;
static bool aygResolved = false;
static void resolveAygLibs()
@@ -128,18 +134,10 @@ static void resolveAygLibs()
ptrAygInitDialog = (AygInitDialog) ayglib.resolve("SHInitDialog");
ptrAygFullScreen = (AygFullScreen) ayglib.resolve("SHFullScreen");
ptrAygSHSipInfo = (AygSHSipInfo) ayglib.resolve("SHSipInfo");
+ ptrAygSHDoneButton = (AygSHDoneButton) ayglib.resolve("SHDoneButton");
}
}
-struct DIBINFO : public BITMAPINFO
-{
- RGBQUAD arColors[255];
-
- operator LPBITMAPINFO() { return (LPBITMAPINFO) this; }
- operator LPBITMAPINFOHEADER() { return &bmiHeader; }
- RGBQUAD* ColorTable() { return bmiColors; }
-};
-
int qt_wince_GetDIBits(HDC /*hdc*/ , HBITMAP hSourceBitmap, uint, uint, LPVOID lpvBits, LPBITMAPINFO, uint)
{
if (!lpvBits) {
@@ -323,6 +321,8 @@ void qt_wince_maximize(QWidget *widget)
shidi.dwFlags |= SHIDIF_CANCELBUTTON;
if (widget->windowFlags() & Qt::WindowOkButtonHint)
shidi.dwFlags |= SHIDIF_DONEBUTTON;
+ if (!(widget->windowFlags() & (Qt::WindowCancelButtonHint | Qt::WindowOkButtonHint)))
+ shidi.dwFlags |= SHIDIF_CANCELBUTTON;
resolveAygLibs();
if (ptrAygInitDialog)
ptrAygInitDialog(&shidi);
@@ -334,6 +334,16 @@ void qt_wince_maximize(QWidget *widget)
}
}
+void qt_wince_unmaximize(QWidget *widget)
+{
+ if (ptrAygSHDoneButton && qt_wince_is_mobile()
+ && !(widget->windowFlags() & (Qt::WindowCancelButtonHint | Qt::WindowOkButtonHint)))
+ {
+ // Hide the [X] button, we've added in qt_wince_maximize.
+ ptrAygSHDoneButton(widget->winId(), SHDB_HIDE);
+ }
+}
+
void qt_wince_minimize(HWND hwnd)
{
#ifdef Q_OS_WINCE_WM
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 62d8a5390d..e05f8ccec8 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -517,7 +517,6 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
- enum { TimerInterval = 2000 };
enum { TapRadius = 40 };
switch (event->type()) {
@@ -526,21 +525,21 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
q->setHotSpot(d->position);
if (d->timerId)
q->killTimer(d->timerId);
- d->timerId = q->startTimer(TimerInterval);
+ d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
case QEvent::MouseButtonPress:
d->position = me->globalPos();
q->setHotSpot(d->position);
if (d->timerId)
q->killTimer(d->timerId);
- d->timerId = q->startTimer(TimerInterval);
+ d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
case QEvent::TouchBegin:
d->position = ev->touchPoints().at(0).startScreenPos();
q->setHotSpot(d->position);
if (d->timerId)
q->killTimer(d->timerId);
- d->timerId = q->startTimer(TimerInterval);
+ d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
case QEvent::GraphicsSceneMouseRelease:
case QEvent::MouseButtonRelease:
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 233df15dce..fed8d0a309 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -338,8 +338,10 @@ QInputContext *QWidgetPrivate::inputContext() const
#ifndef QT_NO_IM
if (ic)
return ic;
-#endif
return qApp->inputContext();
+#else
+ return 0;
+#endif
}
/*!
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index e57ec77177..c7887113f9 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4389,6 +4389,13 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM
data.window_state = data.window_state & ~Qt::WindowMaximized;
const bool visible = q->isVisible();
+ // Apply size restrictions, applicable for Windows & Widgets.
+ if (QWExtra *extra = extraData()) {
+ w = qMin(w, extra->maxw);
+ h = qMin(h, extra->maxh);
+ w = qMax(w, extra->minw);
+ h = qMax(h, extra->minh);
+ }
data.crect = QRect(x, y, w, h);
if (realWindow) {
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 0f05c6b694..23f57dad24 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -70,6 +70,7 @@
#include "qguifunctions_wince.h"
QT_USE_NAMESPACE
extern void qt_wince_maximize(QWidget *widget); //defined in qguifunctions_wince.cpp
+extern void qt_wince_unmaximize(QWidget *widget); //defined in qguifunctions_wince.cpp
extern void qt_wince_minimize(HWND hwnd); //defined in qguifunctions_wince.cpp
extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp
extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp
diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp
index fc1e52caf9..76532ed791 100644
--- a/src/gui/kernel/qwidget_wince.cpp
+++ b/src/gui/kernel/qwidget_wince.cpp
@@ -498,6 +498,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION;
SetWindowLong(internalWinId(), GWL_STYLE, style);
SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG);
+ qt_wince_unmaximize(this);
}
if (isVisible() && newstate & Qt::WindowMaximized)
qt_wince_maximize(this);
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index 4cfa93f88f..687e587365 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -2421,9 +2421,10 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include <QDebug>
QT_END_INCLUDE_NAMESPACE
+#if !defined(QT_NO_DEBUG_STREAM)
QDebug operator<<(QDebug debug, QStyle::State state)
{
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG)
debug << "QStyle::State(";
QStringList states;
@@ -2458,6 +2459,7 @@ QDebug operator<<(QDebug debug, QStyle::State state)
#endif
return debug;
}
+#endif
/*!
\since 4.6
diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h
index 439d62618a..439901a8f9 100644
--- a/src/gui/styles/qstyle.h
+++ b/src/gui/styles/qstyle.h
@@ -878,7 +878,9 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State)
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
+#if !defined(QT_NO_DEBUG_STREAM)
Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state);
+#endif
QT_END_NAMESPACE
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index c057a2b2ea..4780edfbc0 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -5419,9 +5419,10 @@ QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, T
Returns a T or 0 depending on the type of \a hint.
*/
+#if !defined(QT_NO_DEBUG_STREAM)
QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
{
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG)
switch (optionType) {
case QStyleOption::SO_Default:
debug << "SO_Default"; break;
@@ -5488,7 +5489,7 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
QDebug operator<<(QDebug debug, const QStyleOption &option)
{
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG)
debug << "QStyleOption(";
debug << QStyleOption::OptionType(option.type);
debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
@@ -5498,5 +5499,6 @@ QDebug operator<<(QDebug debug, const QStyleOption &option)
#endif
return debug;
}
+#endif
QT_END_NAMESPACE
diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h
index 95de8d50ac..e79d9a4203 100644
--- a/src/gui/styles/qstyleoption.h
+++ b/src/gui/styles/qstyleoption.h
@@ -958,8 +958,10 @@ T qstyleoption_cast(QStyleHintReturn *hint)
return 0;
}
+#if !defined(QT_NO_DEBUG_STREAM)
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType);
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option);
+#endif
QT_END_NAMESPACE
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index daa40a1aac..769ab2fb66 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1283,7 +1283,7 @@ void QTextCursor::setVisualNavigation(bool b)
/*!
\since 4.7
- Sets the visual x position for vertical cursor movements.
+ Sets the visual x position for vertical cursor movements to \a x.
The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept
unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a
@@ -1335,8 +1335,8 @@ bool QTextCursor::keepPositionOnInsert() const
Defines whether the cursor should keep its current position when text gets inserted at the current position of the
cursor.
- If \b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
- If \b is false, the cursor moves along with the inserted text.
+ If \a b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
+ If \a b is false, the cursor moves along with the inserted text.
The default is false.
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 8f31e4603a..9eeec0bfae 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -392,7 +392,12 @@ QList<QTextOption::Tab> QTextOption::tabs() const
/*!
\fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar())
- Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter
+
+ Creates a tab with the given position, tab type, and delimiter
+ (\a pos, \a tabType, \a delim).
+
+ \note \a delim is only used when \a tabType is DelimiterTab.
+
\since 4.7
*/
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 5100176bad..e3985cede9 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -754,19 +754,39 @@ void QTextTable::insertColumns(int pos, int num)
QTextFormatCollection *c = p->formatCollection();
p->beginEditBlock();
+ QList<int> extendedSpans;
for (int i = 0; i < d->nRows; ++i) {
int cell;
if (i == d->nRows - 1 && pos == d->nCols)
cell = d->fragment_end;
else
cell = d->grid[i*d->nCols + pos];
- QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
- QTextCharFormat fmt = c->charFormat(it->format);
if (pos > 0 && pos < d->nCols && cell == d->grid[i*d->nCols + pos - 1]) {
// cell spans the insertion place, extend it
- fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
- p->setCharFormat(it.position(), 1, fmt);
+ if (!extendedSpans.contains(cell)) {
+ QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+ QTextCharFormat fmt = c->charFormat(it->format);
+ fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
+ p->setCharFormat(it.position(), 1, fmt);
+ d->dirty = true;
+ extendedSpans << cell;
+ }
} else {
+ /* If the next cell is spanned from the row above, we need to find the right position
+ to insert to */
+ if (i > 0 && pos < d->nCols && cell == d->grid[(i-1) * d->nCols + pos]) {
+ int gridIndex = i*d->nCols + pos;
+ const int gridEnd = d->nRows * d->nCols - 1;
+ while (gridIndex < gridEnd && cell == d->grid[gridIndex]) {
+ ++gridIndex;
+ }
+ if (gridIndex == gridEnd)
+ cell = d->fragment_end;
+ else
+ cell = d->grid[gridIndex];
+ }
+ QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+ QTextCharFormat fmt = c->charFormat(it->format);
fmt.setTableCellRowSpan(1);
fmt.setTableCellColumnSpan(1);
Q_ASSERT(fmt.objectIndex() == objectIndex());
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 1abc2d9250..04d6de937f 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -154,6 +154,7 @@
#include "QtGui/qevent.h"
#include "QtGui/qheaderview.h"
#include "QtGui/qdesktopwidget.h"
+#include "QtGui/qlineedit.h"
QT_BEGIN_NAMESPACE
@@ -920,8 +921,9 @@ void QCompleterPrivate::showPopup(const QRect& rect)
void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path)
{
Q_Q(QCompleter);
+ QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
//the path given by QFileSystemModel does not end with /
- if (!q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
+ if (lineEdit && !lineEdit->text().isEmpty() && !q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
q->complete();
}
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index a7c445d498..8fe8a9fb25 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -158,6 +158,11 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
\brief The ParticleMotionLinear object moves particles linearly.
\sa Particles
+
+ This is the default motion, and moves the particles according to the
+ properties specified in the Particles element.
+
+ It has no further properties.
*/
/*!
@@ -178,6 +183,13 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
\since 4.7
\brief The ParticleMotionGravity object moves particles towards a point.
+ This motion attracts the particles to the specified point with the specified acceleration.
+ To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8.
+
+ The defaults are all 0, not earth gravity, and so no motion will occur without setting
+ at least the acceleration property.
+
+
\sa Particles
*/
@@ -186,6 +198,7 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
\class QDeclarativeParticleMotionGravity
\ingroup group_effects
\brief The QDeclarativeParticleMotionGravity class moves the particles towards a point.
+
*/
/*!
@@ -305,14 +318,14 @@ Rectangle {
*/
/*!
- \qmlproperty real QDeclarativeParticleMotionWander::xvariance
- \qmlproperty real QDeclarativeParticleMotionWander::yvariance
+ \qmlproperty real ParticleMotionWander::xvariance
+ \qmlproperty real ParticleMotionWander::yvariance
These properties set the amount to wander in the x and y directions.
*/
/*!
- \qmlproperty real QDeclarativeParticleMotionWander::pace
+ \qmlproperty real ParticleMotionWander::pace
This property holds how quickly the paricles will move from side to side.
*/
@@ -1232,7 +1245,7 @@ void QDeclarativeParticles::burst(int count, int emissionRate)
void QDeclarativeParticlesPainter::updateSize()
{
- if (!d->_componentComplete)
+ if (!d->componentComplete)
return;
const int parentX = parentItem()->x();
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 1afabecf74..9e2b85ed68 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -286,13 +286,8 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
resend = false;
//create the response header to be used with QAuthenticatorPrivate.
- QHttpResponseHeader responseHeader;
QList<QPair<QByteArray, QByteArray> > fields = reply->header();
- QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();
- while (it != fields.constEnd()) {
- responseHeader.addValue(QString::fromLatin1(it->first), QString::fromUtf8(it->second));
- it++;
- }
+
//find out the type of authentication protocol requested.
QAuthenticatorPrivate::Method authMethod = reply->d_func()->authenticationMethod(isProxy);
if (authMethod != QAuthenticatorPrivate::None) {
@@ -310,7 +305,7 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
if (auth->isNull())
auth->detach();
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(*auth);
- priv->parseHttpResponse(responseHeader, isProxy);
+ priv->parseHttpResponse(fields, isProxy);
if (priv->phase == QAuthenticatorPrivate::Done) {
if ((isProxy && pendingProxyAuthSignal) ||(!isProxy && pendingAuthSignal)) {
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index a6c5c02bfb..f617244b17 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -944,10 +944,10 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m
checkForRedirect(status);
- emit metaDataChanged();
-
- // invoke this asynchronously, else Arora/QtDemoBrowser don't like cached downloads
- // see task 250221 / 251801
+ // This needs to be emitted in the event loop because it can be reached at
+ // the direct code path of qnam.get(...) before the user has a chance
+ // to connect any signals.
+ QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);
qRegisterMetaType<QIODevice*>("QIODevice*");
QMetaObject::invokeMethod(this, "writeDownstreamData", Qt::QueuedConnection, Q_ARG(QIODevice*, contents));
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index bccfec1dd8..fa592c22c0 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -230,6 +230,14 @@ QT_BEGIN_NAMESPACE
\since 4.7
+ \omitvalue MaximumDownloadBufferSizeAttribute
+ \since 4.7
+ \internal
+
+ \omitvalue DownloadBufferAttribute
+ \since 4.7
+ \internal
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index d2945c40e6..cdadf0f69c 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -82,6 +82,8 @@ public:
CookieLoadControlAttribute,
AuthenticationReuseAttribute,
CookieSaveControlAttribute,
+ MaximumDownloadBufferSizeAttribute, // internal
+ DownloadBufferAttribute, // internal
User = 1000,
UserMax = 32767
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index e4023c843d..d61c6863ea 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -50,6 +50,8 @@
#include <qdatastream.h>
#include <qendian.h>
#include <qstring.h>
+#include <qdatetime.h>
+
QT_BEGIN_NAMESPACE
@@ -83,6 +85,44 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
Note that, in particular, NTLM version 2 is not supported.
+ \section1 Options
+
+ In addition to the username and password required for authentication, a
+ QAuthenticator object can also contain additional options. The
+ options() function can be used to query incoming options sent by
+ the server; the setOption() function can
+ be used to set outgoing options, to be processed by the authenticator
+ calculation. The options accepted and provided depend on the authentication
+ type (see method()).
+
+ The following tables list known incoming options as well as accepted
+ outgoing options. The list of incoming options is not exhaustive, since
+ servers may include additional information at any time. The list of
+ outgoing options is exhaustive, however, and no unknown options will be
+ treated or sent back to the server.
+
+ \section2 Basic
+
+ \table
+ \header \o Option \o Direction \o Description
+ \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+ \endtable
+
+ The Basic authentication mechanism supports no outgoing options.
+
+ \section2 NTLM version 1
+
+ The NTLM authentication mechanism currently supports no incoming or outgoing options.
+
+ \section2 Digest-MD5
+
+ \table
+ \header \o Option \o Direction \o Description
+ \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+ \endtable
+
+ The Digest-MD5 authentication mechanism supports no outgoing options.
+
\sa QSslSocket
*/
@@ -138,7 +178,8 @@ bool QAuthenticator::operator==(const QAuthenticator &other) const
return d->user == other.d->user
&& d->password == other.d->password
&& d->realm == other.d->realm
- && d->method == other.d->method;
+ && d->method == other.d->method
+ && d->options == other.d->options;
}
/*!
@@ -162,7 +203,18 @@ QString QAuthenticator::user() const
void QAuthenticator::setUser(const QString &user)
{
detach();
- d->user = user;
+
+ int separatorPosn = 0;
+ separatorPosn = user.indexOf(QLatin1String("\\"));
+
+ if (separatorPosn == -1) {
+ //No domain name present
+ d->user = user;
+ } else {
+ //domain name is present
+ d->realm = user.left(separatorPosn);
+ d->user = user.mid(separatorPosn+1);
+ }
}
/*!
@@ -205,9 +257,49 @@ QString QAuthenticator::realm() const
return d ? d->realm : QString();
}
+/*!
+ \since 4.7
+ Returns the value related to option \a opt if it was set by the server.
+ See \l{QAuthenticator#Options} for more information on incoming options.
+ If option \a opt isn't found, an invalid QVariant will be returned.
+
+ \sa options(), QAuthenticator#Options
+*/
+QVariant QAuthenticator::option(const QString &opt) const
+{
+ return d ? d->options.value(opt) : QVariant();
+}
/*!
- returns true if the authenticator is null.
+ \since 4.7
+ Returns all incoming options set in this QAuthenticator object by parsing
+ the server reply. See \l{QAuthenticator#Options} for more information
+ on incoming options.
+
+ \sa option(), QAuthenticator#Options
+*/
+QVariantHash QAuthenticator::options() const
+{
+ return d ? d->options : QVariantHash();
+}
+
+/*!
+ \since 4.7
+
+ Sets the outgoing option \a opt to value \a value.
+ See \l{QAuthenticator#Options} for more information on outgoing options.
+
+ \sa options(), option(), QAuthenticator#Options
+*/
+void QAuthenticator::setOption(const QString &opt, const QVariant &value)
+{
+ detach();
+ d->options.insert(opt, value);
+}
+
+
+/*!
+ Returns true if the authenticator is null.
*/
bool QAuthenticator::isNull() const
{
@@ -228,7 +320,20 @@ QAuthenticatorPrivate::QAuthenticatorPrivate()
#ifndef QT_NO_HTTP
void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header, bool isProxy)
{
- QList<QPair<QString, QString> > values = header.values();
+ const QList<QPair<QString, QString> > values = header.values();
+ QList<QPair<QByteArray, QByteArray> > rawValues;
+
+ QList<QPair<QString, QString> >::const_iterator it, end;
+ for (it = values.constBegin(), end = values.constEnd(); it != end; ++it)
+ rawValues.append(qMakePair(it->first.toLatin1(), it->second.toUtf8()));
+
+ // continue in byte array form
+ parseHttpResponse(rawValues, isProxy);
+}
+#endif
+
+void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray> > &values, bool isProxy)
+{
const char *search = isProxy ? "proxy-authenticate" : "www-authenticate";
method = None;
@@ -242,38 +347,40 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
authentication parameters.
*/
- QString headerVal;
+ QByteArray headerVal;
for (int i = 0; i < values.size(); ++i) {
- const QPair<QString, QString> &current = values.at(i);
- if (current.first.toLower() != QLatin1String(search))
+ const QPair<QByteArray, QByteArray> &current = values.at(i);
+ if (current.first.toLower() != search)
continue;
- QString str = current.second;
- if (method < Basic && str.startsWith(QLatin1String("Basic"), Qt::CaseInsensitive)) {
- method = Basic; headerVal = str.mid(6);
- } else if (method < Ntlm && str.startsWith(QLatin1String("NTLM"), Qt::CaseInsensitive)) {
+ QByteArray str = current.second.toLower();
+ if (method < Basic && str.startsWith("basic")) {
+ method = Basic;
+ headerVal = current.second.mid(6);
+ } else if (method < Ntlm && str.startsWith("ntlm")) {
method = Ntlm;
- headerVal = str.mid(5);
- } else if (method < DigestMd5 && str.startsWith(QLatin1String("Digest"), Qt::CaseInsensitive)) {
+ headerVal = current.second.mid(5);
+ } else if (method < DigestMd5 && str.startsWith("digest")) {
method = DigestMd5;
- headerVal = str.mid(7);
+ headerVal = current.second.mid(7);
}
}
- challenge = headerVal.trimmed().toLatin1();
+ challenge = headerVal.trimmed();
QHash<QByteArray, QByteArray> options = parseDigestAuthenticationChallenge(challenge);
switch(method) {
case Basic:
- realm = QString::fromLatin1(options.value("realm"));
+ if(realm.isEmpty())
+ this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
if (user.isEmpty())
phase = Done;
break;
case Ntlm:
// #### extract from header
- realm.clear();
break;
case DigestMd5: {
- realm = QString::fromLatin1(options.value("realm"));
+ if(realm.isEmpty())
+ this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
if (options.value("stale").toLower() == "true")
phase = Start;
if (user.isEmpty())
@@ -286,7 +393,6 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
phase = Invalid;
}
}
-#endif
QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path)
{
@@ -661,6 +767,20 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge,
*/
#define NTLMSSP_NEGOTIATE_56 0x80000000
+/*
+ * AvId values
+ */
+#define AVTIMESTAMP 7
+
+//#define NTLMV1_CLIENT
+
+
+//************************Global variables***************************
+
+const int blockSize = 64; //As per RFC2104 Block-size is 512 bits
+const int nDigestLen = 16; //Trunctaion Length of the Hmac-Md5 digest
+const quint8 respversion = 1;
+const quint8 hirespversion = 1;
/* usage:
// fill up ctx with what we know.
@@ -803,6 +923,7 @@ public:
// extracted
QString targetNameStr, targetInfoStr;
+ QByteArray targetInfoBuff;
};
@@ -818,6 +939,7 @@ public:
// extracted
QByteArray lmResponseBuf, ntlmResponseBuf;
QString domainStr, userStr, workstationStr, sessionKeyStr;
+ QByteArray v2Hash;
};
@@ -899,7 +1021,7 @@ static QString qStringFromUcs2Le(const QByteArray& src)
return QString((const QChar *)src.data(), src.size()/2);
}
-
+#ifdef NTLMV1_CLIENT
static QByteArray qEncodeNtlmResponse(const QAuthenticatorPrivate *ctx, const QNtlmPhase2Block& ch)
{
QCryptographicHash md4(QCryptographicHash::Md4);
@@ -941,7 +1063,232 @@ static QByteArray qEncodeLmResponse(const QAuthenticatorPrivate *ctx, const QNtl
hash.fill(0);
return rc;
}
+#endif
+
+/*********************************************************************
+* Function Name: qEncodeHmacMd5
+* Params:
+* key: Type - QByteArray
+* - It is the Authentication key
+* message: Type - QByteArray
+* - This is the actual message which will be encoded
+* using HMacMd5 hash algorithm
+*
+* Return Value:
+* hmacDigest: Type - QByteArray
+*
+* Description:
+* This function will be used to encode the input message using
+* HMacMd5 hash algorithm.
+*
+* As per the RFC2104 the HMacMd5 algorithm can be specified
+* ---------------------------------------
+* MD5(K XOR opad, MD5(K XOR ipad, text))
+* ---------------------------------------
+*
+*********************************************************************/
+QByteArray qEncodeHmacMd5(QByteArray &key, const QByteArray &message)
+{
+ Q_ASSERT_X(!(message.isEmpty()),"qEncodeHmacMd5", "Empty message check");
+ Q_ASSERT_X(!(key.isEmpty()),"qEncodeHmacMd5", "Empty key check");
+
+ QCryptographicHash hash(QCryptographicHash::Md5);
+ QByteArray hMsg;
+
+ QByteArray iKeyPad(blockSize, 0x36);
+ QByteArray oKeyPad(blockSize, 0x5c);
+
+ hash.reset();
+ // Adjust the key length to blockSize
+
+ if(blockSize < key.length()) {
+ hash.addData(key);
+ key = hash.result(); //MD5 will always return 16 bytes length output
+ }
+
+ //Key will be <= 16 or 20 bytes as hash function (MD5 or SHA hash algorithms)
+ //key size can be max of Block size only
+ key = key.leftJustified(blockSize,0,true);
+
+ //iKeyPad, oKeyPad and key are all of same size "blockSize"
+
+ //xor of iKeyPad with Key and store the result into iKeyPad
+ for(int i = 0; i<key.size();i++) {
+ iKeyPad[i] = key[i]^iKeyPad[i];
+ }
+
+ //xor of oKeyPad with Key and store the result into oKeyPad
+ for(int i = 0; i<key.size();i++) {
+ oKeyPad[i] = key[i]^oKeyPad[i];
+ }
+
+ iKeyPad.append(message); // (K0 xor ipad) || text
+
+ hash.reset();
+ hash.addData(iKeyPad);
+ hMsg = hash.result();
+ //Digest gen after pass-1: H((K0 xor ipad)||text)
+
+ QByteArray hmacDigest;
+ oKeyPad.append(hMsg);
+ hash.reset();
+ hash.addData(oKeyPad);
+ hmacDigest = hash.result();
+ // H((K0 xor opad )|| H((K0 xor ipad) || text))
+
+ /*hmacDigest should not be less than half the length of the HMAC output
+ (to match the birthday attack bound) and not less than 80 bits
+ (a suitable lower bound on the number of bits that need to be
+ predicted by an attacker).
+ Refer RFC 2104 for more details on truncation part */
+
+ /*MD5 hash always returns 16 byte digest only and HMAC-MD5 spec
+ (RFC 2104) also says digest length should be 16 bytes*/
+ return hmacDigest;
+}
+
+static QByteArray qCreatev2Hash(const QAuthenticatorPrivate *ctx,
+ QNtlmPhase3Block *phase3)
+{
+ Q_ASSERT(phase3 != 0);
+ // since v2 Hash is need for both NTLMv2 and LMv2 it is calculated
+ // only once and stored and reused
+ if(phase3->v2Hash.size() == 0) {
+ QCryptographicHash md4(QCryptographicHash::Md4);
+ QByteArray passUnicode = qStringAsUcs2Le(ctx->password);
+ md4.addData(passUnicode.data(), passUnicode.size());
+
+ QByteArray hashKey = md4.result();
+ Q_ASSERT(hashKey.size() == 16);
+ // Assuming the user and domain is always unicode in challenge
+ QByteArray message =
+ qStringAsUcs2Le(ctx->user.toUpper()) +
+ qStringAsUcs2Le(ctx->realm);
+
+ phase3->v2Hash = qEncodeHmacMd5(hashKey, message);
+ }
+ return phase3->v2Hash;
+}
+
+static QByteArray clientChallenge(const QAuthenticatorPrivate *ctx)
+{
+ Q_ASSERT(ctx->cnonce.size() >= 8);
+ QByteArray clientCh = ctx->cnonce.right(8);
+ return clientCh;
+}
+
+// caller has to ensure a valid targetInfoBuff
+static bool qExtractServerTime(const QByteArray& targetInfoBuff,
+ quint64 *serverTime)
+{
+ Q_ASSERT(serverTime != 0);
+ bool retValue = false;
+ QDataStream ds(targetInfoBuff);
+ ds.setByteOrder(QDataStream::LittleEndian);
+
+ quint16 avId;
+ quint16 avLen;
+
+ ds >> avId;
+ ds >> avLen;
+ while(avId != 0) {
+ if(avId == AVTIMESTAMP) {
+ QByteArray timeArray(avLen, 0);
+ //avLen size of QByteArray is allocated
+ ds.readRawData(timeArray.data(), avLen);
+ bool ok;
+ *serverTime = timeArray.toHex().toLongLong(&ok, 16);
+ retValue = true;
+ break;
+ }
+ ds.skipRawData(avLen);
+ ds >> avId;
+ ds >> avLen;
+ }
+ return retValue;
+}
+
+static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx,
+ const QNtlmPhase2Block& ch,
+ QNtlmPhase3Block *phase3)
+{
+ Q_ASSERT(phase3 != 0);
+ // return value stored in phase3
+ qCreatev2Hash(ctx, phase3);
+
+ QByteArray temp;
+ QDataStream ds(&temp, QIODevice::WriteOnly);
+ ds.setByteOrder(QDataStream::LittleEndian);
+
+ ds << respversion;
+ ds << hirespversion;
+ //Reserved
+ QByteArray reserved1(6, 0);
+ ds.writeRawData(reserved1.constData(), reserved1.size());
+
+ quint64 time = 0;
+
+ //if server sends time, use it instead of current time
+ if(!(ch.targetInfo.len && qExtractServerTime(ch.targetInfoBuff, &time))) {
+ QDateTime currentTime(QDate::currentDate(),
+ QTime::currentTime(), Qt::UTC);
+
+ // number of seconds between 1601 and epoc(1970)
+ // 369 years, 89 leap years
+ // ((369 * 365) + 89) * 24 * 3600 = 11644473600
+
+ time = Q_UINT64_C(currentTime.toTime_t() + 11644473600);
+
+ // represented as 100 nano seconds
+ time = Q_UINT64_C(time * 10000000);
+ }
+ ds << time;
+
+ //8 byte client challenge
+ QByteArray clientCh = clientChallenge(ctx);
+ ds.writeRawData(clientCh.constData(), clientCh.size());
+
+ //Reserved
+ QByteArray reserved2(4, 0);
+ ds.writeRawData(reserved2.constData(), reserved2.size());
+
+ if (ch.targetInfo.len > 0) {
+ ds.writeRawData(ch.targetInfoBuff.constData(),
+ ch.targetInfoBuff.size());
+ }
+
+ //Reserved
+ QByteArray reserved3(4, 0);
+ ds.writeRawData(reserved3.constData(), reserved3.size());
+
+ QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));
+ message.append(temp);
+
+ QByteArray ntChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);
+ ntChallengeResp.append(temp);
+
+ return ntChallengeResp;
+}
+
+static QByteArray qEncodeLmv2Response(const QAuthenticatorPrivate *ctx,
+ const QNtlmPhase2Block& ch,
+ QNtlmPhase3Block *phase3)
+{
+ Q_ASSERT(phase3 != 0);
+ // return value stored in phase3
+ qCreatev2Hash(ctx, phase3);
+
+ QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));
+ QByteArray clientCh = clientChallenge(ctx);
+
+ message.append(clientCh);
+
+ QByteArray lmChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);
+ lmChallengeResp.append(clientCh);
+
+ return lmChallengeResp;
+}
static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)
{
@@ -976,7 +1323,10 @@ static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)
}
if (ch.targetInfo.len > 0) {
- // UNUSED right now
+ if (ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size())
+ return false;
+
+ ch.targetInfoBuff = data.mid(ch.targetInfo.offset, ch.targetInfo.len);
}
return true;
@@ -996,7 +1346,8 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE;
- ctx->realm = ch.targetNameStr;
+ if(ctx->realm.isEmpty())
+ ctx->realm = ch.targetNameStr;
pb.flags = NTLMSSP_NEGOTIATE_NTLM;
if (unicode)
@@ -1010,6 +1361,7 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
offset = qEncodeNtlmString(pb.domain, offset, ctx->realm, unicode);
pb.domainStr = ctx->realm;
+
offset = qEncodeNtlmString(pb.user, offset, ctx->user, unicode);
pb.userStr = ctx->user;
@@ -1017,11 +1369,23 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
pb.workstationStr = ctx->workstation;
// Get LM response
+#ifdef NTLMV1_CLIENT
pb.lmResponseBuf = qEncodeLmResponse(ctx, ch);
+#else
+ if (ch.targetInfo.len > 0) {
+ pb.lmResponseBuf = QByteArray();
+ } else {
+ pb.lmResponseBuf = qEncodeLmv2Response(ctx, ch, &pb);
+ }
+#endif
offset = qEncodeNtlmBuffer(pb.lmResponse, offset, pb.lmResponseBuf);
// Get NTLM response
+#ifdef NTLMV1_CLIENT
pb.ntlmResponseBuf = qEncodeNtlmResponse(ctx, ch);
+#else
+ pb.ntlmResponseBuf = qEncodeNtlmv2Response(ctx, ch, &pb);
+#endif
offset = qEncodeNtlmBuffer(pb.ntlmResponse, offset, pb.ntlmResponseBuf);
diff --git a/src/network/kernel/qauthenticator.h b/src/network/kernel/qauthenticator.h
index 13ce593496..983b7c0214 100644
--- a/src/network/kernel/qauthenticator.h
+++ b/src/network/kernel/qauthenticator.h
@@ -43,6 +43,7 @@
#define QAUTHENTICATOR_H
#include <QtCore/qstring.h>
+#include <QtCore/qvariant.h>
QT_BEGIN_HEADER
@@ -73,6 +74,10 @@ public:
QString realm() const;
+ QVariant option(const QString &opt) const;
+ QVariantHash options() const;
+ void setOption(const QString &opt, const QVariant &value);
+
bool isNull() const;
void detach();
private:
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index e9ce9ac161..10966014b9 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -57,12 +57,13 @@
#include <qbytearray.h>
#include <qstring.h>
#include <qauthenticator.h>
+#include <qvariant.h>
QT_BEGIN_NAMESPACE
class QHttpResponseHeader;
-class QAuthenticatorPrivate
+class Q_AUTOTEST_EXPORT QAuthenticatorPrivate
{
public:
enum Method { None, Basic, Plain, Login, Ntlm, CramMd5, DigestMd5 };
@@ -71,7 +72,7 @@ public:
QAtomicInt ref;
QString user;
QString password;
- QHash<QByteArray, QByteArray> options;
+ QVariantHash options;
Method method;
QString realm;
QByteArray challenge;
@@ -102,6 +103,7 @@ public:
#ifndef QT_NO_HTTP
void parseHttpResponse(const QHttpResponseHeader &, bool isProxy);
#endif
+ void parseHttpResponse(const QList<QPair<QByteArray, QByteArray> >&, bool isProxy);
};
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 5ae3accb23..0bacf9095e 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -428,9 +428,9 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot
QHostAddress is normally used with the QTcpSocket, QTcpServer,
and QUdpSocket to connect to a host or to set up a server.
- A host address is set with setAddress(), checked for its type
- using isIPv4Address() or isIPv6Address(), and retrieved with
- toIPv4Address(), toIPv6Address(), or toString().
+ A host address is set with setAddress(), and retrieved with
+ toIPv4Address(), toIPv6Address(), or toString(). You can check the
+ type with protocol().
\note Please note that QHostAddress does not do DNS lookups.
QHostInfo is needed for that.
@@ -679,7 +679,8 @@ void QHostAddress::setAddress(const struct sockaddr *sockaddr)
For example, if the address is 127.0.0.1, the returned value is
2130706433 (i.e. 0x7f000001).
- This value is only valid if isIp4Addr() returns true.
+ This value is only valid if the Protocol() is
+ \l{QAbstractSocket::}{IPv4Protocol}.
\sa toString()
*/
@@ -704,7 +705,8 @@ QAbstractSocket::NetworkLayerProtocol QHostAddress::protocol() const
\snippet doc/src/snippets/code/src_network_kernel_qhostaddress.cpp 0
- This value is only valid if isIPv6Address() returns true.
+ This value is only valid if the protocol() is
+ \l{QAbstractSocket::}{IPv6Protocol}.
\sa toString()
*/
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index 55f926d3f9..0640c7cccd 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -577,7 +577,7 @@ void QTcpServer::incomingConnection(int socketDescriptor)
/*!
This function is called by QTcpServer::incomingConnection()
- to add a socket to the list of pending incoming connections.
+ to add the \a socket to the list of pending incoming connections.
\note Don't forget to call this member from reimplemented
incomingConnection() if you do not want to break the
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index f85fa8449b..f73068eb8b 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -574,7 +574,7 @@ void QSslSocket::setProtocol(QSsl::SslProtocol protocol)
certificate is valid.
The default mode is AutoVerifyPeer, which tells QSslSocket to use
- VerifyPeer for clients, QueryPeer for clients.
+ VerifyPeer for clients and QueryPeer for servers.
\sa setPeerVerifyMode(), peerVerifyDepth(), mode()
*/
@@ -594,7 +594,7 @@ QSslSocket::PeerVerifyMode QSslSocket::peerVerifyMode() const
certificate is valid.
The default mode is AutoVerifyPeer, which tells QSslSocket to use
- VerifyPeer for clients, QueryPeer for clients.
+ VerifyPeer for clients and QueryPeer for servers.
Setting this mode after encryption has started has no effect on the
current connection.
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 1d794ae624..c297eea54b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -475,27 +475,12 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
{
+ QMutexLocker locker(openssl_locks()->initLock());
if (s_loadedCiphersAndCerts)
return;
s_loadedCiphersAndCerts = true;
resetDefaultCiphers();
- setDefaultCaCertificates(systemCaCertificates());
-}
-
-/*!
- \internal
-
- Declared static in QSslSocketPrivate, makes sure the SSL libraries have
- been initialized.
-*/
-
-void QSslSocketPrivate::ensureInitialized()
-{
- if (!supportsSsl())
- return;
-
- ensureCiphersAndCertsLoaded();
//load symbols needed to receive certificates from system store
#if defined(Q_OS_MAC)
@@ -532,6 +517,22 @@ void QSslSocketPrivate::ensureInitialized()
qWarning("could not load crypt32 library"); // should never happen
}
#endif
+ setDefaultCaCertificates(systemCaCertificates());
+}
+
+/*!
+ \internal
+
+ Declared static in QSslSocketPrivate, makes sure the SSL libraries have
+ been initialized.
+*/
+
+void QSslSocketPrivate::ensureInitialized()
+{
+ if (!supportsSsl())
+ return;
+
+ ensureCiphersAndCertsLoaded();
}
/*!
@@ -970,8 +971,20 @@ void QSslSocketBackendPrivate::transmit()
#endif
plainSocket->disconnectFromHost();
break;
+ case SSL_ERROR_SYSCALL: // some IO error
+ case SSL_ERROR_SSL: // error in the SSL library
+ // we do not know exactly what the error is, nor whether we can recover from it,
+ // so just return to prevent an endless loop in the outer "while" statement
+ q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+ q->setSocketError(QAbstractSocket::UnknownSocketError);
+ emit q->error(QAbstractSocket::UnknownSocketError);
+ return;
default:
- // ### Handle errors better.
+ // SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT: can only happen with a
+ // BIO_s_connect() or BIO_s_accept(), which we do not call.
+ // SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
+ // SSL_CTX_set_client_cert_cb(), which we do not call.
+ // So this default case should never be triggered.
q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
@@ -1105,17 +1118,16 @@ bool QSslSocketBackendPrivate::startHandshake()
QString peerName = (verificationPeerName.isEmpty () ? q->peerName() : verificationPeerName);
QString commonName = configuration.peerCertificate.subjectInfo(QSslCertificate::CommonName);
- QRegExp regexp(commonName, Qt::CaseInsensitive, QRegExp::Wildcard);
- if (!regexp.exactMatch(peerName)) {
+ if (!isMatchingHostname(commonName.toLower(), peerName.toLower())) {
bool matched = false;
foreach (const QString &altName, configuration.peerCertificate
.alternateSubjectNames().values(QSsl::DnsEntry)) {
- regexp.setPattern(altName);
- if (regexp.exactMatch(peerName)) {
+ if (isMatchingHostname(altName.toLower(), peerName.toLower())) {
matched = true;
break;
}
}
+
if (!matched) {
// No matches in common names or alternate names.
QSslError error(QSslError::HostNameMismatch, configuration.peerCertificate);
@@ -1245,4 +1257,39 @@ QList<QSslCertificate> QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates
return certificates;
}
+bool QSslSocketBackendPrivate::isMatchingHostname(const QString &cn, const QString &hostname)
+{
+ int wildcard = cn.indexOf(QLatin1Char('*'));
+
+ // Check this is a wildcard cert, if not then just compare the strings
+ if (wildcard < 0)
+ return cn == hostname;
+
+ int firstCnDot = cn.indexOf(QLatin1Char('.'));
+ int secondCnDot = cn.indexOf(QLatin1Char('.'), firstCnDot+1);
+
+ // Check at least 3 components
+ if ((-1 == secondCnDot) || (secondCnDot+1 >= cn.length()))
+ return false;
+
+ // Check * is last character of 1st component (ie. there's a following .)
+ if (wildcard+1 != firstCnDot)
+ return false;
+
+ // Check only one star
+ if (cn.lastIndexOf(QLatin1Char('*')) != wildcard)
+ return false;
+
+ // Check characters preceding * (if any) match
+ if (wildcard && (hostname.leftRef(wildcard) != cn.leftRef(wildcard)))
+ return false;
+
+ // Check characters following first . match
+ if (hostname.midRef(hostname.indexOf(QLatin1Char('.'))) != cn.midRef(firstCnDot))
+ return false;
+
+ // Ok, I guess this was a wildcard CN and the hostname matches.
+ return true;
+}
+
QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index 987dfae6f6..7a4e6b6e04 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -116,6 +116,7 @@ public:
static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher);
static QList<QSslCertificate> STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509);
+ Q_AUTOTEST_EXPORT static bool isMatchingHostname(const QString &cn, const QString &hostname);
};
#if defined(Q_OS_SYMBIAN)
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index ee49a3d00c..d3f6a295e4 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1128,7 +1128,7 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
d->fill(path);
}
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+extern Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index fc28a73202..2fa33bf0c7 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1334,6 +1334,10 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
\value OpenGL_Version_3_2 OpenGL version 3.2 or higher is present.
+ \value OpenGL_Version_3_3 OpenGL version 3.3 or higher is present.
+
+ \value OpenGL_Version_4_0 OpenGL version 4.0 or higher is present.
+
\value OpenGL_ES_CommonLite_Version_1_0 OpenGL ES version 1.0 Common Lite or higher is present.
\value OpenGL_ES_Common_Version_1_0 OpenGL ES version 1.0 Common or higher is present.
@@ -5037,8 +5041,9 @@ void QGLWidget::deleteTexture(QMacCompatGLuint id)
/*!
\since 4.4
- Calls the corresponding QGLContext::drawTexture() on
- this widget's context.
+ Calls the corresponding QGLContext::drawTexture() with
+ \a target, \a textureId, and \a textureTarget for this
+ widget's context.
*/
void QGLWidget::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget)
{
@@ -5058,8 +5063,9 @@ void QGLWidget::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QM
/*!
\since 4.4
- Calls the corresponding QGLContext::drawTexture() on
- this widget's context.
+ Calls the corresponding QGLContext::drawTexture() with
+ \a point, \a textureId, and \a textureTarget for this
+ widget's context.
*/
void QGLWidget::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget)
{
diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index 5223beb96f..e053f3756b 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -1,10 +1,6 @@
-TARGET = qsqldb2
+TARGET = qsqldb2
-HEADERS = ../../../sql/drivers/db2/qsql_db2.h
-SOURCES = main.cpp \
- ../../../sql/drivers/db2/qsql_db2.cpp
-
-unix:!contains( LIBS, .*db2.* ):LIBS *= -ldb2
-win32:!contains( LIBS, .*db2.* ):LIBS *= -ldb2cli
+SOURCES = main.cpp
+include(../../../sql/drivers/db2/qsql_db2.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro
index ec2bc7b987..7870ec8465 100644
--- a/src/plugins/sqldrivers/ibase/ibase.pro
+++ b/src/plugins/sqldrivers/ibase/ibase.pro
@@ -1,14 +1,6 @@
-TARGET = qsqlibase
+TARGET = qsqlibase
-HEADERS = ../../../sql/drivers/ibase/qsql_ibase.h
-SOURCES = main.cpp \
- ../../../sql/drivers/ibase/qsql_ibase.cpp
-
-unix:!contains( LIBS, .*gds.* ):!contains( LIBS, .*libfb.* ):LIBS *= -lgds
-
-win32:!contains( LIBS, .*gds.* ):!contains( LIBS, .*fbclient.* ) {
- !win32-borland:LIBS *= -lgds32_ms
- win32-borland:LIBS += gds32.lib
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/ibase/qsql_ibase.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro
index 9f5c619e19..b6d42fffc8 100644
--- a/src/plugins/sqldrivers/mysql/mysql.pro
+++ b/src/plugins/sqldrivers/mysql/mysql.pro
@@ -1,23 +1,6 @@
-TARGET = qsqlmysql
+TARGET = qsqlmysql
-HEADERS = ../../../sql/drivers/mysql/qsql_mysql.h
-SOURCES = main.cpp \
- ../../../sql/drivers/mysql/qsql_mysql.cpp
-
-unix: {
- isEmpty(QT_LFLAGS_MYSQL) {
- !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
- use_libmysqlclient_r:LIBS *= -lmysqlclient_r
- else:LIBS *= -lmysqlclient
- }
- } else {
- LIBS *= $$QT_LFLAGS_MYSQL
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
- }
-}
-
-win32:!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*) {
- LIBS *= -llibmysql
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/mysql/qsql_mysql.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro
index 3bf70a13f9..d7dcce9e35 100644
--- a/src/plugins/sqldrivers/oci/oci.pro
+++ b/src/plugins/sqldrivers/oci/oci.pro
@@ -1,13 +1,6 @@
-TARGET = qsqloci
+TARGET = qsqloci
-HEADERS = ../../../sql/drivers/oci/qsql_oci.h
-SOURCES = main.cpp \
- ../../../sql/drivers/oci/qsql_oci.cpp
-
-win32:LIBS *= -loci
-
-unix:!contains( LIBS, .*clnts.* ):LIBS *= -lclntsh
-
-macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
+SOURCES = main.cpp
+include(../../../sql/drivers/oci/qsql_oci.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 2bf85f1f7e..677eb6eedf 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -1,19 +1,6 @@
-TARGET = qsqlodbc
+TARGET = qsqlodbc
-HEADERS = ../../../sql/drivers/odbc/qsql_odbc.h
-SOURCES = main.cpp \
- ../../../sql/drivers/odbc/qsql_odbc.cpp
-
-unix {
- !contains( LIBS, .*odbc.* ) {
- LIBS *= $$QT_LFLAGS_ODBC
- }
- DEFINES += UNICODE
-}
-
-win32 {
- !win32-borland:LIBS *= -lodbc32
- win32-borland:LIBS *= $(BCB)/lib/PSDK/odbc32.lib
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/odbc/qsql_odbc.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro
index 80a5348f5e..8276c0ae90 100644
--- a/src/plugins/sqldrivers/psql/psql.pro
+++ b/src/plugins/sqldrivers/psql/psql.pro
@@ -1,18 +1,6 @@
-TARGET = qsqlpsql
+TARGET = qsqlpsql
-HEADERS = ../../../sql/drivers/psql/qsql_psql.h
-SOURCES = main.cpp \
- ../../../sql/drivers/psql/qsql_psql.cpp
-
-unix|win32-g++*: {
- !isEmpty(QT_LFLAGS_PSQL) {
- !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
- !static:LIBS *= $$QT_LFLAGS_PSQL
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
- }
- !contains(LIBS, .*pq.*):LIBS *= -lpq
-}
-
-win32:!win32-g++*:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32
+SOURCES = main.cpp
+include(../../../sql/drivers/psql/qsql_psql.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index fb312334c1..f4c1671a4b 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -1,18 +1,7 @@
-TARGET = qsqlite
+TARGET = qsqlite
-HEADERS = ../../../sql/drivers/sqlite/qsql_sqlite.h
-SOURCES = smain.cpp \
- ../../../sql/drivers/sqlite/qsql_sqlite.cpp
-
-!system-sqlite:!contains( LIBS, .*sqlite.* ) {
- CONFIG(release, debug|release):DEFINES *= NDEBUG
- DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
- INCLUDEPATH += ../../../3rdparty/sqlite
- SOURCES += ../../../3rdparty/sqlite/sqlite3.c
-} else {
- LIBS *= $$QT_LFLAGS_SQLITE
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
-}
+SOURCES = smain.cpp
+include(../../../sql/drivers/sqlite/qsql_sqlite.pri)
wince*: DEFINES += HAVE_LOCALTIME_S=0
diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
index 88db22a63a..e6197b9906 100644
--- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro
+++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
@@ -1,9 +1,6 @@
-TARGET = qsqlite2
+TARGET = qsqlite2
-HEADERS = ../../../sql/drivers/sqlite2/qsql_sqlite2.h
-SOURCES = smain.cpp \
- ../../../sql/drivers/sqlite2/qsql_sqlite2.cpp
-
-!contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
+SOURCES = smain.cpp
+include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri)
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro
index 08a166baa9..b8e8ded321 100644
--- a/src/plugins/sqldrivers/tds/tds.pro
+++ b/src/plugins/sqldrivers/tds/tds.pro
@@ -1,15 +1,6 @@
-TARGET = qsqltds
+TARGET = qsqltds
-HEADERS = ../../../sql/drivers/tds/qsql_tds.h
-
-SOURCES = main.cpp \
- ../../../sql/drivers/tds/qsql_tds.cpp
-
-unix:!contains( LIBS, .*sybdb.* ):LIBS *= -lsybdb
-
-win32 {
- !win32-borland:LIBS *= -lNTWDBLIB
- win32-borland:LIBS *= $(BCB)/lib/PSDK/NTWDBLIB.LIB
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/tds/qsql_tds.pri)
include(../qsqldriverbase.pri)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index e96f83fd96..8fdd72c218 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -1675,4 +1675,5 @@ EXPORTS
?setBindingForObject@QDeclarativeEngineDebug@@QAE_NHABVQString@@ABVQVariant@@_N@Z @ 1674 NONAME ; bool QDeclarativeEngineDebug::setBindingForObject(int, class QString const &, class QVariant const &, bool)
??0QDeclarativeImageProvider@@QAE@W4ImageType@0@@Z @ 1675 NONAME ; QDeclarativeImageProvider::QDeclarativeImageProvider(enum QDeclarativeImageProvider::ImageType)
?setMethodBody@QDeclarativeEngineDebug@@QAE_NHABVQString@@0@Z @ 1676 NONAME ; bool QDeclarativeEngineDebug::setMethodBody(int, class QString const &, class QString const &)
+ ?resetBindingForObject@QDeclarativeEngineDebug@@QAE_NHABVQString@@@Z @ 1677 NONAME ; bool QDeclarativeEngineDebug::resetBindingForObject(int, class QString const &)
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 083e07f30d..dd5103fe3c 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -1706,4 +1706,5 @@ EXPORTS
_ZN25QDeclarativeImageProviderC1ENS_9ImageTypeE @ 1705 NONAME
_ZN25QDeclarativeImageProviderC2ENS_9ImageTypeE @ 1706 NONAME
_ZNK25QDeclarativeImageProvider9imageTypeEv @ 1707 NONAME
+ _ZN23QDeclarativeEngineDebug21resetBindingForObjectEiRK7QString @ 1708 NONAME
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 451d1b0eac..f6390bb0be 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1268,6 +1268,7 @@ QDateTime QScriptValue::toDateTime() const
Q_D(const QScriptValue);
if (!d || !d->engine)
return QDateTime();
+ QScript::APIShim shim(d->engine);
return QScriptEnginePrivate::toDateTime(d->engine->currentFrame, d->jscValue);
}
@@ -1284,6 +1285,7 @@ QRegExp QScriptValue::toRegExp() const
Q_D(const QScriptValue);
if (!d || !d->engine)
return QRegExp();
+ QScript::APIShim shim(d->engine);
return QScriptEnginePrivate::toRegExp(d->engine->currentFrame, d->jscValue);
}
#endif // QT_NO_REGEXP
@@ -1303,6 +1305,7 @@ QObject *QScriptValue::toQObject() const
Q_D(const QScriptValue);
if (!d || !d->engine)
return 0;
+ QScript::APIShim shim(d->engine);
return QScriptEnginePrivate::toQObject(d->engine->currentFrame, d->jscValue);
}
@@ -1317,6 +1320,7 @@ const QMetaObject *QScriptValue::toQMetaObject() const
Q_D(const QScriptValue);
if (!d || !d->engine)
return 0;
+ QScript::APIShim shim(d->engine);
return QScriptEnginePrivate::toQMetaObject(d->engine->currentFrame, d->jscValue);
}
@@ -1407,6 +1411,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex,
Q_D(const QScriptValue);
if (!d || !d->isObject())
return QScriptValue();
+ QScript::APIShim shim(d->engine);
return d->engine->scriptValueFromJSCValue(d->property(arrayIndex, mode));
}
@@ -1434,6 +1439,7 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
"cannot set value created in a different engine");
return;
}
+ QScript::APIShim shim(d->engine);
JSC::JSValue jsValue = d->engine->scriptValueToJSCValue(value);
d->setProperty(arrayIndex, jsValue, flags);
}
diff --git a/src/sql/drivers/db2/qsql_db2.pri b/src/sql/drivers/db2/qsql_db2.pri
new file mode 100644
index 0000000000..16557f0e00
--- /dev/null
+++ b/src/sql/drivers/db2/qsql_db2.pri
@@ -0,0 +1,8 @@
+HEADERS += $$PWD/qsql_db2.h
+SOURCES += $$PWD/qsql_db2.cpp
+
+unix {
+ !contains(LIBS, .*db2.*):LIBS += -ldb2
+} else:!win32-borland {
+ !contains(LIBS, .*db2.*):LIBS += -ldb2cli
+}
diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri
index 05e7265120..87cc0b1d9e 100644
--- a/src/sql/drivers/drivers.pri
+++ b/src/sql/drivers/drivers.pri
@@ -1,119 +1,11 @@
-contains(sql-drivers, all ) {
- sql-driver += psql mysql odbc oci tds db2 sqlite ibase
-}
-
-contains(sql-drivers, psql) {
- HEADERS += drivers/psql/qsql_psql.h
- SOURCES += drivers/psql/qsql_psql.cpp
-
- unix|win32-g++* {
- !static:!isEmpty(QT_LFLAGS_PSQL) {
- !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
- !static:LIBS *= $$QT_LFLAGS_PSQL
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
- }
- !contains(LIBS, .*pq.*):LIBS *= -lpq
- } else:win32:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32
-}
-
-contains(sql-drivers, mysql) {
- HEADERS += drivers/mysql/qsql_mysql.h
- SOURCES += drivers/mysql/qsql_mysql.cpp
-
- unix {
- isEmpty(QT_LFLAGS_MYSQL) {
- !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
- use_libmysqlclient_r:LIBS *= -lmysqlclient_r
- else:LIBS *= -lmysqlclient
- }
- } else {
- LIBS *= $$QT_LFLAGS_MYSQL
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
- }
- }
-
- win32:!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*) {
- !win32-g++*:LIBS *= -llibmysql
- else:LIBS *= -lmysql
- }
-}
-
-contains(sql-drivers, odbc) {
- HEADERS += drivers/odbc/qsql_odbc.h
- SOURCES += drivers/odbc/qsql_odbc.cpp
-
- mac:!contains( LIBS, .*odbc.* ):LIBS *= -liodbc
- unix:!contains( LIBS, .*odbc.* ):LIBS *= -lodbc
- unix:DEFINES += UNICODE
-
- win32 {
- !win32-borland:LIBS *= -lodbc32
- else:LIBS *= $(BCB)/lib/PSDK/odbc32.lib
- }
-}
-
-contains(sql-drivers, oci) {
- HEADERS += drivers/oci/qsql_oci.h
- SOURCES += drivers/oci/qsql_oci.cpp
-
- unix:!contains( LIBS, .*clnts.* ):LIBS += -lclntsh
-
- win32:LIBS += -loci
-}
-
-contains(sql-drivers, tds) {
- HEADERS += drivers/tds/qsql_tds.h
- SOURCES += drivers/tds/qsql_tds.cpp
-
- unix:LIBS += -L$SYBASE/lib -lsybdb
-
- win32 {
- !win32-borland:LIBS += -lNTWDBLIB
- else:LIBS += $(BCB)/lib/PSDK/NTWDBLIB.LIB
- }
-}
-
-contains(sql-drivers, db2) {
- HEADERS += drivers/db2/qsql_db2.h
- SOURCES += drivers/db2/qsql_db2.cpp
-
- unix:LIBS += -ldb2
-
- win32 {
- !win32-borland:LIBS += -ldb2cli
-# else:LIBS += $(BCB)/lib/PSDK/db2cli.lib
- }
-}
-
-contains(sql-drivers, ibase) {
- HEADERS += drivers/ibase/qsql_ibase.h
- SOURCES += drivers/ibase/qsql_ibase.cpp
-
- unix:LIBS *= -lgds
-
- win32 {
- !win32-borland:LIBS *= -lgds32_ms
- else:LIBS += gds32.lib
- }
-}
-
-contains(sql-drivers, sqlite2) {
- HEADERS += drivers/sqlite2/qsql_sqlite2.h
- SOURCES += drivers/sqlite2/qsql_sqlite2.cpp
- !contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
-}
-
-contains(sql-drivers, sqlite) {
- !system-sqlite:!contains( LIBS, .*sqlite3.* ) {
- CONFIG(release, debug|release):DEFINES *= NDEBUG
- DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
- INCLUDEPATH += ../3rdparty/sqlite
- SOURCES += ../3rdparty/sqlite/sqlite3.c
- } else {
- LIBS *= $$QT_LFLAGS_SQLITE
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
- }
-
- HEADERS += drivers/sqlite/qsql_sqlite.h
- SOURCES += drivers/sqlite/qsql_sqlite.cpp
-}
+contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase
+
+contains(sql-drivers, psql):include($$PWD/psql/qsql_psql.pri)
+contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
+contains(sql-drivers, odbc):include($$PWD/odbc/qsql_odbc.pri)
+contains(sql-drivers, oci):include($$PWD/oci/qsql_oci.pri)
+contains(sql-drivers, tds):include($$PWD/tds/qsql_tds.pri)
+contains(sql-drivers, db2):include($$PWD/db2/qsql_db2.pri)
+contains(sql-drivers, ibase):include($$PWD/ibase/qsql_ibase.pri)
+contains(sql-drivers, sqlite2):include($$PWD/sqlite2/qsql_sqlite2.pri)
+contains(sql-drivers, sqlite):include($$PWD/sqlite/qsql_sqlite.pri)
diff --git a/src/sql/drivers/ibase/qsql_ibase.pri b/src/sql/drivers/ibase/qsql_ibase.pri
new file mode 100644
index 0000000000..33fbb0de30
--- /dev/null
+++ b/src/sql/drivers/ibase/qsql_ibase.pri
@@ -0,0 +1,11 @@
+HEADERS += $$PWD/qsql_ibase.h
+SOURCES += $$PWD/qsql_ibase.cpp
+
+unix {
+ !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
+} else {
+ !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
+ win32-borland:LIBS += gds32.lib
+ else:LIBS += -lgds32_ms
+ }
+}
diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
new file mode 100644
index 0000000000..1b9c3dd8ca
--- /dev/null
+++ b/src/sql/drivers/mysql/qsql_mysql.pri
@@ -0,0 +1,16 @@
+HEADERS += $$PWD/qsql_mysql.h
+SOURCES += $$PWD/qsql_mysql.cpp
+
+unix {
+ isEmpty(QT_LFLAGS_MYSQL) {
+ !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
+ use_libmysqlclient_r:LIBS += -lmysqlclient_r
+ else:LIBS += -lmysqlclient
+ }
+ } else {
+ LIBS *= $$QT_LFLAGS_MYSQL
+ QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
+ }
+} else {
+ !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql
+}
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index 2f0cfdce58..c56b9955b5 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -648,7 +648,7 @@ QByteArray qMakeOraDate(const QDateTime& dt)
QDateTime qMakeDate(const char* oraDate)
{
- int century = oraDate[0];
+ int century = uchar(oraDate[0]);
if(century >= 100){
int year = uchar(oraDate[1]);
year = ((century-100)*100) + (year-100);
diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri
new file mode 100644
index 0000000000..60ccc4c227
--- /dev/null
+++ b/src/sql/drivers/oci/qsql_oci.pri
@@ -0,0 +1,9 @@
+HEADERS += $$PWD/qsql_oci.h
+SOURCES += $$PWD/qsql_oci.cpp
+
+unix {
+ !contains(LIBS, .*clnts.*):LIBS += -lclntsh
+} else {
+ LIBS *= -loci
+}
+macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri
new file mode 100644
index 0000000000..66a8d51af0
--- /dev/null
+++ b/src/sql/drivers/odbc/qsql_odbc.pri
@@ -0,0 +1,13 @@
+HEADERS += $$PWD/qsql_odbc.h
+SOURCES += $$PWD/qsql_odbc.cpp
+
+unix {
+ DEFINES += UNICODE
+ !contains(LIBS, .*odbc.*) {
+ macx:LIBS += -liodbc
+ else:LIBS += $$QT_LFLAGS_ODBC
+ }
+} else {
+ win32-borland:LIBS *= $(BCB)/lib/PSDK/odbc32.lib
+ else:LIBS *= -lodbc32
+}
diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri
new file mode 100644
index 0000000000..97db4beb59
--- /dev/null
+++ b/src/sql/drivers/psql/qsql_psql.pri
@@ -0,0 +1,13 @@
+HEADERS += $$PWD/qsql_psql.h
+SOURCES += $$PWD/qsql_psql.cpp
+
+unix|win32-g++* {
+ !static:!isEmpty(QT_LFLAGS_PSQL) {
+ !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
+ LIBS *= $$QT_LFLAGS_PSQL
+ QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
+ }
+ !contains(LIBS, .*pq.*):LIBS += -lpq
+} else {
+ !contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
+}
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri
new file mode 100644
index 0000000000..7ad5936e25
--- /dev/null
+++ b/src/sql/drivers/sqlite/qsql_sqlite.pri
@@ -0,0 +1,9 @@
+HEADERS += $$PWD/qsql_sqlite.h
+SOURCES += $$PWD/qsql_sqlite.cpp
+
+!system-sqlite:!contains(LIBS, .*sqlite3.*) {
+ include($$PWD/../../../3rdparty/sqlite.pri)
+} else {
+ LIBS *= $$QT_LFLAGS_SQLITE
+ QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
+}
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
new file mode 100644
index 0000000000..9a9f6cdf9e
--- /dev/null
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
@@ -0,0 +1,4 @@
+HEADERS += $$PWD/qsql_sqlite2.h
+SOURCES += $$PWD/qsql_sqlite2.cpp
+
+!contains(LIBS, .*sqlite.*):LIBS += -lsqlite
diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri
new file mode 100644
index 0000000000..c552ead1a7
--- /dev/null
+++ b/src/sql/drivers/tds/qsql_tds.pri
@@ -0,0 +1,10 @@
+HEADERS += $$PWD/qsql_tds.h
+SOURCES += $$PWD/qsql_tds.cpp
+
+unix {
+ !contains(LIBS, .*sybdb.*):LIBS += -lsybdb
+} else:win32-borland {
+ LIBS *= $(BCB)/lib/PSDK/NTWDBLIB.LIB
+} else {
+ LIBS *= -lNTWDBLIB
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
new file mode 100644
index 0000000000..d439875630
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/runningTrue.qml
@@ -0,0 +1,20 @@
+import Qt 4.7
+
+Rectangle {
+ id: root
+ width:200; height:200
+
+ property real myValue: 0
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: 100
+ height: 100
+ color: "green"
+ smooth: true
+ rotation: myValue
+ Behavior on rotation {
+ RotationAnimation { id: rotAnim; objectName: "rotAnim"; direction: RotationAnimation.Shortest }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 70739fb986..5c2c1455cb 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
#include <qtest.h>
+#include <qsignalspy.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeview.h>
@@ -78,6 +79,7 @@ private slots:
void dontStart();
void startup();
void groupedPropertyCrash();
+ void runningTrue();
};
void tst_qdeclarativebehaviors::simpleBehavior()
@@ -366,6 +368,22 @@ void tst_qdeclarativebehaviors::groupedPropertyCrash()
QVERIFY(rect); //don't crash
}
+//QTBUG-5491
+void tst_qdeclarativebehaviors::runningTrue()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/runningTrue.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeAbstractAnimation *animation = rect->findChild<QDeclarativeAbstractAnimation*>("rotAnim");
+ QVERIFY(animation);
+
+ QSignalSpy runningSpy(animation, SIGNAL(runningChanged(bool)));
+ rect->setProperty("myValue", 180);
+ QTRY_VERIFY(runningSpy.count() > 0);
+}
+
QTEST_MAIN(tst_qdeclarativebehaviors)
#include "tst_qdeclarativebehaviors.moc"
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
new file mode 100644
index 0000000000..6c39f20313
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
@@ -0,0 +1,28 @@
+import Qt 4.7
+
+Rectangle {
+ id: root
+ width:300; height:400
+
+ property bool focus1: root.wantsFocus
+ property bool focus2: item1.wantsFocus
+ property bool focus3: fs1.wantsFocus
+ property bool focus4: fs2.wantsFocus
+ property bool focus5: theItem.wantsFocus
+
+ Item {
+ id: item1
+ FocusScope {
+ id: fs1
+ focus: true
+ FocusScope {
+ id: fs2
+ focus: true
+ Item {
+ id: theItem
+ focus: true
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
index 5904fd65a0..af9c420bd6 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
@@ -8,10 +8,10 @@ Rectangle {
FocusScope {
id: firstScope
+ objectName: "item0"
focus: true
Rectangle {
- objectName: "item0"
height: 120; width: 420
color: "transparent"
@@ -44,9 +44,9 @@ Rectangle {
FocusScope {
id: secondScope
+ objectName: "item3"
Rectangle {
- objectName: "item3"
y: 160; height: 120; width: 420
color: "transparent"
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
index 6b09c29d92..aa43ba8e49 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
@@ -9,12 +9,12 @@ Rectangle {
FocusScope {
id: myScope
+ objectName: "item0"
focus: true
Keys.onDigit9Pressed: console.log("Error - FocusScope")
Rectangle {
- objectName: "item0"
height: 120
width: 420
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
index d67ec57534..cdb5164850 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
@@ -9,12 +9,12 @@ Rectangle {
FocusScope {
id: myScope
+ objectName: "item0"
focus: true
Keys.onReturnPressed: console.log("Error - FocusScope")
Rectangle {
- objectName: "item0"
height: 120
width: 420
diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
index 7732e6dadb..2559087717 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
+++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
@@ -68,6 +68,7 @@ private slots:
void noFocus();
void textEdit();
void forceFocus();
+ void noParentFocus();
};
/*
@@ -97,7 +98,7 @@ void tst_qdeclarativefocusscope::basic()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test.qml"));
- QDeclarativeRectangle *item0 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
@@ -228,7 +229,7 @@ void tst_qdeclarativefocusscope::textEdit()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/test5.qml"));
- QDeclarativeRectangle *item0 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
QDeclarativeTextEdit *item1 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item1"));
QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
QDeclarativeTextEdit *item3 = findItem<QDeclarativeTextEdit>(view->rootObject(), QLatin1String("item3"));
@@ -283,10 +284,10 @@ void tst_qdeclarativefocusscope::forceFocus()
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/forcefocus.qml"));
- QDeclarativeRectangle *item0 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item0"));
+ QDeclarativeFocusScope *item0 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item0"));
QDeclarativeRectangle *item1 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item1"));
QDeclarativeRectangle *item2 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item2"));
- QDeclarativeRectangle *item3 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item3"));
+ QDeclarativeFocusScope *item3 = findItem<QDeclarativeFocusScope>(view->rootObject(), QLatin1String("item3"));
QDeclarativeRectangle *item4 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item4"));
QDeclarativeRectangle *item5 = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("item5"));
QVERIFY(item0 != 0);
@@ -333,6 +334,20 @@ void tst_qdeclarativefocusscope::forceFocus()
delete view;
}
+void tst_qdeclarativefocusscope::noParentFocus()
+{
+ QDeclarativeView *view = new QDeclarativeView;
+ view->setSource(QUrl::fromLocalFile(SRCDIR "/data/chain.qml"));
+ QVERIFY(view->rootObject());
+
+ QVERIFY(view->rootObject()->property("focus1") == true);
+ QVERIFY(view->rootObject()->property("focus2") == false);
+ QVERIFY(view->rootObject()->property("focus3") == true);
+ QVERIFY(view->rootObject()->property("focus4") == true);
+ QVERIFY(view->rootObject()->property("focus5") == true);
+
+ delete view;
+}
QTEST_MAIN(tst_qdeclarativefocusscope)
diff --git a/tests/auto/declarative/qdeclarativegridview/data/footer.qml b/tests/auto/declarative/qdeclarativegridview/data/footer.qml
new file mode 100644
index 0000000000..170b2b505d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/footer.qml
@@ -0,0 +1,32 @@
+import Qt 4.7
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ width: 80
+ height: 60
+ border.color: "blue"
+ Text {
+ text: index
+ }
+ color: GridView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ cellWidth: 80
+ cellHeight: 60
+ model: testModel
+ delegate: myDelegate
+ footer: Text { objectName: "footer"; text: "Footer"; height: 30 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index a67c56f55c..1a28b7148b 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -81,6 +81,7 @@ private slots:
void enforceRange();
void QTBUG_8456();
void manualHighlight();
+ void footer();
private:
QDeclarativeView *createView();
@@ -147,6 +148,14 @@ public:
emit dataChanged(index(idx,0), index(idx,0));
}
+ void clear() {
+ int count = list.count();
+ emit beginRemoveRows(QModelIndex(), 0, count-1);
+ list.clear();
+ emit endRemoveRows();
+ }
+
+
private:
QList<QPair<QString,QString> > list;
};
@@ -1162,6 +1171,38 @@ void tst_QDeclarativeGridView::manualHighlight()
QTRY_COMPARE(gridview->highlightItem()->x(), gridview->currentItem()->x());
}
+void tst_QDeclarativeGridView::footer()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 7; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QTRY_VERIFY(gridview != 0);
+
+ QDeclarativeItem *contentItem = gridview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(footer);
+
+ QCOMPARE(footer->y(), 180.0);
+
+ model.removeItem(2);
+ QTRY_COMPARE(footer->y(), 120.0);
+
+ model.clear();
+ QTRY_COMPARE(footer->y(), 0.0);
+}
+
QDeclarativeView *tst_QDeclarativeGridView::createView()
{
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 4a57def2d0..ffb2105429 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -703,11 +703,8 @@ void tst_QDeclarativeItem::propertyChanges()
QCOMPARE(focusArguments.at(0).toBool(), true);
QCOMPARE(parentItem->hasFocus(), false);
- QCOMPARE(parentItem->wantsFocus(), true);
- QCOMPARE(wantsFocusSpy.count(),1);
- QList<QVariant> wantsFocusArguments = wantsFocusSpy.first();
- QVERIFY(wantsFocusArguments.count() == 1);
- QCOMPARE(wantsFocusArguments.at(0).toBool(), true);
+ QCOMPARE(parentItem->wantsFocus(), false);
+ QCOMPARE(wantsFocusSpy.count(),0);
delete canvas;
}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index f15ac8ffba..858c26d188 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -193,8 +193,9 @@ void tst_qdeclarativelistmodel::dynamic_data()
QTest::newRow("count") << "count" << 0 << "";
- QTest::newRow("get1") << "{get(0)}" << 0 << "";
- QTest::newRow("get2") << "{get(-1)}" << 0 << "";
+ QTest::newRow("get1") << "{get(0) === undefined}" << 1 << "";
+ QTest::newRow("get2") << "{get(-1) === undefined}" << 1 << "";
+ QTest::newRow("get3") << "{append({'foo':123});get(0) != undefined}" << 1 << "";
QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "";
QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "";
@@ -292,8 +293,6 @@ void tst_qdeclarativelistmodel::dynamic()
if (e.hasError())
qDebug() << e.error(); // errors not expected
- if (QTest::currentDataTag() != QLatin1String("clear3") && QTest::currentDataTag() != QLatin1String("remove3"))
- QVERIFY(!e.hasError());
QCOMPARE(actual,result);
}
@@ -308,6 +307,9 @@ void tst_qdeclarativelistmodel::dynamic_worker()
QFETCH(int, result);
QFETCH(QString, warning);
+ // This is same as dynamic() except it applies the test to a ListModel called
+ // from a WorkerScript (i.e. testing the internal NestedListModel class)
+
QDeclarativeListModel model;
QDeclarativeEngine eng;
QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
diff --git a/tests/auto/declarative/qdeclarativelistview/data/footer.qml b/tests/auto/declarative/qdeclarativelistview/data/footer.qml
new file mode 100644
index 0000000000..11cbe1630a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/footer.qml
@@ -0,0 +1,30 @@
+import Qt 4.7
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ text: index
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ footer: Text { objectName: "footer"; text: "Footer"; height: 30 }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index e13bd94870..9c24e036c1 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -97,6 +97,7 @@ private slots:
void QTBUG_9791();
void manualHighlight();
void QTBUG_11105();
+ void footer();
private:
template <class T> void items();
@@ -1558,6 +1559,37 @@ void tst_QDeclarativeListView::QTBUG_11105()
delete canvas;
}
+void tst_QDeclarativeListView::footer()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 3; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/footer.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *footer = findItem<QDeclarativeText>(contentItem, "footer");
+ QVERIFY(footer);
+ QCOMPARE(footer->y(), 60.0);
+
+ model.removeItem(1);
+ QTRY_COMPARE(footer->y(), 40.0);
+
+ model.clear();
+ QTRY_COMPARE(footer->y(), 0.0);
+}
+
void tst_QDeclarativeListView::qListModelInterface_items()
{
items<TestModel>();
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 695c038063..b08da0f3a4 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -113,7 +113,6 @@ void tst_QDeclarativeViewer::orientation()
viewer->rotateOrientation();
qApp->processEvents();
- qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 300.0);
QCOMPARE(rootItem->height(), 200.0);
@@ -124,7 +123,6 @@ void tst_QDeclarativeViewer::orientation()
viewer->rotateOrientation();
qApp->processEvents();
- qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);
@@ -159,10 +157,10 @@ void tst_QDeclarativeViewer::loading()
// window resized
QTRY_COMPARE(rootItem->width(), 400.0);
- QTRY_COMPARE(rootItem->height(), 500.0-viewer->menuBar()->height());
- QCOMPARE(viewer->view()->size(), QSize(400, 500-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(400, 500));
QCOMPARE(viewer->size(), viewer->sizeHint());
@@ -176,7 +174,7 @@ void tst_QDeclarativeViewer::loading()
QCOMPARE(viewer->view()->size(), QSize(200, 300));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
viewer->resize(QSize(400, 500));
@@ -184,10 +182,10 @@ void tst_QDeclarativeViewer::loading()
// window resized again
QTRY_COMPARE(rootItem->width(), 400.0);
- QTRY_COMPARE(rootItem->height(), 500.0-viewer->menuBar()->height());
- QCOMPARE(viewer->view()->size(), QSize(400, 500-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(400, 500));
QCOMPARE(viewer->size(), viewer->sizeHint());
@@ -201,7 +199,7 @@ void tst_QDeclarativeViewer::loading()
QCOMPARE(viewer->view()->size(), QSize(200, 300));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
delete viewer;
@@ -272,7 +270,7 @@ void tst_QDeclarativeViewer::resizing()
QTRY_COMPARE(viewer->view()->size(), QSize(150, 200));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(150, 200));
- QCOMPARE(viewer->size(), QSize(150, 200+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(150, 200 + MENUBAR_HEIGHT(viewer)));
// do not size root object to view
viewer->resize(QSize(180,250));
@@ -286,10 +284,10 @@ void tst_QDeclarativeViewer::resizing()
qApp->processEvents();
QTRY_COMPARE(rootItem->width(), 250.0);
- QTRY_COMPARE(rootItem->height(), 350.0-viewer->menuBar()->height());
- QTRY_COMPARE(viewer->view()->size(), QSize(250, 350-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+ QTRY_COMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(250, 350));
// do not size view to root object
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index cfaa3fa0bf..2d9ea937a2 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -112,6 +112,7 @@ SUBDIRS=\
qmdisubwindow \
qmessagebox \
qmetaobject \
+ qmimedata \
qmouseevent_modal \
qmovie \
qnetworkaccessmanager_and_qprogressdialog \
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
index 0765bfcdfd..f58f932391 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
@@ -275,3 +275,30 @@ void bogosity()
// no spaces here. test collateral damage from ignoring equal sign
Class::member=QObject::tr("just QObject");
}
+
+
+
+namespace Internal {
+
+class Message : public QObject
+{
+ Q_OBJECT
+public:
+ Message(QObject *parent = 0);
+};
+
+} // The temporary closing of the namespace triggers the problem
+
+namespace Internal {
+
+static inline QString message1()
+{
+ return Message::tr("message1"); // Had no namespace
+}
+
+static inline QString message2()
+{
+ return Message::tr("message2"); // Already had namespace
+}
+
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index 208191d8a8..7ac318e685 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -120,6 +120,19 @@ backslashed \ stuff.</source>
</message>
</context>
<context>
+ <name>Internal::Message</name>
+ <message>
+ <location filename="main.cpp" line="296"/>
+ <source>message1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.cpp" line="301"/>
+ <source>message2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>Kåntekst</name>
<message utf8="true">
<location filename="finddialog.cpp" line="180"/>
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index 994057b128..2f985213d3 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -204,9 +204,8 @@ void tst_MediaObject::testPlayFromResource()
#ifdef Q_OS_SYMBIAN
QSKIP("Not implemented yet.", SkipAll);
#else
- QFile file(MEDIA_FILEPATH);
MediaObject media;
- media.setCurrentSource(&file);
+ media.setCurrentSource(QString(MEDIA_FILEPATH));
QVERIFY(media.state() != Phonon::ErrorState);
if (media.state() != Phonon::StoppedState)
QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000);
diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index 4f205fe049..e1898f1b85 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -7,6 +7,7 @@ SUBDIRS=\
networkselftest \
qabstractnetworkcache \
qabstractsocket \
+ qauthenticator \
qeventloop \
qftp \
qhostaddress \
@@ -36,6 +37,7 @@ SUBDIRS=\
qsslsocket \
contains(QT_CONFIG, private_tests): SUBDIRS -= \
+ qauthenticator \
qhttpnetworkconnection \
qhttpnetworkreply \
qnativesocketengine \
diff --git a/tests/auto/qauthenticator/qauthenticator.pro b/tests/auto/qauthenticator/qauthenticator.pro
new file mode 100644
index 0000000000..05f83bc166
--- /dev/null
+++ b/tests/auto/qauthenticator/qauthenticator.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+requires(contains(QT_CONFIG,private_tests))
+QT = core network
+SOURCES += tst_qauthenticator.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qauthenticator/tst_qauthenticator.cpp b/tests/auto/qauthenticator/tst_qauthenticator.cpp
new file mode 100644
index 0000000000..37d6774e3e
--- /dev/null
+++ b/tests/auto/qauthenticator/tst_qauthenticator.cpp
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** 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 FOO 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 <QtCore/QString>
+#include <QtTest/QtTest>
+#include <QtCore/QCoreApplication>
+#include <QtNetwork/QAuthenticator>
+
+#include <private/qauthenticator_p.h>
+
+class tst_QAuthenticator : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QAuthenticator();
+
+private Q_SLOTS:
+ void basicAuth();
+ void basicAuth_data();
+
+ void ntlmAuth_data();
+ void ntlmAuth();
+};
+
+tst_QAuthenticator::tst_QAuthenticator()
+{
+}
+
+void tst_QAuthenticator::basicAuth_data()
+{
+ QTest::addColumn<QString>("data");
+ QTest::addColumn<QString>("realm");
+ QTest::addColumn<QString>("user");
+ QTest::addColumn<QString>("password");
+ QTest::addColumn<QByteArray>("expectedReply");
+
+ QTest::newRow("just-user") << "" << "" << "foo" << "" << QByteArray("foo:").toBase64();
+ QTest::newRow("user-password") << "" << "" << "foo" << "bar" << QByteArray("foo:bar").toBase64();
+ QTest::newRow("user-password-realm") << "realm=\"secure area\"" << "secure area" << "foo" << "bar" << QByteArray("foo:bar").toBase64();
+}
+
+void tst_QAuthenticator::basicAuth()
+{
+ QFETCH(QString, data);
+ QFETCH(QString, realm);
+ QFETCH(QString, user);
+ QFETCH(QString, password);
+ QFETCH(QByteArray, expectedReply);
+
+ QAuthenticator auth;
+ auth.detach();
+ QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
+ QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+ QList<QPair<QByteArray, QByteArray> > headers;
+ headers << qMakePair(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
+ priv->parseHttpResponse(headers, /*isProxy = */ false);
+
+ QCOMPARE(auth.realm(), realm);
+ QCOMPARE(auth.option("realm").toString(), realm);
+
+ auth.setUser(user);
+ auth.setPassword(password);
+
+ QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+ QCOMPARE(priv->calculateResponse("GET", "/").constData(), ("Basic " + expectedReply).constData());
+}
+
+void tst_QAuthenticator::ntlmAuth_data()
+{
+ QTest::addColumn<QString>("data");
+ QTest::addColumn<QString>("realm");
+
+ QTest::newRow("no-realm") << "TlRMTVNTUAACAAAAHAAcADAAAAAFAoEATFZ3OLRQADIAAAAAAAAAAJYAlgBMAAAAUQBUAC0AVABFAFMAVAAtAEQATwBNAEEASQBOAAIAHABRAFQALQBUAEUAUwBUAC0ARABPAE0AQQBJAE4AAQAcAFEAVAAtAFQARQBTAFQALQBTAEUAUgBWAEUAUgAEABYAcQB0AC0AdABlAHMAdAAtAG4AZQB0AAMANABxAHQALQB0AGUAcwB0AC0AcwBlAHIAdgBlAHIALgBxAHQALQB0AGUAcwB0AC0AbgBlAHQAAAAAAA==" << "";
+ QTest::newRow("with-realm") << "TlRMTVNTUAACAAAADAAMADgAAAAFAoECWCZkccFFAzwAAAAAAAAAAL4AvgBEAAAABQLODgAAAA9NAEcARABOAE8ASwACAAwATQBHAEQATgBPAEsAAQAcAE4ATwBLAC0AQQBNAFMAUwBTAEYARQAtADAAMQAEACAAbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQADAD4AbgBvAGsALQBhAG0AcwBzAHMAZgBlAC0AMAAxAC4AbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQAFACAAbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQAAAAAA" << "NOE";
+}
+
+void tst_QAuthenticator::ntlmAuth()
+{
+ QFETCH(QString, data);
+ QFETCH(QString, realm);
+
+ QAuthenticator auth;
+ auth.detach();
+ QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
+ QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+ QList<QPair<QByteArray, QByteArray> > headers;
+
+ // NTLM phase 1: negotiate
+ // This phase of NTLM contains no information, other than what we're willing to negotiate
+ // Current implementation uses flags:
+ // NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET
+ headers << qMakePair<QByteArray, QByteArray>("WWW-Authenticate", "NTLM");
+ priv->parseHttpResponse(headers, /*isProxy = */ false);
+ QCOMPARE(priv->calculateResponse("GET", "/").constData(), "NTLM TlRMTVNTUAABAAAABQIAAAAAAAAAAAAAAAAAAAAAAAA=");
+
+ // NTLM phase 2: challenge
+ headers.clear();
+ headers << qMakePair(QByteArray("WWW-Authenticate"), "NTLM " + data.toUtf8());
+ priv->parseHttpResponse(headers, /*isProxy = */ false);
+
+ QEXPECT_FAIL("with-realm", "NTLM authentication code doesn't extract the realm", Continue);
+ QCOMPARE(auth.realm(), realm);
+
+ auth.setUser("unimportant");
+ auth.setPassword("unimportant");
+
+ QVERIFY(!priv->calculateResponse("GET", "/").isEmpty());
+}
+
+QTEST_MAIN(tst_QAuthenticator);
+
+#include "tst_qauthenticator.moc"
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index eee495fc33..6299c24e9b 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -140,6 +140,7 @@ private slots:
void QTBUG4419_lineEditSelectAll();
void QTBUG6558_showDirsOnly();
void QTBUG4842_selectFilterWithHideNameFilterDetails();
+ void dontShowCompleterOnRoot();
private:
QByteArray userSettings;
@@ -1194,5 +1195,26 @@ void tst_QFileDialog2::QTBUG4842_selectFilterWithHideNameFilterDetails()
}
+void tst_QFileDialog2::dontShowCompleterOnRoot()
+{
+ QNonNativeFileDialog fd(0, "TestFileDialog");
+ fd.setAcceptMode(QFileDialog::AcceptSave);
+ fd.show();
+
+ QApplication::setActiveWindow(&fd);
+ QTest::qWaitForWindowShown(&fd);
+ QTRY_COMPARE(fd.isVisible(), true);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+
+ fd.setDirectory("");
+ QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
+ QTRY_VERIFY(lineEdit->text().isEmpty());
+
+ //The gatherer thread will then return the result
+ QApplication::processEvents();
+
+ QTRY_VERIFY(lineEdit->completer()->popup()->isHidden());
+}
+
QTEST_MAIN(tst_QFileDialog2)
#include "tst_qfiledialog2.moc"
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 4c651bf3ab..93b1891d6e 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -1082,7 +1082,7 @@ void tst_QFileInfo::isHidden_data()
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QVERIFY(QDir("./hidden-directory").exists() || QDir().mkdir("./hidden-directory"));
- QVERIFY(SetFileAttributesW(QString("./hidden-directory").utf16(),FILE_ATTRIBUTE_HIDDEN));
+ QVERIFY(SetFileAttributesW(reinterpret_cast<LPCWSTR>(QString("./hidden-directory").utf16()),FILE_ATTRIBUTE_HIDDEN));
QTest::newRow("C:/path/to/hidden-directory") << QDir::currentPath() + QString::fromLatin1("/hidden-directory") << true;
QTest::newRow("C:/path/to/hidden-directory/.") << QDir::currentPath() + QString::fromLatin1("/hidden-directory/.") << true;
#endif
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index b9a5c66edd..d1d6860ba8 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -105,6 +105,7 @@ private slots:
void geometries_data();
void geometries();
void avoidRecursionInInsertItem();
+ void styleInfoLeak();
void task236367_maxSizeHint();
};
@@ -2196,6 +2197,12 @@ void tst_QGraphicsGridLayout::avoidRecursionInInsertItem()
QCOMPARE(layout->count(), 0);
}
+void tst_QGraphicsGridLayout::styleInfoLeak()
+{
+ QGraphicsGridLayout grid;
+ grid.horizontalSpacing();
+}
+
void tst_QGraphicsGridLayout::task236367_maxSizeHint()
{
QGraphicsWidget *widget = new QGraphicsWidget;
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 1ae3ecffa8..3634ce990a 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -463,6 +463,7 @@ private slots:
void sortItemsWhileAdding();
void doNotMarkFullUpdateIfNotInScene();
void itemDiesDuringDraggingOperation();
+ void QTBUG_12112_focusItem();
private:
QList<QGraphicsItem *> paintedItems;
@@ -10724,5 +10725,31 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
delete item;
QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == 0);
}
+
+void tst_QGraphicsItem::QTBUG_12112_focusItem()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QGraphicsRectItem *item1 = new QGraphicsRectItem(0, 0, 20, 20);
+ item1->setFlag(QGraphicsItem::ItemIsFocusable);
+ QGraphicsRectItem *item2 = new QGraphicsRectItem(20, 20, 20, 20);
+ item2->setFlag(QGraphicsItem::ItemIsFocusable);
+ item1->setFocus();
+ scene.addItem(item2);
+ scene.addItem(item1);
+
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+
+ QVERIFY(item1->focusItem());
+ QVERIFY(!item2->focusItem());
+
+ item2->setFocus();
+ QVERIFY(!item1->focusItem());
+ QVERIFY(item2->focusItem());
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index c26e5d4aec..6107fa11e7 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -102,6 +102,7 @@ private slots:
void layoutDirection();
void removeLayout();
void avoidRecursionInInsertItem();
+ void styleInfoLeak();
// Task specific tests
void task218400_insertStretchCrash();
@@ -1443,6 +1444,12 @@ void tst_QGraphicsLinearLayout::avoidRecursionInInsertItem()
QCOMPARE(layout->count(), 0);
}
+void tst_QGraphicsLinearLayout::styleInfoLeak()
+{
+ QGraphicsLinearLayout layout;
+ layout.spacing();
+}
+
void tst_QGraphicsLinearLayout::task218400_insertStretchCrash()
{
QGraphicsScene *scene = new QGraphicsScene;
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index ed8ff04cdc..a771332b31 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -176,6 +176,7 @@ private slots:
void task243004_setStyleCrash();
void task250119_shortcutContext();
void QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems();
+ void QT_BUG_12056_tabFocusFirstUnsetWhenRemovingItems();
};
@@ -3089,6 +3090,25 @@ void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
//This should not crash
}
+void tst_QGraphicsWidget::QT_BUG_12056_tabFocusFirstUnsetWhenRemovingItems()
+{
+ QGraphicsScene scene;
+ QGraphicsWidget* item1 = new QGraphicsWidget;
+ QGraphicsWidget* item2 = new QGraphicsWidget;
+ QGraphicsWidget* item3 = new QGraphicsWidget;
+
+ scene.addItem(item1);
+ scene.addItem(item2);
+
+ scene.removeItem(item2);
+ scene.removeItem(item1);
+ delete item2;
+ delete item1;
+
+ scene.addItem(item3);
+
+ //This should not crash
+}
QTEST_MAIN(tst_QGraphicsWidget)
#include "tst_qgraphicswidget.moc"
diff --git a/tests/auto/qmake/testdata/simple_app/build/README b/tests/auto/qmake/testdata/simple_app/build/README
new file mode 100644
index 0000000000..acfd9d9226
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/build/README
@@ -0,0 +1 @@
+Here to ensure build/ exists, used by the simple_app_shadowbuild2 test.
diff --git a/tests/auto/qmake/testdata/simple_app/simple_app.pro b/tests/auto/qmake/testdata/simple_app/simple_app.pro
index f496d5bb8e..a8c4ad613d 100644
--- a/tests/auto/qmake/testdata/simple_app/simple_app.pro
+++ b/tests/auto/qmake/testdata/simple_app/simple_app.pro
@@ -3,6 +3,7 @@ CONFIG += qt warn_on
HEADERS = test_file.h
SOURCES = test_file.cpp \
main.cpp
+RESOURCES = test.qrc
TARGET = simple_app
DESTDIR = ./
diff --git a/tests/auto/qmake/testdata/simple_app/test.qrc b/tests/auto/qmake/testdata/simple_app/test.qrc
new file mode 100644
index 0000000000..decde3dd24
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/test.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.qrc</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp
index 03054e709d..5efe7148db 100644
--- a/tests/auto/qmake/tst_qmake.cpp
+++ b/tests/auto/qmake/tst_qmake.cpp
@@ -65,6 +65,7 @@ public slots:
private slots:
void simple_app();
void simple_app_shadowbuild();
+ void simple_app_shadowbuild2();
void simple_lib();
void simple_dll();
void subdirs();
@@ -163,6 +164,21 @@ void tst_qmake::simple_app_shadowbuild()
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
+void tst_qmake::simple_app_shadowbuild2()
+{
+ QString workDir = base_path + "/testdata/simple_app";
+ QString buildDir = base_path + "/testdata/simple_app/build";
+
+ QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir ));
+ QVERIFY( test_compiler.make( buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" ));
+ QVERIFY( test_compiler.makeClean( buildDir ));
+ QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
+ QVERIFY( test_compiler.makeDistClean( buildDir ));
+ QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
+ QVERIFY( test_compiler.removeMakefile( buildDir ) );
+}
+
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";
diff --git a/tests/auto/qmimedata/qmimedata.pro b/tests/auto/qmimedata/qmimedata.pro
new file mode 100644
index 0000000000..13fbe65edc
--- /dev/null
+++ b/tests/auto/qmimedata/qmimedata.pro
@@ -0,0 +1,4 @@
+load(qttest_p4)
+SOURCES += tst_qmimedata.cpp
+
+
diff --git a/tests/auto/qmimedata/tst_qmimedata.cpp b/tests/auto/qmimedata/tst_qmimedata.cpp
new file mode 100644
index 0000000000..be7a654f84
--- /dev/null
+++ b/tests/auto/qmimedata/tst_qmimedata.cpp
@@ -0,0 +1,343 @@
+/****************************************************************************
+**
+** 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 test suite 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 <QtTest/QtTest>
+
+#include <QMimeData>
+
+class tst_QMimeData : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QMimeData()
+ {
+ }
+
+private slots:
+ void clear() const;
+ void colorData() const;
+ void data() const;
+ void formats() const;
+ void hasColor() const;
+ void hasFormat() const;
+ void hasHtml() const;
+ void hasImage() const;
+ // hasText() covered by setText()
+ // hasUrls() covered by setUrls()
+ // html() covered by setHtml()
+ void imageData() const;
+ void removeFormat() const;
+ // setColorData() covered by hasColor()
+ // setData() covered in a few different tests
+ void setHtml() const;
+ // setImageData() covered in a few tests
+ void setText() const;
+ void setUrls() const;
+ // text() covered in setText()
+ // urls() covered by setUrls()
+};
+
+void tst_QMimeData::clear() const
+{
+ QMimeData mimeData;
+
+ // set, clear, verify empty
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasText());
+ mimeData.clear();
+ QVERIFY(mimeData.hasText() == false);
+
+ // repopulate, verify not empty
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasText());
+}
+
+void tst_QMimeData::colorData() const
+{
+ QMimeData mimeData;
+ QColor red = Qt::red;
+ QColor blue = Qt::blue;
+
+ // set, verify
+ mimeData.setColorData(red);
+ QVERIFY(mimeData.hasColor());
+ QCOMPARE(qvariant_cast<QColor>(mimeData.colorData()), red);
+
+ // change, verify
+ mimeData.setColorData(Qt::blue);
+ QVERIFY(mimeData.hasColor());
+ QCOMPARE(qvariant_cast<QColor>(mimeData.colorData()), blue);
+}
+
+void tst_QMimeData::data() const
+{
+ QMimeData mimeData;
+
+ // set text, verify
+ mimeData.setData("text/plain", "pirates");
+ QCOMPARE(mimeData.data("text/plain"), QByteArray("pirates"));
+ QVERIFY(mimeData.data("text/html").length() == 0);
+
+ // html time
+ mimeData.setData("text/html", "ninjas");
+ QCOMPARE(mimeData.data("text/html"), QByteArray("ninjas"));
+ QCOMPARE(mimeData.data("text/plain"), QByteArray("pirates")); // make sure text not damaged
+ QCOMPARE(mimeData.data("text/html"), mimeData.html().toLatin1());
+}
+
+void tst_QMimeData::formats() const
+{
+ QMimeData mimeData;
+
+ // set text, verify
+ mimeData.setData("text/plain", "pirates");
+ QCOMPARE(mimeData.formats(), QStringList() << "text/plain");
+
+ // set html, verify
+ mimeData.setData("text/html", "ninjas");
+ QCOMPARE(mimeData.formats(), QStringList() << "text/plain" << "text/html");
+
+ // clear, verify
+ mimeData.clear();
+ QCOMPARE(mimeData.formats(), QStringList());
+
+ // set an odd format, verify
+ mimeData.setData("foo/bar", "somevalue");
+ QCOMPARE(mimeData.formats(), QStringList() << "foo/bar");
+}
+
+void tst_QMimeData::hasColor() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QVERIFY(mimeData.hasColor() == false);
+
+ // set, verify
+ mimeData.setColorData(QColor(Qt::red));
+ QVERIFY(mimeData.hasColor());
+
+ // clear, verify
+ mimeData.clear();
+ QVERIFY(mimeData.hasColor() == false);
+
+ // set something else, verify
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasColor() == false);
+}
+
+void tst_QMimeData::hasFormat() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QVERIFY(mimeData.hasFormat("text/plain") == false);
+
+ // add, verify
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasFormat("text/plain"));
+ QVERIFY(mimeData.hasFormat("text/html") == false);
+
+ // clear, verify
+ mimeData.clear();
+ QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(mimeData.hasFormat("text/html") == false);
+}
+
+void tst_QMimeData::hasHtml() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QVERIFY(mimeData.hasHtml() == false);
+
+ // add plain, verify false
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasHtml() == false);
+
+ // add html, verify
+ mimeData.setData("text/html", "ninjas");
+ QVERIFY(mimeData.hasHtml());
+
+ // clear, verify
+ mimeData.clear();
+ QVERIFY(mimeData.hasHtml() == false);
+
+ // readd, verify
+ mimeData.setData("text/html", "ninjas");
+ QVERIFY(mimeData.hasHtml());
+}
+
+void tst_QMimeData::hasImage() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QVERIFY(mimeData.hasImage() == false);
+
+ // add text, verify false
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasImage() == false);
+
+ // add image
+ mimeData.setImageData(QImage());
+ QVERIFY(mimeData.hasImage());
+
+ // clear, verify
+ mimeData.clear();
+ QVERIFY(mimeData.hasImage() == false);
+}
+
+void tst_QMimeData::imageData() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QCOMPARE(mimeData.imageData(), QVariant());
+
+ // set, test
+ mimeData.setImageData(QImage());
+ QVERIFY(mimeData.hasImage());
+ QCOMPARE(mimeData.imageData(), QVariant(QImage()));
+
+ // clear, verify
+ mimeData.clear();
+ QCOMPARE(mimeData.imageData(), QVariant());
+}
+
+void tst_QMimeData::removeFormat() const
+{
+ QMimeData mimeData;
+
+ // add, verify
+ mimeData.setData("text/plain", "pirates");
+ QVERIFY(mimeData.hasFormat("text/plain"));
+
+ // add another, verify
+ mimeData.setData("text/html", "ninjas");
+ QVERIFY(mimeData.hasFormat("text/html"));
+
+ // remove, verify
+ mimeData.removeFormat("text/plain");
+ QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(mimeData.hasFormat("text/html"));
+
+ // remove, verify
+ mimeData.removeFormat("text/html");
+ QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(mimeData.hasFormat("text/html") == false);
+}
+
+void tst_QMimeData::setHtml() const
+{
+ QMimeData mimeData;
+
+ // initial state
+ QVERIFY(mimeData.hasHtml() == false);
+
+ // add html, verify
+ mimeData.setHtml("ninjas");
+ QVERIFY(mimeData.hasHtml());
+ QCOMPARE(mimeData.html(), QLatin1String("ninjas"));
+
+ // reset html
+ mimeData.setHtml("pirates");
+ QVERIFY(mimeData.hasHtml());
+ QCOMPARE(mimeData.html(), QLatin1String("pirates"));
+}
+
+void tst_QMimeData::setText() const
+{
+ QMimeData mimeData;
+
+ // verify initial state
+ QCOMPARE(mimeData.text(), QLatin1String(""));
+ QVERIFY(mimeData.hasText() == false);
+
+ // set, verify
+ mimeData.setText("pirates");
+ QVERIFY(mimeData.hasText());
+ QCOMPARE(mimeData.text(), QLatin1String("pirates"));
+ QCOMPARE(mimeData.text().toLatin1(), mimeData.data("text/plain"));
+
+ // reset, verify
+ mimeData.setText("ninjas");
+ QVERIFY(mimeData.hasText());
+ QCOMPARE(mimeData.text(), QLatin1String("ninjas"));
+ QCOMPARE(mimeData.text().toLatin1(), mimeData.data("text/plain"));
+
+ // clear, verify
+ mimeData.clear();
+ QCOMPARE(mimeData.text(), QLatin1String(""));
+ QVERIFY(mimeData.hasText() == false);
+}
+
+void tst_QMimeData::setUrls() const
+{
+ QMimeData mimeData;
+ QList<QUrl> shortUrlList;
+ QList<QUrl> longUrlList;
+
+ // set up
+ shortUrlList += QUrl("http://qt.nokia.com");
+ longUrlList = shortUrlList;
+ longUrlList += QUrl("http://www.google.com");
+
+ // verify initial state
+ QVERIFY(mimeData.hasUrls() == false);
+
+ // set a few, verify
+ mimeData.setUrls(shortUrlList);
+ QCOMPARE(mimeData.urls(), shortUrlList);
+
+ // change them, verify
+ mimeData.setUrls(longUrlList);
+ QCOMPARE(mimeData.urls(), longUrlList);
+
+ // clear, verify
+ mimeData.clear();
+ QVERIFY(mimeData.hasUrls() == false);
+}
+
+
+QTEST_MAIN(tst_QMimeData)
+#include "tst_qmimedata.moc"
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 6885adf3ad..7a732ccc58 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -4265,6 +4265,35 @@ void tst_QScriptEngine::reentrancy()
QScriptEngine eng;
QCOMPARE(eng.evaluate("Array()").toString(), QString());
}
+
+ {
+ QScriptEngine eng1;
+ QScriptEngine eng2;
+ {
+ QScriptValue d1 = eng1.newDate(0);
+ QScriptValue d2 = eng2.newDate(0);
+ QCOMPARE(d1.toDateTime(), d2.toDateTime());
+ QCOMPARE(d2.toDateTime(), d1.toDateTime());
+ }
+ {
+ QScriptValue r1 = eng1.newRegExp("foo", "gim");
+ QScriptValue r2 = eng2.newRegExp("foo", "gim");
+ QCOMPARE(r1.toRegExp(), r2.toRegExp());
+ QCOMPARE(r2.toRegExp(), r1.toRegExp());
+ }
+ {
+ QScriptValue o1 = eng1.newQObject(this);
+ QScriptValue o2 = eng2.newQObject(this);
+ QCOMPARE(o1.toQObject(), o2.toQObject());
+ QCOMPARE(o2.toQObject(), o1.toQObject());
+ }
+ {
+ QScriptValue mo1 = eng1.newQMetaObject(&staticMetaObject);
+ QScriptValue mo2 = eng2.newQMetaObject(&staticMetaObject);
+ QCOMPARE(mo1.toQMetaObject(), mo2.toQMetaObject());
+ QCOMPARE(mo2.toQMetaObject(), mo1.toQMetaObject());
+ }
+ }
}
void tst_QScriptEngine:: incDecNonObjectProperty()
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 8aa4e711de..83a3388fd6 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2123,6 +2123,10 @@ void tst_QScriptValue::getSetProperty()
QVERIFY(object.property(foo).strictlyEquals(num));
QVERIFY(object.property("foo").strictlyEquals(num));
QVERIFY(object.propertyFlags(foo) == 0);
+
+ // Setting index property on non-Array
+ object.setProperty(13, num);
+ QVERIFY(object.property(13).equals(num));
}
void tst_QScriptValue::arrayElementGetterSetter()
diff --git a/tests/auto/qscrollbar/tst_qscrollbar.cpp b/tests/auto/qscrollbar/tst_qscrollbar.cpp
index 735b2dd2d4..16d5b4242e 100644
--- a/tests/auto/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/qscrollbar/tst_qscrollbar.cpp
@@ -130,7 +130,7 @@ void tst_QScrollBar::task_209492()
QMouseEvent mousePressEvent(QEvent::MouseButtonPress, pressPoint, globalPressPoint,
Qt::LeftButton, Qt::LeftButton, 0);
QApplication::sendEvent(verticalScrollBar, &mousePressEvent);
- QTest::qWait(50);
+ QTest::qWait(1);
QMouseEvent mouseReleaseEvent(QEvent::MouseButtonRelease, pressPoint, globalPressPoint,
Qt::LeftButton, Qt::LeftButton, 0);
QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent);
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 0cf638b56c..0c12974455 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -55,6 +55,7 @@
#include <QAuthenticator>
#include "private/qhostinfo_p.h"
+#include "private/qsslsocket_openssl_p.h"
#include "../network-settings.h"
@@ -163,6 +164,7 @@ private slots:
void setDefaultCiphers();
void supportedCiphers();
void systemCaCertificates();
+ void wildcardCertificateNames();
void wildcard();
void setEmptyKey();
void spontaneousWrite();
@@ -1063,6 +1065,28 @@ void tst_QSslSocket::systemCaCertificates()
QCOMPARE(certs, QSslSocket::defaultCaCertificates());
}
+void tst_QSslSocket::wildcardCertificateNames()
+{
+ // Passing CN matches
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("www.example.com"), QString("www.example.com")), true );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example.com"), QString("www.example.com")), true );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("xxx*.example.com"), QString("xxxwww.example.com")), true );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("f*.example.com"), QString("foo.example.com")), true );
+
+ // Failing CN matches
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("xxx.example.com"), QString("www.example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*"), QString("www.example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.*.com"), QString("www.example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example.com"), QString("baa.foo.example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("f*.example.com"), QString("baa.example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.com"), QString("example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*fail.com"), QString("example.com")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example."), QString("www.example.")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example."), QString("www.example")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString(""), QString("www")), false );
+ QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*"), QString("www")), false );
+}
+
void tst_QSslSocket::wildcard()
{
QSKIP("TODO: solve wildcard problem", SkipAll);
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index 31cae403dd..e3b2ca53a6 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -275,7 +275,7 @@ void tst_QTcpSocket::initTestCase_data()
QTest::newRow("WithHttpProxy") << true << int(HttpProxy) << false;
QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false;
-// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << false;
+ QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << false;
#ifndef QT_NO_OPENSSL
QTest::newRow("WithoutProxy SSL") << false << 0 << true;
@@ -284,7 +284,7 @@ void tst_QTcpSocket::initTestCase_data()
QTest::newRow("WithHttpProxy SSL") << true << int(HttpProxy) << true;
QTest::newRow("WithHttpProxyBasicAuth SSL") << true << int(HttpProxy | AuthBasic) << true;
-// QTest::newRow("WithHttpProxyNtlmAuth SSL") << true << int(HttpProxy | AuthNtlm) << true;
+ QTest::newRow("WithHttpProxyNtlmAuth SSL") << true << int(HttpProxy | AuthNtlm) << true;
#endif
}
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index 2e6007e2f6..9dcc369645 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -48,9 +48,14 @@
#include <qtexttable.h>
#include <qdebug.h>
#include <qtextcursor.h>
+#include <qtextdocument.h>
+#include <qtextedit.h>
//TESTED_FILES=
+typedef QList<int> IntList;
+Q_DECLARE_METATYPE(IntList)
+
QT_FORWARD_DECLARE_CLASS(QTextDocument)
class tst_QTextTable : public QObject
@@ -78,6 +83,7 @@ private slots:
void insertRows();
void deleteInTable();
void mergeCells();
+ void mergeAndInsert();
void splitCells();
void blocksForTableShouldHaveEmptyFormat();
void removeTableByRemoveRows();
@@ -93,6 +99,8 @@ private slots:
void removeColumns3();
void removeColumns4();
void removeColumns5();
+ void QTBUG11282_insertBeforeMergedEnding_data();
+ void QTBUG11282_insertBeforeMergedEnding();
private:
QTextTable *create2x2Table();
@@ -586,6 +594,16 @@ void tst_QTextTable::mergeCells()
QVERIFY(table->cellAt(0, 1) == table->cellAt(1, 1));
}
+void tst_QTextTable::mergeAndInsert()
+{
+ QTextTable *table = cursor.insertTable(4,3);
+ table->mergeCells(0,1,3,2);
+ table->mergeCells(3,0,1,3);
+ //Don't crash !
+ table->insertColumns(1,2);
+ QCOMPARE(table->columns(), 5);
+}
+
void tst_QTextTable::splitCells()
{
QTextTable *table = create4x4Table();
@@ -931,5 +949,42 @@ void tst_QTextTable::removeColumns5()
QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
}
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding_data()
+{
+ QTest::addColumn<int>("rows");
+ QTest::addColumn<int>("columns");
+ QTest::addColumn<QList<int> >("merge");
+ QTest::addColumn<QList<int> >("insert");
+
+ QTest::newRow("2x3, merge two, insert one") << 2 << 3 << (QList<int>() << 1 << 2 << 2)
+ << (QList<int>() << 1 << 1) ;
+ QTest::newRow("3x4, merge three, insert one") << 3 << 4 << (QList<int>() << 1 << 3 << 3)
+ << (QList<int>() << 1 << 1) ;
+ QTest::newRow("4x3, merge two, insert two") << 4 << 3 << (QList<int>() << 1 << 4 << 2)
+ << (QList<int>() << 1 << 2) ;
+ QTest::newRow("4x4, merge middle two, insert one") << 4 << 4 << (QList<int>() << 1 << 4 << 2)
+ << (QList<int>() << 1 << 1) ;
+}
+
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding()
+{
+ QFETCH(int, rows);
+ QFETCH(int, columns);
+ QFETCH(QList<int>, merge);
+ QFETCH(QList<int>, insert);
+ QTextTable *table = cursor.insertTable(rows, columns);
+ QTextEdit *textEdit = new QTextEdit;
+ textEdit->setDocument(doc);
+ textEdit->show();
+ QTest::qWaitForWindowShown(textEdit);
+ table->mergeCells(0,merge.at(0), merge.at(1), merge.at(2));
+ //Don't crash !
+ table->insertColumns(insert.at(0), insert.at(1));
+ //Check that the final size is what we expected
+ QCOMPARE(table->rows(), rows);
+ QCOMPARE(table->columns(), columns + insert.at(1));
+ delete textEdit;
+}
+
QTEST_MAIN(tst_QTextTable)
#include "tst_qtexttable.moc"
diff --git a/tests/auto/quuid/quuid.pro b/tests/auto/quuid/quuid.pro
index f7608fa377..25e24561ae 100644
--- a/tests/auto/quuid/quuid.pro
+++ b/tests/auto/quuid/quuid.pro
@@ -1,3 +1,6 @@
-load(qttest_p4)
-QT = core
-SOURCES += tst_quuid.cpp
+TEMPLATE = subdirs
+
+SUBDIRS = testProcessUniqueness
+
+SUBDIRS += test
+
diff --git a/tests/auto/quuid/test/test.pro b/tests/auto/quuid/test/test.pro
new file mode 100644
index 0000000000..123aa50e4e
--- /dev/null
+++ b/tests/auto/quuid/test/test.pro
@@ -0,0 +1,29 @@
+load(qttest_p4)
+
+QT = core
+SOURCES += ../tst_quuid.cpp
+TARGET = tst_quuid
+
+CONFIG(debug_and_release_target) {
+ CONFIG(debug, debug|release) {
+ DESTDIR = ../debug
+ } else {
+ DESTDIR = ../release
+ }
+} else {
+ DESTDIR = ..
+}
+
+wince* {
+ addFile_processUniqueness.sources = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe
+ addFile_processUniqueness.path = testProcessUniqueness
+
+ DEPLOYMENT += addFile_processUniqueness
+}
+
+symbian {
+ binDep.sources = testProcessUniqueness.exe
+ binDep.path = \\sys\\bin
+
+ DEPLOYMENT += binDep
+}
diff --git a/tests/auto/quuid/testProcessUniqueness/main.cpp b/tests/auto/quuid/testProcessUniqueness/main.cpp
new file mode 100644
index 0000000000..4d33c84abb
--- /dev/null
+++ b/tests/auto/quuid/testProcessUniqueness/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 test suite 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 <stdio.h>
+#include <QUuid>
+
+// This is a testcase for QTBUG-11213
+int main(int argc, char **argv)
+{
+ Q_UNUSED(argc)
+ Q_UNUSED(argv)
+
+ // First, break QUuid.
+ qrand();
+
+ // Now print a few uuids.
+ printf("%s", qPrintable(QUuid::createUuid().toString()));
+ printf("%s", qPrintable(QUuid::createUuid().toString()));
+ printf("%s", qPrintable(QUuid::createUuid().toString()));
+
+ // Done
+ return 0;
+}
+
diff --git a/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro b/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro
new file mode 100644
index 0000000000..88df1a25d7
--- /dev/null
+++ b/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro
@@ -0,0 +1,8 @@
+SOURCES = main.cpp
+CONFIG += console
+
+DESTDIR = ./
+
+# no install rule for application used by test
+INSTALLS =
+
diff --git a/tests/auto/quuid/tst_quuid.cpp b/tests/auto/quuid/tst_quuid.cpp
index 47f356a8b7..409d8cf2c0 100644
--- a/tests/auto/quuid/tst_quuid.cpp
+++ b/tests/auto/quuid/tst_quuid.cpp
@@ -73,6 +73,7 @@ private slots:
void versions();
void threadUniqueness();
+ void processUniqueness();
public:
// Variables
@@ -196,5 +197,33 @@ void tst_QUuid::threadUniqueness()
qDeleteAll(threads);
}
+void tst_QUuid::processUniqueness()
+{
+ QProcess process;
+ QString processOneOutput;
+ QString processTwoOutput;
+
+ // Start it once
+#ifdef Q_OS_MAC
+ process.start("testProcessUniqueness/testProcessUniqueness.app");
+#else
+ process.start("testProcessUniqueness/testProcessUniqueness");
+#endif
+ QVERIFY(process.waitForFinished());
+ processOneOutput = process.readAllStandardOutput();
+
+ // Start it twice
+#ifdef Q_OS_MAC
+ process.start("testProcessUniqueness/testProcessUniqueness.app");
+#else
+ process.start("testProcessUniqueness/testProcessUniqueness");
+#endif
+ QVERIFY(process.waitForFinished());
+ processTwoOutput = process.readAllStandardOutput();
+
+ // They should be *different*!
+ QVERIFY(processOneOutput != processTwoOutput);
+}
+
QTEST_MAIN(tst_QUuid)
#include "tst_quuid.moc"
diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp
index b0faf0caa4..52478478a4 100644
--- a/tools/assistant/lib/qhelpprojectdata.cpp
+++ b/tools/assistant/lib/qhelpprojectdata.cpp
@@ -327,10 +327,12 @@ bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace,
QUrl url;
const QLatin1String scheme("qthelp");
url.setScheme(scheme);
- url.setHost(nameSpace);
+ const QString canonicalNamespace = nameSpace.toLower();
+ url.setHost(canonicalNamespace);
url.setPath(vFolder);
- const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder);
+ const QString expectedUrl(scheme + QLatin1String("://")
+ + canonicalNamespace + slash + vFolder);
return url.isValid() && url.toString() == expectedUrl;
}
diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index eb8cc51d90..d9aff7a4da 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -1,4 +1,4 @@
-include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri)
+include(../../../shared/fontpanel/fontpanel.pri)
TEMPLATE = app
LANGUAGE = C++
TARGET = assistant
diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro
deleted file mode 100644
index 6f66876325..0000000000
--- a/tools/assistant/translations/qt_help.pro
+++ /dev/null
@@ -1,53 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-SOURCES += ../lib/qhelpcollectionhandler.cpp \
- ../lib/qhelpcontentwidget.cpp \
- ../lib/qhelpdatainterface.cpp \
- ../lib/qhelpdbreader.cpp \
- ../lib/qhelpengine.cpp \
- ../lib/qhelpenginecore.cpp \
- ../lib/qhelpgenerator.cpp \
- ../lib/qhelpindexwidget.cpp \
- ../lib/qhelpprojectdata.cpp \
- ../lib/qhelpsearchengine.cpp \
- ../lib/qhelpsearchindexreader_clucene.cpp \
- ../lib/qhelpsearchindexreader_default.cpp \
- ../lib/qhelpsearchindexwriter_clucene.cpp \
- ../lib/qhelpsearchindexwriter_default.cpp \
- ../lib/qhelpsearchindex_default.cpp \
- ../lib/qhelpsearchquerywidget.cpp \
- ../lib/qhelpsearchresultwidget.cpp
-
-HEADERS += ../lib/qhelpcollectionhandler_p.h \
- ../lib/qhelpcontentwidget.h \
- ../lib/qhelpdatainterface_p.h \
- ../lib/qhelpdbreader_p.h \
- ../lib/qhelpengine.h \
- ../lib/qhelpenginecore.h \
- ../lib/qhelpengine_p.h \
- ../lib/qhelpgenerator_p.h \
- ../lib/qhelpindexwidget.h \
- ../lib/qhelpprojectdata_p.h \
- ../lib/qhelpsearchengine.h \
- ../lib/qhelpsearchindexreader_clucene_p.h \
- ../lib/qhelpsearchindexreader_default_p.h \
- ../lib/qhelpsearchindexwriter_clucene_p.h \
- ../lib/qhelpsearchindexwriter_default_p.h \
- ../lib/qhelpsearchindex_default_p.h \
- ../lib/qhelpsearchquerywidget.h \
- ../lib/qhelpsearchresultwidget.h \
- ../lib/qhelp_global.h
-
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/qt_help_cs.ts \
- $$TR_DIR/qt_help_da.ts \
- $$TR_DIR/qt_help_de.ts \
- $$TR_DIR/qt_help_hu.ts \
- $$TR_DIR/qt_help_ja.ts \
- $$TR_DIR/qt_help_pl.ts \
- $$TR_DIR/qt_help_ru.ts \
- $$TR_DIR/qt_help_zh_CN.ts \
- $$TR_DIR/qt_help_zh_TW.ts \
- $$TR_DIR/qt_help_fr.ts
diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro
deleted file mode 100644
index c692262fea..0000000000
--- a/tools/assistant/translations/translations.pro
+++ /dev/null
@@ -1,54 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-FORMS += ../tools/assistant/filternamedialog.ui \
- ../tools/assistant/installdialog.ui \
- ../tools/assistant/preferencesdialog.ui \
- ../tools/assistant/topicchooser.ui \
- ../tools/assistant/bookmarkdialog.ui
-
-SOURCES += ../tools/assistant/aboutdialog.cpp \
- ../tools/assistant/bookmarkmanager.cpp \
- ../tools/assistant/centralwidget.cpp \
- ../tools/assistant/cmdlineparser.cpp \
- ../tools/assistant/contentwindow.cpp \
- ../tools/assistant/filternamedialog.cpp \
- ../tools/assistant/helpviewer.cpp \
- ../tools/assistant/indexwindow.cpp \
- ../tools/assistant/installdialog.cpp \
- ../tools/assistant/main.cpp \
- ../tools/assistant/mainwindow.cpp \
- ../tools/assistant/preferencesdialog.cpp \
- ../tools/assistant/remotecontrol.cpp \
- ../tools/assistant/searchwidget.cpp \
- ../tools/assistant/topicchooser.cpp \
-
-SOURCES += ../../shared/fontpanel/fontpanel.cpp
-
-HEADERS += ../tools/assistant/aboutdialog.h \
- ../tools/assistant/bookmarkmanager.h \
- ../tools/assistant/centralwidget.h \
- ../tools/assistant/cmdlineparser.h \
- ../tools/assistant/contentwindow.h \
- ../tools/assistant/filternamedialog.h \
- ../tools/assistant/helpviewer.h \
- ../tools/assistant/indexwindow.h \
- ../tools/assistant/installdialog.h \
- ../tools/assistant/mainwindow.h \
- ../tools/assistant/preferencesdialog.h \
- ../tools/assistant/remotecontrol.h \
- ../tools/assistant/remotecontrol_win.h \
- ../tools/assistant/searchwidget.h \
- ../tools/assistant/topicchooser.h \
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/assistant_cs.ts \
- $$TR_DIR/assistant_da.ts \
- $$TR_DIR/assistant_de.ts \
- $$TR_DIR/assistant_fr.ts \
- $$TR_DIR/assistant_hu.ts \
- $$TR_DIR/assistant_ja.ts \
- $$TR_DIR/assistant_pl.ts \
- $$TR_DIR/assistant_ru.ts \
- $$TR_DIR/assistant_zh_CN.ts \
- $$TR_DIR/assistant_zh_TW.ts
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 952d4e0ac7..7f2d53bd44 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2439,7 +2439,9 @@ void Configure::generateOutputVars()
qmakeFormatPlugins += "gif";
if (dictionary[ "TIFF" ] == "no")
- qtConfig += "no-tiff";
+ qtConfig += "no-tiff";
+ else if (dictionary[ "TIFF" ] == "yes")
+ qtConfig += "tiff";
else if (dictionary[ "TIFF" ] == "plugin")
qmakeFormatPlugins += "tiff";
if (dictionary[ "LIBTIFF" ] == "system")
@@ -2447,6 +2449,8 @@ void Configure::generateOutputVars()
if (dictionary[ "JPEG" ] == "no")
qtConfig += "no-jpeg";
+ else if (dictionary[ "JPEG" ] == "yes")
+ qtConfig += "jpeg";
else if (dictionary[ "JPEG" ] == "plugin")
qmakeFormatPlugins += "jpeg";
if (dictionary[ "LIBJPEG" ] == "system")
@@ -3160,16 +3164,6 @@ void Configure::generateConfigfiles()
QFile::remove(outName);
tmpFile.copy(outName);
tmpFile.close();
-
- if (!QFile::exists(buildPath + "/include/QtCore/qconfig.h")) {
- if (!writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
- buildPath + "/include/QtCore/qconfig.h")
- || !writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
- buildPath + "/include/Qt/qconfig.h")) {
- dictionary["DONE"] = "error";
- return;
- }
- }
}
// Copy configured mkspec to default directory, but remove the old one first, if there is any
diff --git a/tools/designer/src/components/lib/lib.pro b/tools/designer/src/components/lib/lib.pro
index 8d0e69266a..0ada845f83 100644
--- a/tools/designer/src/components/lib/lib.pro
+++ b/tools/designer/src/components/lib/lib.pro
@@ -44,11 +44,11 @@ SOURCES += qdesigner_components.cpp
}
INCLUDEPATH += . .. \
- $$QT_SOURCE_TREE/tools/designer/src/lib/components \
- $$QT_SOURCE_TREE/tools/designer/src/lib/sdk \
- $$QT_SOURCE_TREE/tools/designer/src/lib/extension \
- $$QT_SOURCE_TREE/tools/designer/src/lib/uilib \
- $$QT_SOURCE_TREE/tools/designer/src/lib/shared
+ $$PWD/../../lib/components \
+ $$PWD/../../lib/sdk \
+ $$PWD/../../lib/extension \
+ $$PWD/../../lib/uilib \
+ $$PWD/../../lib/shared
include(../propertyeditor/propertyeditor.pri)
include(../objectinspector/objectinspector.pri)
diff --git a/tools/designer/src/components/objectinspector/objectinspector.pri b/tools/designer/src/components/objectinspector/objectinspector.pri
index 733c4b37ae..565f78bdcb 100644
--- a/tools/designer/src/components/objectinspector/objectinspector.pri
+++ b/tools/designer/src/components/objectinspector/objectinspector.pri
@@ -3,7 +3,7 @@
contains(CONFIG, static) {
INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/findwidget
} else {
- include($$QT_SOURCE_TREE/tools/shared/findwidget/findwidget.pri)
+ include(../../../../shared/findwidget/findwidget.pri)
}
INCLUDEPATH += $$PWD
diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.pri b/tools/designer/src/components/propertyeditor/propertyeditor.pri
index a8ed37e81d..7d2e7cba6c 100644
--- a/tools/designer/src/components/propertyeditor/propertyeditor.pri
+++ b/tools/designer/src/components/propertyeditor/propertyeditor.pri
@@ -10,8 +10,8 @@ contains(CONFIG, static) {
INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/qtpropertybrowser
INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/qtgradienteditor
} else {
- include($$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri)
- include($$QT_SOURCE_TREE/tools/shared/qtgradienteditor/qtcolorbutton.pri)
+ include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri)
+ include(../../../../shared/qtgradienteditor/qtcolorbutton.pri)
}
FORMS += $$PWD/paletteeditor.ui \
diff --git a/tools/designer/src/designer/designer.pro b/tools/designer/src/designer/designer.pro
index 8590c7b2c7..8564e96cb7 100644
--- a/tools/designer/src/designer/designer.pro
+++ b/tools/designer/src/designer/designer.pro
@@ -25,8 +25,8 @@ contains(CONFIG, static) {
TARGET = designer
-include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri)
-include($$QT_SOURCE_TREE/tools/shared/qttoolbardialog/qttoolbardialog.pri)
+include(../../../shared/fontpanel/fontpanel.pri)
+include(../../../shared/qttoolbardialog/qttoolbardialog.pri)
HEADERS += \
qdesigner.h \
@@ -88,4 +88,3 @@ INSTALLS += target
include(../sharedcomponents.pri)
unix:!mac:LIBS += -lm
-TRANSLATIONS = designer_de.ts
diff --git a/tools/designer/src/lib/shared/shared.pri b/tools/designer/src/lib/shared/shared.pri
index 570b2080a0..828636082c 100644
--- a/tools/designer/src/lib/shared/shared.pri
+++ b/tools/designer/src/lib/shared/shared.pri
@@ -2,11 +2,11 @@
INCLUDEPATH += $$PWD
contains(QT_CONFIG, script): QT += script
-include($$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri)
-include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri)
-include($$QT_SOURCE_TREE/src/tools/rcc/rcc.pri)
-include($$QT_SOURCE_TREE/tools/shared/findwidget/findwidget.pri)
-include($$QT_SOURCE_TREE/tools/shared/qtgradienteditor/qtgradienteditor.pri)
+include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri)
+include(../../../../shared/deviceskin/deviceskin.pri)
+include(../../../../../src/tools/rcc/rcc.pri)
+include(../../../../shared/findwidget/findwidget.pri)
+include(../../../../shared/qtgradienteditor/qtgradienteditor.pri)
# Input
FORMS += $$PWD/addlinkdialog.ui \
diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro
deleted file mode 100644
index 103c1fe6c0..0000000000
--- a/tools/designer/translations/translations.pro
+++ /dev/null
@@ -1,141 +0,0 @@
-include(../src/components/buddyeditor/buddyeditor.pri)
-include(../src/components/component.pri)
-include(../src/components/formeditor/formeditor.pri)
-include(../src/components/objectinspector/objectinspector.pri)
-include(../src/components/propertyeditor/propertyeditor.pri)
-include(../src/components/signalsloteditor/signalsloteditor.pri)
-include(../src/components/tabordereditor/tabordereditor.pri)
-include(../src/components/taskmenu/taskmenu.pri)
-include(../src/components/widgetbox/widgetbox.pri)
-include(../src/lib/extension/extension.pri)
-include(../src/lib/sdk/sdk.pri)
-include(../src/lib/shared/shared.pri)
-include(../src/lib/uilib/uilib.pri)
-include(../../shared/qttoolbardialog/qttoolbardialog.pri)
-include(../../shared/qtpropertybrowser/qtpropertybrowser.pri)
-include(../../shared/qtgradienteditor/qtgradienteditor.pri)
-
-# Include ActiveQt plugin
-SOURCES += ../src/plugins/activeqt/qaxwidgetextrainfo.cpp \
- ../src/plugins/activeqt/qaxwidgetplugin.cpp \
- ../src/plugins/activeqt/qaxwidgetpropertysheet.cpp \
- ../src/plugins/activeqt/qaxwidgettaskmenu.cpp \
- ../src/plugins/activeqt/qdesigneraxwidget.cpp
-
-HEADERS += ../src/plugins/activeqt/qaxwidgetextrainfo.h \
- ../src/plugins/activeqt/qaxwidgetplugin.h \
- ../src/plugins/activeqt/qaxwidgetpropertysheet.h \
- ../src/plugins/activeqt/qaxwidgettaskmenu.h \
- ../src/plugins/activeqt/qdesigneraxwidget.h \
- ../../../src/activeqt/shared/qaxtypes.h
-
-
-# Include Qt3Support plugin
-
-SOURCES += ../src/plugins/widgets/qt3supportwidgets.cpp
-HEADERS += ../src/plugins/widgets/q3iconview/q3iconview_extrainfo.h \
- ../src/plugins/widgets/q3iconview/q3iconview_plugin.h \
- ../src/plugins/widgets/q3listview/q3listview_extrainfo.h \
- ../src/plugins/widgets/q3listview/q3listview_plugin.h \
- ../src/plugins/widgets/q3mainwindow/q3mainwindow_container.h \
- ../src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h \
- ../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h \
- ../src/plugins/widgets/q3toolbar/q3toolbar_plugin.h \
- ../src/plugins/widgets/q3widgetstack/q3widgetstack_container.h \
- ../src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.h \
- ../src/plugins/widgets/q3widgetstack/qdesigner_q3widgetstack_p.h \
- ../src/plugins/widgets/q3wizard/q3wizard_container.h \
- ../src/plugins/widgets/q3wizard/q3wizard_plugin.h \
- ../src/plugins/widgets/q3listbox/q3listbox_extrainfo.h \
- ../src/plugins/widgets/q3listbox/q3listbox_plugin.h \
- ../src/plugins/widgets/q3table/q3table_extrainfo.h \
- ../src/plugins/widgets/q3table/q3table_plugin.h \
- ../src/plugins/widgets/q3textedit/q3textedit_extrainfo.h \
- ../src/plugins/widgets/q3textedit/q3textedit_plugin.h \
- ../src/plugins/widgets/q3widgets/q3widget_plugins.h
-
-SOURCES += ../src/plugins/widgets/q3iconview/q3iconview_extrainfo.cpp \
- ../src/plugins/widgets/q3iconview/q3iconview_plugin.cpp \
- ../src/plugins/widgets/q3listview/q3listview_extrainfo.cpp \
- ../src/plugins/widgets/q3listview/q3listview_plugin.cpp \
- ../src/plugins/widgets/q3mainwindow/q3mainwindow_container.cpp \
- ../src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.cpp \
- ../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.cpp \
- ../src/plugins/widgets/q3toolbar/q3toolbar_plugin.cpp \
- ../src/plugins/widgets/q3widgetstack/q3widgetstack_container.cpp \
- ../src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.cpp \
- ../src/plugins/widgets/q3widgetstack/qdesigner_q3widgetstack.cpp \
- ../src/plugins/widgets/q3wizard/q3wizard_container.cpp \
- ../src/plugins/widgets/q3wizard/q3wizard_plugin.cpp \
- ../src/plugins/widgets/q3listbox/q3listbox_extrainfo.cpp \
- ../src/plugins/widgets/q3listbox/q3listbox_plugin.cpp \
- ../src/plugins/widgets/q3table/q3table_extrainfo.cpp \
- ../src/plugins/widgets/q3table/q3table_plugin.cpp \
- ../src/plugins/widgets/q3textedit/q3textedit_extrainfo.cpp \
- ../src/plugins/widgets/q3textedit/q3textedit_plugin.cpp \
- ../src/plugins/widgets/q3widgets/q3widget_plugins.cpp
-
-# Include those manually as they do not contain any directory specification
-APP_DIR=../src/designer
-SOURCES += $$APP_DIR/appfontdialog.cpp \
- $$APP_DIR/assistantclient.cpp \
- $$APP_DIR/main.cpp \
- $$APP_DIR/mainwindow.cpp \
- $$APP_DIR/newform.cpp \
- $$APP_DIR/preferencesdialog.cpp \
- $$APP_DIR/qdesigner_actions.cpp \
- $$APP_DIR/qdesigner_appearanceoptions.cpp \
- $$APP_DIR/qdesigner.cpp \
- $$APP_DIR/qdesigner_formwindow.cpp \
- $$APP_DIR/qdesigner_server.cpp \
- $$APP_DIR/qdesigner_settings.cpp \
- $$APP_DIR/qdesigner_toolwindow.cpp \
- $$APP_DIR/qdesigner_workbench.cpp \
- $$APP_DIR/saveformastemplate.cpp \
- $$APP_DIR/versiondialog.cpp
-
-HEADERS+= $$APP_DIR/appfontdialog.h \
- $$APP_DIR/assistantclient.h \
- $$APP_DIR/designer_enums.h \
- $$APP_DIR/mainwindow.h \
- $$APP_DIR/newform.h \
- $$APP_DIR/preferencesdialog.h \
- $$APP_DIR/qdesigner_actions.h \
- $$APP_DIR/qdesigner_appearanceoptions.h \
- $$APP_DIR/qdesigner_formwindow.h \
- $$APP_DIR/qdesigner.h \
- $$APP_DIR/qdesigner_pch.h \
- $$APP_DIR/qdesigner_server.h \
- $$APP_DIR/qdesigner_settings.h \
- $$APP_DIR/qdesigner_toolwindow.h \
- $$APP_DIR/qdesigner_workbench.h \
- $$APP_DIR/saveformastemplate.h \
- $$APP_DIR/versiondialog.h
-
-FORMS += $$APP_DIR/preferencesdialog.ui \
- $$APP_DIR/qdesigner_appearanceoptions.ui \
- $$APP_DIR/saveformastemplate.ui
-
-# Shared solutions
-SOURCES += ../../shared/fontpanel/fontpanel.cpp \
- ../../shared/deviceskin/deviceskin.cpp \
- ../../shared/findwidget/abstractfindwidget.cpp \
- ../../shared/findwidget/itemviewfindwidget.cpp \
- ../../shared/findwidget/texteditfindwidget.cpp \
-
-HEADERS += ../../shared/findwidget/abstractfindwidget.h \
- ../../shared/findwidget/itemviewfindwidget.h \
- ../../shared/findwidget/texteditfindwidget.h
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/designer_cs.ts \
- $$TR_DIR/designer_de.ts \
- $$TR_DIR/designer_fr.ts \
- $$TR_DIR/designer_hu.ts \
- $$TR_DIR/designer_ja.ts \
- $$TR_DIR/designer_pl.ts \
- $$TR_DIR/designer_ru.ts \
- $$TR_DIR/designer_sl.ts \
- $$TR_DIR/designer_zh_CN.ts \
- $$TR_DIR/designer_zh_TW.ts
diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro
index 4f7ed8a77e..ce8d5854f1 100644
--- a/tools/linguist/linguist/linguist.pro
+++ b/tools/linguist/linguist/linguist.pro
@@ -94,15 +94,3 @@ FORMS += statistics.ui \
translationsettings.ui \
finddialog.ui
RESOURCES += linguist.qrc
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/linguist_cs.ts \
- $$TR_DIR/linguist_de.ts \
- $$TR_DIR/linguist_fr.ts \
- $$TR_DIR/linguist_hu.ts \
- $$TR_DIR/linguist_ja.ts \
- $$TR_DIR/linguist_pl.ts \
- $$TR_DIR/linguist_ru.ts \
- $$TR_DIR/linguist_zh_CN.ts \
- $$TR_DIR/linguist_zh_TW.ts
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 609bd3dff9..bc9bb261ce 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1686,9 +1686,14 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
HashString ns = HashString(text);
yyTok = getToken();
if (yyTok == Tok_LeftBrace) {
+ yyTok = getToken();
namespaceDepths.push(namespaces.count());
enterNamespace(&namespaces, ns);
- yyTok = getToken();
+
+ functionContext = namespaces;
+ functionContextUnresolved.clear();
+ prospectiveContext.clear();
+ pendingContext.clear();
} else if (yyTok == Tok_Equals) {
// e.g. namespace Is = OuterSpace::InnerSpace;
QList<HashString> fullName;
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 33ceaf5108..7130d61679 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -630,4 +630,12 @@ QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle )
}
#endif
+const Node* CodeMarker::resolveTarget(const QString& ,
+ const Tree* ,
+ const Node* ,
+ const Node* )
+{
+ return 0;
+}
+
QT_END_NAMESPACE
diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h
index aab8a9cee8..53ad4a8eed 100644
--- a/tools/qdoc3/codemarker.h
+++ b/tools/qdoc3/codemarker.h
@@ -155,10 +155,11 @@ class CodeMarker
virtual QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
SynopsisStyle style);
#endif
- virtual const Node *resolveTarget(const QString& target,
- const Tree *tree,
- const Node *relative) = 0;
- virtual QStringList macRefsForNode(const Node *node);
+ virtual const Node* resolveTarget(const QString& target,
+ const Tree* tree,
+ const Node* relative,
+ const Node* self = 0);
+ virtual QStringList macRefsForNode(const Node* node);
static void initialize(const Config& config);
static void terminate();
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index c29becca8a..af58a3f6c6 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -143,6 +143,7 @@ class Config
#define CONFIG_NATURALLANGUAGE "naturallanguage"
#define CONFIG_OBSOLETELINKS "obsoletelinks"
#define CONFIG_ONLINE "online"
+#define CONFIG_CREATOR "creator"
#define CONFIG_OUTPUTDIR "outputdir"
#define CONFIG_OUTPUTENCODING "outputencoding"
#define CONFIG_OUTPUTLANGUAGE "outputlanguage"
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index c4ee054af6..562e92bea0 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -825,9 +825,10 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
return sections;
}
-const Node *CppCodeMarker::resolveTarget(const QString &target,
- const Tree *tree,
- const Node *relative)
+const Node *CppCodeMarker::resolveTarget(const QString& target,
+ const Tree* tree,
+ const Node* relative,
+ const Node* self)
{
if (target.endsWith("()")) {
const FunctionNode *func;
@@ -869,11 +870,13 @@ const Node *CppCodeMarker::resolveTarget(const QString &target,
else {
QStringList path = target.split("::");
const Node *node;
+ int flags = Tree::SearchBaseClasses |
+ Tree::SearchEnumValues |
+ Tree::NonFunction;
if ((node = tree->findNode(path,
relative,
- Tree::SearchBaseClasses |
- Tree::SearchEnumValues |
- Tree::NonFunction)))
+ flags,
+ self)))
return node;
}
return 0;
diff --git a/tools/qdoc3/cppcodemarker.h b/tools/qdoc3/cppcodemarker.h
index 2dcf400acd..eca3936b5c 100644
--- a/tools/qdoc3/cppcodemarker.h
+++ b/tools/qdoc3/cppcodemarker.h
@@ -81,9 +81,10 @@ class CppCodeMarker : public CodeMarker
Status status);
QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
SynopsisStyle style);
- const Node *resolveTarget(const QString& target,
- const Tree *tree,
- const Node *relative);
+ const Node* resolveTarget(const QString& target,
+ const Tree* tree,
+ const Node* relative,
+ const Node* self = 0);
private:
QString addMarkUp(const QString& protectedCode,
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index e4870e3f6d..d5108fd770 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -728,23 +728,12 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
if (n)
classNode = static_cast<const ClassNode*>(n);
}
- if (names[0].startsWith("Q"))
+ if (names[0].startsWith("Qt"))
return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode);
else
return new QmlClassNode(tre->root(), names[0], classNode);
}
else if (command == COMMAND_QMLBASICTYPE) {
-#if 0
- QStringList parts = arg.split(" ");
- qDebug() << command << parts;
- if (parts.size() > 1) {
- FakeNode* pageNode = static_cast<FakeNode*>(tre->root()->findNode(parts[1], Node::Fake));
- if (pageNode) {
- qDebug() << "FOUND";
- return new QmlBasicTypeNode(pageNode, parts[0]);
- }
- }
-#endif
return new QmlBasicTypeNode(tre->root(), arg);
}
else if ((command == COMMAND_QMLSIGNAL) ||
@@ -755,7 +744,7 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
QString type;
QmlClassNode* qmlClass = 0;
if (splitQmlMethodArg(doc,arg,type,element)) {
- if (element.startsWith(QLatin1String("Q")))
+ if (element.startsWith(QLatin1String("Qt")))
element = QLatin1String("QML:") + element;
Node* n = tre->findNode(QStringList(element),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 89b1e9853c..9977df0257 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -63,6 +63,12 @@ QT_BEGIN_NAMESPACE
int HtmlGenerator::id = 0;
bool HtmlGenerator::debugging_on = false;
+#if 0
+QString HtmlGenerator::divNavTop = "<div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>";
+#endif
+
+QString HtmlGenerator::divNavTop = "";
+
QString HtmlGenerator::sinceTitles[] =
{
" New Namespaces",
@@ -214,6 +220,7 @@ HtmlGenerator::HtmlGenerator()
numTableRows(0),
threeColumnEnumValueTable(true),
offlineDocs(true),
+ creatorDocs(true),
funcLeftParen("\\S(\\()"),
myTree(0),
slow(false),
@@ -276,6 +283,7 @@ void HtmlGenerator::initializeGenerator(const Config &config)
project = config.getString(CONFIG_PROJECT);
offlineDocs = !config.getBool(CONFIG_ONLINE);
+ creatorDocs = false; //!config.getBool(CONFIG_CREATOR);
projectDescription = config.getString(CONFIG_DESCRIPTION);
if (projectDescription.isEmpty() && !project.isEmpty())
projectDescription = project + " Reference Documentation";
@@ -346,17 +354,6 @@ QString HtmlGenerator::format()
*/
void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
{
-#if 0
- // Copy the stylesheets from the directory containing the qdocconf file.
- // ### This should be changed to use a special directory in doc/src.
- QStringList::ConstIterator styleIter = stylesheets.begin();
- QDir configPath = QDir::current();
- while (styleIter != stylesheets.end()) {
- QString filePath = configPath.absoluteFilePath(*styleIter);
- Config::copyFile(Location(), filePath, filePath, outputDir());
- ++styleIter;
- }
-#endif
myTree = tree;
nonCompatClasses.clear();
mainClasses.clear();
@@ -371,9 +368,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
findAllFunctions(tree->root());
findAllLegaleseTexts(tree->root());
findAllNamespaces(tree->root());
-#ifdef ZZZ_QDOC_QML
- findAllQmlClasses(tree->root());
-#endif
findAllSince(tree->root());
PageGenerator::generateTree(tree, marker);
@@ -923,13 +917,13 @@ int HtmlGenerator::generateAtom(const Atom *atom,
else
out() << "<tr class=\"even\">";
- out() << "<tr><th>Constant</th>"
- << "<th>Value</th>"
- << "<th>Description</th></tr>\n";
+ out() << "<tr><th class=\"tblConst\">Constant</th>"
+ << "<th class=\"tblval\">Value</th>"
+ << "<th class=\"tbldscr\">Description</th></tr>\n";
}
else {
out() << "<table class=\"valuelist\">"
- << "<tr><th>Constant</th><th>Value</th></tr>\n";
+ << "<tr><th class=\"tblConst\">Constant</th><th class=\"tblVal\">Value</th></tr>\n";
}
}
else {
@@ -1067,11 +1061,11 @@ int HtmlGenerator::generateAtom(const Atom *atom,
}
sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
}
- out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a>" << divNavTop << "\n";
}
#else
out() << "<a name=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString())
- << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ << "\"></a>" << divNavTop << "\n";
#endif
break;
case Atom::SectionRight:
@@ -1143,9 +1137,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
case Atom::TableItemLeft:
{
if (inTableHeader)
- out() << "<th";
+ out() << "<th ";
else
- out() << "<td";
+ out() << "<td ";
QStringList spans = atom->string().split(",");
if (spans.size() == 2) {
@@ -1259,30 +1253,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")"
<< Atom(Atom::LineBreak);
-#if 0
- // No longer used because the modeule name is a breadcrumb.
- QString fixedModule = inner->moduleName();
- if (fixedModule == "Qt3SupportLight")
- fixedModule = "Qt3Support";
- if (!fixedModule.isEmpty())
- subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]";
-
- if (fixedModule.isEmpty()) {
- QMultiMap<QString, QString> publicGroups = myTree->publicGroups();
- QList<QString> groupNames = publicGroups.values(inner->name());
- if (!groupNames.isEmpty()) {
- qSort(groupNames.begin(), groupNames.end());
- subtitleText << "[";
- for (int j=0; j<groupNames.count(); j++) {
- subtitleText << Atom(Atom::AutoLink, groupNames[j]);
- if (j<groupNames.count()-1)
- subtitleText <<", ";
- }
- subtitleText << "]";
- }
- }
-#endif
-
generateHeader(title, inner, marker);
sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
generateTableOfContents(inner,marker,&sections);
@@ -1343,7 +1313,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
// out() << "<hr />\n";
out() << "<a name=\""
<< registerRef((*s).name.toLower())
- << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ << "\"></a>" << divNavTop << "\n";
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
generateSection(s->members, inner, marker, CodeMarker::Summary);
}
@@ -1352,7 +1322,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
// out() << "<hr />\n";
out() << "<a name=\""
<< registerRef(name.toLower())
- << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ << "\"></a>" << divNavTop << "\n";
out() << "<h2>" << protectEnc(name) << "</h2>\n";
generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
}
@@ -1379,15 +1349,17 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
out() << "</ul>\n";
}
- out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
if (!inner->doc().isEmpty()) {
+ generateExtractionMark(inner, DetailedDescriptionMark);
//out() << "<hr />\n"
- out() << "<div class=\"descr\"/>\n" // QTBUG-9504
+ out() << "<div class=\"descr\">\n" // QTBUG-9504
<< "<h2>" << "Detailed Description" << "</h2>\n";
generateBody(inner, marker);
out() << "</div>\n"; // QTBUG-9504
generateAlsoList(inner, marker);
+ generateExtractionMark(inner, EndMark);
}
sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
@@ -1395,7 +1367,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
while (s != sections.end()) {
//out() << "<hr />\n";
if (!(*s).divClass.isEmpty())
- out() << "<div class=\"" << (*s).divClass << "\"/>\n"; // QTBUG-9504
+ out() << "<div class=\"" << (*s).divClass << "\">\n"; // QTBUG-9504
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
NodeList::ConstIterator m = (*s).members.begin();
@@ -1519,12 +1491,12 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateStatus(fake, marker);
if (moduleNamespaceMap.contains(fake->name())) {
- out() << "<a name=\"" << registerRef("namespaces") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << "\n";
out() << "<h2>Namespaces</h2>\n";
generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
}
if (moduleClassMap.contains(fake->name())) {
- out() << "<a name=\"" << registerRef("classes") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"" << registerRef("classes") << "\"></a>" << divNavTop << "\n";
out() << "<h2>Classes</h2>\n";
generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
}
@@ -1587,18 +1559,20 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
s = sections.begin();
while (s != sections.end()) {
- out() << "<a name=\"" << registerRef((*s).name) << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
generateQmlSummary(*s,fake,marker);
++s;
}
- out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ generateExtractionMark(fake, DetailedDescriptionMark);
+ out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
out() << "<h2>" << "Detailed Description" << "</h2>\n";
generateBody(fake, marker);
if (cn)
generateQmlText(cn->doc().body(), cn, marker, fake->name());
generateAlsoList(fake, marker);
+ generateExtractionMark(fake, EndMark);
//out() << "<hr />\n";
sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
@@ -1623,7 +1597,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay);
s = sections.begin();
while (s != sections.end()) {
- out() << "<a name=\"" << registerRef((*s).name) << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
generateSectionList(*s, fake, marker, CodeMarker::Summary);
++s;
@@ -1631,16 +1605,20 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
Text brief = fake->doc().briefText();
if (fake->subType() == Node::Module && !brief.isEmpty()) {
- out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
- out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
+ generateExtractionMark(fake, DetailedDescriptionMark);
+ out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
+ out() << "<div class=\"descr\">\n"; // QTBUG-9504
out() << "<h2>" << "Detailed Description" << "</h2>\n";
}
- else
- out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
+ else {
+ generateExtractionMark(fake, DetailedDescriptionMark);
+ out() << "<div class=\"descr\">\n"; // QTBUG-9504
+ }
generateBody(fake, marker);
out() << "</div>\n"; // QTBUG-9504
generateAlsoList(fake, marker);
+ generateExtractionMark(fake, EndMark);
if (!fake->groupMembers().isEmpty()) {
NodeMap groupMembersMap;
@@ -1738,8 +1716,9 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
}
}
else if (node->subType() == Node::Page) {
- if (fn->name() == QString("examples.html")) {
- out() << " <li>Examples</li>";
+ if (fn->name() == QString("qdeclarativeexamples.html")) {
+ out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
+ out() << " <li>QML Examples & Demos</li>";
}
else if (fn->name().startsWith("examples-")) {
out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
@@ -1759,10 +1738,14 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
else if (node->subType() == Node::Example) {
out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
QStringList sl = fn->name().split('/');
- QString name = "examples-" + sl.at(0) + ".html";
- QString t = CodeParser::titleFromName(name);
- out() << " <li><a href=\"" << name << "\">"
- << t << "</a></li>";
+ if (sl.contains("declarative"))
+ out() << " <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>";
+ else {
+ QString name = "examples-" + sl.at(0) + ".html";
+ QString t = CodeParser::titleFromName(name);
+ out() << " <li><a href=\"" << name << "\">"
+ << t << "</a></li>";
+ }
out() << " <li>" << title << "</li>";
}
}
@@ -1795,21 +1778,38 @@ void HtmlGenerator::generateHeader(const QString& title,
else
shortVersion = "Qt " + shortVersion + ": ";
}
-
+ // Generating page title
out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n";
-
- //out() << " <title>Qt Reference Documentation</title>";
-
+ // Adding style sheet
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />";
+ // Adding jquery and functions - providing online tools and search features
+ out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
+ out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ // Adding style and js for small windows
+ out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+ out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
+
+ // Adding syntax highlighter // future release
+
+ // Setting assistant configuration
if (offlineDocs)
{
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />";
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
out() << "</head>\n";
- out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
- out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << "<body class=\"offline \">\n"; // offline for Assistant
}
+ if (creatorDocs)
+ {
+ out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
+ out() << "</head>\n";
+ out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
+ }
+ // Setting online doc configuration
else
{
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
+ // Browser spec styles
out() << " <!--[if IE]>\n";
out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
@@ -1823,25 +1823,9 @@ void HtmlGenerator::generateHeader(const QString& title,
out() << "<!--[if IE 8]>\n";
out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
out() << "<![endif]-->\n";
- // jquery functions
- out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
- out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
- // menus and small docs js and css
- out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
- out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
-
- // syntax highlighter js and css
- // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shCore.css\"/>\n";
- // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shThemeDefault.css\"/>\n";
- // out() << " <script type=\"text/javascript\" src=\"scripts/shCore.js\"></script>\n";
- // out() << " <script type=\"text/javascript\" src=\"scripts/shBrushCpp.js\"></script>\n";
- // out() << " <script type=\"text/javascript\">\n";
- // out() << " SyntaxHighlighter.all();\n";
- // out() << " </script>\n";
out() << "</head>\n";
+ // CheckEmptyAndLoadList activating search
out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
}
@@ -1853,7 +1837,7 @@ void HtmlGenerator::generateHeader(const QString& title,
generateBreadCrumbs(title,node,marker);
out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
-#if 0 // Removed for new docf format. MWS
+#if 0 // Removed for new doc format. MWS
if (node && !node->links().empty())
out() << "<p>\n" << navigationLinks << "</p>\n";
#endif
@@ -1890,6 +1874,10 @@ void HtmlGenerator::generateFooter(const Node *node)
{
out() << "</body>\n";
}
+ if (creatorDocs)
+ {
+ out() << "</body>\n";
+ }
else
{
out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
@@ -1913,6 +1901,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
{
Text brief = node->doc().briefText();
if (!brief.isEmpty()) {
+ generateExtractionMark(node, BriefMark);
out() << "<p>";
generateText(brief, node, marker);
if (!relative || node == relative)
@@ -1920,6 +1909,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
else
out() << " <a href=\"" << linkForNode(node, relative) << "#";
out() << registerRef("details") << "\">More...</a></p>\n";
+ generateExtractionMark(node, EndMark);
}
}
@@ -2072,7 +2062,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
}
}
}
- else if (sections && (node->type() == Node::Class)) {
+ else if (sections && ((node->type() == Node::Class) ||
+ (node->type() == Node::Namespace))) {
QList<Section>::ConstIterator s = sections->begin();
while (s != sections->end()) {
if (!s->members.isEmpty() || !s->reimpMembers.isEmpty()) {
@@ -2333,20 +2324,20 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
out() << "<tr class=\"odd topAlign\">";
else
out() << "<tr class=\"even topAlign\">";
- out() << "<td><p>";
+ out() << "<td class=\"tblName\"><p>";
generateFullName(node, relative, marker);
out() << "</p></td>";
if (!(node->type() == Node::Fake)) {
Text brief = node->doc().trimmedBriefText(name);
if (!brief.isEmpty()) {
- out() << "<td><p>";
+ out() << "<td class=\"tblDescr\"><p>";
generateText(brief, node, marker);
out() << "</p></td>";
}
}
else {
- out() << "<td><p>";
+ out() << "<td class=\"tblDescr\"><p>";
out() << protectEnc(node->doc().briefText().toString());
out() << "</p></td>";
}
@@ -2665,19 +2656,7 @@ void HtmlGenerator::generateQmlItem(const Node *node,
marked.replace("<@type>", "");
marked.replace("</@type>", "");
}
- if (node->type() == Node::QmlProperty) {
- const QmlPropertyNode* qpn = static_cast<const QmlPropertyNode*>(node);
- if (!summary && qpn->name() == "color" && qpn->dataType() == "color") {
- if (relative && relative->name() == "GradientStop") {
- qDebug() << "color : color";
- debugging_on = true;
- qDebug() << " " << relative->name() << relative->type() << relative->subType();
- qDebug() << marked;
- }
- }
- }
- out() << highlightedCode(marked, marker, relative);
- debugging_on = false;
+ out() << highlightedCode(marked, marker, relative, false, node);
}
#endif
@@ -2988,7 +2967,8 @@ void HtmlGenerator::generateSynopsis(const Node *node,
QString HtmlGenerator::highlightedCode(const QString& markedCode,
CodeMarker* marker,
const Node* relative,
- bool alignNames)
+ bool alignNames,
+ const Node* self)
{
QString src = markedCode;
QString html;
@@ -3002,7 +2982,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
static const QString headerTag("headerfile");
static const QString funcTag("func");
static const QString linkTag("link");
-
+
// replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
bool done = false;
for (int i = 0, srcSize = src.size(); i < srcSize;) {
@@ -3067,13 +3047,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
bool handled = false;
if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
par1 = QStringRef();
- const Node* n = marker->resolveTarget(arg.toString(), myTree, relative);
- if (HtmlGenerator::debugging_on) {
- if (n) {
- qDebug() << " " << n->name() << n->type() << n->subType();
- qDebug() << " " << relative->name() << relative->type() << relative->subType();
- }
- }
+ const Node* n = marker->resolveTarget(arg.toString(), myTree, relative, self);
addLink(linkForNode(n,relative), arg, &html);
handled = true;
}
@@ -3504,6 +3478,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
#ifdef GENERATE_MAC_REFS
generateMacRef(node, marker);
#endif
+ generateExtractionMark(node, MemberMark);
if (node->type() == Node::Enum
&& (enume = static_cast<const EnumNode *>(node))->flagsType()) {
#ifdef GENERATE_MAC_REFS
@@ -3523,7 +3498,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
out() << "<h3 class=\"fn\">";
out() << "<a name=\"" + refForNode(node) + "\"></a>";
generateSynopsis(node, relative, marker, CodeMarker::Detailed);
- out() << "</h3><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+ out() << "</h3>" << divNavTop << "\n";
}
generateStatus(node, marker);
@@ -3566,6 +3541,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
}
}
generateAlsoList(node, marker);
+ generateExtractionMark(node, EndMark);
}
void HtmlGenerator::findAllClasses(const InnerNode *node)
@@ -3679,13 +3655,6 @@ void HtmlGenerator::findAllSince(const InnerNode *node)
}
}
-#if 0
- const QRegExp versionSeparator("[\\-\\.]");
- const int minorIndex = version.indexOf(versionSeparator);
- const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
- version = version.left(patchIndex);
-#endif
-
void HtmlGenerator::findAllFunctions(const InnerNode *node)
{
NodeList::ConstIterator c = node->childNodes().begin();
@@ -3749,29 +3718,6 @@ void HtmlGenerator::findAllNamespaces(const InnerNode *node)
}
}
-#ifdef ZZZ_QDOC_QML
-/*!
- This function finds all the qml element nodes and
- stores them in a map for later use.
- */
-void HtmlGenerator::findAllQmlClasses(const InnerNode *node)
-{
- NodeList::const_iterator c = node->childNodes().constBegin();
- while (c != node->childNodes().constEnd()) {
- if ((*c)->type() == Node::Fake) {
- const FakeNode* fakeNode = static_cast<const FakeNode *>(*c);
- if (fakeNode->subType() == Node::QmlClass) {
- const QmlClassNode* qmlNode =
- static_cast<const QmlClassNode*>(fakeNode);
- const Node* n = qmlNode->classNode();
- }
- qmlClasses.insert(fakeNode->name(),*c);
- }
- ++c;
- }
-}
-#endif
-
int HtmlGenerator::hOffset(const Node *node)
{
switch (node->type()) {
@@ -3780,12 +3726,6 @@ int HtmlGenerator::hOffset(const Node *node)
return 2;
case Node::Fake:
return 1;
-#if 0
- if (node->doc().briefText().isEmpty())
- return 1;
- else
- return 2;
-#endif
case Node::Enum:
case Node::Typedef:
case Node::Function:
@@ -4148,6 +4088,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
#ifdef GENERATE_MAC_REFS
generateMacRef(node, marker);
#endif
+ generateExtractionMark(node, MemberMark);
out() << "<div class=\"qmlitem\">";
if (node->subType() == Node::QmlPropertyGroup) {
const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node);
@@ -4163,7 +4104,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
else
out() << "<tr class=\"even\">";
- out() << "<td><p>";
+ out() << "<td class=\"tblQmlPropNode\"><p>";
out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
if (!qpn->isWritable())
@@ -4187,7 +4128,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
out() << "<tr class=\"odd\">";
else
out() << "<tr class=\"even\">";
- out() << "<td><p>";
+ out() << "<td class=\"tblQmlFuncNode\"><p>";
out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
//generateQmlItem(qsn,relative,marker,false);
@@ -4204,7 +4145,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
out() << "<tr class=\"odd\">";
else
out() << "<tr class=\"even\">";
- out() << "<td><p>";
+ out() << "<td class=\"tblQmlFuncNode\"><p>";
out() << "<a name=\"" + refForNode(qmn) + "\"></a>";
generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
out() << "</p></td></tr>";
@@ -4219,6 +4160,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
generateAlsoList(node, marker);
out() << "</div>";
out() << "</div>";
+ generateExtractionMark(node, EndMark);
}
/*!
@@ -4288,7 +4230,10 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
text << "[";
text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
- text << Atom(Atom::String, qcn->name());
+ QString name = qcn->name();
+ if (name.startsWith(QLatin1String("QML:")))
+ name = name.mid(4); // remove the "QML:" prefix
+ text << Atom(Atom::String, name);
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
text << " instantiates the C++ class ";
text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
@@ -4457,140 +4402,40 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke
file.close();
}
-#endif
-
-#if 0 // fossil removed for new doc format MWS 19/04/2010
- out() << "<!DOCTYPE html\n"
- " PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n";
- out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage);
-
- QString shortVersion;
- if ((project != "Qtopia") && (project != "Qt Extended")) {
- shortVersion = project + " " + shortVersion + ": ";
- if (node && !node->doc().location().isEmpty())
- out() << "<!-- " << node->doc().location().fileName() << " -->\n";
-
- shortVersion = myTree->version();
- if (shortVersion.count(QChar('.')) == 2)
- shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
- if (!shortVersion.isEmpty()) {
- if (project == "QSA")
- shortVersion = "QSA " + shortVersion + ": ";
- else
- shortVersion = "Qt " + shortVersion + ": ";
- }
- }
-
- out() << "<head>\n"
- " <title>" << shortVersion << protectEnc(title) << "</title>\n";
- out() << QString("<meta http-equiv=\"Content-type\" content=\"text/html; charset=%1\" />").arg(outputEncoding);
-
- if (!style.isEmpty())
- out() << " <style type=\"text/css\">" << style << "</style>\n";
-
- const QMap<QString, QString> &metaMap = node->doc().metaTagMap();
- if (!metaMap.isEmpty()) {
- QMapIterator<QString, QString> i(metaMap);
- while (i.hasNext()) {
- i.next();
- out() << " <meta name=\"" << protectEnc(i.key()) << "\" contents=\""
- << protectEnc(i.value()) << "\" />\n";
- }
- }
-
- navigationLinks.clear();
-
- if (node && !node->links().empty()) {
- QPair<QString,QString> linkPair;
- QPair<QString,QString> anchorPair;
- const Node *linkNode;
-
- if (node->links().contains(Node::PreviousLink)) {
- linkPair = node->links()[Node::PreviousLink];
- linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
-
- out() << " <link rel=\"prev\" href=\""
- << anchorPair.first << "\" />\n";
-
- navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">";
- if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
- navigationLinks += protectEnc(anchorPair.second);
- else
- navigationLinks += protectEnc(linkPair.second);
- navigationLinks += "</a>]\n";
- }
- if (node->links().contains(Node::ContentsLink)) {
- linkPair = node->links()[Node::ContentsLink];
- linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
-
- out() << " <link rel=\"contents\" href=\""
- << anchorPair.first << "\" />\n";
-
- navigationLinks += "[<a href=\"" + anchorPair.first + "\">";
- if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
- navigationLinks += protectEnc(anchorPair.second);
- else
- navigationLinks += protectEnc(linkPair.second);
- navigationLinks += "</a>]\n";
- }
- if (node->links().contains(Node::NextLink)) {
- linkPair = node->links()[Node::NextLink];
- linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
-
- out() << " <link rel=\"next\" href=\""
- << anchorPair.first << "\" />\n";
-
- navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">";
- if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
- navigationLinks += protectEnc(anchorPair.second);
- else
- navigationLinks += protectEnc(linkPair.second);
- navigationLinks += "</a>]\n";
- }
- if (node->links().contains(Node::IndexLink)) {
- linkPair = node->links()[Node::IndexLink];
- linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
- out() << " <link rel=\"index\" href=\""
- << anchorPair.first << "\" />\n";
- }
- if (node->links().contains(Node::StartLink)) {
- linkPair = node->links()[Node::StartLink];
- linkNode = findNodeForTarget(linkPair.first, node, marker);
- if (!linkNode || linkNode == node)
- anchorPair = linkPair;
- else
- anchorPair = anchorForNode(linkNode);
- out() << " <link rel=\"start\" href=\""
- << anchorPair.first << "\" />\n";
+void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType markType)
+{
+ if (markType != EndMark) {
+ out() << "<!-- $$$" + node->name();
+ if (markType == MemberMark) {
+ if (node->type() == Node::Function) {
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ if (!func->associatedProperty()) {
+ if (func->overloadNumber() == 1)
+ out() << "[overload1]";
+ out() << "$$$" + func->name() + func->rawParameters().remove(' ');
+ }
+ } else if (node->type() == Node::Property) {
+ const PropertyNode *prop = static_cast<const PropertyNode *>(node);
+ out() << "-prop";
+ const NodeList &list = prop->functions();
+ foreach (const Node *propFuncNode, list) {
+ if (propFuncNode->type() == Node::Function) {
+ const FunctionNode *func = static_cast<const FunctionNode *>(propFuncNode);
+ out() << "$$$" + func->name() + func->rawParameters().remove(' ');
+ }
+ }
+ }
+ } else if (markType == BriefMark) {
+ out() << "-brief";
+ } else if (markType == DetailedDescriptionMark) {
+ out() << "-description";
}
+ out() << " -->\n";
+ } else {
+ out() << "<!-- @@@" + node->name() + " -->\n";
}
+}
- foreach (const QString &stylesheet, stylesheets) {
- out() << " <link href=\"" << stylesheet << "\" rel=\"stylesheet\" "
- << "type=\"text/css\" />\n";
- }
-
- foreach (const QString &customHeadElement, customHeadElements) {
- out() << " " << customHeadElement << "\n";
- }
-
- out() << "</head>\n"
- #endif
+#endif
QT_END_NAMESPACE
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 80341def61..aaf2318925 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -123,6 +123,12 @@ class HtmlGenerator : public PageGenerator
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
+ enum ExtractionMarkType {
+ BriefMark,
+ DetailedDescriptionMark,
+ MemberMark,
+ EndMark
+ };
const QPair<QString,QString> anchorForNode(const Node *node);
const Node *findNodeForTarget(const QString &target,
@@ -210,9 +216,10 @@ class HtmlGenerator : public PageGenerator
const Node *relative,
CodeMarker *marker);
QString highlightedCode(const QString& markedCode,
- CodeMarker *marker,
- const Node *relative,
- bool alignNames = false);
+ CodeMarker* marker,
+ const Node* relative,
+ bool alignNames = false,
+ const Node* self = 0);
void generateFullName(const Node *apparentNode,
const Node *relative,
@@ -236,9 +243,6 @@ class HtmlGenerator : public PageGenerator
void findAllFunctions(const InnerNode *node);
void findAllLegaleseTexts(const InnerNode *node);
void findAllNamespaces(const InnerNode *node);
-#ifdef ZZZ_QDOC_QML
- void findAllQmlClasses(const InnerNode *node);
-#endif
void findAllSince(const InnerNode *node);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
@@ -268,6 +272,7 @@ class HtmlGenerator : public PageGenerator
CodeMarker* marker) const;
void generatePageIndex(const QString& fileName,
CodeMarker* marker) const;
+ void generateExtractionMark(const Node *node, ExtractionMarkType markType);
#if 0
NavigationBar currentNavigationBar;
@@ -290,6 +295,7 @@ class HtmlGenerator : public PageGenerator
int numTableRows;
bool threeColumnEnumValueTable;
bool offlineDocs;
+ bool creatorDocs;
QString link;
QStringList sectionNumber;
QRegExp funcLeftParen;
@@ -316,9 +322,6 @@ class HtmlGenerator : public PageGenerator
NodeMap obsoleteClasses;
NodeMap namespaceIndex;
NodeMap serviceClasses;
-#ifdef QDOC_QML
- NodeMap qmlClasses;
-#endif
QMap<QString, NodeMap > funcIndex;
QMap<Text, const Node *> legaleseTexts;
NewSinceMaps newSinceMaps;
@@ -328,6 +331,7 @@ class HtmlGenerator : public PageGenerator
static int id;
public:
static bool debugging_on;
+ static QString divNavTop;
};
#define HTMLGENERATOR_ADDRESS "address"
diff --git a/tools/qdoc3/javacodemarker.cpp b/tools/qdoc3/javacodemarker.cpp
index 1918cd8ead..c9a8f60929 100644
--- a/tools/qdoc3/javacodemarker.cpp
+++ b/tools/qdoc3/javacodemarker.cpp
@@ -155,8 +155,10 @@ QList<Section> JavaCodeMarker::sections(const InnerNode * /* inner */, SynopsisS
return QList<Section>();
}
-const Node *JavaCodeMarker::resolveTarget(const QString &target, const Tree *tree,
- const Node *relative)
+const Node *JavaCodeMarker::resolveTarget(const QString &target,
+ const Tree *tree,
+ const Node *relative,
+ const Node* /* self */)
{
if (target.endsWith("()")) {
const FunctionNode *func;
diff --git a/tools/qdoc3/javacodemarker.h b/tools/qdoc3/javacodemarker.h
index a2d04dd1b7..c2aabc018a 100644
--- a/tools/qdoc3/javacodemarker.h
+++ b/tools/qdoc3/javacodemarker.h
@@ -72,7 +72,10 @@ public:
QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
QString functionBeginRegExp( const QString& funcName );
QString functionEndRegExp( const QString& funcName );
- const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
+ const Node* resolveTarget( const QString& target,
+ const Tree* tree,
+ const Node* relative,
+ const Node* self = 0 );
};
QT_END_NAMESPACE
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index b0770740ac..0ca487089d 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -299,7 +299,7 @@ InnerNode::~InnerNode()
Node *InnerNode::findNode(const QString& name)
{
Node *node = childMap.value(name);
- if (node)
+ if (node && node->subType() != QmlPropertyGroup)
return node;
if ((type() == Fake) && (subType() == QmlClass)) {
for (int i=0; i<children.size(); ++i) {
@@ -1246,6 +1246,24 @@ QStringList FunctionNode::parameterNames() const
}
/*!
+ Returns a raw list of parameters. If \a names is true, the
+ names are included. If \a values is true, the default values
+ are included, if any are present.
+ */
+QString FunctionNode::rawParameters(bool names, bool values) const
+{
+ QString raw;
+ foreach (const Parameter &parameter, parameters()) {
+ raw += parameter.leftType() + parameter.rightType();
+ if (names)
+ raw += parameter.name();
+ if (values)
+ raw += parameter.defaultValue();
+ }
+ return raw;
+}
+
+/*!
Returns the list of reconstructed parameters. If \a values
is true, the default values are included, if any are present.
*/
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index e9f2d74605..121b818179 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -616,6 +616,7 @@ class FunctionNode : public LeafNode
int numOverloads() const;
const QList<Parameter>& parameters() const { return params; }
QStringList parameterNames() const;
+ QString rawParameters(bool names = false, bool values = false) const;
const FunctionNode* reimplementedFrom() const { return rf; }
const QList<FunctionNode*> &reimplementedBy() const { return rb; }
const PropertyNode* associatedProperty() const { return ap; }
diff --git a/tools/qdoc3/plaincodemarker.cpp b/tools/qdoc3/plaincodemarker.cpp
index 4abfd2b9f7..d825c13f0f 100644
--- a/tools/qdoc3/plaincodemarker.cpp
+++ b/tools/qdoc3/plaincodemarker.cpp
@@ -129,11 +129,4 @@ QList<Section> PlainCodeMarker::sections(const InnerNode * /* innerNode */,
return QList<Section>();
}
-const Node *PlainCodeMarker::resolveTarget( const QString& /* target */,
- const Tree * /* tree */,
- const Node * /* relative */ )
-{
- return 0;
-}
-
QT_END_NAMESPACE
diff --git a/tools/qdoc3/plaincodemarker.h b/tools/qdoc3/plaincodemarker.h
index e9cc40d0e5..7afb88e2ae 100644
--- a/tools/qdoc3/plaincodemarker.h
+++ b/tools/qdoc3/plaincodemarker.h
@@ -71,7 +71,6 @@ public:
QString functionBeginRegExp( const QString& funcName );
QString functionEndRegExp( const QString& funcName );
QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
- const Node *resolveTarget(const QString &target, const Tree *tree, const Node *relative);
};
QT_END_NAMESPACE
diff --git a/tools/qdoc3/qscodemarker.cpp b/tools/qdoc3/qscodemarker.cpp
index d4b8e80f05..2ee5d99340 100644
--- a/tools/qdoc3/qscodemarker.cpp
+++ b/tools/qdoc3/qscodemarker.cpp
@@ -375,11 +375,4 @@ QList<Section> QsCodeMarker::sections( const InnerNode *inner, SynopsisStyle sty
return sections;
}
-const Node *QsCodeMarker::resolveTarget( const QString& /* target */,
- const Tree * /* tree */,
- const Node * /* relative */ )
-{
- return 0;
-}
-
QT_END_NAMESPACE
diff --git a/tools/qdoc3/qscodemarker.h b/tools/qdoc3/qscodemarker.h
index 1590009dad..c6a177f4e4 100644
--- a/tools/qdoc3/qscodemarker.h
+++ b/tools/qdoc3/qscodemarker.h
@@ -72,7 +72,6 @@ public:
QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
QString functionBeginRegExp( const QString& funcName );
QString functionEndRegExp( const QString& funcName );
- const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
};
QT_END_NAMESPACE
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 4b52992cc1..8d5fa895ea 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -17,7 +17,10 @@ qhp.Assistant.namespace = com.trolltech.assistant.470
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
qhp.Assistant.extraFiles = images/bg_l.png \
- images/bg_l_blank.png \
+ images/bg_l_blank.png \
+ images/bg_ll_blank.png \
+ images/bg_ul_blank.png \
+ images/header_bg.png \
images/bg_r.png \
images/box_bg.png \
images/breadcrumb.png \
@@ -25,24 +28,27 @@ qhp.Assistant.extraFiles = images/bg_l.png \
images/bullet_dn.png \
images/bullet_sq.png \
images/bullet_up.png \
+ images/arrow_down.png \
images/feedbackground.png \
images/horBar.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
- images/arrow-down.png \
images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
images/dynamiclayouts-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/OfflineStyle.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
+ scripts/functions.js \
+ scripts/jquery.js \
+ scripts/narrow.js \
+ scripts/superfish.js \
+ style/narrow.css \
+ style/superfish.css \
+ style/style_ie6.css \
+ style/style_ie7.css \
+ style/style_ie8.css \
+ style/style.css
qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 140b81fb29..4ac4f47e0f 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -24,6 +24,9 @@ qhp.Qt.indexTitle = Qt Reference Documentation
qhp.Qt.extraFiles = index.html \
images/bg_l.png \
images/bg_l_blank.png \
+ images/bg_ll_blank.png \
+ images/bg_ul_blank.png \
+ images/header_bg.png \
images/bg_r.png \
images/box_bg.png \
images/breadcrumb.png \
@@ -31,12 +34,12 @@ qhp.Qt.extraFiles = index.html \
images/bullet_dn.png \
images/bullet_sq.png \
images/bullet_up.png \
+ images/arrow_down.png \
images/feedbackground.png \
images/horBar.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
- images/arrow-down.png \
images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
@@ -44,17 +47,10 @@ qhp.Qt.extraFiles = index.html \
images/dynamiclayouts-example.png \
scripts/functions.js \
scripts/jquery.js \
- scripts/shBrushCpp.js \
- scripts/shCore.js \
- scripts/shLegacy.js \
scripts/narrow.js \
scripts/superfish.js \
- style/shCore.css \
- style/shThemeDefault.css \
style/narrow.css \
style/superfish.css \
- style/superfish_skin.css \
- style/OfflineStyle.css \
style/style_ie6.css \
style/style_ie7.css \
style/style_ie8.css \
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index dcf33dcd4a..8cc4fd9566 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -90,4 +90,5 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \
__attribute__ \
K_DECLARE_PRIVATE \
PHONON_OBJECT \
- PHONON_HEIR
+ PHONON_HEIR \
+ Q_PRIVATE_PROPERTY
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 31c9d5ae01..b428a90071 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -17,12 +17,11 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <div id=\"nav-topright\">\n" \
" <ul>\n" \
" <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
- " <li class=\"nav-topright-dev\"><a href=\"http://qt.nokia.com/developer\">DEV</a></li>\n" \
+ " <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \
" <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
" <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
" DOC</a></li>\n" \
" <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
- " <li class=\"nav-topright-shop\"><a title=\"SHOP\" href=\"http://shop.qt.nokia.com\">SHOP</a></li>\n" \
" </ul>\n" \
" </div>\n" \
" <div id=\"shortCut\">\n" \
@@ -113,7 +112,6 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \
" <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \
" <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li>\n" \
" </ul> \n" \
" </div>\n" \
" </div>\n" \
@@ -160,8 +158,8 @@ HTML.footer = " <!-- /div -->\n" \
" <div id=\"feedbackBox\">\n" \
" <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
" <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
- " <p id=\"noteHead\">Thank you for giving your feedback. <div class=\"note\">Make sure it is related the page. For more general bugs and \n" \
- " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a></div></p>\n" \
+ " <p id=\"noteHead\">Thank you for giving your feedback. <div class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \
+ " requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</div></p>\n" \
" <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
" <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
" </form>\n" \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index d13277173a..5575b7ba57 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -51,17 +51,10 @@ qhp.Qt.extraFiles = index.html \
images/dynamiclayouts-example.png \
scripts/functions.js \
scripts/jquery.js \
- scripts/shBrushCpp.js \
- scripts/shCore.js \
- scripts/shLegacy.js \
scripts/narrow.js \
scripts/superfish.js \
- style/shCore.css \
- style/shThemeDefault.css \
style/narrow.css \
style/superfish.css \
- style/superfish_skin.css \
- style/OfflineStyle.css \
style/style_ie6.css \
style/style_ie7.css \
style/style_ie8.css \
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 70b998f041..d22a09aae0 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -125,18 +125,20 @@ Tree::~Tree()
/*!
*/
-Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags)
+Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags, const Node* self)
{
return const_cast<Node*>(const_cast<const Tree*>(this)->findNode(path,
relative,
- findFlags));
+ findFlags,
+ self));
}
/*!
*/
const Node* Tree::findNode(const QStringList &path,
const Node* start,
- int findFlags) const
+ int findFlags,
+ const Node* self) const
{
const Node* current = start;
if (!current)
@@ -171,9 +173,11 @@ const Node* Tree::findNode(const QStringList &path,
}
if (node && i == path.size()
&& (!(findFlags & NonFunction) || node->type() != Node::Function
- || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams))
- if ((node != start) && (node->subType() != Node::QmlPropertyGroup))
+ || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams)) {
+ if ((node != self) && (node->subType() != Node::QmlPropertyGroup)) {
return node;
+ }
+ }
current = current->parent();
} while (current);
diff --git a/tools/qdoc3/tree.h b/tools/qdoc3/tree.h
index 0865847b3e..b34c3a8d05 100644
--- a/tools/qdoc3/tree.h
+++ b/tools/qdoc3/tree.h
@@ -65,10 +65,13 @@ class Tree
Tree();
~Tree();
- Node *findNode(const QStringList &path, Node *relative=0, int findFlags=0);
- Node *findNode(const QStringList &path,
+ Node* findNode(const QStringList &path,
+ Node* relative=0,
+ int findFlags=0,
+ const Node* self=0);
+ Node* findNode(const QStringList &path,
Node::Type type,
- Node *relative = 0,
+ Node* relative = 0,
int findFlags = 0);
FunctionNode *findFunctionNode(const QStringList &path,
Node *relative = 0,
@@ -98,12 +101,13 @@ class Tree
NamespaceNode *root() { return &roo; }
QString version() const { return vers; }
- const Node *findNode(const QStringList &path,
- const Node *relative = 0,
- int findFlags = 0) const;
- const Node *findNode(const QStringList &path,
+ const Node* findNode(const QStringList &path,
+ const Node* relative = 0,
+ int findFlags = 0,
+ const Node* self=0) const;
+ const Node* findNode(const QStringList &path,
Node::Type type, const
- Node *relative = 0,
+ Node* relative = 0,
int findFlags = 0) const;
const FunctionNode *findFunctionNode(const QStringList &path,
const Node *relative = 0,
diff --git a/tools/qml/deviceorientation_symbian.cpp b/tools/qml/deviceorientation_symbian.cpp
index 48bfc72227..c305f942d5 100644
--- a/tools/qml/deviceorientation_symbian.cpp
+++ b/tools/qml/deviceorientation_symbian.cpp
@@ -118,18 +118,14 @@ private:
data = dataBuf();
Orientation o = UnknownOrientation;
switch (data.iDeviceOrientation) {
- case TSensrvOrientationData::EOrientationDisplayRightUp:
- o = LandscapeInverted;
- break;
case TSensrvOrientationData::EOrientationDisplayUp:
o = Portrait;
break;
- case TSensrvOrientationData::EOrientationDisplayDown:
- o = PortraitInverted;
- break;
- case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ case TSensrvOrientationData::EOrientationDisplayRightUp:
o = Landscape;
break;
+ case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ case TSensrvOrientationData::EOrientationDisplayDown:
case TSensrvOrientationData::EOrientationUndefined:
case TSensrvOrientationData::EOrientationDisplayUpwards:
case TSensrvOrientationData::EOrientationDisplayDownwards:
@@ -137,7 +133,7 @@ private:
break;
}
- if (m_current != o) {
+ if (m_current != o && o != UnknownOrientation) {
m_current = o;
emit orientationChanged();
}
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index dfd172652c..4b1162e22d 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -56,9 +56,7 @@ QT_USE_NAMESPACE
QtMsgHandler systemMsgOutput = 0;
-#if defined(Q_WS_S60)
-#include <aknappui.h> // For locking app to portrait
-#endif
+
#if defined (Q_OS_SYMBIAN)
#include <unistd.h>
@@ -211,12 +209,7 @@ int main(int argc, char ** argv)
app.setOrganizationName("Nokia");
app.setOrganizationDomain("nokia.com");
-#if defined(Q_WS_S60)
- CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
- if (appUi) {
- appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait);
- }
-#endif
+
QDeclarativeViewer::registerTypes();
QDeclarativeTester::registerTypes();
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index fcd0c33f88..80afb45cae 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -17,16 +17,16 @@ SOURCES += $$PWD/qmlruntime.cpp \
$$PWD/loggerwidget.cpp
RESOURCES = $$PWD/qmlruntime.qrc
-maemo5 {
+symbian:!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
+ SOURCES += $$PWD/deviceorientation_symbian.cpp
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
+} else:maemo5 {
QT += dbus
HEADERS += $$PWD/texteditautoresizer_maemo5.h
SOURCES += $$PWD/deviceorientation_maemo5.cpp
FORMS = $$PWD/recopts_maemo5.ui \
$$PWD/proxysettings_maemo5.ui
-} symbian:!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
- SOURCES += $$PWD/deviceorientation_symbian.cpp
- FORMS = $$PWD/recopts.ui \
- $$PWD/proxysettings.ui
} else {
SOURCES += $$PWD/deviceorientation.cpp
FORMS = $$PWD/recopts.ui \
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 0a51c0b8d3..bb69e8a63e 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -39,7 +39,6 @@ symbian {
TARGET.CAPABILITY = NetworkServices ReadUserData
!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
LIBS += -lsensrvclient -lsensrvutil
- contains(QT_CONFIG, s60): LIBS += -lavkon -lcone
}
}
mac {
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 03ca798a1f..951b187811 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -944,13 +944,7 @@ void QDeclarativeViewer::statusChanged()
if (canvas->status() == QDeclarativeView::Ready) {
initialSize = canvas->initialSize();
- if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
- if (!isFullScreen() && !isMaximized()) {
- canvas->setFixedSize(initialSize);
- resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrink
- QTimer::singleShot(0, this, SLOT(updateSizeHints()));
- }
- }
+ updateSizeHints(true);
}
}
@@ -1075,13 +1069,9 @@ void QDeclarativeViewer::setRecordRate(int fps)
record_rate = fps;
}
-void QDeclarativeViewer::sceneResized(QSize size)
+void QDeclarativeViewer::sceneResized(QSize)
{
- if (size.width() > 0 && size.height() > 0) {
- if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
- updateSizeHints();
- }
- }
+ updateSizeHints();
}
void QDeclarativeViewer::keyPressEvent(QKeyEvent *event)
@@ -1344,17 +1334,7 @@ void QDeclarativeViewer::changeOrientation(QAction *action)
void QDeclarativeViewer::orientationChanged()
{
- if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
- if (canvas->rootObject()) {
- QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size();
- if (size() != rootObjectSize.toSize()) {
- canvas->setMinimumSize(rootObjectSize.toSize());
- canvas->resize(rootObjectSize.toSize());
- resize(rootObjectSize.toSize());
- resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
- }
- }
- }
+ updateSizeHints();
}
void QDeclarativeViewer::setDeviceKeys(bool on)
@@ -1403,20 +1383,32 @@ void QDeclarativeViewer::setSizeToView(bool sizeToView)
}
}
-void QDeclarativeViewer::updateSizeHints()
+void QDeclarativeViewer::updateSizeHints(bool initial)
{
- if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
- QSize newWindowSize = canvas->sizeHint();
+ static bool isRecursive = false;
+
+ if (isRecursive)
+ return;
+ isRecursive = true;
+
+ if (initial || (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject)) {
+ QSize newWindowSize = initial ? initialSize : canvas->sizeHint();
+ //qWarning() << "USH:" << (initial ? "INIT:" : "V2R:") << "setting fixed size " << newWindowSize;
if (!isFullScreen() && !isMaximized()) {
- canvas->setMinimumSize(newWindowSize);
- canvas->resize(newWindowSize);
- resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrinks
- canvas->setMinimumSize(QSize(0, 0));
+ canvas->setFixedSize(newWindowSize);
+ resize(1, 1);
+ layout()->setSizeConstraint(QLayout::SetFixedSize);
+ layout()->activate();
}
- } else { // QDeclarativeView::SizeRootObjectToView
- canvas->setMinimumSize(QSize(0,0));
- canvas->setMaximumSize(QSize(16777215,16777215));
}
+ //qWarning() << "USH: R2V: setting free size ";
+ layout()->setSizeConstraint(QLayout::SetNoConstraint);
+ layout()->activate();
+ setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
+ canvas->setMinimumSize(QSize(0,0));
+ canvas->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
+
+ isRecursive = false;
}
void QDeclarativeViewer::registerTypes()
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index e70e69fd3e..68d3452a2d 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -145,9 +145,9 @@ private slots:
void warningsWidgetOpened();
void warningsWidgetClosed();
- void updateSizeHints();
-
private:
+ void updateSizeHints(bool initial = false);
+
QString getVideoFileName();
LoggerWidget *loggerWindow;
diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro
deleted file mode 100644
index 5d35b6aac9..0000000000
--- a/tools/qtconfig/translations/translations.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-SOURCES += ../colorbutton.cpp ../main.cpp ../previewframe.cpp ../previewwidget.cpp ../mainwindow.cpp ../paletteeditoradvanced.cpp \
- ../mainwindowbase.cpp ../paletteeditoradvancedbase.cpp ../previewwidgetbase.cpp
-HEADERS += ../colorbutton.h ../previewframe.h ../previewwidget.h ../mainwindow.h ../paletteeditoradvanced.h \
- ../mainwindowbase.h ../paletteeditoradvancedbase.h ../previewwidgetbase.h
-
-FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwidgetbase.ui
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/qtconfig_hu.ts \
- $$TR_DIR/qtconfig_pl.ts \
- $$TR_DIR/qtconfig_ru.ts \
- $$TR_DIR/qtconfig_zh_CN.ts \
- $$TR_DIR/qtconfig_zh_TW.ts
diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro
index dde7e8dc6a..c101d00a50 100644
--- a/tools/qvfb/qvfb.pro
+++ b/tools/qvfb/qvfb.pro
@@ -35,7 +35,7 @@ SOURCES = qvfb.cpp \
../../src/gui/embedded/qlock.cpp \
../../src/gui/embedded/qwssignalhandler.cpp
-include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri)
+include(../shared/deviceskin/deviceskin.pri)
contains(QT_CONFIG, opengl) {
QT += opengl
diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro
deleted file mode 100644
index b0b1af4f43..0000000000
--- a/tools/qvfb/translations/translations.pro
+++ /dev/null
@@ -1,35 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-FORMS = ../config.ui
-HEADERS = ../qvfb.h \
- ../qvfbview.h \
- ../qvfbratedlg.h \
- ../qanimationwriter.h \
- ../gammaview.h \
- ../qvfbprotocol.h \
- ../qvfbshmem.h \
- ../qvfbmmap.h \
- ../../../src/gui/embedded/qvfbhdr.h \
- ../../../src/gui/embedded/qlock_p.h \
- ../../../src/gui/embedded/qwssignalhandler_p.h \
- ../../shared/deviceskin/deviceskin.h
-
-SOURCES = ../qvfb.cpp \
- ../qvfbview.cpp \
- ../qvfbratedlg.cpp \
- ../main.cpp \
- ../qanimationwriter.cpp \
- ../qvfbprotocol.cpp \
- ../qvfbshmem.cpp \
- ../qvfbmmap.cpp \
- ../../../src/gui/embedded/qlock.cpp \
- ../../../src/gui/embedded/qwssignalhandler.cpp \
- ../../shared/deviceskin/deviceskin.cpp
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/qvfb_hu.ts \
- $$TR_DIR/qvfb_pl.ts \
- $$TR_DIR/qvfb_ru.ts \
- $$TR_DIR/qvfb_zh_CN.ts \
- $$TR_DIR/qvfb_zh_TW.ts
diff --git a/tools/runonphone/trksignalhandler.cpp b/tools/runonphone/trksignalhandler.cpp
index b6d446f420..898692a75d 100644
--- a/tools/runonphone/trksignalhandler.cpp
+++ b/tools/runonphone/trksignalhandler.cpp
@@ -71,8 +71,10 @@ private:
QFile crashlogtextfile;
QFile crashstackfile;
QList<CrashState> queuedCrashes;
+ QList<int> dyingThreads;
QString crashlogPath;
bool crashlog;
+ bool terminateNeeded;
};
void TrkSignalHandler::copyingStarted()
@@ -201,15 +203,23 @@ void TrkSignalHandler::stopped(uint pc, uint pid, uint tid, const QString& reaso
cs.crashPC = pc;
cs.crashReason = reason;
- d->queuedCrashes.append(cs);
-
- if (d->queuedCrashes.count() == 1) {
- d->err << "Fetching registers and stack..." << endl;
- emit getRegistersAndCallStack(pid, tid);
+ if (d->dyingThreads.contains(tid)) {
+ if(d->queuedCrashes.isEmpty())
+ emit terminate();
+ else
+ d->terminateNeeded = true;
+ } else {
+ d->queuedCrashes.append(cs);
+ d->dyingThreads.append(tid);
+
+ if (d->queuedCrashes.count() == 1) {
+ d->err << "Fetching registers and stack..." << endl;
+ emit getRegistersAndCallStack(pid, tid);
+ }
}
}
else
- emit resume(pid, tid);
+ emit terminate();
}
void TrkSignalHandler::registersAndCallStackReadComplete(const QList<uint>& registers, const QByteArray& stack)
@@ -307,6 +317,8 @@ void TrkSignalHandler::registersAndCallStackReadComplete(const QList<uint>& regi
d->err << "Fetching registers and stack..." << endl;
emit getRegistersAndCallStack(cs.pid, cs.tid);
}
+ else if (d->terminateNeeded)
+ emit terminate();
}
@@ -333,7 +345,8 @@ TrkSignalHandlerPrivate::TrkSignalHandlerPrivate()
: out(stdout),
err(stderr),
loglevel(0),
- lastpercent(0)
+ lastpercent(0),
+ terminateNeeded(false)
{
}
diff --git a/translations/check-ts.pl b/translations/check-ts.pl
index 5f38703fe0..067cad87af 100755
--- a/translations/check-ts.pl
+++ b/translations/check-ts.pl
@@ -43,19 +43,18 @@
use strict;
-# "qt" must come last to avoid prefix matching.
-my @groups = ("assistant", "designer", "linguist", "qt_help", "qtconfig", "qvfb", "qt");
+my @groups = ("qt", "assistant", "designer", "linguist", "qt_help", "qtconfig", "qvfb");
my %scores = ();
my %langs = ();
-my $files = join("\n", <*.ts>);
+my $files = join("\n", <*_??.ts>);
my $res = `xmlpatterns -param files=\"$files\" check-ts.xq`;
for my $i (split(/ /, $res)) {
- $i =~ /^([^.]+).ts:(.*)$/;
+ $i =~ /^([^.]+)\.ts:(.*)$/;
my ($fn, $pc) = ($1, $2);
for my $g (@groups) {
- if ($fn =~ /^${g}_(.*)$/) {
+ if ($fn =~ /^${g}_((.._)?..)$/) {
my $lang = $1;
$scores{$g}{$lang} = $pc;
$langs{$lang} = 1;
@@ -64,10 +63,6 @@ for my $i (split(/ /, $res)) {
}
}
-# now we move "qt" to the front, as it should be the first column.
-pop @groups;
-unshift @groups, "qt";
-
my $code = "";
print "L10n ";
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index 7d32ead8c0..74bd048539 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -2024,6 +2024,11 @@ nach
<translation>Signalnamen dürfen nicht mit einem Großbuchstaben beginnen</translation>
</message>
<message>
+ <location line="+2"/>
+ <source>Illegal signal name</source>
+ <translation>Ungültiger Name für Signal</translation>
+ </message>
+ <message>
<location line="+6"/>
<source>Duplicate method name</source>
<translation>Mehrfaches Auftreten eines Methodennamens</translation>
@@ -2034,6 +2039,11 @@ nach
<translation>Methodennamen dürfen nicht mit einem Großbuchstaben beginnen</translation>
</message>
<message>
+ <location line="+2"/>
+ <source>Illegal method name</source>
+ <translation>Ungültiger Name für Methode</translation>
+ </message>
+ <message>
<location line="+21"/>
<source>Property value set multiple times</source>
<translation>Mehrfache Zuweisung eines Wertes an eine Eigenschaft</translation>
@@ -7713,21 +7723,53 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<translation>Kontext4</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+2"/>
<source>Call</source>
+ <extracomment>Button to start a call (note: a separate button is used to end the call)</extracomment>
<translation>Anruf</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+2"/>
<source>Hangup</source>
+ <extracomment>Button to end a call (note: a separate button is used to start the call)</extracomment>
<translation>Auflegen</translation>
</message>
<message>
+ <location line="+2"/>
+ <source>Toggle Call/Hangup</source>
+ <extracomment>Button that will hang up if we&apos;re in call, or make a call if we&apos;re not.</extracomment>
+ <translation>Anrufen/Aufhängen</translation>
+ </message>
+ <message>
<location line="+1"/>
<source>Flip</source>
<translation>Umdrehen</translation>
</message>
<message>
+ <location line="+2"/>
+ <source>Voice Dial</source>
+ <extracomment>Button to trigger voice dialling</extracomment>
+ <translation>Sprachwahl</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Last Number Redial</source>
+ <extracomment>Button to redial the last number called</extracomment>
+ <translation>Wahlwiederholung</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Camera Shutter</source>
+ <extracomment>Button to trigger the camera shutter (take a picture)</extracomment>
+ <translation>Auslöser</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Camera Focus</source>
+ <extracomment>Button to focus the camera</extracomment>
+ <translation>Scharfstellen</translation>
+ </message>
+ <message>
<location line="+4"/>
<source>Kanji</source>
<translation>Kanji</translation>
diff --git a/translations/translations.pri b/translations/translations.pri
index 9ab72fc277..fbc1596023 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -1,80 +1,80 @@
-defineReplace(prependAll) {
- prepend = $$1
- arglist = $$2
- append = $$3
- for(a,arglist) {
- result += $${prepend}$${a}$${append}
- }
- return ($$result)
-}
-
+qtPrepareTool(LCONVERT, lconvert)
qtPrepareTool(LUPDATE, lupdate)
LUPDATE += -locations relative -no-ui-lines
-###### Qt Libraries
-
-QT_TS = ar cs da de es fr he hu ja pl pt ru sk sl sv uk zh_CN zh_TW
-
-ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- -I../include -I../include/Qt \
- 3rdparty/phonon \
- 3rdparty/webkit \
- activeqt \
- corelib \
- declarative \
- gui \
- multimedia \
- network \
- opengl \
- plugins \
- qt3support \
- script \
- scripttools \
- sql \
- svg \
- xml \
- xmlpatterns \
- -ts $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts))
-ts-qt.depends = sub-tools
-
-###### Designer
-
-ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/designer/translations/translations.pro)
-ts-designer.depends = sub-tools
-
-###### Linguist
-
-ts-linguist.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/linguist/linguist/linguist.pro)
-ts-linguist.depends = sub-tools
-
-###### Assistant
-
-ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/assistant/translations/translations.pro \
- && $$LUPDATE \
- ../tools/assistant/translations/qt_help.pro)
-ts-assistant.depends = sub-tools
-
-###### Qtconfig
-
-ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/qtconfig/translations/translations.pro)
-ts-qtconfig.depends = sub-tools
-
-###### Qvfp
-
-ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/qvfb/translations/translations.pro)
-ts-qvfb.depends = sub-tools
+TS_TARGETS =
+
+# meta target name, target name, lupdate base options, files
+defineTest(addTsTarget) {
+ cv = $${2}.commands
+ $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
+ export($$cv)
+ dv = $${1}.depends
+ $$dv += $$2
+ export($$dv)
+ TS_TARGETS += $$1 $$2
+ export(TS_TARGETS)
+}
-###### Overall Rules
+# target basename, lupdate base options
+defineTest(addTsTargets) {
+ files = $$files($$PWD/$${1}_??.ts) $$files($$PWD/$${1}_??_??.ts)
+ for(file, files) {
+ lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
+ addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
+ }
+ addTsTarget(ts-untranslated, ts-$$1-untranslated, $$2, $$PWD/$${1}_untranslated.ts)
+ addTsTarget(ts-all, ts-$$1-all, $$2, $$PWD/$${1}_untranslated.ts $$files)
+}
-ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb
+addTsTargets(qt, -I../include -I../include/Qt \
+ 3rdparty/phonon \
+ 3rdparty/webkit \
+ activeqt \
+ corelib \
+ declarative \
+ gui \
+ multimedia \
+ network \
+ opengl \
+ plugins \
+ qt3support \
+ script \
+ scripttools \
+ sql \
+ svg \
+ xml \
+ xmlpatterns \
+)
+addTsTargets(designer, ../tools/designer/designer.pro)
+addTsTargets(linguist, ../tools/linguist/linguist/linguist.pro)
+addTsTargets(assistant, ../tools/assistant/tools/assistant/assistant.pro)
+addTsTargets(qt_help, ../tools/assistant/lib/lib.pro)
+addTsTargets(qtconfig, ../tools/qtconfig/qtconfig.pro)
+addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
check-ts.commands = (cd $$PWD && perl check-ts.pl)
-check-ts.depends = ts
+check-ts.depends = ts-all
+
+isEqual(QMAKE_DIR_SEP, /) {
+ commit-ts.commands = \
+ cd $$PWD/..; \
+ for f in `git diff-files --name-only translations/*_??.ts`; do \
+ $$LCONVERT -locations none -i \$\$f -o \$\$f; \
+ done; \
+ git add translations/*_??.ts && git commit
+} else {
+ wd = $$replace(PWD, /, \\)\\..
+ commit-ts.commands = \
+ cd $$wd && \
+ for /f usebackq %%f in (`git diff-files --name-only translations/*_??.ts`) do \
+ $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
+ cd $$wd && git add translations/*_??.ts && git commit
+}
+
+ts.commands = \
+ @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
+ echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
+ echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
-QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb \
- ts check-ts
+QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts