summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbin/elf2e32_qtwrapper145
-rwxr-xr-xbin/syncqt6
-rwxr-xr-xconfigure2
-rw-r--r--demos/declarative/rssnews/content/NewsDelegate.qml3
-rw-r--r--demos/declarative/snake/content/snake.js6
-rw-r--r--demos/embedded/anomaly/src/BookmarksView.cpp2
-rw-r--r--demos/embedded/anomaly/src/BrowserView.cpp1
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro9
-rw-r--r--demos/embedded/qmlcalculator/deployment.pri2
-rw-r--r--demos/embedded/qmlclocks/deployment.pri2
-rw-r--r--demos/embedded/qmldialcontrol/deployment.pri2
-rw-r--r--demos/embedded/qmleasing/deployment.pri2
-rw-r--r--demos/embedded/qmlflickr/deployment.pri2
-rw-r--r--demos/embedded/qmlphotoviewer/deployment.pri2
-rw-r--r--demos/embedded/qmltwitter/deployment.pri2
-rw-r--r--demos/qtdemo/menumanager.cpp6
-rw-r--r--demos/qtdemo/qmlShell.qml4
-rw-r--r--demos/spectrum/3rdparty/fftreal/fftreal.pro2
-rw-r--r--demos/spectrum/app/app.pro2
-rw-r--r--demos/spectrum/spectrum.pro2
-rw-r--r--doc/src/declarative/animation.qdoc16
-rw-r--r--doc/src/declarative/basictypes.qdoc16
-rw-r--r--doc/src/declarative/declarativeui.qdoc1
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc18
-rw-r--r--doc/src/declarative/examples.qdoc7
-rw-r--r--doc/src/declarative/focus.qdoc4
-rw-r--r--doc/src/declarative/globalobject.qdoc6
-rw-r--r--doc/src/declarative/qdeclarativei18n.qdoc3
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc347
-rw-r--r--doc/src/declarative/qdeclarativestates.qdoc3
-rw-r--r--doc/src/declarative/qmlruntime.qdoc275
-rw-r--r--doc/src/declarative/qmlviewer.qdoc234
-rw-r--r--doc/src/declarative/tutorial.qdoc2
-rw-r--r--doc/src/examples/qml-examples.qdoc15
-rw-r--r--doc/src/images/qml-abstractitemmodel-example.pngbin0 -> 4478 bytes
-rw-r--r--doc/src/images/qml-focus-example.pngbin43921 -> 31370 bytes
-rw-r--r--doc/src/scripting/ecmascript.qdoc50
-rw-r--r--doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml2
-rw-r--r--examples/declarative/animation/behaviors/behavior-example.qml2
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro2
-rw-r--r--examples/declarative/cppextensions/qwidgets/qwidgets.pro2
-rw-r--r--examples/declarative/keyinteraction/focus/Core/GridMenu.qml7
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml17
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViews.qml4
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qml5
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro8
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.qrc6
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/main.cpp66
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/model.cpp88
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/model.h83
-rw-r--r--examples/declarative/modelviews/abstractitemmodel/view.qml51
-rw-r--r--examples/declarative/modelviews/objectlistmodel/dataobject.h4
-rw-r--r--examples/declarative/modelviews/objectlistmodel/main.cpp5
-rw-r--r--examples/declarative/modelviews/objectlistmodel/view.qml18
-rw-r--r--examples/declarative/modelviews/stringlistmodel/main.cpp5
-rw-r--r--examples/declarative/modelviews/stringlistmodel/view.qml16
-rw-r--r--examples/declarative/ui-components/progressbar/content/ProgressBar.qml2
-rw-r--r--examples/declarative/ui-components/searchbox/SearchBox.qml2
-rw-r--r--examples/declarative/ui-components/tabwidget/main.qml6
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknLayoutFont.h2
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsConstants.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsItemID.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h1
-rw-r--r--mkspecs/common/symbian/header-wrappers/AknsUtils.h1
-rw-r--r--mkspecs/common/symbian/symbian-makefile.conf2
-rw-r--r--mkspecs/features/sis_targets.prf25
-rw-r--r--mkspecs/features/symbian/data_caging_paths.prf3
-rw-r--r--mkspecs/features/symbian/def_files.prf4
-rw-r--r--mkspecs/features/symbian/run_on_phone.prf10
-rw-r--r--mkspecs/features/symbian/symbian_building.prf126
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp14
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp7
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp1
-rw-r--r--qmake/generators/win32/msvc_vcxproj.cpp1
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog46
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h9
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h2
-rw-r--r--src/3rdparty/javascriptcore/VERSION4
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog34
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h206
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog78
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro7
-rw-r--r--src/3rdparty/webkit/WebCore/loader/DocLoader.cpp15
-rw-r--r--src/3rdparty/webkit/WebCore/loader/DocLoader.h5
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.h9
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog31
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp8
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/io/qiodevice.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp46
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h20
-rw-r--r--src/corelib/thread/qsemaphore.cpp7
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/declarative/QmlChanges.txt2
-rw-r--r--src/declarative/debugger/qdeclarativedebug.cpp29
-rw-r--r--src/declarative/debugger/qdeclarativedebug_p.h20
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp23
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp73
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h20
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h16
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp20
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h6
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp33
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h3
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp12
-rw-r--r--src/declarative/qml/qdeclarativecustomparser.cpp10
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p.h14
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp46
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp67
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp8
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp43
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h4
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h2
-rw-r--r--src/declarative/qml/qdeclarativelist.cpp2
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp24
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h2
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript_p.h2
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp2
-rw-r--r--src/declarative/util/qdeclarativebind_p.h2
-rw-r--r--src/declarative/util/qdeclarativeconnections_p.h2
-rw-r--r--src/declarative/util/qdeclarativefontloader_p.h2
-rw-r--r--src/declarative/util/qdeclarativelistaccessor_p.h2
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp11
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p.h2
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp56
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp2
-rw-r--r--src/declarative/util/qdeclarativepropertychanges_p.h5
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p.h2
-rw-r--r--src/declarative/util/qdeclarativesmoothedfollow_p.h2
-rw-r--r--src/declarative/util/qdeclarativespringfollow_p.h2
-rw-r--r--src/declarative/util/qdeclarativestateoperations_p.h6
-rw-r--r--src/declarative/util/qdeclarativestyledtext_p.h2
-rw-r--r--src/declarative/util/qdeclarativesystempalette_p.h2
-rw-r--r--src/declarative/util/qdeclarativetimer.cpp2
-rw-r--r--src/declarative/util/qdeclarativetimer_p.h2
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel_p.h4
-rw-r--r--src/gui/accessible/qaccessible_mac_cocoa.mm4
-rw-r--r--src/gui/egl/qegl_x11.cpp5
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp22
-rw-r--r--src/gui/image/image.pri4
-rw-r--r--src/gui/image/qimagereader.cpp2
-rw-r--r--src/gui/kernel/qapplication_win.cpp23
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp15
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm7
-rw-r--r--src/gui/kernel/qwidget_mac.mm10
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
-rw-r--r--src/gui/kernel/qwidget_win.cpp2
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/widgets/qcombobox.cpp5
-rw-r--r--src/gui/widgets/qcommandlinkbutton.cpp18
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp2
-rw-r--r--src/multimedia/audio/qaudio_mac.cpp9
-rw-r--r--src/multimedia/audio/qaudioinput_mac_p.cpp49
-rw-r--r--src/multimedia/audio/qaudiooutput_mac_p.cpp15
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp14
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp82
-rw-r--r--src/network/ssl/qsslsocket_p.h12
-rw-r--r--src/opengl/qgl.cpp26
-rw-r--r--src/opengl/qgl.h7
-rw-r--r--src/opengl/qgl_p.h2
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp55
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp5
-rw-r--r--src/plugins/codecs/cn/qgb18030codec.cpp21
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro10
-rw-r--r--src/plugins/imageformats/mng/mng.pro46
-rw-r--r--src/plugins/imageformats/tiff/tiff.pro98
-rw-r--r--src/plugins/phonon/mmf/mmf.pro250
-rw-r--r--src/s60installs/bwins/QtCoreu.def2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def4
-rw-r--r--src/s60installs/bwins/QtGuiu.def4
-rw-r--r--src/s60installs/eabi/QtCoreu.def2
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def5
-rw-r--r--src/s60installs/eabi/QtGuiu.def3
-rw-r--r--src/s60installs/eabi/QtScriptu.def2
-rw-r--r--src/s60installs/s60installs.pro7
-rw-r--r--src/s60main/s60main.pro4
-rw-r--r--src/script/api/qscriptengine.cpp59
-rw-r--r--src/script/api/qscriptengine_p.h25
-rw-r--r--src/script/bridge/bridge.pri2
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp36
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h5
-rw-r--r--src/script/bridge/qscriptstaticscopeobject.cpp157
-rw-r--r--src/script/bridge/qscriptstaticscopeobject_p.h103
-rw-r--r--src/script/script.pri1
-rw-r--r--src/script/utils/qscriptdate.cpp365
-rw-r--r--src/script/utils/qscriptdate_p.h52
-rw-r--r--src/script/utils/utils.pri5
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/corelib.pro7
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp28
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml15
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml16
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp23
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js4
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments.qml2
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cb.pngbin528 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cc.pngbin549 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_ct.pngbin564 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lb.pngbin522 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lc.pngbin541 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lt.pngbin558 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rb.pngbin530 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rc.pngbin550 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rt.pngbin564 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments.qml2
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.pngbin528 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.pngbin549 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.pngbin564 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.pngbin522 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.pngbin541 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.pngbin558 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.pngbin530 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.pngbin550 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.pngbin564 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp60
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/basic.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/elements.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/javaScript.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/loadError.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/newwindows.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml2
-rw-r--r--tests/auto/declarative/qdeclarativewebview/data/sethtml.qml2
-rw-r--r--tests/auto/gui.pro8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp13
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result12
-rwxr-xr-xtests/auto/mediaobject/mediaobject.pro2
-rw-r--r--tests/auto/networkselftest/networkselftest.pro2
-rw-r--r--tests/auto/patternistexamples/patternistexamples.pro2
-rw-r--r--tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro5
-rw-r--r--tests/auto/qapplication/test/test.pro2
-rw-r--r--tests/auto/qaudiooutput/qaudiooutput.pro2
-rw-r--r--tests/auto/qchar/qchar.pro4
-rw-r--r--tests/auto/qclipboard/test/test.pro4
-rw-r--r--tests/auto/qcryptographichash/qcryptographichash.pro4
-rw-r--r--tests/auto/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/qdom/qdom.pro2
-rw-r--r--tests/auto/qfile/qfile.pro2
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/qftp/qftp.pro2
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro4
-rw-r--r--tests/auto/qhash/qhash.pro4
-rw-r--r--tests/auto/qhttp/qhttp.pro2
-rw-r--r--tests/auto/qicoimageformat/qicoimageformat.pro2
-rw-r--r--tests/auto/qimage/qimage.pro2
-rw-r--r--tests/auto/qimagereader/qimagereader.pro2
-rw-r--r--tests/auto/qimagewriter/qimagewriter.pro2
-rw-r--r--tests/auto/qitemmodel/qitemmodel.pro2
-rw-r--r--tests/auto/qlayout/qlayout.pro2
-rw-r--r--tests/auto/qlibrary/tst/tst.pro2
-rw-r--r--tests/auto/qline/qline.pro2
-rw-r--r--tests/auto/qlocalsocket/qlocalsocket.pro2
-rw-r--r--tests/auto/qmenubar/qmenubar.pro2
-rw-r--r--tests/auto/qmovie/qmovie.pro2
-rw-r--r--tests/auto/qpainter/qpainter.pro2
-rw-r--r--tests/auto/qpathclipper/qpathclipper.pro2
-rw-r--r--tests/auto/qpixmap/qpixmap.pro4
-rw-r--r--tests/auto/qprocess/testDetached/testDetached.pro2
-rw-r--r--tests/auto/qresourceengine/qresourceengine.pro2
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro2
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp242
-rw-r--r--tests/auto/qsemaphore/tst_qsemaphore.cpp49
-rw-r--r--tests/auto/qset/qset.pro4
-rw-r--r--tests/auto/qsound/qsound.pro2
-rw-r--r--tests/auto/qsplitter/qsplitter.pro2
-rw-r--r--tests/auto/qstyle/qstyle.pro2
-rw-r--r--tests/auto/qtcpsocket/qtcpsocket.pro2
-rw-r--r--tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro2
-rw-r--r--tests/auto/qtextbrowser/qtextbrowser.pro4
-rw-r--r--tests/auto/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/qthread/qthread.pro2
-rw-r--r--tests/auto/qthreadstorage/qthreadstorage.pro2
-rw-r--r--tests/auto/qtipc/qsharedmemory/test/test.pro2
-rw-r--r--tests/auto/qtransform/qtransform.pro2
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qtwidgets/qtwidgets.pro2
-rw-r--r--tests/auto/qudpsocket/test/test.pro2
-rw-r--r--tests/auto/qwmatrix/qwmatrix.pro2
-rw-r--r--tests/auto/qxml/qxml.pro2
-rw-r--r--tests/auto/qxmlformatter/qxmlformatter.pro2
-rw-r--r--tests/auto/qxmlquery/qxmlquery.pro2
-rw-r--r--tests/auto/qxmlsimplereader/qxmlsimplereader.pro2
-rw-r--r--tests/auto/qxmlstream/qxmlstream.pro2
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp58
-rw-r--r--tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp52
-rw-r--r--tools/configure/configureapp.cpp1192
-rw-r--r--tools/linguist/lupdate/cpp.cpp16
-rw-r--r--tools/qdoc3/codechunk.h2
-rw-r--r--tools/qdoc3/codemarker.cpp12
-rw-r--r--tools/qdoc3/cppcodeparser.cpp39
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp231
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h7
-rw-r--r--tools/qdoc3/htmlgenerator.cpp10
-rw-r--r--tools/qdoc3/node.cpp52
-rw-r--r--tools/qdoc3/node.h161
-rw-r--r--tools/qdoc3/pagegenerator.cpp3
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf4
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf76
-rw-r--r--tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf67
-rw-r--r--tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf14
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf6
-rw-r--r--tools/qdoc3/tree.cpp10
-rw-r--r--tools/qml/deviceorientation_maemo5.cpp (renamed from tools/qml/deviceorientation_maemo.cpp)2
-rw-r--r--tools/qml/loggerwidget.cpp25
-rw-r--r--tools/qml/loggerwidget.h12
-rw-r--r--tools/qml/main.cpp2
-rw-r--r--tools/qml/proxysettings.cpp5
-rw-r--r--tools/qml/proxysettings.h4
-rw-r--r--tools/qml/proxysettings_maemo5.ui177
-rw-r--r--tools/qml/qdeclarativetester.h3
-rw-r--r--tools/qml/qml.pri10
-rw-r--r--tools/qml/qml.pro3
-rw-r--r--tools/qml/qmlruntime.cpp511
-rw-r--r--tools/qml/qmlruntime.h33
-rw-r--r--tools/qml/recopts_maemo5.ui254
-rw-r--r--tools/qml/texteditautoresizer_maemo5.h113
393 files changed, 5894 insertions, 2850 deletions
diff --git a/.gitignore b/.gitignore
index f187b23..fdb6843 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ qrc_*.cpp
*.ncb
*.vcxproj
*.vcxproj.filters
+*.vcxproj.user
# MinGW generated files
*.Debug
diff --git a/bin/elf2e32_qtwrapper b/bin/elf2e32_qtwrapper
new file mode 100755
index 0000000..694d54a
--- /dev/null
+++ b/bin/elf2e32_qtwrapper
@@ -0,0 +1,145 @@
+#!/usr/bin/perl -w
+
+# A script to get around some shortcomings in elf2e32, namely:
+# - Returning 0 even when there are errors.
+# - Excluding symbols from the dso file even when they are present in the ELF file.
+# - Including symbols in the the dso file even when they are not present in the ELF file.
+# - Overwriting the old dso file even when there are no changes (increases build time).
+
+use File::Copy;
+
+my @args = ();
+my @definput;
+my @defoutput;
+my @dso;
+my @tmpdso;
+foreach (@ARGV) {
+ if (/^--definput/o) {
+ @definput = split('=', $_);
+ } elsif (/^--defoutput/o) {
+ @defoutput = split('=', $_);
+ } elsif (/^--dso/o) {
+ @dso = split('=', $_);
+ } elsif (/^--tmpdso/o) {
+ @tmpdso = split('=', $_);
+ $tmpdso[0] = "--dso";
+ } else {
+ push(@args, $_);
+ }
+}
+
+@definput = () if (!@definput || ! -e $definput[1]);
+
+if (@dso && !@tmpdso || !@dso && @tmpdso) {
+ print("--dso and --tmpdso must be used together.\n");
+ exit 1;
+}
+
+my $buildingLibrary = (@defoutput && @dso) ? 1 : 0;
+
+my $fixupFile = "";
+my $runCount = 0;
+my $returnCode = 0;
+
+while (1) {
+ if (++$runCount > 2) {
+ print("Internal error in $0, link succeeded, but exports may be wrong.\n");
+ last;
+ }
+
+ my $elf2e32Pipe;
+ my $elf2e32Cmd = "elf2e32 @args"
+ . " " . join("=", @definput)
+ . " " . join("=", @defoutput)
+ . " " . join("=", @tmpdso);
+ open($elf2e32Pipe, "$elf2e32Cmd 2>&1 |") or die ("Could not run elf2e32");
+
+ my %fixupSymbols;
+ my $foundBrokenSymbols = 0;
+ my $errors = 0;
+ while (<$elf2e32Pipe>) {
+ print;
+ if (/Error:/io) {
+ $errors = 1;
+ } elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
+ $fixupSymbols{$1} = 1;
+ $foundBrokenSymbols = 1;
+ } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
+ $foundBrokenSymbols = 1;
+ }
+ }
+ close($elf2e32Pipe);
+
+ if ($errors) {
+ $returnCode = 1;
+ last;
+ }
+
+ if ($buildingLibrary) {
+ my $tmpDefFile;
+ my $defFile;
+ open($defFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
+ open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
+ $fixupFile = "$defoutput[1].tmp";
+ while (<$defFile>) {
+ s/\r//;
+ s/\n//;
+ next if (/; NEW:/);
+ if (/([a-z0-9_]+) @/i) {
+ if (exists($fixupSymbols{$1})) {
+ s/ ABSENT//;
+ } elsif (s/; MISSING://) {
+ s/$/ ABSENT/;
+ }
+ }
+ print($tmpDefFile "$_\n");
+ }
+ close($defFile);
+ close($tmpDefFile);
+
+ $definput[1] = "$defoutput[1].tmp";
+
+ if (!$foundBrokenSymbols || $errors) {
+ last;
+ }
+
+ print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
+ } else {
+ last;
+ }
+};
+
+if ($fixupFile) {
+ unlink($defoutput[1]);
+ move($fixupFile, $defoutput[1]);
+}
+
+exit $returnCode if ($returnCode != 0);
+
+if ($buildingLibrary) {
+ my $differenceFound = 0;
+
+ if (-e $dso[1]) {
+ my $dsoFile;
+ my $tmpdsoFile;
+ my $dsoBuf;
+ my $tmpdsoBuf;
+ open($dsoFile, "< $dso[1]") or die("Could not open $dso[1]");
+ open($tmpdsoFile, "< $tmpdso[1]") or die("Could not open $tmpdso[1]");
+ binmode($dsoFile);
+ binmode($tmpdsoFile);
+ while(read($dsoFile, $dsoBuf, 4096) && read($tmpdsoFile, $tmpdsoBuf, 4096)) {
+ if ($dsoBuf ne $tmpdsoBuf) {
+ $differenceFound = 1;
+ }
+ }
+ close($tmpdsoFile);
+ close($dsoFile);
+ } else {
+ $differenceFound = 1;
+ }
+
+ if ($differenceFound) {
+ copy($tmpdso[1], $dso[1]);
+ }
+}
diff --git a/bin/syncqt b/bin/syncqt
index f499bbc..11b1d72 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -834,12 +834,12 @@ foreach (@modules_to_sync) {
# write forwarding headers to include/Qt
if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) {
my $file_name = "$out_basedir/include/Qt/$header";
+ my $file_op = '>';
my $header_content = '';
if (exists $colliding_headers{$file_name}) {
- $file_name = ">>$file_name";
+ $file_op = '>>';
} else {
$colliding_headers{$file_name} = 1;
- $file_name = ">$file_name";
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" .
@@ -850,7 +850,7 @@ foreach (@modules_to_sync) {
"#endif\n\n";
}
$header_content .= '#include "' . "../$lib/$header" . "\"\n";
- open HEADERFILE, $file_name;
+ open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n";
print HEADERFILE $header_content;
close HEADERFILE;
}
diff --git a/configure b/configure
index 5d97405..7f6d43b 100755
--- a/configure
+++ b/configure
@@ -2340,7 +2340,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
chmod 755 "$outpath/bin/syncqt"
fi
- for i in createpackage patch_capabilities; do
+ for i in elf2e32_qtwrapper createpackage patch_capabilities; do
rm -f "$outpath/bin/$i"
if [ -x "$relpath/bin/$i" ]; then
mkdir -p "$outpath/bin"
diff --git a/demos/declarative/rssnews/content/NewsDelegate.qml b/demos/declarative/rssnews/content/NewsDelegate.qml
index 040dadc..cfe9b00 100644
--- a/demos/declarative/rssnews/content/NewsDelegate.qml
+++ b/demos/declarative/rssnews/content/NewsDelegate.qml
@@ -43,10 +43,11 @@ import Qt 4.7
Item {
id: delegate
- height: childrenRect.height + 20
+ height: column.height + 40
width: delegate.ListView.view.width
Column {
+ id: column
x: 20; y: 20
width: parent.width - 40
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js
index 4d05e33..0f0dbf7 100644
--- a/demos/declarative/snake/content/snake.js
+++ b/demos/declarative/snake/content/snake.js
@@ -150,7 +150,7 @@ function move() {
snake.push(newLink);
} else {
var lastLink = snake[snake.length-1];
- board[lastLink.row * numColumns + lastLink.column] = Undefined;
+ board[lastLink.row * numColumns + lastLink.column] = undefined;
}
if (waitForCookie > 0) {
@@ -186,7 +186,7 @@ function move() {
function isFree(row, column)
{
- return board[row * numColumns + column] == Undefined;
+ return board[row * numColumns + column] == undefined;
}
function isHead(row, column)
@@ -214,7 +214,7 @@ function moveSkull()
--linksToDie;
var link = snake.pop();
link.dying = true;
- board[link.row * numColumns + link.column] = Undefined;
+ board[link.row * numColumns + link.column] = undefined;
if (score > 0)
--score;
if (snake.length == 0) {
diff --git a/demos/embedded/anomaly/src/BookmarksView.cpp b/demos/embedded/anomaly/src/BookmarksView.cpp
index 729bf73..d6e6035 100644
--- a/demos/embedded/anomaly/src/BookmarksView.cpp
+++ b/demos/embedded/anomaly/src/BookmarksView.cpp
@@ -55,7 +55,7 @@ BookmarksView::BookmarksView(QWidget *parent)
m_iconView->addItem("www.google.com");
m_iconView->addItem("qt.nokia.com/doc/4.5");
- m_iconView->addItem("news.bbc.co.uk/text_only.stm");
+ m_iconView->addItem("news.bbc.co.uk/2/mobile/default.stm");
m_iconView->addItem("mobile.wikipedia.org");
m_iconView->addItem("qt.nokia.com");
m_iconView->addItem("en.wikipedia.org");
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
index 41318ad..a6e6f7a 100644
--- a/demos/embedded/anomaly/src/BrowserView.cpp
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -177,7 +177,6 @@ void BrowserView::resizeEvent(QResizeEvent *event)
void BrowserView::setDefaultIap()
{
qt_SetDefaultIap();
- m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm"));
}
#endif
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 416e58b..ca74c38 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -118,7 +118,7 @@ symbian {
}
contains(QT_CONFIG, multimedia) {
- reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/spectrum_reg.rsc
+ reg_resource.sources += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc)
}
@@ -202,10 +202,11 @@ symbian {
}
contains(QT_CONFIG, multimedia) {
- executables.sources += spectrum.exe fftreal.dll
- resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.rsc
+ executables.sources += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe
+ executables.sources += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll
+ resource.sources += $$appResourceDir(demos/spectrum/app/spectrum.rsc)
mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.mif
+ $$appResourceDir(demos/spectrum/app/spectrum.mif)
}
contains(QT_CONFIG, script) {
diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri
index a0bfbb6..53c6dbf 100644
--- a/demos/embedded/qmlcalculator/deployment.pri
+++ b/demos/embedded/qmlcalculator/deployment.pri
@@ -1,7 +1,7 @@
qmlcalculator_src = $$PWD/../../declarative/calculator
symbian {
qmlcalculator_uid3 = A000E3FB
- qmlcalculator_files.path = ../$$qmlcalculator_uid3
+ qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3
}
qmlcalculator_files.sources = $$qmlcalculator_src/calculator.qml $$qmlcalculator_src/Core
DEPLOYMENT += qmlcalculator_files
diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri
index a30e403..03ba129 100644
--- a/demos/embedded/qmlclocks/deployment.pri
+++ b/demos/embedded/qmlclocks/deployment.pri
@@ -1,7 +1,7 @@
qmlclocks_src = $$PWD/../../../examples/declarative/toys/clocks
symbian {
qmlclocks_uid3 = A000E3FC
- qmlclocks_files.path = ../$$qmlclocks_uid3
+ qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3
}
qmlclocks_files.sources = $$qmlclocks_src/clocks.qml $$qmlclocks_src/content
DEPLOYMENT += qmlclocks_files
diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri
index c04ed05..097c74c 100644
--- a/demos/embedded/qmldialcontrol/deployment.pri
+++ b/demos/embedded/qmldialcontrol/deployment.pri
@@ -1,7 +1,7 @@
qmldialcontrol_src = $$PWD/../../../examples/declarative/ui-components/dialcontrol
symbian {
qmldialcontrol_uid3 = A000E3FD
- qmldialcontrol_files.path = ../$$qmldialcontrol_uid3
+ qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3
}
qmldialcontrol_files.sources = $$qmldialcontrol_src/dialcontrol.qml $$qmldialcontrol_src/content
DEPLOYMENT += qmldialcontrol_files
diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri
index bc37348..47192e6 100644
--- a/demos/embedded/qmleasing/deployment.pri
+++ b/demos/embedded/qmleasing/deployment.pri
@@ -1,7 +1,7 @@
qmleasing_src = $$PWD/../../../examples/declarative/animation/easing
symbian {
qmleasing_uid3 = A000E3FE
- qmleasing_files.path = ../$$qmleasing_uid3
+ qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3
}
qmleasing_files.sources = $$qmleasing_src/easing.qml
DEPLOYMENT += qmleasing_files
diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri
index c1f82df..c8fef1a 100644
--- a/demos/embedded/qmlflickr/deployment.pri
+++ b/demos/embedded/qmlflickr/deployment.pri
@@ -1,7 +1,7 @@
qmlflickr_src = $$PWD/../../declarative/flickr
symbian {
qmlflickr_uid3 = A000E3FF
- qmlflickr_files.path = ../$$qmlflickr_uid3
+ qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3
}
qmlflickr_files.sources = $$qmlflickr_src/flickr.qml $$qmlflickr_src/common $$qmlflickr_src/mobile
DEPLOYMENT += qmlflickr_files
diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri
index 0a457de..128a1f7 100644
--- a/demos/embedded/qmlphotoviewer/deployment.pri
+++ b/demos/embedded/qmlphotoviewer/deployment.pri
@@ -1,7 +1,7 @@
qmlphotoviewer_src = $$PWD/../../declarative/photoviewer
symbian {
qmlphotoviewer_uid3 = A000E400
- qmlphotoviewer_files.path = ../$$qmlphotoviewer_uid3
+ qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3
}
qmlphotoviewer_files.sources = $$qmlphotoviewer_src/photoviewer.qml $$qmlphotoviewer_src/PhotoViewerCore
DEPLOYMENT += qmlphotoviewer_files
diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri
index 34c8cd1..40c53ad 100644
--- a/demos/embedded/qmltwitter/deployment.pri
+++ b/demos/embedded/qmltwitter/deployment.pri
@@ -1,7 +1,7 @@
qmltwitter_src = $$PWD/../../declarative/twitter
symbian {
qmltwitter_uid3 = A000E401
- qmltwitter_files.path = ../$$qmltwitter_uid3
+ qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3
}
qmltwitter_files.sources = $$qmltwitter_src/twitter.qml $$qmltwitter_src/TwitterCore
DEPLOYMENT += qmltwitter_files
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index a2ceb0e..15561ab 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -369,10 +369,10 @@ void MenuManager::launchQmlExample(const QString &name)
dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
else
dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
- QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + fileName.split('/').last() + ".qml");
+ QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml");
if(!file.exists()){
- //try main.qml as well
- file.setFileName(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml");
+ //try dirname.qml as well
+ file.setFileName(dir.path() + "/" + dirName + "/" + fileName + "/" + fileName.split('/').last() + ".qml");
if(!file.exists()){
exampleError(QProcess::UnknownError);
return;
diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index 5c5f96c..e15d33c 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -99,6 +99,7 @@ Item {
}
MouseArea{
anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: loader.focus=true;/* and don't propogate to the 'exit' area*/
}
@@ -130,7 +131,7 @@ Item {
textFormat: Text.RichText
//Note that if loader is Error, it is because the file was found but there was an error creating the component
//This means either we have a bug in our demos, or the required modules (which ship with Qt) did not deploy correctly
- text: "The example has failed to load.<br />If you installed Qt's QML modules this is a bug!<br />"
+ text: "The example has failed to load.<br />If you installed all Qt's C++ and QML modules then this is a bug!<br />"
+ 'Report it at <a href="http://bugreports.qt.nokia.com">http://bugreports.qt.nokia.com</a>';
onLinkActivated: Qt.openUrlExternally(link);
}
@@ -145,6 +146,7 @@ Item {
z: 8
enabled: main.show
hoverEnabled: main.show //To steal focus from the buttons
+ acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
anchors.fill: parent
onClicked: main.show=false;
}
diff --git a/demos/spectrum/3rdparty/fftreal/fftreal.pro b/demos/spectrum/3rdparty/fftreal/fftreal.pro
index 8d9f46e..6801b42 100644
--- a/demos/spectrum/3rdparty/fftreal/fftreal.pro
+++ b/demos/spectrum/3rdparty/fftreal/fftreal.pro
@@ -29,7 +29,7 @@ DEFINES += FFTREAL_LIBRARY
symbian {
# Provide unique ID for the generated binary, required by Symbian OS
- TARGET.UID3 = 0xA000E3FB
+ TARGET.UID3 = 0xA000E403
TARGET.CAPABILITY = UserEnvironment
} else {
macx {
diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro
index c4b0943..c15edf9 100644
--- a/demos/spectrum/app/app.pro
+++ b/demos/spectrum/app/app.pro
@@ -48,7 +48,7 @@ symbian {
TARGET.CAPABILITY = UserEnvironment
# Provide unique ID for the generated binary, required by Symbian OS
- TARGET.UID3 = 0xA000E3FA
+ TARGET.UID3 = 0xA000E402
}
diff --git a/demos/spectrum/spectrum.pro b/demos/spectrum/spectrum.pro
index d5a07f7..df14a7d 100644
--- a/demos/spectrum/spectrum.pro
+++ b/demos/spectrum/spectrum.pro
@@ -19,7 +19,7 @@ symbian {
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
# UID for the SIS file
- TARGET.UID3 = 0xA000E3FA
+ TARGET.UID3 = 0xA000E402
}
sources.files = README.txt spectrum.pri spectrum.pro TODO.txt
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index 13202ee..c5333df 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -71,13 +71,15 @@ to explicitly set the \c target and \c property to animate.
Animations can be joined into a group using SequentialAnimation and ParallelAnimation.
+See the \l {declarative/animation/basics}{Animation basics example} for a demonstration of creating and combining multiple animations in QML.
+
\target state-transitions
\section1 Transitions
-QML transitions describe animations to perform when \l{qmlstates}{state} changes occur. A transition
+\l Transition elements describe the animations to perform when \l{qmlstates}{state} changes occur. A transition
can only be triggered by a state change.
-For example, a transition could describe how an item moves from its initial position to its new position:
+For example, a \l Transition could describe how an item moves from its initial position to its new position:
\snippet doc/src/snippets/declarative/animation.qml transitions-1
@@ -108,9 +110,13 @@ making use of both sequential and parallel animations:
\snippet doc/src/snippets/declarative/animation.qml transitions-3
+
+See \l {declarative/animation/states}{States and Transitions example} for a simple example of how transitions can be applied.
+
+
\section1 Property Behaviors
-A \l{Behavior}{property behavior} specifies a default animation to run whenever the property's value changes, regardless
+A property \l {Behavior}{behavior} specifies a default animation to run whenever the property's value changes, regardless
of what caused the change. The \c enabled property can be used to force a \l Behavior
to only apply under certain circumstances.
@@ -119,7 +125,7 @@ whenever it changes. The animation will last 300 milliseconds and use an \l{Prop
\snippet doc/src/snippets/declarative/animation.qml behavior
-Like using an animation as a value source, when used in a Behavior and animation does not need to specify
+Like using an animation as a value source, when used in a \l Behavior and animation does not need to specify
a \c target or \c property.
To trigger this behavior, we could enter a state that changes \c x:
@@ -149,4 +155,6 @@ If \c x were bound to another property, triggering the binding would also trigge
If a state change has a transition animation matching a property with a \l Behavior, the transition animation
will override the \l Behavior for that state change.
+The \l {declarative/animation/behaviors}{Behaviors example} shows how behaviors can be used to provide animations.
+
*/
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 734175c..159f40d 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -157,8 +157,8 @@
Rectangle { color: "#800000FF" }
\endqml
- Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
- \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
+ Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()},
+ \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
\qml
Rectangle { color: Qt.rgba(255, 0, 0, 1) }
@@ -181,7 +181,7 @@
CustomObject { myPointProperty: "0,20" }
\endqml
- Or use the \l{Qt::point()}{Qt.point()} function:
+ Or use the \l{QML:Qt::point()}{Qt.point()} function:
\qml
CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -213,7 +213,7 @@
LayoutItem { preferredSize: "150x50" }
\endqml
- Or use the \l{Qt::size()}{Qt.size()} function:
+ Or use the \l{QML:Qt::size()}{Qt.size()} function:
\qml
LayoutItem { preferredSize: Qt.size(150, 50) }
@@ -246,7 +246,7 @@
CustomObject { myRectProperty: "50,50,100x100" }
\endqml
- Or use the \l{Qt::rect()}{Qt.rect()} function:
+ Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
\qml
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
@@ -269,7 +269,7 @@
\endqml
To read a date value returned from a C++ extension class, use
- \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
\sa {QML Basic Types}
*/
@@ -288,7 +288,7 @@
\endqml
To read a time value returned from a C++ extension class, use
- \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+ \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
\sa {QML Basic Types}
*/
@@ -386,7 +386,7 @@
Rotation { angle: 60; axis: "0,1,0" }
\endqml
- or with the \l{Qt::vector3d()}{Qt.vector3d()} function:
+ or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
\qml
Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index f113147..4235c27 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -104,6 +104,7 @@ application or to build completely new applications. QML is fully \l
\o \l {QML Security}
\o \l {QtDeclarative Module}
\o \l {Debugging QML}
+\o \l {QML Viewer}
\o \l {QML Performance}
\o \l {QML Coding Conventions}
\endlist
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 0ffdbc9..a5e53a9 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -39,18 +39,22 @@ QML also supports the dynamic creation of objects from within JavaScript
code. This is useful if the existing QML elements do not fit the needs of your
application, and there are no C++ components involved.
+See the {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
+of the concepts discussed on this page.
+
\section1 Creating Objects Dynamically
+
There are two ways to create objects dynamically from JavaScript. You can either call
-\l {Qt::createComponent()}{Qt.createComponent()} to create
-a component which instantiates items, or use \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to create
+a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
to create an item from a string of QML.
Creating a component is better if you have a predefined
item, and you want to create dynamic instances of that item; creating an item from
a string of QML is useful when the item QML itself is generated at runtime.
If you have a component specified in a QML file, you can dynamically load it with
-the \l {Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
+the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}.
This function takes the URL of the QML file as its only argument and returns
a component object which can be used to create and load that QML file.
@@ -84,10 +88,10 @@ in \c main.qml). After creating an item, you must set its parent to an item with
Otherwise your dynamically created item will not appear in the scene.
When using files with relative paths, the path should
-be relative to the file where \l {Qt::createComponent()}{Qt.createComponent()} is executed.
+be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
If the QML component does not exist until runtime, you can create a QML item from
-a string of QML using the \l{Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
+a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
\snippet doc/src/snippets/declarative/createQmlObject.qml 0
@@ -107,9 +111,9 @@ the bindings in the dynamic item will no longer work.
The actual creation context depends on how an item is created:
\list
-\o If \l {Qt::createComponent()}{Qt.createComponent()} is used, the creation context
+\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
is the QDeclarativeContext in which this method is called
-\o If \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
if called, it is the context of the item used as the second argument to this method
\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
is called on that item, it is the context in which the \c Component is defined
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 7b02d33..587cdf2 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -168,11 +168,14 @@ The examples can be found in Qt's \c examples/declarative directory.
\list
\o \l{declarative/modelviews/gridview}{GridView}
\o \l{declarative/modelviews/listview}{ListView}
-\o \l{declarative/modelviews/objectlistmodel}{Object ListModel}
\o \l{declarative/modelviews/package}{Package}
\o \l{declarative/modelviews/parallax}{Parallax}
-\o \l{declarative/modelviews/stringlistmodel}{String ListModel}
\o \l{declarative/modelviews/visualitemmodel}{VisualItemModel}
+
+\o \l{declarative/modelviews/stringlistmodel}{String ListModel}
+\o \l{declarative/modelviews/objectlistmodel}{Object ListModel}
+\o \l{declarative/modelviews/abstractitemmodel}{AbstractItemModel}
+
\o \l{declarative/modelviews/webview}{WebView}
\endlist
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index 699ebcb..cc546c0 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -266,6 +266,10 @@ When a QML item explicitly relinquishes focus (by setting its
does not automatically select another element to receive focus. That is, it
is possible for there to be no currently \e {active focus}.
+See the {declarative/keyinteraction/focus}{Keyboard Focus example} for a
+demonstration of moving keyboard focus between multiple areas using FocusScope
+elements.
+
\section1 Advanced uses of Focus Scopes
Focus scopes allow focus to allocation to be easily partitioned. Several
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index ecbaa9e..36d91ec 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -114,6 +114,9 @@ browser. The following objects and properties are supported by the QML implemen
\endtable
+The \l{declarative/xml/xmlhttprequest}{XMLHttpRequest example} demonstrates how to
+use the XMLHttpRequest object to make a request and read the response headers.
+
\section1 Offline Storage API
\section2 Database API
@@ -132,6 +135,9 @@ The API can be used from JavaScript functions in your QML:
The API conforms to the Synchronous API of the HTML5 Web Database API,
\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
+The \l{declarative/sqllocalstorage}{SQL Local Storage example} demonstrates the basics of
+using the Offline Storage API.
+
\section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db))
Returns the database identified by \e identifier. If the database does not already exist, it
diff --git a/doc/src/declarative/qdeclarativei18n.qdoc b/doc/src/declarative/qdeclarativei18n.qdoc
index c16dea3..40f7919 100644
--- a/doc/src/declarative/qdeclarativei18n.qdoc
+++ b/doc/src/declarative/qdeclarativei18n.qdoc
@@ -78,4 +78,7 @@ Finally, we can test the translation:
\code
qml -translation hello.qm hello.qml
\endcode
+
+
+You can see a complete example and source code in the {declarative/i18n}{QML Internationalization example}.
*/
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index bb17896..b44e6f2 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -30,63 +30,67 @@
\target qmlmodels
\title Data Models
-Some QML Items use Data Models to provide the data to be displayed.
+QML items such as ListView, GridView and \l Repeater require Data Models
+that provide the data to be displayed.
These items typically require a \e delegate component that
creates an instance for each item in the model. Models may be static, or
have items modified, inserted, removed or moved dynamically.
Data is provided to the delegate via named data roles which the
-delegate may bind to. The roles are exposed as properties of the
-\e model context property, though this property is set as a default property
-of the delegate so, unless there is a naming clash with a
-property in the delegate, the roles are usually accessed unqualified. The
-example below would have a clash between the \e color role of the model and
-the \e color property of the Rectangle. The clash is avoided by referencing
-the \e color property of the model by its full name: \e model.color.
+delegate may bind to. Here is a ListModel with two roles, \e type and \e age,
+and a ListView with a delegate that binds to these roles to display their
+values:
-\code
-ListModel {
- id: myModel
- ListElement { color: "red" }
- ListElement { color: "green" }
-}
+\qml
+import Qt 4.7
+
+Item {
+ width: 200; height: 250
+
+ ListModel {
+ id: myModel
+ ListElement { type: "Dog"; age: 8 }
+ ListElement { type: "Cat"; age: 5 }
+ }
-Component {
- id: myDelegate
- Rectangle {
- width: 20; height: 20
- color: model.color
+ Component {
+ id: myDelegate
+ Text { text: type + ", " + age }
+ }
+
+ ListView {
+ anchors.fill: parent
+ model: myModel
+ delegate: myDelegate
}
}
-\endcode
+\endqml
-A special \e index role containing the index of the item in the model
-is also available.
+If there is a naming clash between the model's properties and the delegate's
+properties, the roles can be accessed with the qualified \e model name instead.
+For example, if a \l Text element had \e type or \e age properties, the text in the
+above example would display those property values instead of the \e type and \e age values
+from the model item. In this case, the properties could have been referenced as
+\c model.type and \c model.age instead to ensure the delegate displays the
+property values from the model item.
-\e Note: the index role will be set to -1 if the item is removed from
+A special \e index role containing the index of the item in the model
+is also available to the delegate. Note this index is set to -1 if the item is removed from
the model. If you bind to the index role, be sure that the logic
accounts for the possibility of index being -1, i.e. that the item
-is no longer valid. Usually the item will shortly be destroyed, but
-it is possible to delay delegate destruction in some views via a delayRemove
-attached property.
+is no longer valid. (Usually the item will shortly be destroyed, but
+it is possible to delay delegate destruction in some views via a \c delayRemove
+attached property.)
-Models that do not have named roles will have the data provided via
-the \e modelData role. The \e modelData role is also provided for
-Models that have only one role. In this case the \e modelData role
+Models that do not have named roles (such as the QStringList model shown below)
+will have the data provided via the \e modelData role. The \e modelData role is also provided for
+models that have only one role. In this case the \e modelData role
contains the same data as the named role.
-There are a number of QML elements that operate using data models:
+QML provides several types of data models among the built-in set of
+QML elements. In addition, models can be created with C++ and then
+made available to QML components.
-\list
-\o ListView
-\o GridView
-\o PathView
-\o \l Repeater
-\endlist
-
-QML supports several types of data model, which may be provided by QML
-or C++ (via QDeclarativeContext::setContextProperty() or as plugin types,
-for example).
\section1 QML Data Models
@@ -98,6 +102,7 @@ available roles are specified by the \l ListElement properties.
\code
ListModel {
id: fruitModel
+
ListElement {
name: "Apple"
cost: 2.45
@@ -117,30 +122,26 @@ The above model has two roles, \e name and \e cost. These can be bound
to by a ListView delegate, for example:
\code
-Component {
- id: fruitDelegate
- Row {
+ListView {
+ width: 200; height: 250
+ model: fruitModel
+ delegate: Row {
Text { text: "Fruit: " + name }
Text { text: "Cost: $" + cost }
}
}
-ListView {
- model: fruitModel
- delegate: fruitDelegate
-}
\endcode
-It is also possible to manipulate the ListModel directly via JavaScript.
-In this case, the first item inserted will determine the roles available
-to any views using the model. For example, if an empty ListModel is
-created and populated via JavaScript the roles provided by the first
+ListModel provides methods to manipulate the ListModel directly via JavaScript.
+In this case, the first item inserted determines the roles available
+to any views that are using the model. For example, if an empty ListModel is
+created and populated via JavaScript, the roles provided by the first
insertion are the only roles that will be shown in the view:
\code
Item {
- ListModel {
- id: fruitModel
- }
+ ListModel { id: fruitModel }
+
MouseArea {
anchors.fill: parent
onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
@@ -148,9 +149,9 @@ Item {
}
\endcode
-When the MouseArea is clicked fruitModel will have two roles, "cost" and "name".
+When the MouseArea is clicked, \c fruitModel will have two roles, \e cost and \e name.
Even if subsequent roles are added, only the first two will be handled by views
-using the model.
+using the model. To reset the roles available in the model, call ListModel::clear().
\section2 XmlListModel
@@ -170,11 +171,17 @@ XmlListModel {
}
\endcode
+The \l{demos/declarative/rssnews}{RSS News demo} shows how XmlListModel can
+be used to display an RSS feed.
+
\section2 VisualItemModel
-VisualItemModel allows QML items to be provided as a model. This model contains
-both the data and delegate (its child items). This model does not provide any roles.
+VisualItemModel allows QML items to be provided as a model.
+
+This model contains both the data and delegate; the child items of a
+VisualItemModel provide the contents of the delegate. The model
+does not provide any roles.
\code
VisualItemModel {
@@ -197,15 +204,74 @@ will be positioned by the view.
\section1 C++ Data Models
-Models defined in C++ can be made available to QML either from a C++ application or from a
-\l{QDeclarativeExtensionPlugin}{QML C++ plugin}.
+Models can be defined in C++ and then made available to QML. This is useful
+for exposing existing C++ data models or otherwise complex datasets to QML.
+
+A C++ model class can be defined as a QStringList, a QList<QObject*> or a
+QAbstractItemModel.
+
+\section2 QStringList
+
+A model may be a simple QStringList, which provides the contents of the list via the \e modelData role.
+
+Here is a ListView with a delegate that references its model item's
+value using the \c modelData role:
+
+\snippet examples/declarative/modelviews/stringlistmodel/view.qml 0
+
+A Qt application can load this QML document and set the value of \c myModel
+to a QStringList:
+
+\snippet examples/declarative/modelviews/stringlistmodel/main.cpp 0
+
+The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/declarative/modelviews/stringlistmodel} directory.
+
+\note There is no way for the view to know that the contents of a QStringList
+have changed. If the QStringList changes, it will be necessary to reset
+the model by calling QDeclarativeContext::setContextProperty() again.
+
+
+\section2 QList<QObject*>
+
+A list of QObject* values can also be used as a model. A QList<QObject*> provides
+the properties of the objects in the list as roles.
+
+The following application creates a \c DataObject class that with
+Q_PROPERTY values that will be accessible as named roles when a
+QList<DataObject*> is exposed to QML:
+
+\snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 0
+\dots 4
+\snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 1
+\codeline
+\snippet examples/declarative/modelviews/objectlistmodel/main.cpp 0
+\dots
+
+The QObject* is available as the \c modelData property. As a convenience,
+the properties of the object are also made available directly in the
+delegate's context. Here, \c view.qml references the \c DataModel properties in
+the ListView delegate:
+
+\snippet examples/declarative/modelviews/objectlistmodel/view.qml 0
+
+Note the use of the fully qualified access to the \c color property.
+The properties of the object are not replicated in the \c model
+object, since they are easily available via the \c modelData
+object.
+
+The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/declarative/modelviews/objectlistmodel} directory.
+
+Note: There is no way for the view to know that the contents of a QList
+have changed. If the QList changes, it will be necessary to reset
+the model by calling QDeclarativeContext::setContextProperty() again.
+
\section2 QAbstractItemModel
A model can be defined by subclassing QAbstractItemModel.
-QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNames() method.
-The default role names set by Qt are:
+The roles of a QAbstractItemModel subclass can be exposed to QML by calling
+QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
\table
\header
@@ -219,22 +285,34 @@ The default role names set by Qt are:
\o decoration
\endtable
-The model could be made available to QML either directly:
+Here is an application with a QAbstractListModel subclass named \c AnimalModel
+that has \e type and \e size roles. It calls QAbstractItemModel::setRoleNames() to set the
+role names for accessing the properties via QML:
-\code
-QDeclarativeContext *ctxt = view.rootContext();
-MyModel *model = new MyModel; // subclass of QAbstractItemModel
-ctxt->setContextProperty("myModel", model);
-\endcode
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 0
+\dots
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 1
+\dots
+\snippet examples/declarative/modelviews/abstractitemmodel/model.h 2
+\codeline
+\snippet examples/declarative/modelviews/abstractitemmodel/model.cpp 0
+\codeline
+\snippet examples/declarative/modelviews/abstractitemmodel/main.cpp 0
+\dots
+
+This model is displayed by a ListView delegate that accesses the \e type and \e size
+roles:
+
+\snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0
-or by registering the subclass as a new QML type in
-a \l{QDeclarativeExtensionPlugin}{QML C++ plugin}.
+The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory.
-QAbstractItemModel presents a heirachy of tables, but views currently provided by QML
+QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
can only display list data.
-In order to display child lists of a heirachical model
+In order to display child lists of a hierarchical model
the VisualDataModel element provides several properties and functions for use
with models of type QAbstractItemModel:
+
\list
\o \e hasModelChildren role property to determine whether a node has child nodes.
\o \l VisualDataModel::rootIndex allows the root node to be specifed
@@ -243,100 +321,51 @@ with models of type QAbstractItemModel:
\endlist
-\section2 QStringList
+\section2 Exposing C++ data models to QML
-A model may be a simple QStringList, which provides the contents of the list via the \e modelData role:
+The above examples use QDeclarativeContext::setContextProperty() to set
+model values directly in QML components. An alternative to this is to
+register the C++ model class as a QML type from a QML C++ plugin using
+QDeclarativeExtensionPlugin. This would allow the model classes to be
+created directly as elements within QML:
\table
-\row
-\o
-\code
-// main.cpp
-QStringList dataList;
-dataList.append("Fred");
-dataList.append("Ginger");
-dataList.append("Skipper");
-
-QDeclarativeContext *ctxt = view.rootContext();
-ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
-\endcode
+\row
\o
\code
-// main.qml
-ListView {
- width: 100
- height: 100
- anchors.fill: parent
- model: myModel
- delegate: Component {
- Rectangle {
- height: 25
- Text { text: modelData }
- }
- }
-}
-\endcode
-\endtable
-
-\note There is no way for the view to know that the contents of a QStringList
-have changed. If the QStringList is changed, it will be necessary to reset
-the model by calling QDeclarativeContext::setContextProperty() again.
-
-
-\section2 QList<QObject*>
-
-QList<QObject*> provides the properties of the objects in the list as roles.
-
-\code
-class DataObject : public QObject
+class MyModelPlugin : public QDeclarativeExtensionPlugin
{
- Q_OBJECT
-
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString color READ color WRITE setColor)
-...
-};
-
-QList<QObject*> dataList;
-dataList.append(new DataObject("Item 1", "red"));
-dataList.append(new DataObject("Item 2", "green"));
-dataList.append(new DataObject("Item 3", "blue"));
-dataList.append(new DataObject("Item 4", "yellow"));
+public:
+ void registerTypes(const char *uri)
+ {
+ qmlRegisterType<MyModel>(uri, 1, 0,
+ "MyModel");
+ }
+}
-QDeclarativeContext *ctxt = view.rootContext();
-ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+Q_EXPORT_PLUGIN2(mymodelplugin, MyModelPlugin);
\endcode
-The QObject* is available as the \c modelData property. As a convenience,
-the properties of the object are also made available directly in the
-delegate's context:
+\o
+\qml
+MyModel {
+ id: myModel
+ ListElement { someProperty: "some value" }
+}
-\code
ListView {
- width: 100
- height: 100
- anchors.fill: parent
- model: myModel
- delegate: Component {
- Rectangle {
- height: 25
- width: 100
- color: model.modelData.color
- Text { text: name }
- }
- }
+ width: 200; height: 250
+ model: myModel
+ delegate: Text { text: someProperty }
}
-\endcode
+\endqml
-Note the use of the fully qualified access to the \c color property.
-The properties of the object are not replicated in the \c model
-object, since they are easily available via the modelData
-object.
+\endtable
+
+See \l {Tutorial: Writing QML extensions with C++} for details on writing QML C++
+plugins.
-Note: There is no way for the view to know that the contents of a QList
-have changed. If the QList is changed, it will be necessary to reset
-the model by calling QDeclarativeContext::setContextProperty() again.
\section1 Other Data Models
@@ -344,14 +373,13 @@ the model by calling QDeclarativeContext::setContextProperty() again.
\section2 An Integer
-An Integer specifies a model containing the integer number of elements.
-There are no data roles.
+An integer can be used to specify a model that contains a certain number
+of elements. In this case, the model does not have any data roles.
The following example creates a ListView with five elements:
\code
Item {
- width: 200
- height: 250
+ width: 200; height: 250
Component {
id: itemDelegate
@@ -370,7 +398,7 @@ Item {
\section2 An Object Instance
-An Object Instance specifies a model with a single Object element. The
+An object instance can be used to specify a model with a single object element. The
properties of the object are provided as roles.
The example below creates a list with one item, showing the color of the
@@ -379,6 +407,8 @@ to avoid clashing with \e color property of the Text element in the delegate.
\code
Rectangle {
+ width: 200; height: 250
+
Text {
id: myText
text: "Hello"
@@ -387,10 +417,9 @@ Rectangle {
Component {
id: myDelegate
- Text {
- text: model.color
- }
+ Text { text: model.color }
}
+
ListView {
anchors.fill: parent
anchors.topMargin: 30
diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc
index ef5bf98..6461925 100644
--- a/doc/src/declarative/qdeclarativestates.qdoc
+++ b/doc/src/declarative/qdeclarativestates.qdoc
@@ -82,4 +82,7 @@ Other things you can do in a state change:
\o Run some script with StateChangeScript
\endlist
+
+The {declarative/animation/states}{States and Transitions example} demonstrates how to declare a basic set of states and then apply animated transitions between them.
+
*/
diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc
index 15d8567..d44e774 100644
--- a/doc/src/declarative/qmlruntime.qdoc
+++ b/doc/src/declarative/qmlruntime.qdoc
@@ -26,172 +26,117 @@
****************************************************************************/
/*!
- \page qmlruntime.html
- \title Qt Declarative UI Runtime
- \keyword QML Viewer
- \ingroup qttools
-
- This page documents the \e{Declarative UI Runtime} for the Qt GUI
- toolkit, and the \QQV which can be used to run apps
- written for the runtime. The \QQV reads a declarative
- user interface definition (\c .qml) file and displays the user interface it describes.
-
- QML is a runtime, as you can run plain QML files which pull in their required modules.
- To run apps with the QML runtime, you can either start the runtime
- from your own application (using a QDeclarativeView) or with the simple \QQV.
- The launcher can be installed in a production environment, assuming that it is not already
- present in the system. It is generally packaged alongside Qt.
-
- To deploy an application using the QML runtime, you have two options:
-
- \list
- \o Write your own Qt application including a QDeclarative view and deploy it the same as
- any other Qt application (not discussed further on this page), or
- \o Write a main QML file for your application, and run your application using the included \QQV.
- \endlist
-
- To run an application with the \QQV, pass the filename as an argument:
-
- \code
- qmlviewer myQmlFile.qml
- \endcode
-
- Deploying a QML application via the \QQV allows for QML only deployments, but can also
- include custom C++ modules just as easily. Below is an example of how you might structure
- a complex application deployed via the QML runtime, it is a listing of the files that would
- be included in the deployment package.
-
- \code
- MyApp.qml
- MyAppCore/qmldir
- MyAppCore/libMyAppCore.so
- MyAppCore/MyAppCore.dll
- MyAppCore/AnAppElement.qml
- MyAppCore/AnotherElement.qml
- MyAppCore/images/Logo.png
- OtherModule/qmldir
- OtherModule/OtherElement.qml
- \endcode
-
- Note that this example is for deploying the example to both windows and linux. You will still need to compile the C++
- modules for each target platform, but you can deploy multiple versions of the modules across platforms with different naming conventions,
- as the appropriate module file is chosen based on platform naming conventions. The C++
- modules must contain a QDeclarativeExtentionPlugin subclass.
-
- The application would be executed either with your own application, the command 'qmlviewer MyApp.qml' or by
- opening the file if your system has the \QQV registered as the handler for QML files. The MyApp.qml file would have access
- to all of the deployed types using the import statements such as the following:
-
- \code
- import "MyAppCore"
- import "OtherModule" 1.0 as Other
- \endcode
-
- \section1 Qt QML Viewer functionality
- The \QQV implements some additional functionality to help it supporting
- myriad applications. If you implement your own application, you may also wish to reimplement
- some or all of this functionality. However, much of this functionality is intended to aid the prototyping of
- QML applications and may not be necessary for a deployed application.
-
- \section2 Options
-
- When run with the \c -help option, \c qmlviewer shows available options.
-
- \section2 Translations
-
- When the launcher loads an initial QML file, it will install a translation file from
- a "i18n" subdirectory relative to that initial QML file. The actual translation file
- loaded will be according to the system locale and have the form
- "qml_<language>.qm", where <language> is a two-letter ISO 639 language,
- such as "qml_fr.qm", optionally followed by an underscore and an uppercase two-letter ISO 3166 country
- code, such as "qml_fr_FR.qm" or "qml_fr_CA.qm".
-
- Such files can be created using \l{Qt Linguist}.
-
- See the \l{scripting.html#internationalization}{Qt Internationalization} documentation for information about how to make
- the JavaScript in QML files use translatable strings.
-
- Additionally, the launcher will load translation files specified on the
- command line via the \c -translation option.
-
- \section2 Dummy Data
-
- The secondary use of the launcher is to allow QML files to be viewed with
- dummy data. This is useful when prototyping the UI, as the dummy data can
- be later replaced with actual data and bindings from a C++ plugin.
- To provide dummy data: create a directory called "dummydata" in the same directory as
- the target QML file and create files there with the "qml" extension.
- All such files will be loaded as QML objects and bound to the root
- context as a property with the name of the file (without ".qml").
-
- To replace this with real data, you simply bind the real object to
- the root context in C++.
-
- For example, if the Qt application has a "clock.time" property
- that is a qreal from 0 to 86400 representing the number of seconds since
- midnight, dummy data for this could be provided by \c dummydata/clock.qml:
- \code
- QtObject { property real time: 12345 }
- \endcode
- Any QML can be used in the dummy data files. You could even animate the
- fictional data!
-
- \section2 Runtime Object
-
- All applications using the launcher will have access to the \c runtime
- property on the root context. This property contains several pieces of
- information about the runtime environment of the application.
-
- \section3 Screen Orientation
-
- A special piece of dummy data which is integrated into the launcher is
- a simple orientation property. The orientation can be set via the
- settings menu in the application, or by pressing Ctrl+T to rotate it.
-
- To use this from within your QML file, access \c runtime.orientation,
- which can be one of the following values:
-
- \list
- \o \c Orientation.Portrait
- \o \c Orientation.Landscape
- \o \c Orientation.PortraitInverted (Portrait orientation, upside-down)
- \o \c Orientation.LandscapeInverted (Landscape orientation, upside-down)
- \endlist
-
- These values can be bound to in your application. For example:
-
- \code
- Item {
- state: (runtime.orientation == Orientation.Landscape) ? 'landscape' : ''
+\page qmlruntime.html
+\title Qt Declarative UI Runtime
+
+QML documents are loaded and executed by the QML runtime. This includes the
+Declarative UI engine along with the built-in QML elements and plugin modules,
+and it also provides access to third-party QML elements and modules.
+
+Applications that use QML need to invoke the QML runtime in order to
+execute QML documents. This can be done by creating a QDeclarativeView
+or a QDeclarativeEngine, as described below. In addition, the Declarative UI
+package includes the \QQV tool, which loads \c .qml files. This tool is
+useful for developing and testing QML code without the need to write
+a C++ application to load the QML runtime.
+
+
+
+\section1 Deploying QML-based applications
+
+To deploy an application that uses QML, the QML runtime must be invoked by
+the application. This is done by writing a Qt C++ application that loads the
+QDeclarativeEngine by either:
+
+\list
+\o Loading the QML file through a QDeclarativeView instance, or
+\o Creating a QDeclarativeEngine instance and loading QML files with QDeclarativeComponent
+\endlist
+
+
+\section2 Deploying with QDeclarativeView
+
+QDeclarativeView is a QWidget-based class that is able to load QML files.
+For example, if there is a QML file, \c application.qml, like this:
+
+\qml
+ import Qt 4.7
+
+ Rectangle { width: 100; height: 100; color: "red" }
+\endqml
+
+It can be loaded in a Qt application's \c main.cpp file like this:
+
+\code
+ #include <QApplication>
+ #include <QDeclarativeView>
+
+ int main(int argc, char *argv[])
+ {
+ QApplication app(argc, argv);
+
+ QDeclarativeView view;
+ view.setSource(QUrl::fromLocalFile("application.qml"));
+ view.show();
+
+ return app.exec();
}
- \endcode
-
- This allows your application to respond to changes in the screen's orientation. The launcher
- will automatically update this on some platforms (currently the N900 only) to match the physical
- screen's orientation. On other plaforms orientation changes will only happen when explictly asked for.
-
- \section3 Window Active
-
- The \c runtime.isActiveWindow property tells whether the main window of the launcher is currently active
- or not. This is especially useful for embedded devices when you want to pause parts of your application,
- including animations, when your application loses focus or goes to the background.
-
- The example below, stops the animation when the application's window is deactivated and resumes on activation:
-
- \code
- Item {
- width: 300; height: 200
- Rectangle {
- width: 100; height: 100
- color: "green"
- SequentialAnimation on x {
- running: runtime.isActiveWindow
- loops: Animation.Infinite
- NumberAnimation {to: 200}
- NumberAnimation {to: 0}
- }
- }
+\endcode
+
+This creates a QWidget-based view that displays the contents of
+\c application.qml.
+
+The application's \c .pro \l{qmake Project Files}{project file} must specify
+the \c declarative module for the \c QT variable. For example:
+
+\code
+ TEMPLATE += app
+ QT += gui declarative
+ SOURCES += main.cpp
+\endcode
+
+
+\section2 Creating a QDeclarativeEngine directly
+
+If \c application.qml does not have any graphical components, or if it is
+preferred to avoid QDeclarativeView for other reasons, the QDeclarativeEngine
+can be constructed directly instead. In this case, \c application.qml is
+loaded as a QDeclarativeComponent instance rather than placed into a view:
+
+\code
+ #include <QCoreApplication>
+ #include <QDeclarativeEngine>
+
+ int main(int argc, char *argv[])
+ {
+ QCoreApplication app(argc, argv);
+
+ QDeclarativeEngine engine;
+ QDeclarativeContext *windowContext = new QDeclarativeContext(engine.rootContext());
+
+ QDeclarativeComponent component(&engine, "application.qml");
+ QObject *window = component.create(windowContext);
+
+ // ... delete window and windowContext when necessary
+
+ return app.exec();
}
- \endcode
+\endcode
+
+See \l {Using QML in C++ Applications} for more information about using
+QDeclarativeEngine, QDeclarativeContext and QDeclarativeComponent, as well
+as details on including QML files through \l{The Qt Resource System}{Qt's Resource system}.
+
+
+
+\section1 Developing and prototyping with QML Viewer
+
+The Declarative UI package includes a QML runtime tool, the \QQV, which loads
+and displays QML documents. This is useful during the application development
+phase for prototyping QML-based applications without writing your own C++
+applications to invoke the QML runtime.
+
+See the \l{QML Viewer} documentation for more details.
*/
+
diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc
new file mode 100644
index 0000000..efff9cc
--- /dev/null
+++ b/doc/src/declarative/qmlviewer.qdoc
@@ -0,0 +1,234 @@
+/****************************************************************************
+**
+** 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:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+
+\page qmlviewer.html
+\title QML Viewer
+\ingroup qttools
+
+The Declarative UI package includes \QQV, a tool for loading QML documents that
+makes it easy to quickly develop and debug QML applications. It invokes the QML
+runtime to load QML documents and also includes additional features useful for
+the development of QML-based applications.
+
+The QML Viewer is a tool for testing and developing QML applications. It is
+\e not intended for use in a production environment and should not be used for the
+deployment of QML applications. In those cases, the QML runtime should be invoked
+from a Qt application instead; see \l {Qt Declarative UI Runtime} for more
+information.
+
+The viewer is located at QTDIR/bin/qmlviewer. To load a \c .qml file
+with the viewer, run the viewer and select the file to be opened, or provide the
+file path on the command line:
+
+\code
+ qmlviewer myqmlfile.qml
+\endcode
+
+On Mac OS X, the QML Viewer application is named \c QMLViewer.app instead. You
+can launch the viewer by opening the QMLViewer application from the Finder, or
+from the command line:
+
+\code
+ QMLViewer.app/Contents/MacOS/QMLViewer myqmlfile.qml
+\endcode
+
+The QML Viewer has a number of configuration options involving features such as
+fullscreen display, module import path configurations, video recording of QML
+animations, and OpenGL support.
+
+To see the configuration options, run \c qmlviewer with the \c -help argument.
+
+
+\section1 Adding module import paths
+
+Additional module import paths can be provided using the \c -I flag.
+For example, the \l{declarative/cppextensions/plugins}{QML plugins example} creates
+a C++ plugin identified as \c com.nokia.TimeExample. Since this has a namespaced
+identifier, the viewer has to be run with the \c -I flag from the example's
+base directory:
+
+\code
+qmlviewer -I . plugins.qml
+\endcode
+
+This adds the current directory to the import path so that the viewer will
+find the plugin in the \c com/nokia/TimeExample directory.
+
+Note by default, the current directory is included in the import search path,
+but namespaced modules like \c com.nokia.TimeExample are not found unless
+the path is explicitly added.
+
+
+\section1 Loading translation files
+
+When the QML Viewer loads a QML file, it installs a translation file from a
+"i18n" subdirectory relative to that initial file. This directory should contain
+translation files named "qml_<language>.qm", where <language> is a two-letter
+ISO 639 language, such as "qml_fr.qm", optionally followed by an underscore and
+an uppercase two-letter ISO 3166 country code, such as "qml_fr_FR.qm" or
+"qml_fr_CA.qm".
+
+Such files can be created using \l {Qt Linguist}.
+
+The actual translation file that is loaded depends on the system locale.
+Additionally, the viewer will load any translation files specified on the command
+line via the \c -translation option.
+
+See the \l{declarative/i18n}{QML i18n example} for an example. Also, the
+\l{scripting.html#internationalization}{Qt Internationalization} documentation
+shows how JavaScript code in QML files can be made to use translatable strings.
+
+
+\section1 Loading placeholder data with QML Viewer
+
+Often, QML applications are prototyped with fake data that is later replaced
+by real data sources from C++ plugins. QML Viewer assists in this aspect by
+loading fake data into the application context: it looks for a directory named
+"dummydata" in the same directory as the target QML file, and any \c .qml
+files in that directory are loaded as QML objects and bound to the root context
+as properties named after the files.
+
+For example, this QML document refers to a \c lottoNumbers property which does
+not actually exist within the document:
+
+\qml
+import Qt 4.7
+
+ListView {
+ width: 200; height: 300
+ model: lottoNumbers
+ delegate: Text { text: number }
+}
+\endqml
+
+If within the document's directory, there is a "dummydata" directory which
+contains a \c lottoNumbers.qml file like this:
+
+\qml
+import Qt 4.7
+
+ListModel {
+ ListElement { number: 23 }
+ ListElement { number: 44 }
+ ListElement { number: 78 }
+}
+\endqml
+
+Then this model would be automatically loaded into the ListView in the previous document.
+
+Child properties are included when loaded from dummy data. The following document
+refers to a \c clock.time property:
+
+\qml
+import Qt 4.7
+Text { text: clock.time }
+\endqml
+
+The text value could be filled by a \c dummydata/clock.qml file with a \c time
+property in the root context:
+
+\qml
+import Qt 4.7
+QtObject { property int time: 54321 }
+\endqml
+
+To replace this with real data, you can simply bind the real data object to
+the root context in C++ using QDeclarativeContext::setContextProperty(). This
+is detailed in \l {Using QML in C++ Applications}.
+
+\section1 Using the \c runtime object
+
+QML applications that are loaded with the QML Viewer have access to a special
+\c runtime property on the root context. This property provides additional
+information about the application's runtime environment through the following properties:
+
+\table
+\row
+
+\o \c runtime.isActiveWindow
+
+\o This property indicates whether the QML Viewer window is the current active
+window on the system. It is useful for "pausing" an application, particularly
+animations, when the QML Viewer loses focus or moves to the background.
+
+For example, the following animation is only played when the QML Viewer is
+the active window:
+
+\qml
+Rectangle {
+ width: 200; height: 200
+
+ ColorAnimation on color {
+ running: runtime.isActiveWindow
+ loops: Animation.Infinite
+ from: "green"; to: "blue"; duration: 2000
+ }
+}
+\endqml
+
+\row
+
+\o \c runtime.orientation
+
+\o This property indicates the current orientation of the QML Viewer. On the
+N900 platform, this property automatically updates to reflect the device's
+actual orientation; on other platforms, this indicates the orientation currently
+selected in the QML Viewer's \e {Settings -> Properties} menu. The
+\c orientation value can be one of the following:
+
+\list
+\o \c Orientation.Portrait
+\o \c Orientation.Landscape
+\o \c Orientation.PortraitInverted (Portrait orientation, upside-down)
+\o \c Orientation.LandscapeInverted (Landscape orientation, upside-down)
+\endlist
+
+When the viewer's orientation changes, the appearance of the loaded QML document
+does not change unless it has been set to respond to changes in
+\c runtime.orientation. For example, the following Rectangle changes its
+aspect ratio depending on the orientation of the QML Viewer:
+
+\qml
+Rectangle {
+ id: window
+ width: 640; height: 480
+
+ states: State {
+ name: "landscape"
+ PropertyChanges { target: window; width: 480; height: 640 }
+ }
+ state: (runtime.orientation == Orientation.Landscape
+ || runtime.orientation == Orientation.LandscapeInverted) ? 'landscape' : ''
+}
+\endqml
+
+\endtable
+
+*/
+
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 252c11e..c884486 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -222,5 +222,5 @@ This is equivalent to writing the two transitions separately.
The \l ParallelAnimation element makes sure that the two types of animations (number and color) start at the same time.
We could also run them one after the other by using \l SequentialAnimation instead.
-For more details on states and transitions, see \l {QML States}.
+For more details on states and transitions, see \l {QML States} and the {declarative/animation/states}{states and transitions example}.
*/
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 211ee4b..c8a7403 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -252,6 +252,15 @@
*/
/*!
+ \title Models and Views: AbstractItemModel
+ \example declarative/modelviews/abstractitemmodel
+
+ This example shows how to use a QAbstractItemModel subclass as a model in QML.
+
+ \image qml-abstractitemmodel-example.png
+*/
+
+/*!
\title Models and Views: GridView
\example declarative/modelviews/gridview
@@ -306,8 +315,7 @@
\title Models and Views: Object ListModel
\example declarative/modelviews/objectlistmodel
- This example shows how to create a C++ extension that exposes a
- QList<QObject*> as a model in QML.
+ This example shows how to use a QList<QObject*> as a model in QML.
\image qml-objectlistmodel-example.png
*/
@@ -334,8 +342,7 @@
\title Models and Views: String ListModel
\example declarative/modelviews/stringlistmodel
- This example shows how to create a C++ extension that exposes a
- QStringList as a model in QML.
+ This example shows how to use a QStringList as a model in QML.
\image qml-stringlistmodel-example.png
*/
diff --git a/doc/src/images/qml-abstractitemmodel-example.png b/doc/src/images/qml-abstractitemmodel-example.png
new file mode 100644
index 0000000..1d7ff19
--- /dev/null
+++ b/doc/src/images/qml-abstractitemmodel-example.png
Binary files differ
diff --git a/doc/src/images/qml-focus-example.png b/doc/src/images/qml-focus-example.png
index 0ec2bff..107d2cb 100644
--- a/doc/src/images/qml-focus-example.png
+++ b/doc/src/images/qml-focus-example.png
Binary files differ
diff --git a/doc/src/scripting/ecmascript.qdoc b/doc/src/scripting/ecmascript.qdoc
index 4497a0b..508bf3b 100644
--- a/doc/src/scripting/ecmascript.qdoc
+++ b/doc/src/scripting/ecmascript.qdoc
@@ -30,8 +30,9 @@
\title ECMAScript Reference
\brief A list of objects, functions and properties supported by QtScript.
- This reference contains a list of objects, functions and
- properties supported by QtScript.
+ This reference contains a list of built-in objects, functions and
+ properties supported by QtScript. For a detailed description, see
+ the \l{ECMA-262} specification.
\tableofcontents
@@ -43,7 +44,6 @@
\o NaN
\o Infinity
\o undefined
- \o Math
\endlist
\section2 Function Properties
@@ -80,10 +80,33 @@
\o URIError
\endlist
+ \section2 Other Properties
+
+ \list
+ \o Math
+ \o JSON
+ \endlist
+
\section1 Object Objects
+ \section2 Object Constructor
+
+ \section3 Function Properties
+
+ \list
+ \o getPrototypeOf(O)
+ \o getOwnPropertyDescriptor(O, P)
+ \o getOwnPropertyNames(O)
+ \o create(O [, Properties])
+ \o defineProperty(O, P, Attributes)
+ \o defineProperties(O, Properties)
+ \o keys(O)
+ \endlist
+
\section2 Object Prototype Object
+ \section3 Function Properties
+
\list
\o toString()
\o toLocaleString()
@@ -124,6 +147,15 @@
\o sort(comparefn)
\o splice(start, deleteCount[, item1 [, item2 [, ...]]])
\o unshift([item1 [, item2 [, ...]]])
+ \o indexOf(searchElement [, fromIndex])
+ \o lastIndexOf(searchElement [, fromIndex])
+ \o every(callbackfn [, thisArg])
+ \o some(callbackfn [, thisArg])
+ \o forEach(callbackfn [, thisArg])
+ \o map(callbackfn [, thisArg])
+ \o filter(callbackfn [, thisArg])
+ \o reduce(callbackfn [, initialValue])
+ \o reduceRight(callbackfn [, initialValue])
\endlist
\section1 String Objects
@@ -151,6 +183,7 @@
\o toLocaleLowerCase()
\o toUpperCase()
\o toLocaleUpperCase()
+ \o trim()
\endlist
\section1 Boolean Objects
@@ -264,6 +297,8 @@
\o setFullYear(year [, month [, date]])
\o setUTCFullYear(year [, month [, date]])
\o toUTCString()
+ \o toISOString()
+ \o toJSON()
\endlist
\section1 RegExp Objects
@@ -295,4 +330,13 @@
\o toString()
\endlist
+ \section1 The JSON Object
+
+ \section2 Function Properties
+
+ \list
+ \o parse(text [, reviver])
+ \o stringify(value [, replacer [, space]])
+ \endlist
+
*/
diff --git a/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
index 835ca32..9e759f9 100644
--- a/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
+++ b/doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml
@@ -55,7 +55,7 @@ ListView {
MouseArea {
anchors.fill: parent
onClicked: {
- if (hasModelChildren)
+ if (model.hasModelChildren)
view.model.rootIndex = view.model.modelIndex(index)
}
}
diff --git a/examples/declarative/animation/behaviors/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example.qml
index d187fbf..adefb9e 100644
--- a/examples/declarative/animation/behaviors/behavior-example.qml
+++ b/examples/declarative/animation/behaviors/behavior-example.qml
@@ -82,7 +82,7 @@ Rectangle {
property string text
- x: 62.5; y: 75; width: 75; height: 50
+ x: 62; y: 75; width: 75; height: 50
radius: 6
border.width: 4; border.color: "white"
color: "firebrick"
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index c7e7843..7149986 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -22,7 +22,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = qmlimageproviderplugin.dll ImageProviderCore/qmldir
+ importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
importFiles.path = ImageProviderCore
DEPLOYMENT = importFiles
}
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 3ec7d29..2e610f9 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -17,7 +17,7 @@ symbian:{
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCALLOWDLLDATA = 1
- importFiles.sources = qmlqwidgetsplugin.dll QWidgets/qmldir
+ importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
importFiles.path = QWidgets
DEPLOYMENT = importFiles
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
index d0b45f5..9a8d3f3 100644
--- a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
@@ -55,10 +55,11 @@ FocusScope {
GridView {
id: gridView
- x: 20; width: parent.width - 40; height: parent.height
+ anchors.fill: parent; anchors.leftMargin: 20; anchors.rightMargin: 20
cellWidth: 152; cellHeight: 152
focus: true
model: 12
+
KeyNavigation.down: listViews
KeyNavigation.left: contextMenu
@@ -70,9 +71,9 @@ FocusScope {
id: content
color: "transparent"
smooth: true
- anchors.centerIn: parent; width: container.width - 40; height: container.height - 40; radius: 10
+ anchors.fill: parent; anchors.margins: 20; radius: 10
- Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
+ Rectangle { color: "#91AA9D"; anchors.fill: parent; anchors.margins: 3; radius: 8; smooth: true }
Image { source: "images/qt-logo.png"; anchors.centerIn: parent; smooth: true }
}
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
index fba9b05..cc13637 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
@@ -42,7 +42,7 @@ import Qt 4.7
Item {
id: container
- x: 5; width: ListView.view.width - 10; height: 60
+ width: ListView.view.width; height: 60; anchors.leftMargin: 10; anchors.rightMargin: 10
Rectangle {
id: content
@@ -51,11 +51,15 @@ Item {
smooth: true
radius: 10
- Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
- Text {
- text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent
- font.pixelSize: 14
- }
+ Rectangle { anchors.fill: parent; anchors.margins: 3; color: "#91AA9D"; smooth: true; radius: 8 }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: content
+ text: "List element " + (index + 1)
+ color: "#193441"
+ font.pixelSize: 14
}
MouseArea {
@@ -72,6 +76,7 @@ Item {
states: State {
name: "active"; when: container.focus == true
PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ PropertyChanges { target: label; font.pixelSize: 16 }
}
transitions: Transition {
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
index 670a3fa..6f9ceb4 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViews.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
@@ -60,7 +60,7 @@ FocusScope {
ListView {
id: list2
- y: wantsFocus ? 10 : 40; x: parent.width / 3; width: parent.width / 3; height: parent.height - 20
+ y: wantsFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
@@ -72,7 +72,7 @@ FocusScope {
ListView {
id: list3
- y: wantsFocus ? 10 : 40; x: 2 * parent.width / 3; width: parent.width / 3; height: parent.height - 20
+ y: wantsFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list2
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 068ba1d..8b2af70 100644
--- a/examples/declarative/keyinteraction/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -68,7 +68,8 @@ Rectangle {
Rectangle {
id: shade
- color: "black"; opacity: 0; anchors.fill: parent
+ anchors.fill: parent
+ color: "black"; opacity: 0
}
states: State {
@@ -88,7 +89,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
MouseArea {
- anchors { fill: parent; leftMargin: -10; topMargin: -10; rightMargin: -10; bottomMargin: -10 }
+ anchors.fill: parent; anchors.margins: -10
onClicked: window.state = "contextMenuOpen"
}
}
diff --git a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
new file mode 100644
index 0000000..55e67f3
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += declarative
+
+RESOURCES += abstractitemmodel.qrc
+
+HEADERS = model.h
+SOURCES = main.cpp model.cpp
diff --git a/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.qrc b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.qrc
new file mode 100644
index 0000000..4ae861c
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/abstractitemmodel.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>view.qml</file>
+</qresource>
+</RCC>
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/main.cpp b/examples/declarative/modelviews/abstractitemmodel/main.cpp
new file mode 100644
index 0000000..e869aba
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include "model.h"
+#include <QDeclarativeContext>
+#include <QDeclarativeView>
+
+#include <QApplication>
+
+//![0]
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ AnimalModel model;
+ model.addAnimal(Animal("Wolf", "Medium"));
+ model.addAnimal(Animal("Polar bear", "Large"));
+ model.addAnimal(Animal("Quoll", "Small"));
+
+ QDeclarativeView view;
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", &model);
+//![0]
+
+ view.setSource(QUrl("qrc:view.qml"));
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/model.cpp b/examples/declarative/modelviews/abstractitemmodel/model.cpp
new file mode 100644
index 0000000..d0e0971
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/model.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 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$
+**
+****************************************************************************/
+#include "model.h"
+
+Animal::Animal(const QString &type, const QString &size)
+ : m_type(type), m_size(size)
+{
+}
+
+QString Animal::type() const
+{
+ return m_type;
+}
+
+QString Animal::size() const
+{
+ return m_size;
+}
+
+//![0]
+AnimalModel::AnimalModel(QObject *parent)
+ : QAbstractListModel(parent)
+{
+ QHash<int, QByteArray> roles;
+ roles[TypeRole] = "type";
+ roles[SizeRole] = "size";
+ setRoleNames(roles);
+}
+//![0]
+
+void AnimalModel::addAnimal(const Animal &animal)
+{
+ m_animals << animal;
+}
+
+int AnimalModel::rowCount(const QModelIndex & parent) const {
+ return m_animals.count();
+}
+
+QVariant AnimalModel::data(const QModelIndex & index, int role) const {
+ if (index.row() < 0 || index.row() > m_animals.count())
+ return QVariant();
+
+ const Animal &animal = m_animals[index.row()];
+ if (role == TypeRole)
+ return animal.type();
+ else if (role == SizeRole)
+ return animal.size();
+ return QVariant();
+}
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/model.h b/examples/declarative/modelviews/abstractitemmodel/model.h
new file mode 100644
index 0000000..1119837
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/model.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+#include <QAbstractListModel>
+#include <QStringList>
+
+//![0]
+class Animal
+{
+public:
+ Animal(const QString &type, const QString &size);
+//![0]
+
+ QString type() const;
+ QString size() const;
+
+private:
+ QString m_type;
+ QString m_size;
+//![1]
+};
+
+class AnimalModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ enum AnimalRoles {
+ TypeRole = Qt::UserRole + 1,
+ SizeRole
+ };
+
+ AnimalModel(QObject *parent = 0);
+//![1]
+
+ void addAnimal(const Animal &animal);
+
+ int rowCount(const QModelIndex & parent = QModelIndex()) const;
+
+ QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
+
+private:
+ QList<Animal> m_animals;
+//![2]
+};
+//![2]
+
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/view.qml b/examples/declarative/modelviews/abstractitemmodel/view.qml
new file mode 100644
index 0000000..591d89a
--- /dev/null
+++ b/examples/declarative/modelviews/abstractitemmodel/view.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+import Qt 4.7
+
+//![0]
+ListView {
+ width: 200; height: 250
+ anchors.fill: parent
+
+ model: myModel
+ delegate: Text { text: "Animal: " + type + ", " + size }
+}
+//![0]
+
diff --git a/examples/declarative/modelviews/objectlistmodel/dataobject.h b/examples/declarative/modelviews/objectlistmodel/dataobject.h
index c61e50c..17aa355 100644
--- a/examples/declarative/modelviews/objectlistmodel/dataobject.h
+++ b/examples/declarative/modelviews/objectlistmodel/dataobject.h
@@ -43,12 +43,14 @@
#include <QObject>
+//![0]
class DataObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
+//![0]
public:
DataObject(QObject *parent=0);
@@ -67,6 +69,8 @@ signals:
private:
QString m_name;
QString m_color;
+//![1]
};
+//![1]
#endif // DATAOBJECT_H
diff --git a/examples/declarative/modelviews/objectlistmodel/main.cpp b/examples/declarative/modelviews/objectlistmodel/main.cpp
index 25de8d1..89c22a1 100644
--- a/examples/declarative/modelviews/objectlistmodel/main.cpp
+++ b/examples/declarative/modelviews/objectlistmodel/main.cpp
@@ -53,20 +53,21 @@
model in QML
*/
+//![0]
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
- QDeclarativeView view;
-
QList<QObject*> dataList;
dataList.append(new DataObject("Item 1", "red"));
dataList.append(new DataObject("Item 2", "green"));
dataList.append(new DataObject("Item 3", "blue"));
dataList.append(new DataObject("Item 4", "yellow"));
+ QDeclarativeView view;
QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+//![0]
view.setSource(QUrl("qrc:view.qml"));
view.show();
diff --git a/examples/declarative/modelviews/objectlistmodel/view.qml b/examples/declarative/modelviews/objectlistmodel/view.qml
index 034121c..c3cccdd 100644
--- a/examples/declarative/modelviews/objectlistmodel/view.qml
+++ b/examples/declarative/modelviews/objectlistmodel/view.qml
@@ -40,17 +40,17 @@
import Qt 4.7
+//![0]
ListView {
- width: 100
- height: 100
+ width: 100; height: 100
anchors.fill: parent
+
model: myModel
- delegate: Component {
- Rectangle {
- height: 25
- width: 100
- color: model.modelData.color
- Text { text: name }
- }
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ color: model.modelData.color
+ Text { text: name }
}
}
+//![0]
diff --git a/examples/declarative/modelviews/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp
index b2ebd4b..bf46c63 100644
--- a/examples/declarative/modelviews/stringlistmodel/main.cpp
+++ b/examples/declarative/modelviews/stringlistmodel/main.cpp
@@ -56,16 +56,17 @@ int main(int argc, char ** argv)
{
QApplication app(argc, argv);
- QDeclarativeView view;
-
+//![0]
QStringList dataList;
dataList.append("Item 1");
dataList.append("Item 2");
dataList.append("Item 3");
dataList.append("Item 4");
+ QDeclarativeView view;
QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+//![0]
view.setSource(QUrl("qrc:view.qml"));
view.show();
diff --git a/examples/declarative/modelviews/stringlistmodel/view.qml b/examples/declarative/modelviews/stringlistmodel/view.qml
index ec5597d..3d789fd 100644
--- a/examples/declarative/modelviews/stringlistmodel/view.qml
+++ b/examples/declarative/modelviews/stringlistmodel/view.qml
@@ -39,17 +39,17 @@
****************************************************************************/
import Qt 4.7
+//![0]
ListView {
- width: 100
- height: 100
+ width: 100; height: 100
anchors.fill: parent
+
model: myModel
- delegate: Component {
- Rectangle {
- height: 25
- width: 100
- Text { text: modelData }
- }
+ delegate: Rectangle {
+ height: 25
+ width: 100
+ Text { text: modelData }
}
}
+//![0]
diff --git a/examples/declarative/ui-components/progressbar/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
index 829ab9b..6aa6765 100644
--- a/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
+++ b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
@@ -66,7 +66,7 @@ Item {
width: highlight.widthDest
Behavior on width { SmoothedAnimation { velocity: 1200 } }
- anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 3; topMargin: 3; bottomMargin: 3 }
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
radius: 1
gradient: Gradient {
GradientStop { id: gradient1; position: 0.0 }
diff --git a/examples/declarative/ui-components/searchbox/SearchBox.qml b/examples/declarative/ui-components/searchbox/SearchBox.qml
index e6b9c8f..6d87837 100644
--- a/examples/declarative/ui-components/searchbox/SearchBox.qml
+++ b/examples/declarative/ui-components/searchbox/SearchBox.qml
@@ -73,7 +73,7 @@ FocusScope {
TextInput {
id: textInput
- anchors { left: parent.left; leftMargin: 8; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
focus: true
}
diff --git a/examples/declarative/ui-components/tabwidget/main.qml b/examples/declarative/ui-components/tabwidget/main.qml
index e11902a..4a27806 100644
--- a/examples/declarative/ui-components/tabwidget/main.qml
+++ b/examples/declarative/ui-components/tabwidget/main.qml
@@ -50,7 +50,7 @@ TabWidget {
color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#ff7f7f"
Text {
width: parent.width - 20
@@ -68,7 +68,7 @@ TabWidget {
color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#7fff7f"
Text {
width: parent.width - 20
@@ -85,7 +85,7 @@ TabWidget {
anchors.fill: parent; color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#7f7fff"
Text {
width: parent.width - 20
diff --git a/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
new file mode 100644
index 0000000..b5954e1
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
@@ -0,0 +1,2 @@
+#include <aknlayoutfont.h>
+
diff --git a/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
new file mode 100644
index 0000000..d121122
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
@@ -0,0 +1 @@
+#include <aknsbasicbackgroundcontrolcontext.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsConstants.h b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
new file mode 100644
index 0000000..c262866
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
@@ -0,0 +1 @@
+#include <aknsconstants.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
new file mode 100644
index 0000000..7d71624
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
@@ -0,0 +1 @@
+#include <aknsdrawutils.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsItemID.h b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
new file mode 100644
index 0000000..fe3b80e
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
@@ -0,0 +1 @@
+#include <aknsitemid.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
new file mode 100644
index 0000000..4a9dcd8
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
@@ -0,0 +1 @@
+#include <aknsskininstance.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsUtils.h b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
new file mode 100644
index 0000000..1b9bece
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
@@ -0,0 +1 @@
+#include <aknsutils.h>
diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index ab0c5b9..b1ca367 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -14,8 +14,6 @@ QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
QMAKE_ELF2E32_FLAGS = --dlldata \
- --heap=0x00020000,0x00800000 \
- --stack=0x00014000 \
--fpu=softvfp \
--unfrozen \
--compressionmethod bytepair \
diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index 4207e0b..c31e38f 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -126,35 +126,38 @@ equals(GENERATE_SIS_TARGETS, true) {
}
} else {
sis_destdir = $$DESTDIR
- !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
- contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ isEmpty(sis_destdir):sis_destdir = .
+ baseTarget = $$basename(TARGET)
+ !equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
sis_target.target = sis
- sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \
+ sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
- $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
sis_target.depends = first
unsigned_sis_target.target = unsigned_sis
- unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $$basename(TARGET)_template.pkg
+ unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg
unsigned_sis_target.depends = first
- target_sis_target.target = $${sis_destdir}$${TARGET}.sis
+ target_sis_target.target = $${sis_destdir}/$${baseTarget}.sis
target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis
installer_sis_target.target = installer_sis
- installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \
+ installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
- installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis
+ installer_sis_target.depends = $${sis_destdir}/$${baseTarget}.sis
- !isEmpty(DESTDIR) {
- sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
- installer_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
+ !isEmpty(sis_destdir):!equals(sis_destdir, "."):!equals(sis_destdir, "./") {
+ sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
+ installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
}
QMAKE_EXTRA_TARGETS += sis_target \
unsigned_sis_target \
target_sis_target \
installer_sis_target
+
+ QMAKE_DISTCLEAN += $${sis_destdir}/$${baseTarget}.sis
}
} else {
contains(TEMPLATE, subdirs) {
@@ -177,5 +180,3 @@ equals(GENERATE_SIS_TARGETS, true) {
QMAKE_EXTRA_TARGETS += store_build_target
}
}
-
-QMAKE_DISTCLEAN += $${sis_destdir}$${TARGET}.sis
diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf
index 6b38d4d..2f03128 100644
--- a/mkspecs/features/symbian/data_caging_paths.prf
+++ b/mkspecs/features/symbian/data_caging_paths.prf
@@ -76,4 +76,5 @@ exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) {
isEmpty(HW_ZDIR): HW_ZDIR = epoc32/data/z
isEmpty(REG_RESOURCE_DIR): REG_RESOURCE_DIR = /private/10003a3f/apps
-isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps \ No newline at end of file
+isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps
+isEmpty(APP_PRIVATE_DIR_BASE): APP_PRIVATE_DIR_BASE = /private
diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf
index 1b8e551..bae9d2d 100644
--- a/mkspecs/features/symbian/def_files.prf
+++ b/mkspecs/features/symbian/def_files.prf
@@ -56,7 +56,7 @@ symbian-abld|symbian-sbsv2 {
} else {
elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile
}
- QMAKE_ELF2E32_FLAGS += "`test -e $$elf2e32FileToAdd && echo --definput=$$elf2e32FileToAdd`"
+ QMAKE_ELF2E32_FLAGS += "--definput=$$elf2e32FileToAdd"
symbianObjdir = $$OBJECTS_DIR
isEmpty(symbianObjdir):symbianObjdir = .
@@ -64,7 +64,7 @@ symbian-abld|symbian-sbsv2 {
freeze_target.target = freeze
freeze_target.depends = first
# The perl part is to convert to unix line endings and remove comments, which the s60 tools refuse to do.
- freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def > $$elf2e32FileToAdd
+ freeze_target.commands = $$QMAKE_COPY $$symbianObjdir/$${TARGET}.def $$elf2e32FileToAdd
QMAKE_EXTRA_TARGETS += freeze_target
} else:contains(TEMPLATE, subdirs) {
freeze_target.target = freeze
diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf
index 6948a48..818151a 100644
--- a/mkspecs/features/symbian/run_on_phone.prf
+++ b/mkspecs/features/symbian/run_on_phone.prf
@@ -11,9 +11,13 @@ else:!equals(DEPLOYMENT, default_deployment) {
}
equals(GENERATE_RUN_TARGETS, true) {
- sis_destdir = $$DESTDIR
- !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
- contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ symbian-abld|symbian-sbsv2 {
+ sis_destdir =
+ } else {
+ sis_destdir = $$DESTDIR
+ !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
+ contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+ }
contains(SYMBIAN_PLATFORMS, "WINSCW"):contains(TEMPLATE, "app") {
run_target.target = run
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 9fc4d1e..fbaefca 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -8,6 +8,11 @@
QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
}
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+epoc_heap_size = $$split(TARGET.EPOCHEAPSIZE, " ")
+epoc_heap_size = $$join(epoc_heap_size, ",")
+
symbianObjdir=$$OBJECTS_DIR
isEmpty(symbianObjdir) {
symbianObjdir = .
@@ -16,6 +21,8 @@ symbianDestdir=$$DESTDIR
isEmpty(symbianDestdir) {
symbianDestdir = .
}
+baseTarget = $$basename(TARGET)
+!equals(TARGET, "$$baseTarget"):symbianDestdir = $$symbianDestdir/$$dirname(TARGET)
contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
DEFINES += __MARM_THUMB__
@@ -99,34 +106,29 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
- # The tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error.
- # The comparison of dso files is to avoid extra building of modules that depend on this dso, in
- # case it has not changed.
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version=$$decVersion \
+ QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
+ && elf2e32_qtwrapper --version=$$decVersion \
--sid=$$TARGET.SID \
--uid1=0x10000079 \
--uid2=$$TARGET.UID2 \
--uid3=$$TARGET.UID3 \
--targettype=DLL \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym \
- --output=$${symbianDestdir}/$${TARGET}.dll \
- --dso=$$symbianObjdir/$${TARGET}.dso \
- --defoutput=$$symbianObjdir/$${TARGET}.def \
- --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+ --output=$${symbianDestdir}/$${baseTarget}.dll \
+ --tmpdso=$${symbianObjdir}/$${baseTarget}.dso \
+ --dso=$${symbianDestdir}/$${baseTarget}.dso \
+ --defoutput=$$symbianObjdir/$${baseTarget}.def \
+ --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ --heap=$$epoc_heap_size \
+ --stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
$$capability \
$$QMAKE_ELF2E32_FLAGS \
- | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
- && if ! diff -q $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso \
- > /dev/null 2>&1; then \
- $$QMAKE_COPY $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso; \
- fi \
$$QMAKE_POST_LINK
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
- QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.dso
- QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso
+ QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
+ QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.def
linux-armcc: {
LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -142,7 +144,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
-lgcc
}
- QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
+ QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
DEFINES += __DLL__
}
@@ -152,26 +154,26 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "")
QMAKE_POST_LINK = && $$QMAKE_POST_LINK
}
- # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
- QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version $$decVersion \
+ QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
+ && elf2e32_qtwrapper --version $$decVersion \
--sid=$$TARGET.SID \
--uid1=0x1000007a \
--uid2=$$TARGET.UID2 \
--uid3=$$TARGET.UID3 \
--targettype=EXE \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym \
- --output=$${symbianDestdir}/$${TARGET}.exe \
- --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+ --output=$${symbianDestdir}/$${baseTarget}.exe \
+ --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ --heap=$$epoc_heap_size \
+ --stack=$$TARGET.EPOCSTACKSIZE \
$$elf2e32_LIBPATH \
$$capability \
$$QMAKE_ELF2E32_FLAGS \
- | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
- && ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
+ && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \
$$QMAKE_POST_LINK
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
- QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
+ QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
linux-armcc: {
QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -200,7 +202,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_LFLAGS += --shared
}
- QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+ QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
DEFINES += __EXE__
}
@@ -241,47 +243,47 @@ symbianresources.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += symbianresources
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
- baseTarget = $$basename(TARGET)
+ baseResourceTarget = $$basename(TARGET)
# If you change this, also see application_icon.prf
- baseTarget = $$replace(baseTarget, " ",_)
+ baseResourceTarget = $$replace(baseResourceTarget, " ",_)
# Make our own extra target in order to get dependencies for generated
# files right. This also avoids the warning about files not found.
- symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+ symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
symbianGenResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseTarget}.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
+ $${baseResourceTarget}.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
- -o$${symbianDestdir}/$${baseTarget}.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
- -i$${baseTarget}.rss
- symbianGenResource.depends = $${baseTarget}.rss
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
- QMAKE_DISTCLEAN += $${baseTarget}.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
+ -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
+ -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
+ -i$${baseResourceTarget}.rss
+ symbianGenResource.depends = $${baseResourceTarget}.rss
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp
+ QMAKE_DISTCLEAN += $${baseResourceTarget}.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}.rsc
- symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+ symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
symbianGenRegResource.commands = cpp -nostdinc -undef \
$$symbian_resources_INCLUDES \
$$symbian_resources_DEFINES \
- $${baseTarget}_reg.rss \
- -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
+ $${baseResourceTarget}_reg.rss \
+ -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
&& rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
- -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
- -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
- -i$${baseTarget}_reg.rss
- symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
- PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
- QMAKE_DISTCLEAN += $${TARGET}_reg.rss
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}_reg.rsc
+ -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
+ -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
+ -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
+ -i$${baseResourceTarget}_reg.rss
+ symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+ PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+ QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp
+ QMAKE_DISTCLEAN += $${baseResourceTarget}_reg.rss
+ QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}_reg.rsc
# Trick to get qmake to create the RCC_DIR for us.
symbianRccDirCreation.input = SOURCES
@@ -292,9 +294,9 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
- QMAKE_DISTCLEAN += $${TARGET}.loc
+ QMAKE_DISTCLEAN += $${baseTarget}.loc
}
# Generated pkg files
-QMAKE_DISTCLEAN += $${TARGET}_template.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 2750ecb..382e012 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -198,6 +198,7 @@ void initProjectDeploySymbian(QMakeProject* project,
devicePathWithoutDrive.remove(0,2);
}
if (!deployBinaries
+ && 0 != platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))
&& !devicePathWithoutDrive.isEmpty()
&& (0 == devicePathWithoutDrive.compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive)
|| 0 == devicePathWithoutDrive.compare(project->values("REG_RESOURCE_IMPORT_DIR").join(""), Qt::CaseInsensitive))) {
@@ -343,4 +344,17 @@ void initProjectDeploySymbian(QMakeProject* project,
}
}
}
+
+ // Remove deployments that do not actually do anything
+ if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))
+ || 0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) {
+ QMutableListIterator<CopyItem> i(deploymentList);
+ while(i.hasNext()) {
+ CopyItem &item = i.next();
+ QFileInfo fromItem(item.from);
+ QFileInfo toItem(item.to);
+ if (fromItem == toItem)
+ i.remove();
+ }
+ }
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index bf874b2..75fc910 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -385,7 +385,6 @@ VCXCLCompilerTool::VCXCLCompilerTool()
DisableLanguageExtensions(unset),
EnableFiberSafeOptimizations(unset),
EnablePREfast(unset),
- ExceptionHandling("false"),
ExpandAttributedSource(unset),
FloatingPointExceptions(unset),
ForceConformanceInForLoopScope(unset),
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index e23e119..1e060a0 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -360,11 +360,8 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP
inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion)
{
- if (eh == ehDefault) {
- if (compilerVersion >= NET2005)
- return attrE(_ExceptionHandling, ehNone);
- return attrS(_ExceptionHandling, "false");
- }
+ if (eh == ehDefault)
+ return noxml();
if (compilerVersion >= NET2005)
return attrE(_ExceptionHandling, eh);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 35e4896..8686ae8 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -900,6 +900,7 @@ void VcprojGenerator::initCompilerTool()
conf.compiler.AssemblerListingLocation = placement ;
conf.compiler.ProgramDataBaseFileName = ".\\" ;
conf.compiler.ObjectFile = placement ;
+ conf.compiler.ExceptionHandling = ehNone;
// PCH
if (usePCH) {
conf.compiler.UsePrecompiledHeader = pchUseUsingSpecific;
diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp
index 05c1511..f68a435 100644
--- a/qmake/generators/win32/msvc_vcxproj.cpp
+++ b/qmake/generators/win32/msvc_vcxproj.cpp
@@ -274,6 +274,7 @@ void VcxprojGenerator::initCompilerTool()
conf.compiler.AssemblerListingLocation = placement ;
conf.compiler.ProgramDataBaseFileName = ".\\" ;
conf.compiler.ObjectFileName = placement ;
+ conf.compiler.ExceptionHandling = "false";
// PCH
if (usePCH) {
conf.compiler.PrecompiledHeader = "Use";
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index 5b2b679..bccd6a2 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,7 +39,7 @@
#define HB_END_HEADER /* nothing */
#endif
-#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER)
+#if defined(__GNUC__) || defined(_MSC_VER)
#define HB_USE_PACKED_STRUCTS
#endif
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index fc2bdbf..e153ba9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -53,6 +53,8 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
else
result[i] = '?';
}
+
+ result[len] = 0;
}
static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes)
@@ -70,8 +72,8 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
if (!th_brk)
return;
- if (len > 128)
- cstr = (char *)malloc(len*sizeof(char));
+ if (len >= 128)
+ cstr = (char *)malloc(len*sizeof(char) + 1);
to_tis620(string, len, cstr);
@@ -96,7 +98,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
if (break_positions != brp)
free(break_positions);
- if (len > 128)
+ if (len >= 128)
free(cstr);
}
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
index b0873ab..93431df 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
@@ -1,3 +1,49 @@
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Don't use __attribute__((may_alias)) with the Intel compiler,
+ as it doesn't understand it.
+
+ * wtf/Vector.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix compilation with the Intel C++ compiler (11.1.072).
+
+ Like RVCT, label pointers must be void*, not const void*.
+
+ * bytecode/Opcode.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add the WTF_COMPILER_INTEL for when the Intel compiler is used
+ for building. Usually, the Intel compiler masquerades as
+ another compiler in the system and gets away with it, but some
+ times specific fixes are required (such as when using language
+ extensions).
+
+ * wtf/Platform.h:
+
+2010-06-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Crash when compiling on Snow Leopard and running on Leopard
+ https://bugs.webkit.org/show_bug.cgi?id=31403
+
+ Disable the use of pthread_setname_np and other symbols
+ when targetting Leopard.
+
+ Use the defines TARGETING_XX instead of BUILDING_ON_XX
+ for features that cannot be used before Snow Leopard.
+
+ * wtf/Platform.h:
+
2010-05-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Darin Adler.
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
index d9b2153..9ac17ec 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
@@ -196,7 +196,7 @@ namespace JSC {
#undef VERIFY_OPCODE_ID
#if HAVE(COMPUTED_GOTO)
-#if COMPILER(RVCT)
+#if COMPILER(RVCT) || COMPILER(INTEL)
typedef void* Opcode;
#else
typedef const void* Opcode;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
index eafcc23..24873c8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -217,9 +217,7 @@ void Heap::destroy()
NEVER_INLINE CollectorBlock* Heap::allocateBlock()
{
- // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4
- // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
vm_address_t address = 0;
vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
#elif OS(SYMBIAN)
@@ -315,9 +313,7 @@ NEVER_INLINE void Heap::freeBlock(size_t block)
NEVER_INLINE void Heap::freeBlockPtr(CollectorBlock* block)
{
- // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4
- // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
#elif OS(SYMBIAN)
userChunk->Free(reinterpret_cast<TAny*>(block));
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
index be5f51b..5abe9a1 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
@@ -98,6 +98,11 @@
#define WTF_COMPILER_WINSCW 1
#endif
+/* COMPILER(INTEL) - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
+#endif
+
/* COMPILER(ACC) - HP aCC */
#if defined(__HP_aCC)
#define WTF_COMPILER_ACC 1
@@ -703,11 +708,11 @@
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
#define HAVE_DISPATCH_H 1
-#if !PLATFORM(IPHONE) && !PLATFORM(QT)
+#if !PLATFORM(IPHONE)
#define HAVE_MADV_FREE_REUSE 1
#define HAVE_MADV_FREE 1
#define HAVE_PTHREAD_SETNAME_NP 1
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
index 8a4ffba..156ff1a 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
@@ -48,7 +48,7 @@ namespace WTF {
#define WTF_ALIGN_OF(type) 0
#endif
- #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
+ #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
typedef char __attribute__((__may_alias__)) AlignedBufferChar;
#else
typedef char AlignedBufferChar;
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index daecc37..6f5fb7c 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from
The commit imported was from the
- javascriptcore-snapshot-16062010 branch/tag
+ javascriptcore-snapshot-28062010 branch/tag
and has the sha1 checksum
- 8b2d3443afca194f8ac50a63151dc9d19a150582
+ 0fccd26d3624e80cf68873701ef70ad72ca66bec
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 21b75f0..aa30784 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-b3589e88fb8d581fb523578763831109f914dc2e
+38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index 676ed23..8fa3a72 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,37 @@
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+ https://bugs.webkit.org/show_bug.cgi?id=39304
+ <rdar://problem/7998366>
+
+ Add an inlineCapacity template parameter to ListHashSet.
+
+ * wtf/ListHashSet.h:
+ (WTF::::ListHashSet):
+ (WTF::::operator):
+ (WTF::::swap):
+ (WTF::::~ListHashSet):
+ (WTF::::size):
+ (WTF::::capacity):
+ (WTF::::isEmpty):
+ (WTF::::begin):
+ (WTF::::end):
+ (WTF::::find):
+ (WTF::::contains):
+ (WTF::::add):
+ (WTF::::insertBefore):
+ (WTF::::remove):
+ (WTF::::clear):
+ (WTF::::unlinkAndDelete):
+ (WTF::::appendNode):
+ (WTF::::insertNodeBefore):
+ (WTF::::deleteAllNodes):
+ (WTF::::makeIterator):
+ (WTF::::makeConstIterator):
+ (WTF::deleteAllValues):
+
2010-06-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
index 54ed36b..09355ad 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
@@ -37,27 +37,27 @@ namespace WTF {
// and an append that moves the element to the end even if already present,
// but unclear yet if these are needed.
- template<typename Value, typename HashFunctions> class ListHashSet;
+ template<typename Value, size_t inlineCapacity, typename HashFunctions> class ListHashSet;
template<typename T> struct IdentityExtractor;
- template<typename Value, typename HashFunctions>
- void deleteAllValues(const ListHashSet<Value, HashFunctions>&);
+ template<typename Value, size_t inlineCapacity, typename HashFunctions>
+ void deleteAllValues(const ListHashSet<Value, inlineCapacity, HashFunctions>&);
- template<typename ValueArg, typename HashArg> class ListHashSetIterator;
- template<typename ValueArg, typename HashArg> class ListHashSetConstIterator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator;
- template<typename ValueArg> struct ListHashSetNode;
- template<typename ValueArg> struct ListHashSetNodeAllocator;
- template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions;
- template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
+ template<typename ValueArg, size_t inlineCapacity = 256, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
private:
- typedef ListHashSetNode<ValueArg> Node;
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
typedef HashTraits<Node*> NodeTraits;
- typedef ListHashSetNodeHashFunctions<ValueArg, HashArg> NodeHash;
+ typedef ListHashSetNodeHashFunctions<ValueArg, inlineCapacity, HashArg> NodeHash;
typedef HashTable<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplType;
typedef HashTableIterator<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplTypeIterator;
@@ -67,10 +67,10 @@ namespace WTF {
public:
typedef ValueArg ValueType;
- typedef ListHashSetIterator<ValueType, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator;
+ typedef ListHashSetIterator<ValueType, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueType, inlineCapacity, HashArg> const_iterator;
- friend class ListHashSetConstIterator<ValueType, HashArg>;
+ friend class ListHashSetConstIterator<ValueType, inlineCapacity, HashArg>;
ListHashSet();
ListHashSet(const ListHashSet&);
@@ -119,9 +119,9 @@ namespace WTF {
OwnPtr<NodeAllocator> m_allocator;
};
- template<typename ValueArg> struct ListHashSetNodeAllocator {
- typedef ListHashSetNode<ValueArg> Node;
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator {
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
ListHashSetNodeAllocator()
: m_freeList(pool())
@@ -181,15 +181,15 @@ namespace WTF {
Node* m_freeList;
bool m_isDoneWithInitialFreeList;
- static const size_t m_poolSize = 256;
+ static const size_t m_poolSize = inlineCapacity;
union {
char pool[sizeof(Node) * m_poolSize];
double forAlignment;
} m_pool;
};
- template<typename ValueArg> struct ListHashSetNode {
- typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+ template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode {
+ typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
ListHashSetNode(ValueArg value)
: m_value(value)
@@ -220,25 +220,25 @@ namespace WTF {
#endif
};
- template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions {
- typedef ListHashSetNode<ValueArg> Node;
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions {
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
static unsigned hash(Node* const& key) { return HashArg::hash(key->m_value); }
static bool equal(Node* const& a, Node* const& b) { return HashArg::equal(a->m_value, b->m_value); }
static const bool safeToCompareToEmptyOrDeleted = false;
};
- template<typename ValueArg, typename HashArg> class ListHashSetIterator {
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator {
private:
- typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
- typedef ListHashSetNode<ValueArg> Node;
+ typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+ typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
typedef ValueType& ReferenceType;
typedef ValueType* PointerType;
- friend class ListHashSet<ValueArg, HashArg>;
+ friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
ListHashSetIterator(const ListHashSetType* set, Node* position) : m_iterator(set, position) { }
@@ -271,18 +271,18 @@ namespace WTF {
const_iterator m_iterator;
};
- template<typename ValueArg, typename HashArg> class ListHashSetConstIterator {
+ template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator {
private:
- typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, HashArg> iterator;
- typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
- typedef ListHashSetNode<ValueArg> Node;
+ typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+ typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+ typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+ typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
typedef const ValueType& ReferenceType;
typedef const ValueType* PointerType;
- friend class ListHashSet<ValueArg, HashArg>;
- friend class ListHashSetIterator<ValueArg, HashArg>;
+ friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
+ friend class ListHashSetIterator<ValueArg, inlineCapacity, HashArg>;
ListHashSetConstIterator(const ListHashSetType* set, Node* position)
: m_set(set)
@@ -341,11 +341,11 @@ namespace WTF {
};
- template<typename ValueType, typename HashFunctions>
+ template<typename ValueType, size_t inlineCapacity, typename HashFunctions>
struct ListHashSetTranslator {
private:
- typedef ListHashSetNode<ValueType> Node;
- typedef ListHashSetNodeAllocator<ValueType> NodeAllocator;
+ typedef ListHashSetNode<ValueType, inlineCapacity> Node;
+ typedef ListHashSetNodeAllocator<ValueType, inlineCapacity> NodeAllocator;
public:
static unsigned hash(const ValueType& key) { return HashFunctions::hash(key); }
static bool equal(Node* const& a, const ValueType& b) { return HashFunctions::equal(a->m_value, b); }
@@ -355,16 +355,16 @@ namespace WTF {
}
};
- template<typename T, typename U>
- inline ListHashSet<T, U>::ListHashSet()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::ListHashSet()
: m_head(0)
, m_tail(0)
, m_allocator(new NodeAllocator)
{
}
- template<typename T, typename U>
- inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other)
: m_head(0)
, m_tail(0)
, m_allocator(new NodeAllocator)
@@ -374,16 +374,16 @@ namespace WTF {
add(*it);
}
- template<typename T, typename U>
- inline ListHashSet<T, U>& ListHashSet<T, U>::operator=(const ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>& ListHashSet<T, inlineCapacity, U>::operator=(const ListHashSet& other)
{
ListHashSet tmp(other);
swap(tmp);
return *this;
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::swap(ListHashSet& other)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::swap(ListHashSet& other)
{
m_impl.swap(other.m_impl);
std::swap(m_head, other.m_head);
@@ -391,95 +391,95 @@ namespace WTF {
m_allocator.swap(other.m_allocator);
}
- template<typename T, typename U>
- inline ListHashSet<T, U>::~ListHashSet()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSet<T, inlineCapacity, U>::~ListHashSet()
{
deleteAllNodes();
}
- template<typename T, typename U>
- inline int ListHashSet<T, U>::size() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline int ListHashSet<T, inlineCapacity, U>::size() const
{
return m_impl.size();
}
- template<typename T, typename U>
- inline int ListHashSet<T, U>::capacity() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline int ListHashSet<T, inlineCapacity, U>::capacity() const
{
return m_impl.capacity();
}
- template<typename T, typename U>
- inline bool ListHashSet<T, U>::isEmpty() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline bool ListHashSet<T, inlineCapacity, U>::isEmpty() const
{
return m_impl.isEmpty();
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::begin()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::begin()
{
return makeIterator(m_head);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::end()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::end()
{
return makeIterator(0);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::begin() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::begin() const
{
return makeConstIterator(m_head);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::end() const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::end() const
{
return makeConstIterator(0);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::find(const ValueType& value)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
ImplTypeIterator it = m_impl.template find<ValueType, Translator>(value);
if (it == m_impl.end())
return end();
return makeIterator(*it);
}
- template<typename T, typename U>
- inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::find(const ValueType& value) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value) const
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
ImplTypeConstIterator it = m_impl.template find<ValueType, Translator>(value);
if (it == m_impl.end())
return end();
return makeConstIterator(*it);
}
- template<typename T, typename U>
- inline bool ListHashSet<T, U>::contains(const ValueType& value) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline bool ListHashSet<T, inlineCapacity, U>::contains(const ValueType& value) const
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
return m_impl.template contains<ValueType, Translator>(value);
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::add(const ValueType &value)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::add(const ValueType &value)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(value, m_allocator.get());
if (result.second)
appendNode(*result.first);
return std::make_pair(makeIterator(*result.first), result.second);
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(iterator it, const ValueType& newValue)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(iterator it, const ValueType& newValue)
{
- typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+ typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(newValue, m_allocator.get());
if (result.second)
insertNodeBefore(it.node(), *result.first);
@@ -487,14 +487,14 @@ namespace WTF {
}
- template<typename T, typename U>
- pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
+ template<typename T, size_t inlineCapacity, typename U>
+ pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
{
return insertBefore(find(beforeValue), newValue);
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::remove(iterator it)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::remove(iterator it)
{
if (it == end())
return;
@@ -502,14 +502,14 @@ namespace WTF {
unlinkAndDelete(it.node());
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::remove(const ValueType& value)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::remove(const ValueType& value)
{
remove(find(value));
}
- template<typename T, typename U>
- inline void ListHashSet<T, U>::clear()
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void ListHashSet<T, inlineCapacity, U>::clear()
{
deleteAllNodes();
m_impl.clear();
@@ -517,8 +517,8 @@ namespace WTF {
m_tail = 0;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::unlinkAndDelete(Node* node)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::unlinkAndDelete(Node* node)
{
if (!node->m_prev) {
ASSERT(node == m_head);
@@ -539,8 +539,8 @@ namespace WTF {
node->destroy(m_allocator.get());
}
- template<typename T, typename U>
- void ListHashSet<T, U>::appendNode(Node* node)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::appendNode(Node* node)
{
node->m_prev = m_tail;
node->m_next = 0;
@@ -556,8 +556,8 @@ namespace WTF {
m_tail = node;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
{
if (!beforeNode)
return appendNode(newNode);
@@ -572,8 +572,8 @@ namespace WTF {
m_head = newNode;
}
- template<typename T, typename U>
- void ListHashSet<T, U>::deleteAllNodes()
+ template<typename T, size_t inlineCapacity, typename U>
+ void ListHashSet<T, inlineCapacity, U>::deleteAllNodes()
{
if (!m_head)
return;
@@ -582,16 +582,16 @@ namespace WTF {
node->destroy(m_allocator.get());
}
- template<typename T, typename U>
- inline ListHashSetIterator<T, U> ListHashSet<T, U>::makeIterator(Node* position)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSetIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeIterator(Node* position)
{
- return ListHashSetIterator<T, U>(this, position);
+ return ListHashSetIterator<T, inlineCapacity, U>(this, position);
}
- template<typename T, typename U>
- inline ListHashSetConstIterator<T, U> ListHashSet<T, U>::makeConstIterator(Node* position) const
+ template<typename T, size_t inlineCapacity, typename U>
+ inline ListHashSetConstIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeConstIterator(Node* position) const
{
- return ListHashSetConstIterator<T, U>(this, position);
+ return ListHashSetConstIterator<T, inlineCapacity, U>(this, position);
}
template<bool, typename ValueType, typename HashTableType>
@@ -603,10 +603,10 @@ namespace WTF {
delete (*it)->m_value;
}
- template<typename T, typename U>
- inline void deleteAllValues(const ListHashSet<T, U>& collection)
+ template<typename T, size_t inlineCapacity, typename U>
+ inline void deleteAllValues(const ListHashSet<T, inlineCapacity, U>& collection)
{
- deleteAllValues<true, typename ListHashSet<T, U>::ValueType>(collection.m_impl);
+ deleteAllValues<true, typename ListHashSet<T, inlineCapacity, U>::ValueType>(collection.m_impl);
}
} // namespace WTF
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 57c1cf6..980e01a 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- b3589e88fb8d581fb523578763831109f914dc2e
+ 38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 687b76b..a84f177 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,81 @@
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * WebCore.pro: Deploy qmlwebkitplugin.dll.
+
+2010-06-23 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ The frame view take into acount the list of fixed object when scrolling
+ the view. If the number of object is lower than a certain threshold, the pixel
+ are blitted, and the invalidated area updated.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::addFixedObject):
+ (WebCore::FrameView::removeFixedObject):
+ (WebCore::FrameView::scrollContentsFastPath):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::scrollContentsFastPath):
+ * platform/ScrollView.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::repaintRectIncludingDescendants):
+ * rendering/RenderLayer.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::styleWillChange):
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Allocate the m_preloads list hash set dynamically and free it when done.
+ https://bugs.webkit.org/show_bug.cgi?id=39309
+ <rdar://problem/7998495>
+
+ This saves about 6000 bytes on a fully loaded document.
+
+ * loader/DocLoader.cpp:
+ (WebCore::DocLoader::requestPreload):
+ (WebCore::DocLoader::clearPreloads):
+ * loader/DocLoader.h:
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Revert unintended indentation and unnecessary nested name specifier.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::clipOutPositionedObjects):
+ (WebCore::RenderBlock::insertPositionedObject):
+
+2010-05-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+ https://bugs.webkit.org/show_bug.cgi?id=39304
+ <rdar://problem/7998366>
+
+ Set the inlineCapacity for the positionedObjects ListHashSet to 4 instead of 256. Since a RenderBlock usually has
+ few positioned objects, this saves memory.
+
+ * WebCore.base.exp:
+ * rendering/RenderBlock.cpp:
+ (WebCore::clipOutPositionedObjects):
+ (WebCore::RenderBlock::insertPositionedObject):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::positionedObjects):
+
2010-06-22 Simon Hausmann <simon.hausmann@nokia.com>
Unreviewed Qt/Symbian build fix.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index f0e41bc..c1661a4 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -25,6 +25,13 @@ symbian: {
webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+ contains(QT_CONFIG, declarative) {
+ declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
+ declarativeImport.sources += ../WebKit/qt/declarative/qmldir
+ declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
+ DEPLOYMENT += declarativeImport
+ }
+
DEPLOYMENT += webkitlibs webkitbackup
# Need to guarantee that these come before system includes of /epoc32/include
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
index 0053e7b..4597704 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
@@ -407,10 +407,14 @@ void DocLoader::requestPreload(CachedResource::Type type, const String& url, con
encoding = charset.isEmpty() ? m_doc->frame()->loader()->encoding() : charset;
CachedResource* resource = requestResource(type, url, encoding, true);
- if (!resource || m_preloads.contains(resource))
+ if (!resource || (m_preloads && m_preloads->contains(resource)))
return;
resource->increasePreloadCount();
- m_preloads.add(resource);
+
+ if (!m_preloads)
+ m_preloads.set(new ListHashSet<CachedResource*>);
+ m_preloads->add(resource);
+
#if PRELOAD_DEBUG
printf("PRELOADING %s\n", resource->url().latin1().data());
#endif
@@ -421,8 +425,11 @@ void DocLoader::clearPreloads()
#if PRELOAD_DEBUG
printPreloadStats();
#endif
- ListHashSet<CachedResource*>::iterator end = m_preloads.end();
- for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
+ if (!m_preloads)
+ return;
+
+ ListHashSet<CachedResource*>::iterator end = m_preloads->end();
+ for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
CachedResource* res = *it;
res->decreasePreloadCount();
if (res->canDelete() && !res->inCache())
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.h b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
index 8ec73e1..66e4164 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.h
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
@@ -47,8 +47,7 @@ class ImageLoader;
class KURL;
// The DocLoader manages the loading of scripts/images/stylesheets for a single document.
-class DocLoader : public Noncopyable
-{
+class DocLoader : public Noncopyable {
friend class Cache;
friend class ImageLoader;
@@ -117,7 +116,7 @@ private:
int m_requestCount;
- ListHashSet<CachedResource*> m_preloads;
+ OwnPtr<ListHashSet<CachedResource*> > m_preloads;
struct PendingPreload {
CachedResource::Type m_type;
String m_url;
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index a53db36..639414b 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -884,7 +884,7 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
{
const size_t fixedObjectThreshold = 5;
- ListHashSet<RenderBox*>* positionedObjects = 0;
+ RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
if (RenderView* root = m_frame->contentRenderer())
positionedObjects = root->positionedObjects();
@@ -896,14 +896,14 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
// Get the rects of the fixed objects visible in the rectToScroll
Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
bool updateInvalidatedSubRect = true;
- ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
- for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* renderBox = *it;
if (renderBox->style()->position() != FixedPosition)
continue;
- IntRect topLevelRect;
- IntRect updateRect = renderBox->paintingRootRect(topLevelRect);
- updateRect.move(-scrollX(), -scrollY());
+ IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
+ updateRect = contentsToWindow(updateRect);
+
updateRect.intersect(rectToScroll);
if (!updateRect.isEmpty()) {
if (subRectToUpdate.size() >= fixedObjectThreshold) {
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
index a7b8a02..798663e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
@@ -1982,13 +1982,13 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)
}
#ifndef BUILDING_ON_TIGER
-static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderBox*>* positionedObjects)
+static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, RenderBlock::PositionedObjectsListHashSet* positionedObjects)
{
if (!positionedObjects)
return;
- ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
- for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* r = *it;
paintInfo->context->clipOut(IntRect(tx + r->x(), ty + r->y(), r->width(), r->height()));
}
@@ -2274,7 +2274,7 @@ void RenderBlock::insertPositionedObject(RenderBox* o)
{
// Create the list of special objects if we don't aleady have one
if (!m_positionedObjects)
- m_positionedObjects = new ListHashSet<RenderBox*>;
+ m_positionedObjects = new PositionedObjectsListHashSet;
m_positionedObjects->add(o);
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
index 184f983..d555d31 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
@@ -74,7 +74,9 @@ public:
void insertPositionedObject(RenderBox*);
void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*);
- ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; }
+
+ typedef ListHashSet<RenderBox*, 4> PositionedObjectsListHashSet;
+ PositionedObjectsListHashSet* positionedObjects() const { return m_positionedObjects; }
void addPercentHeightDescendant(RenderBox*);
static void removePercentHeightDescendant(RenderBox*);
@@ -483,9 +485,10 @@ private:
void setCollapsedBottomMargin(const MarginInfo&);
// End helper functions and structs used by layoutBlockChildren.
- typedef ListHashSet<RenderBox*>::const_iterator Iterator;
+ typedef PositionedObjectsListHashSet::const_iterator Iterator;
DeprecatedPtrList<FloatingObject>* m_floatingObjects;
- ListHashSet<RenderBox*>* m_positionedObjects;
+
+ PositionedObjectsListHashSet* m_positionedObjects;
// An inline can be split with blocks occurring in between the inline content.
// When this occurs we need a pointer to our next object. We can basically be
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index 3314772..a012868 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -325,6 +325,14 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
m_marquee->updateMarqueePosition();
}
+IntRect RenderLayer::repaintRectIncludingDescendants() const
+{
+ IntRect repaintRect = m_repaintRect;
+ for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+ repaintRect.unite(child->repaintRectIncludingDescendants());
+ return repaintRect;
+}
+
void RenderLayer::computeRepaintRects()
{
RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index 81a66e1..e221f28 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -394,6 +394,7 @@ public:
// Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
IntRect repaintRect() const { return m_repaintRect; }
+ IntRect repaintRectIncludingDescendants() const;
void computeRepaintRects();
void updateRepaintRectsAfterScroll(bool fixed = false);
void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index 7a25646..c4d240c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -442,6 +442,8 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
#if ENABLE(TILED_BACKING_STORE)
void QGraphicsWebViewPrivate::updateTiledBackingStoreScale()
{
+ if (!page)
+ return;
WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
if (!backingStore)
return;
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 050b1c1..8fb929e 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,34 @@
+2010-06-28 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QGraphicsWebView crash when calling setScale() before setUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=40000
+
+ Check 'page' before dereference in _q_scaleChanged()
+ Autotest included.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::_q_scaleChanged):
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl):
+
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * declarative/declarative.pro: Removed non-working deployment.
+
+2010-06-23 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Doc: Fixed documentation errors.
+
+ * docs/qtwebkit-bridge.qdoc:
+
2010-06-23 Alessandro Portale <alessandro.portale@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
index c75bbce..75268f3 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
@@ -67,13 +67,6 @@ qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
symbian:{
TARGET.UID3 = 0x20021321
- load(data_caging_paths)
- include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-
- importFiles.sources = qmlwebkitplugin.dll qmldir
- importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
}
INSTALLS += target qmldir
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index a349bec..0342c9f 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -180,6 +180,8 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
When this item has keyboard focus, all keyboard input will be sent directly to the
web page within.
+
+ \sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo}
*/
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
index fa93293..c2a38fd 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -8,7 +8,7 @@
The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection,
- a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
+ a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
for example \l{QObject} properties map directly to JavaScript properties.
For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
@@ -24,7 +24,7 @@
applications. For example, an application that contains a media-player, playlist manager, and music store.
The playlist manager is usually best authored as a classic desktop application,
with the native-looking robust \l{QWidget}s helping with producing that application.
- The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
+ The media-player control, which usually looks custom, can be written using the \l{Graphics View framework}
or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
from the internet and gets modified rapidly, is best authored in HTML and maintained on the server.
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index e06524d..a04ff17 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -34,6 +34,7 @@ private slots:
void crashOnViewlessWebPages();
void microFocusCoordinates();
void focusInputTypes();
+ void crashOnSetScaleBeforeSetUrl();
};
void tst_QGraphicsWebView::qgraphicswebview()
@@ -132,6 +133,13 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
delete page;
}
+void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl()
+{
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ webView->setScale(2.0);
+ delete webView;
+}
+
void tst_QGraphicsWebView::microFocusCoordinates()
{
QWebPage* page = new QWebPage;
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1eab394..76f35ac 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -412,15 +412,13 @@ namespace QT_NAMESPACE {}
# if defined(__INTEL_COMPILER)
# define Q_CC_INTEL
# endif
-/* x64 does not support mmx intrinsics on windows */
-# if (defined(Q_OS_WIN64) && defined(_M_X64))
+/* MSVC does not support SSE/MMX on x64 */
+# if (defined(Q_CC_MSVC) && defined(_M_X64))
# undef QT_HAVE_SSE
-# undef QT_HAVE_SSE2
# undef QT_HAVE_MMX
# undef QT_HAVE_3DNOW
# endif
-
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index ea60792..26e587d 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1452,7 +1452,7 @@ qint64 QIODevicePrivate::peek(char *data, qint64 maxSize)
return readBytes;
buffer.ungetBlock(data, readBytes);
- pos -= readBytes;
+ *pPos -= readBytes;
return readBytes;
}
@@ -1467,7 +1467,7 @@ QByteArray QIODevicePrivate::peek(qint64 maxSize)
return result;
buffer.ungetBlock(result.constData(), result.size());
- pos -= result.size();
+ *pPos -= result.size();
return result;
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 9d8ee5a..e86efb2 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -100,40 +100,25 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
class QSelectMutexGrabber
{
public:
- QSelectMutexGrabber(int fd, QMutex *threadMutex, QMutex *selectCallMutex)
- : m_threadMutex(threadMutex), m_selectCallMutex(selectCallMutex), bHasThreadLock(false)
+ QSelectMutexGrabber(int fd, QMutex *mutex)
+ : m_mutex(mutex)
{
- // see if selectThread is waiting m_waitCond
- // if yes ... dont write to pipe
- if (m_threadMutex->tryLock()) {
- bHasThreadLock = true;
+ if (m_mutex->tryLock())
return;
- }
-
- // still check that SelectThread
- // is in select call
- if (m_selectCallMutex->tryLock()) {
- m_selectCallMutex->unlock();
- return;
- }
char dummy = 0;
qt_pipe_write(fd, &dummy, 1);
- m_threadMutex->lock();
- bHasThreadLock = true;
+ m_mutex->lock();
}
~QSelectMutexGrabber()
{
- if(bHasThreadLock)
- m_threadMutex->unlock();
+ m_mutex->unlock();
}
private:
- QMutex *m_threadMutex;
- QMutex *m_selectCallMutex;
- bool bHasThreadLock;
+ QMutex *m_mutex;
};
/*
@@ -415,12 +400,7 @@ void QSelectThread::run()
int ret;
int savedSelectErrno;
- {
- // helps fighting the race condition between
- // selctthread and new socket requests (cancel, restart ...)
- QMutexLocker locker(&m_selectCallMutex);
- ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
- }
+ ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
savedSelectErrno = errno;
char buffer;
@@ -515,9 +495,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
start();
}
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
Q_ASSERT(!m_AOStatuses.contains(notifier));
@@ -528,9 +506,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
{
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
m_AOStatuses.remove(notifier);
@@ -539,9 +515,7 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
void QSelectThread::restart()
{
- QMutexLocker locker(&m_grabberMutex);
-
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
m_waitCond.wakeAll();
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 211ded4..bc42753 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -211,26 +211,6 @@ private:
QMutex m_mutex;
QWaitCondition m_waitCond;
bool m_quit;
-
- // to protect when several
- // requests like:
- // requestSocketEvents
- // cancelSocketEvents
- // kick in the same time
- // all will fight for m_mutex
- //
- // TODO: fix more elegantely
- //
- QMutex m_grabberMutex;
-
- // this one will tell
- // if selectthread is
- // really in select call
- // and will prevent
- // writing to pipe that
- // causes later in locking
- // of the thread in waitcond
- QMutex m_selectCallMutex;
};
class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 9dc828d..8e8a88a 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -44,6 +44,8 @@
#ifndef QT_NO_THREAD
#include "qmutex.h"
#include "qwaitcondition.h"
+#include "qelapsedtimer.h"
+#include "qdatetime.h"
QT_BEGIN_NAMESPACE
@@ -218,8 +220,11 @@ bool QSemaphore::tryAcquire(int n, int timeout)
while (n > d->avail)
d->cond.wait(locker.mutex());
} else {
+ QElapsedTimer timer;
+ timer.start();
while (n > d->avail) {
- if (!d->cond.wait(locker.mutex(), timeout))
+ if (timer.hasExpired(timeout)
+ || !d->cond.wait(locker.mutex(), timeout - timer.elapsed()))
return false;
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 05d38f6..b46af1f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1805,6 +1805,11 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
/*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after)
\overload
+
+ Replaces \a len bytes from index position \a pos with the zero terminated
+ string \a after.
+
+ Notice: this can change the lenght of the byte array.
*/
QByteArray &QByteArray::replace(int pos, int len, const char *after)
{
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index cbe6146..58d2dcb 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -58,7 +58,8 @@ QT_BEGIN_HEADER
#endif
// SSE intrinsics
-#if defined(__SSE2__) && defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED)
+#if defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) && (defined(__SSE2__) \
+ || (defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP == 2)))
#if defined(QT_LINUXBASE)
/// this is an evil hack - the posix_memalign declaration in LSB
/// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 432b5d6..336fbbf 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -14,6 +14,8 @@ Component:
- isReady, isLoading, isError and isNull properties removed, use
status property instead
- errorsString() renamed to errorString()
+ListView:
+ - ListView.prevSection property changed to ListView.previousSection
TextInput xToPosition -> positionAt (to match TextEdit.positionAt)
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp
index cd5340b..e4a991b 100644
--- a/src/declarative/debugger/qdeclarativedebug.cpp
+++ b/src/declarative/debugger/qdeclarativedebug.cpp
@@ -562,6 +562,33 @@ QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult
return query;
}
+QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::setBindingForObject(int objectDebugId,
+ const QString &propertyName,
+ const QVariant &bindingExpression,
+ bool isLiteralValue,
+ QObject *parent)
+{
+ Q_D(QDeclarativeEngineDebug);
+
+ QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent);
+ if (d->client->isConnected() && objectDebugId != -1) {
+ query->m_client = this;
+ query->m_expr = bindingExpression;
+ int queryId = d->getId();
+ query->m_queryId = queryId;
+ d->expressionQuery.insert(queryId, query);
+
+ QByteArray message;
+ QDataStream ds(&message, QIODevice::WriteOnly);
+ ds << QByteArray("SET_BINDING") << queryId << objectDebugId << propertyName << bindingExpression << isLiteralValue;
+ d->client->sendMessage(message);
+ } else {
+ query->m_state = QDeclarativeDebugQuery::Error;
+ }
+
+ return query;
+}
+
QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
{
@@ -698,7 +725,7 @@ QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery()
QDeclarativeEngineDebugPrivate::remove(m_client, this);
}
-QString QDeclarativeDebugExpressionQuery::expression() const
+QVariant QDeclarativeDebugExpressionQuery::expression() const
{
return m_expr;
}
diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h
index 4ead232..007cbd7 100644
--- a/src/declarative/debugger/qdeclarativedebug_p.h
+++ b/src/declarative/debugger/qdeclarativedebug_p.h
@@ -94,7 +94,11 @@ public:
QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId,
const QString &expr,
QObject *parent = 0);
-
+ QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId,
+ const QString &propertyName,
+ const QVariant &bindingExpression,
+ bool isLiteralValue,
+ QObject *parent = 0);
private:
Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
};
@@ -198,6 +202,11 @@ public:
private:
friend class QDeclarativeEngineDebugPrivate;
+ QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId,
+ const QString &propertyName,
+ const QVariant &bindingExpression,
+ bool isLiteralValue,
+ QObject *parent);
QUrl m_url;
int m_lineNumber;
int m_columnNumber;
@@ -215,6 +224,11 @@ public:
QString name() const;
private:
+ QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId,
+ const QString &propertyName,
+ const QVariant &bindingExpression,
+ bool isLiteralValue,
+ QObject *parent);
friend class QDeclarativeEngineDebugPrivate;
int m_debugId;
QString m_name;
@@ -348,7 +362,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativ
Q_OBJECT
public:
virtual ~QDeclarativeDebugExpressionQuery();
- QString expression() const;
+ QVariant expression() const;
QVariant result() const;
private:
friend class QDeclarativeEngineDebug;
@@ -356,7 +370,7 @@ private:
QDeclarativeDebugExpressionQuery(QObject *);
QDeclarativeEngineDebug *m_client;
int m_queryId;
- QString m_expr;
+ QVariant m_expr;
QVariant m_result;
};
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h
index 5981cd3..ec361ea 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h
@@ -55,7 +55,7 @@ QT_MODULE(Declarative)
class QMovie;
class QDeclarativeAnimatedImagePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeAnimatedImage : public QDeclarativeImage
+class Q_AUTOTEST_EXPORT QDeclarativeAnimatedImage : public QDeclarativeImage
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
index 07f049e..9944cbe 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p.h
@@ -54,7 +54,7 @@ QT_MODULE(Declarative)
class QDeclarativeScaleGrid;
class QDeclarativeGridScaledImage;
class QDeclarativeBorderImagePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeBorderImage : public QDeclarativeImageBase
+class Q_AUTOTEST_EXPORT QDeclarativeBorderImage : public QDeclarativeImageBase
{
Q_OBJECT
Q_ENUMS(TileMode)
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 65bc233..a40546f 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -971,20 +971,19 @@ void QDeclarativeFlickable::viewportMoved()
{
Q_D(QDeclarativeFlickable);
- int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
- if (!elapsed)
- return;
-
qreal prevY = d->lastFlickablePosition.x();
qreal prevX = d->lastFlickablePosition.y();
d->velocityTimeline.clear();
if (d->pressed) {
- qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
- qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / elapsed;
- d->velocityTimeline.move(d->hData.smoothVelocity, horizontalVelocity, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->hData.smoothVelocity, 0, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->vData.smoothVelocity, verticalVelocity, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->vData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
+ if (elapsed > 0) {
+ qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
+ qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / elapsed;
+ d->velocityTimeline.move(d->hData.smoothVelocity, horizontalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->hData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->vData.smoothVelocity, verticalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->vData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ }
} else {
if (d->timeline.time() > d->vTime) {
qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index be4846e..47746c6 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -52,7 +52,7 @@ QT_MODULE(Declarative)
class QDeclarativeFlickablePrivate;
class QDeclarativeFlickableVisibleArea;
-class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeFlickable : public QDeclarativeItem
{
Q_OBJECT
@@ -112,10 +112,10 @@ public:
void setContentHeight(qreal);
qreal contentX() const;
- void setContentX(qreal pos);
+ virtual void setContentX(qreal pos);
qreal contentY() const;
- void setContentY(qreal pos);
+ virtual void setContentY(qreal pos);
bool isMoving() const;
bool isMovingHorizontally() const;
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable_p.h b/src/declarative/graphicsitems/qdeclarativeflipable_p.h
index fd0119b..78eaf53 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflipable_p.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeFlipablePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeFlipable : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeFlipable : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
index d9ca0b0..99bd540 100644
--- a/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QDeclarativeFocusPanel : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeFocusPanel : public QDeclarativeItem
{
Q_OBJECT
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
index 4bd2a86..e8e6fa2 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
@@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE
Focus scopes assist in keyboard focus handling when building reusable QML
components. All the details are covered in the
\l {qmlfocus}{keyboard focus documentation}.
+
+ \sa {declarative/keyinteraction/focus}{Keyboard focus example}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope_p.h b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
index c65a07c..363167e 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
//### set component root as focusscope
-class Q_DECLARATIVE_EXPORT QDeclarativeFocusScope : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeFocusScope : public QDeclarativeItem
{
Q_OBJECT
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index af9b04e..cb99129 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -151,9 +151,9 @@ public:
void setPosition(qreal pos) {
Q_Q(QDeclarativeGridView);
if (flow == QDeclarativeGridView::LeftToRight)
- q->setContentY(pos);
+ q->QDeclarativeFlickable::setContentY(pos);
else
- q->setContentX(pos);
+ q->QDeclarativeFlickable::setContentX(pos);
}
int size() const {
Q_Q(const QDeclarativeGridView);
@@ -1099,6 +1099,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
nicely.
+
+ \sa {declarative/modelviews/gridview}{GridView example}
*/
QDeclarativeGridView::QDeclarativeGridView(QDeclarativeItem *parent)
: QDeclarativeFlickable(*(new QDeclarativeGridViewPrivate), parent)
@@ -1742,6 +1744,22 @@ void QDeclarativeGridView::setHeader(QDeclarativeComponent *header)
}
}
+void QDeclarativeGridView::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentX(pos);
+}
+
+void QDeclarativeGridView::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentY(pos);
+}
+
bool QDeclarativeGridView::event(QEvent *event)
{
Q_D(QDeclarativeGridView);
@@ -2144,6 +2162,7 @@ void QDeclarativeGridView::componentComplete()
d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
d->updateTrackedItem();
}
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
d->fixupPosition();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index 021aad9..d6bbaf3 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -52,7 +52,7 @@ QT_MODULE(Declarative)
class QDeclarativeVisualModel;
class QDeclarativeGridViewAttached;
class QDeclarativeGridViewPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
+class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
{
Q_OBJECT
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeGridView)
@@ -151,6 +151,9 @@ public:
QDeclarativeComponent *header() const;
void setHeader(QDeclarativeComponent *);
+ virtual void setContentX(qreal pos);
+ virtual void setContentY(qreal pos);
+
enum PositionMode { Beginning, Center, End, Visible, Contain };
Q_INVOKABLE void positionViewAtIndex(int index, int mode);
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index ec08517..ff61302 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -199,6 +199,7 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
fillMode: Image.PreserveAspectCrop
smooth: true
source: "qtlogo.png"
+ clip: true
}
\endqml
@@ -220,6 +221,7 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
Image {
width: 120; height: 120
fillMode: Image.TileVertically
+ smooth: true
source: "qtlogo.png"
}
\endqml
@@ -231,11 +233,14 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
Image {
width: 120; height: 120
fillMode: Image.TileHorizontally
+ smooth: true
source: "qtlogo.png"
}
\endqml
\endtable
+
+ \sa {declarative/imageelements/image}{Image example}
*/
QDeclarativeImage::FillMode QDeclarativeImage::fillMode() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
index fa5b2a9..a4f4475 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeImagePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeImage : public QDeclarativeImageBase
+class Q_AUTOTEST_EXPORT QDeclarativeImage : public QDeclarativeImageBase
{
Q_OBJECT
Q_ENUMS(FillMode)
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
index 49b1c58..f5896b1 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
@@ -49,7 +49,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QDeclarativeImageBasePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeImageBase : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeImageBase : public QDeclarativeItem
{
Q_OBJECT
Q_ENUMS(Status)
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 336010f..9a17d78 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -149,7 +149,7 @@ QT_BEGIN_NAMESPACE
}
\endqml
- \sa Rotate, Translate
+ \sa Rotation, Translate
*/
/*!
@@ -196,6 +196,8 @@ QT_BEGIN_NAMESPACE
\snippet doc/src/snippets/declarative/rotation.qml 0
\image axisrotation.png
+
+ \sa {declarative/ui-components/dialcontrol}{Dial Control example}, {declarative/toys/clocks}{Clocks example}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 59bb178..e519bd9 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -105,7 +105,7 @@ public:
else
return (view->orientation() == QDeclarativeListView::Vertical ? item->y() : item->x());
}
- int size() const {
+ qreal size() const {
if (section)
return (view->orientation() == QDeclarativeListView::Vertical ? item->height()+section->height() : item->width()+section->height());
else
@@ -216,9 +216,9 @@ public:
void setPosition(qreal pos) {
Q_Q(QDeclarativeListView);
if (orient == QDeclarativeListView::Vertical)
- q->setContentY(pos);
+ q->QDeclarativeFlickable::setContentY(pos);
else
- q->setContentX(pos);
+ q->QDeclarativeFlickable::setContentX(pos);
}
qreal size() const {
Q_Q(const QDeclarativeListView);
@@ -476,7 +476,7 @@ public:
QHash<QDeclarativeItem*,int> unrequestedItems;
FxListItem *currentItem;
QDeclarativeListView::Orientation orient;
- int visiblePos;
+ qreal visiblePos;
int visibleIndex;
qreal averageSize;
int currentIndex;
@@ -575,6 +575,10 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
listItem->attached->m_prevSection = item->attached->section();
else
listItem->attached->m_prevSection = sectionAt(modelIndex-1);
+ if (FxListItem *item = visibleItem(modelIndex+1))
+ listItem->attached->m_nextSection = item->attached->section();
+ else
+ listItem->attached->m_nextSection = sectionAt(modelIndex+1);
}
}
if (model->completePending()) {
@@ -655,7 +659,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
bool changed = false;
FxListItem *item = 0;
- int pos = itemEnd + 1;
+ qreal pos = itemEnd + 1;
while (modelIndex < model->count() && pos <= fillTo) {
// qDebug() << "refill: append item" << modelIndex << "pos" << pos;
if (!(item = createItem(modelIndex)))
@@ -744,8 +748,8 @@ void QDeclarativeListViewPrivate::layout()
}
updateSections();
if (!visibleItems.isEmpty()) {
- int oldEnd = visibleItems.last()->endPosition();
- int pos = visibleItems.first()->endPosition() + spacing + 1;
+ qreal oldEnd = visibleItems.last()->endPosition();
+ qreal pos = visibleItems.first()->endPosition() + spacing + 1;
for (int i=1; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
item->setPosition(pos);
@@ -951,14 +955,26 @@ void QDeclarativeListViewPrivate::updateSections()
QString prevSection;
if (visibleIndex > 0)
prevSection = sectionAt(visibleIndex-1);
+ QDeclarativeListViewAttached *prevAtt = 0;
+ int idx = -1;
for (int i = 0; i < visibleItems.count(); ++i) {
if (visibleItems.at(i)->index != -1) {
QDeclarativeListViewAttached *attached = visibleItems.at(i)->attached;
attached->setPrevSection(prevSection);
+ if (prevAtt)
+ prevAtt->setNextSection(attached->section());
createSection(visibleItems.at(i));
prevSection = attached->section();
+ prevAtt = attached;
+ idx = visibleItems.at(i)->index;
}
}
+ if (prevAtt) {
+ if (idx > 0 && idx < model->count()-1)
+ prevAtt->setNextSection(sectionAt(idx+1));
+ else
+ prevAtt->setNextSection(QString());
+ }
}
}
@@ -1027,7 +1043,7 @@ void QDeclarativeListViewPrivate::updateAverage()
qreal sum = 0.0;
for (int i = 0; i < visibleItems.count(); ++i)
sum += visibleItems.at(i)->size();
- averageSize = sum / visibleItems.count();
+ averageSize = qRound(sum / visibleItems.count());
}
void QDeclarativeListViewPrivate::updateFooter()
@@ -1379,7 +1395,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
to set \e {clip: true} in order to have the out of view items clipped
nicely.
- \sa ListModel, GridView, {declarative/modelviews/listview}{ListView examples}
+ \sa {Data Models}, GridView, {declarative/modelviews/listview}{ListView examples}
*/
QDeclarativeListView::QDeclarativeListView(QDeclarativeItem *parent)
@@ -1418,7 +1434,7 @@ QDeclarativeListView::~QDeclarativeListView()
*/
/*!
- \qmlattachedproperty string ListView::prevSection
+ \qmlattachedproperty string ListView::previousSection
This attached property holds the section of the previous element.
It is attached to each instance of the delegate.
@@ -1427,6 +1443,15 @@ QDeclarativeListView::~QDeclarativeListView()
*/
/*!
+ \qmlattachedproperty string ListView::nextSection
+ This attached property holds the section of the next element.
+
+ It is attached to each instance of the delegate.
+
+ The section is evaluated using the \l {ListView::section.property}{section} properties.
+*/
+
+/*!
\qmlattachedproperty string ListView::section
This attached property holds the section of this element.
@@ -1547,9 +1572,12 @@ void QDeclarativeListView::setModel(const QVariant &model)
that is not needed for the normal display of the delegate in a \l Loader which
can load additional elements when needed.
- Tthe ListView will lay out the items based on the size of the root item
+ The ListView will lay out the items based on the size of the root item
in the delegate.
+ It is recommended that the delagate's size be a whole number to avoid sub-pixel
+ alignment of items.
+
\note Delegates are instantiated as needed and may be destroyed at any time.
State should \e never be stored in a delegate.
*/
@@ -1960,9 +1988,9 @@ void QDeclarativeListView::setCacheBuffer(int b)
\c section.delegate holds the delegate component for each section.
- Each item in the list has attached properties named \c ListView.section and
- \c ListView.prevSection. These may be used to place a section header for
- related items.
+ Each item in the list has attached properties named \c ListView.section,
+ \c ListView.previousSection and \c ListView.nextSection. These may be
+ used to place a section header for related items.
For example, here is a ListView that displays a list of animals, separated
into sections. Each item in the ListView is placed in a different section
@@ -2182,6 +2210,22 @@ void QDeclarativeListView::setHeader(QDeclarativeComponent *header)
}
}
+void QDeclarativeListView::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeListView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ QDeclarativeFlickable::setContentX(pos);
+}
+
+void QDeclarativeListView::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeListView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeListViewPrivate::Other;
+ QDeclarativeFlickable::setContentY(pos);
+}
+
bool QDeclarativeListView::event(QEvent *event)
{
Q_D(QDeclarativeListView);
@@ -2551,6 +2595,7 @@ void QDeclarativeListView::componentComplete()
d->highlight->setPosition(d->currentItem->position());
d->updateTrackedItem();
}
+ d->moveReason = QDeclarativeListViewPrivate::Other;
d->fixupPosition();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index d6e8023..9941040 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QDeclarativeViewSection : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeViewSection : public QObject
{
Q_OBJECT
Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY changed)
@@ -86,7 +86,7 @@ private:
class QDeclarativeVisualModel;
class QDeclarativeListViewAttached;
class QDeclarativeListViewPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeListView : public QDeclarativeFlickable
+class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable
{
Q_OBJECT
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeListView)
@@ -198,6 +198,9 @@ public:
QDeclarativeComponent *header() const;
void setHeader(QDeclarativeComponent *);
+ virtual void setContentX(qreal pos);
+ virtual void setContentY(qreal pos);
+
static QDeclarativeListViewAttached *qmlAttachedProperties(QObject *);
enum PositionMode { Beginning, Center, End, Visible, Contain };
@@ -276,7 +279,7 @@ public:
}
}
- Q_PROPERTY(QString prevSection READ prevSection NOTIFY prevSectionChanged)
+ Q_PROPERTY(QString previousSection READ prevSection NOTIFY prevSectionChanged)
QString prevSection() const { return m_prevSection; }
void setPrevSection(const QString &sect) {
if (m_prevSection != sect) {
@@ -285,6 +288,15 @@ public:
}
}
+ Q_PROPERTY(QString nextSection READ nextSection NOTIFY nextSectionChanged)
+ QString nextSection() const { return m_nextSection; }
+ void setNextSection(const QString &sect) {
+ if (m_nextSection != sect) {
+ m_nextSection = sect;
+ emit nextSectionChanged();
+ }
+ }
+
Q_PROPERTY(QString section READ section NOTIFY sectionChanged)
QString section() const { return m_section; }
void setSection(const QString &sect) {
@@ -310,6 +322,7 @@ Q_SIGNALS:
void currentItemChanged();
void sectionChanged();
void prevSectionChanged();
+ void nextSectionChanged();
void delayRemoveChanged();
void add();
void remove();
@@ -318,6 +331,7 @@ public:
QDeclarativeListView *m_view;
mutable QString m_section;
QString m_prevSection;
+ QString m_nextSection;
bool m_isCurrent : 1;
bool m_delayRemove : 1;
};
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 25b1119..c8c9e44 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -174,7 +174,7 @@ void QDeclarativeLoaderPrivate::initResize()
QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent)
{
- Q_D(QDeclarativeItem);
+ Q_D(QDeclarativeLoader);
d->flags |= QGraphicsItem::ItemIsFocusScope;
}
@@ -183,6 +183,14 @@ QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
*/
QDeclarativeLoader::~QDeclarativeLoader()
{
+ Q_D(QDeclarativeLoader);
+ if (d->item) {
+ if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(d->item)) {
+ QDeclarativeItemPrivate *p =
+ static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
+ p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
+ }
+ }
}
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p.h
index ec7ffe9..d63eaf7 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeLoaderPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeLoader : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeLoader : public QDeclarativeItem
{
Q_OBJECT
Q_ENUMS(Status)
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 0bed41b..caf251d 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -192,7 +192,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
MouseArea is an invisible item: it is never painted.
- \sa MouseEvent
+ \sa MouseEvent, {declarative/touchinteraction/mousearea}{MouseArea example}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index df77ac6..4fe3fcb 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QDeclarativeDrag : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeDrag : public QObject
{
Q_OBJECT
@@ -110,7 +110,7 @@ private:
class QDeclarativeMouseEvent;
class QDeclarativeMouseAreaPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
index 86f065a..8142986 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativePaintedItemPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativePaintedItem : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativePaintedItem : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h
index dad43e6..001bcdf 100644
--- a/src/declarative/graphicsitems/qdeclarativepath_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepath_p.h
@@ -54,7 +54,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QDeclarativePathElement : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativePathElement : public QObject
{
Q_OBJECT
public:
@@ -63,7 +63,7 @@ Q_SIGNALS:
void changed();
};
-class Q_DECLARATIVE_EXPORT QDeclarativePathAttribute : public QDeclarativePathElement
+class Q_AUTOTEST_EXPORT QDeclarativePathAttribute : public QDeclarativePathElement
{
Q_OBJECT
@@ -87,7 +87,7 @@ private:
qreal _value;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeCurve : public QDeclarativePathElement
+class Q_AUTOTEST_EXPORT QDeclarativeCurve : public QDeclarativePathElement
{
Q_OBJECT
@@ -109,7 +109,7 @@ private:
qreal _y;
};
-class Q_DECLARATIVE_EXPORT QDeclarativePathLine : public QDeclarativeCurve
+class Q_AUTOTEST_EXPORT QDeclarativePathLine : public QDeclarativeCurve
{
Q_OBJECT
public:
@@ -118,7 +118,7 @@ public:
void addToPath(QPainterPath &path);
};
-class Q_DECLARATIVE_EXPORT QDeclarativePathQuad : public QDeclarativeCurve
+class Q_AUTOTEST_EXPORT QDeclarativePathQuad : public QDeclarativeCurve
{
Q_OBJECT
@@ -140,7 +140,7 @@ private:
qreal _controlY;
};
-class Q_DECLARATIVE_EXPORT QDeclarativePathCubic : public QDeclarativeCurve
+class Q_AUTOTEST_EXPORT QDeclarativePathCubic : public QDeclarativeCurve
{
Q_OBJECT
@@ -172,7 +172,7 @@ private:
int _control2Y;
};
-class Q_DECLARATIVE_EXPORT QDeclarativePathPercent : public QDeclarativePathElement
+class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement
{
Q_OBJECT
Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed)
@@ -187,7 +187,7 @@ private:
};
class QDeclarativePathPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativePath : public QObject, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativePath : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h
index 8a6f53f..d2980c6 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h
@@ -53,7 +53,7 @@ QT_MODULE(Declarative)
class QDeclarativePathViewPrivate;
class QDeclarativePathViewAttached;
-class Q_DECLARATIVE_EXPORT QDeclarativePathView : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativePathView : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index b9231a1..179f13d 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -1027,13 +1027,13 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
continue;
if (d->flow == LeftToRight) {
- if (hoffset && hoffset + child.item->width() > width()) {
+ if (widthValid() && hoffset && hoffset + child.item->width() > width()) {
hoffset = 0;
voffset += linemax + spacing();
linemax = 0;
}
} else {
- if (voffset && voffset + child.item->height() > height()) {
+ if (heightValid() && voffset && voffset + child.item->height() > height()) {
voffset = 0;
hoffset += linemax + spacing();
linemax = 0;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index 787dcd3..c03e518 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeBasePositionerPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeBasePositioner : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeBasePositioner : public QDeclarativeItem
{
Q_OBJECT
@@ -112,7 +112,7 @@ private:
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeBasePositioner)
};
-class Q_DECLARATIVE_EXPORT QDeclarativeColumn : public QDeclarativeBasePositioner
+class Q_AUTOTEST_EXPORT QDeclarativeColumn : public QDeclarativeBasePositioner
{
Q_OBJECT
public:
@@ -124,7 +124,7 @@ private:
Q_DISABLE_COPY(QDeclarativeColumn)
};
-class Q_DECLARATIVE_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
+class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
{
Q_OBJECT
public:
@@ -136,7 +136,7 @@ private:
Q_DISABLE_COPY(QDeclarativeRow)
};
-class Q_DECLARATIVE_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
+class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner
{
Q_OBJECT
Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowsChanged)
@@ -174,7 +174,7 @@ private:
};
class QDeclarativeFlowPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
+class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner
{
Q_OBJECT
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p.h
index 7272962..ecc3fbf 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle_p.h
+++ b/src/declarative/graphicsitems/qdeclarativerectangle_p.h
@@ -68,7 +68,7 @@ public:
QColor color() const { return _color; }
void setColor(const QColor &c);
- bool isValid() { return _valid; };
+ bool isValid() { return _valid; }
Q_SIGNALS:
void penChanged();
@@ -79,7 +79,7 @@ private:
bool _valid;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeGradientStop : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeGradientStop : public QObject
{
Q_OBJECT
@@ -103,7 +103,7 @@ private:
QColor m_color;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeGradient : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeGradient : public QObject
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater_p.h b/src/declarative/graphicsitems/qdeclarativerepeater_p.h
index db46699..ff58fa0 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater_p.h
+++ b/src/declarative/graphicsitems/qdeclarativerepeater_p.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeRepeaterPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeRepeater : public QDeclarativeItem
+class Q_AUTOTEST_EXPORT QDeclarativeRepeater : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 2ba680d..0bd9a53 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -136,6 +136,8 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
HTML img tags that load remote images, the text is reloaded.
Text provides read-only text. For editable text, see \l TextEdit.
+
+ \sa {declarative/text/fonts}{Fonts example}
*/
/*!
@@ -225,12 +227,6 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
*/
/*!
- \qmlproperty bool Text::font.outline
-
- Sets whether the font has an outline style.
-*/
-
-/*!
\qmlproperty bool Text::font.strikeout
Sets whether the font has a strikeout style.
@@ -441,6 +437,8 @@ void QDeclarativeText::setStyleColor(const QColor &color)
\qml
Text { font.pointSize: 18; text: "hello"; style: Text.Raised; styleColor: "gray" }
\endqml
+
+ \sa style
*/
QColor QDeclarativeText::styleColor() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 7db21f2..c6566ff 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -99,7 +99,7 @@ TextEdit {
You can translate between cursor positions (characters from the start of the document) and pixel
points using positionAt() and positionToRectangle().
- \sa Text, TextInput
+ \sa Text, TextInput, {declarative/text/textselection}{Text Selection example}
*/
/*!
@@ -186,12 +186,6 @@ QString QDeclarativeTextEdit::text() const
*/
/*!
- \qmlproperty bool TextEdit::font.outline
-
- Sets whether the font has an outline style.
-*/
-
-/*!
\qmlproperty bool TextEdit::font.strikeout
Sets whether the font has a strikeout style.
@@ -1289,6 +1283,7 @@ void QDeclarativeTextEditPrivate::init()
void QDeclarativeTextEdit::q_textChanged()
{
updateSize();
+ updateMicroFocus();
emit textChanged(text());
}
@@ -1330,6 +1325,7 @@ void QDeclarativeTextEdit::updateSelectionMarkers()
d->lastSelectionEnd = d->control->textCursor().selectionEnd();
emit selectionEndChanged();
}
+ updateMicroFocus();
}
QRectF QDeclarativeTextEdit::boundingRect() const
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index a6dd4a4..279af78 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -58,7 +58,7 @@ QT_MODULE(Declarative)
class QDeclarativeTextEditPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
+class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
{
Q_OBJECT
Q_ENUMS(VAlignment)
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index ec14c78..ed999a2 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled.
If you want such bindings (on any platform), you will need to construct them in QML.
- \sa TextEdit, Text
+ \sa TextEdit, Text, {declarative/text/textselection}{Text Selection example}
*/
QDeclarativeTextInput::QDeclarativeTextInput(QDeclarativeItem* parent)
: QDeclarativePaintedItem(*(new QDeclarativeTextInputPrivate), parent)
@@ -152,12 +152,6 @@ void QDeclarativeTextInput::setText(const QString &s)
*/
/*!
- \qmlproperty bool TextInput::font.outline
-
- Sets whether the font has an outline style.
-*/
-
-/*!
\qmlproperty bool TextInput::font.strikeout
Sets whether the font has a strikeout style.
@@ -1398,18 +1392,11 @@ void QDeclarativeTextInputPrivate::init()
q->connect(control, SIGNAL(selectionChanged()),
q, SLOT(selectionChanged()));
q->connect(control, SIGNAL(textChanged(const QString &)),
- q, SIGNAL(displayTextChanged(const QString &)));
- q->connect(control, SIGNAL(textChanged(const QString &)),
q, SLOT(q_textChanged()));
q->connect(control, SIGNAL(accepted()),
q, SIGNAL(accepted()));
q->connect(control, SIGNAL(updateNeeded(QRect)),
q, SLOT(updateRect(QRect)));
- q->connect(control, SIGNAL(cursorPositionChanged(int,int)),
- q, SLOT(updateRect()));//TODO: Only update rect between pos's
- q->connect(control, SIGNAL(selectionChanged()),
- q, SLOT(updateRect()));//TODO: Only update rect in selection
- //Note that above TODOs probably aren't that big a savings
q->updateSize();
oldValidity = control->hasAcceptableInput();
lastSelectionStart = 0;
@@ -1422,6 +1409,8 @@ void QDeclarativeTextInputPrivate::init()
void QDeclarativeTextInput::cursorPosChanged()
{
Q_D(QDeclarativeTextInput);
+ updateRect();//TODO: Only update rect between pos's
+ updateMicroFocus();
emit cursorPositionChanged();
if(!d->control->hasSelectedText()){
@@ -1439,6 +1428,7 @@ void QDeclarativeTextInput::cursorPosChanged()
void QDeclarativeTextInput::selectionChanged()
{
Q_D(QDeclarativeTextInput);
+ updateRect();//TODO: Only update rect in selection
emit selectedTextChanged();
if(d->lastSelectionStart != d->control->selectionStart()){
@@ -1460,7 +1450,9 @@ void QDeclarativeTextInput::q_textChanged()
Q_D(QDeclarativeTextInput);
d->updateHorizontalScroll();
updateSize();
+ updateMicroFocus();
emit textChanged();
+ emit displayTextChanged();
if(hasAcceptableInput() != d->oldValidity){
d->oldValidity = hasAcceptableInput();
emit acceptableInputChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 6934da4..bacd041 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -56,7 +56,7 @@ QT_MODULE(Declarative)
class QDeclarativeTextInputPrivate;
class QValidator;
-class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedItem
+class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativePaintedItem
{
Q_OBJECT
Q_ENUMS(HAlignment)
@@ -208,7 +208,7 @@ Q_SIGNALS:
void inputMaskChanged(const QString &inputMask);
void echoModeChanged(EchoMode echoMode);
void passwordCharacterChanged();
- void displayTextChanged(const QString &text);
+ void displayTextChanged();
void focusOnPressChanged(bool focusOnPress);
void autoScrollChanged(bool autoScroll);
void selectByMouseChanged(bool selectByMouse);
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate_p.h b/src/declarative/graphicsitems/qdeclarativetranslate_p.h
index 939692b..0207dce 100644
--- a/src/declarative/graphicsitems/qdeclarativetranslate_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetranslate_p.h
@@ -52,7 +52,7 @@ QT_MODULE(Declarative)
class QDeclarativeTranslatePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeTranslate : public QGraphicsTransform
+class Q_AUTOTEST_EXPORT QDeclarativeTranslate : public QGraphicsTransform
{
Q_OBJECT
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 5092349..786d6f9 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -283,7 +283,7 @@ public:
if (m_roles.count() == 1)
m_roleNames.insert("modelData", m_roles.at(0));
if (m_roles.count())
- m_roleNames.insert("hasModelChildren", 0);
+ m_roleNames.insert("hasModelChildren", -1);
} else if (m_listAccessor) {
m_roleNames.insert("modelData", 0);
if (m_listAccessor->type() == QDeclarativeListAccessor::Instance) {
@@ -818,6 +818,12 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate)
\c view.qml:
\snippet doc/src/snippets/declarative/visualdatamodel_rootindex/view.qml 0
+ If the \l model is a QAbstractItemModel subclass, the delegate can also
+ reference a \c hasModelChildren property (optionally qualified by a
+ \e model. prefix) that indicates whether the delegate's model item has
+ any child nodes.
+
+
\sa modelIndex(), parentModelIndex()
*/
QVariant QDeclarativeVisualDataModel::rootIndex() const
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
index 079c9e6..d5c0de2 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -60,7 +60,7 @@ class QDeclarativeComponent;
class QDeclarativePackage;
class QDeclarativeVisualDataModelPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeVisualModel : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeVisualModel : public QObject
{
Q_OBJECT
@@ -103,7 +103,7 @@ private:
class QDeclarativeVisualItemModelAttached;
class QDeclarativeVisualItemModelPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeVisualItemModel : public QDeclarativeVisualModel
+class Q_AUTOTEST_EXPORT QDeclarativeVisualItemModel : public QDeclarativeVisualModel
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeVisualItemModel)
@@ -138,7 +138,7 @@ private:
};
-class Q_DECLARATIVE_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisualModel
+class Q_AUTOTEST_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisualModel
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeVisualDataModel)
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 80a1093..623e3df 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -815,6 +815,10 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
}
}
+ QDeclarativeCustomParser *cp = 0;
+ if (isCustomParser)
+ cp = output->types.at(obj->type).type->customParser();
+
// Build all explicit properties specified
foreach(Property *prop, obj->properties) {
@@ -825,7 +829,9 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
bool canDefer = false;
if (isCustomParser) {
- if (doesPropertyExist(prop, obj)) {
+ if (doesPropertyExist(prop, obj) &&
+ (!(cp->flags() & QDeclarativeCustomParser::AcceptsAttachedProperties) ||
+ !isAttachedPropertyName(prop->name))) {
int ids = compileState.ids.count();
COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
canDefer = ids == compileState.ids.count();
@@ -876,8 +882,7 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
defaultProperty->release();
// Compile custom parser parts
- if (isCustomParser/* && !customProps.isEmpty()*/) {
- QDeclarativeCustomParser *cp = output->types.at(obj->type).type->customParser();
+ if (isCustomParser && !customProps.isEmpty()) {
cp->clearErrors();
cp->compiler = this;
cp->object = obj;
@@ -1356,7 +1361,7 @@ bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDecl
Returns true if (value) property \a prop exists on obj, false otherwise.
*/
bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeParser::Property *prop,
- QDeclarativeParser::Object *obj)
+ QDeclarativeParser::Object *obj)
{
if(isAttachedPropertyName(prop->name) || prop->name == "id")
return true;
@@ -2176,6 +2181,18 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const
return -1;
}
+const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) const
+{
+ QDeclarativeType *qmltype = 0;
+ if (!enginePrivate->importDatabase.resolveType(unit->imports, name, &qmltype,
+ 0, 0, 0, 0))
+ return 0;
+ if (!qmltype)
+ return 0;
+ return qmltype->metaObject();
+}
+
+
// Ensures that the dynamic meta specification on obj is valid
bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
{
@@ -2199,6 +2216,10 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
if (QString::fromUtf8(prop.name).at(0).isUpper())
COMPILE_EXCEPTION(&prop, tr("Property names cannot begin with an upper case letter"));
+
+ if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(prop.name))
+ COMPILE_EXCEPTION(&prop, tr("Illegal property name"));
+
propNames.insert(prop.name);
}
@@ -2208,6 +2229,8 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
COMPILE_EXCEPTION(obj, tr("Duplicate signal name"));
if (QString::fromUtf8(name).at(0).isUpper())
COMPILE_EXCEPTION(obj, tr("Signal names cannot begin with an upper case letter"));
+ if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(name))
+ COMPILE_EXCEPTION(obj, tr("Illegal signal name"));
methodNames.insert(name);
}
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
@@ -2216,6 +2239,8 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
COMPILE_EXCEPTION(obj, tr("Duplicate method name"));
if (QString::fromUtf8(name).at(0).isUpper())
COMPILE_EXCEPTION(obj, tr("Method names cannot begin with an upper case letter"));
+ if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(name))
+ COMPILE_EXCEPTION(obj, tr("Illegal method name"));
methodNames.insert(name);
}
diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h
index 908c703..49dc53f 100644
--- a/src/declarative/qml/qdeclarativecompiler_p.h
+++ b/src/declarative/qml/qdeclarativecompiler_p.h
@@ -146,7 +146,7 @@ private:
};
class QMetaObjectBuilder;
-class Q_DECLARATIVE_EXPORT QDeclarativeCompiler
+class Q_AUTOTEST_EXPORT QDeclarativeCompiler
{
Q_DECLARE_TR_FUNCTIONS(QDeclarativeCompiler)
public:
@@ -161,6 +161,7 @@ public:
static bool isSignalPropertyName(const QByteArray &);
int evaluateEnum(const QByteArray& script) const; // for QDeclarativeCustomParser::evaluateEnum
+ const QMetaObject *resolveType(const QByteArray& name) const; // for QDeclarativeCustomParser::resolveType
private:
static void reset(QDeclarativeCompiledData *);
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index b4919ff..9d3032c 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -572,7 +572,9 @@ QScriptValue QDeclarativeComponent::createObject(QObject* parent)
{
Q_D(QDeclarativeComponent);
QDeclarativeContext* ctxt = creationContext();
- if(!ctxt)
+ if(!ctxt && d->engine)
+ ctxt = d->engine->rootContext();
+ if (!ctxt)
return QScriptValue(QScriptValue::NullValue);
QObject* ret = create(ctxt);
if (!ret)
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 2221d78..60e9dd3 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -660,10 +660,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newUrlContext(url));
- scriptContext->pushScope(enginePriv->globalClass->globalObject());
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
- QScriptValue scope = scriptEngine->newObject();
- scriptContext->setActivationObject(scope);
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
scriptContext->pushScope(scope);
scriptEngine->evaluate(code, url, 1);
@@ -686,10 +685,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newUrlContext(this, 0, url));
- scriptContext->pushScope(enginePriv->globalClass->globalObject());
-
- QScriptValue scope = scriptEngine->newObject();
- scriptContext->setActivationObject(scope);
+ scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
+
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
scriptContext->pushScope(scope);
scriptEngine->evaluate(code, url, 1);
diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp
index 472a883..97a6a00 100644
--- a/src/declarative/qml/qdeclarativecustomparser.cpp
+++ b/src/declarative/qml/qdeclarativecustomparser.cpp
@@ -295,4 +295,14 @@ int QDeclarativeCustomParser::evaluateEnum(const QByteArray& script) const
return compiler->evaluateEnum(script);
}
+/*!
+ Resolves \a name to a type, or 0 if it is not a type. This can be used
+ to type-check object nodes.
+*/
+const QMetaObject *QDeclarativeCustomParser::resolveType(const QByteArray& name) const
+{
+ return compiler->resolveType(name);
+}
+
+
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h
index 0e397c5..509e30a 100644
--- a/src/declarative/qml/qdeclarativecustomparser_p.h
+++ b/src/declarative/qml/qdeclarativecustomparser_p.h
@@ -113,10 +113,18 @@ private:
class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser
{
public:
- QDeclarativeCustomParser() : compiler(0), object(0) {}
+ enum Flag {
+ NoFlag = 0x00000000,
+ AcceptsAttachedProperties = 0x00000001
+ };
+ Q_DECLARE_FLAGS(Flags, Flag);
+
+ QDeclarativeCustomParser() : compiler(0), object(0), m_flags(NoFlag) {}
+ QDeclarativeCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {}
virtual ~QDeclarativeCustomParser() {}
void clearErrors();
+ Flags flags() const { return m_flags; }
virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &)=0;
virtual void setCustomData(QObject *, const QByteArray &)=0;
@@ -130,12 +138,16 @@ protected:
int evaluateEnum(const QByteArray&) const;
+ const QMetaObject *resolveType(const QByteArray&) const;
+
private:
QList<QDeclarativeError> exceptions;
QDeclarativeCompiler *compiler;
QDeclarativeParser::Object *object;
+ Flags m_flags;
friend class QDeclarativeCompiler;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeCustomParser::Flags);
#if 0
#define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 5c4d229..8b15ae9 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -183,11 +183,11 @@ data types. This is primarily useful when setting the properties of an item
when the property has one of the following types:
\list
-\o \c color - use \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()}, \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()}
-\o \c rect - use \l{Qt::rect()}{Qt.rect()}
-\o \c point - use \l{Qt::point()}{Qt.point()}
-\o \c size - use \l{Qt::size()}{Qt.size()}
-\o \c vector3d - use \l{Qt::vector3d()}{Qt.vector3d()}
+\o \c color - use \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()}
+\o \c rect - use \l{QML:Qt::rect()}{Qt.rect()}
+\o \c point - use \l{QML:Qt::point()}{Qt.point()}
+\o \c size - use \l{QML:Qt::size()}{Qt.size()}
+\o \c vector3d - use \l{QML:Qt::vector3d()}{Qt.vector3d()}
\endlist
There are also string based constructors for these types. See \l{qdeclarativebasictypes.html}{QML Basic Types} for more information.
@@ -197,12 +197,12 @@ There are also string based constructors for these types. See \l{qdeclarativebas
The Qt object contains several functions for formatting dates and times.
\list
- \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
- \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
- \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
+ \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
+ \o \l{QML:Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
+ \o \l{QML:Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
\endlist
-The format specification is described at \l{Qt::formatDateTime}{Qt.formatDateTime}.
+The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDateTime}.
\section1 Dynamic Object Creation
@@ -211,8 +211,8 @@ items from files or strings. See \l{Dynamic Object Management} for an overview
of their use.
\list
- \o \l{Qt::createComponent()}{object Qt.createComponent(url)}
- \o \l{Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
+ \o \l{QML:Qt::createComponent()}{object Qt.createComponent(url)}
+ \o \l{QML:Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
\endlist
*/
@@ -1033,6 +1033,17 @@ QDeclarativeContextData *QDeclarativeEnginePrivate::getContext(QScriptContext *c
return contextClass->contextFromValue(scopeNode);
}
+/*!
+ Returns the QUrl associated with the script \a ctxt for the case that there is
+ no QDeclarativeContext.
+*/
+QUrl QDeclarativeEnginePrivate::getUrl(QScriptContext *ctxt)
+{
+ QScriptValue scopeNode = QScriptDeclarativeClass::scopeChainValue(ctxt, -3);
+ Q_ASSERT(scopeNode.isValid());
+ Q_ASSERT(QScriptDeclarativeClass::scriptClass(scopeNode) == contextClass);
+ return contextClass->urlFromValue(scopeNode);
+}
QString QDeclarativeEnginePrivate::urlToLocalFileOrQrc(const QUrl& url)
{
@@ -1075,16 +1086,19 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS
static_cast<QDeclarativeScriptEngine*>(engine)->p;
QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
- QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
- Q_ASSERT(context);
-
if(ctxt->argumentCount() != 1) {
return ctxt->throwError(QLatin1String("Qt.createComponent(): Invalid arguments"));
- }else{
+ } else {
+
QString arg = ctxt->argument(0).toString();
if (arg.isEmpty())
return engine->nullValue();
- QUrl url = QUrl(context->resolvedUrl(QUrl(arg)));
+ QUrl url;
+ QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
+ if (context)
+ url = QUrl(context->resolvedUrl(QUrl(arg)));
+ else
+ url = activeEnginePriv->getUrl(ctxt).resolved(QUrl(arg));
QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine);
QDeclarativeComponentPrivate::get(c)->creationContext = context;
QDeclarativeData::get(c, true)->setImplicitDestructible();
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 3269e98..cfa9d73 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -315,6 +315,7 @@ public:
static QDeclarativeEnginePrivate *get(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p; }
static QDeclarativeEngine *get(QDeclarativeEnginePrivate *p) { return p->q_func(); }
QDeclarativeContextData *getContext(QScriptContext *);
+ QUrl getUrl(QScriptContext *);
static QString urlToLocalFileOrQrc(const QUrl& url);
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 7ae0050..d765649 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
QList<QDeclarativeEngine *> QDeclarativeEngineDebugServer::m_engines;
QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent)
: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
- m_watch(new QDeclarativeWatcher(this))
+ m_watch(new QDeclarativeWatcher(this))
{
QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)),
this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant)));
@@ -99,6 +99,29 @@ QDataStream &operator>>(QDataStream &ds,
return ds;
}
+static inline bool isSignalPropertyName(const QString &signalName)
+{
+ // see QmlCompiler::isSignalPropertyName
+ return signalName.length() >= 3 && signalName.startsWith(QLatin1String("on")) &&
+ signalName.at(2).isLetter() && signalName.at(2).isUpper();
+}
+
+static bool hasValidSignal(QObject *object, const QString &propertyName)
+{
+ if (!isSignalPropertyName(propertyName))
+ return false;
+
+ QString signalName = propertyName.mid(2);
+ signalName[0] = signalName.at(0).toLower();
+
+ int sigIdx = QDeclarativePropertyPrivate::findSignalByName(object->metaObject(), signalName.toLatin1()).methodIndex();
+
+ if (sigIdx == -1)
+ return false;
+
+ return true;
+}
+
QDeclarativeEngineDebugServer::QDeclarativeObjectProperty
QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
{
@@ -396,7 +419,6 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
rs << QByteArray("WATCH_EXPR_OBJECT_R") << queryId << ok;
-
sendMessage(reply);
} else if (type == "NO_WATCH") {
int queryId;
@@ -430,7 +452,48 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
rs << QByteArray("EVAL_EXPRESSION_R") << queryId << result;
sendMessage(reply);
+ } else if (type == "SET_BINDING") {
+ int queryId;
+ int objectId;
+ QString propertyName;
+ QVariant expr;
+ bool isLiteralValue;
+ ds >> queryId >> objectId >> propertyName >> expr >> isLiteralValue;
+ setBinding(objectId, propertyName, expr, isLiteralValue);
+ }
+}
+
+void QDeclarativeEngineDebugServer::setBinding(int objectId,
+ const QString &propertyName,
+ const QVariant &expression,
+ bool isLiteralValue)
+{
+ QObject *object = objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
+
+ if (object && context) {
+
+ if (isLiteralValue) {
+ QDeclarativeProperty literalProperty(object, propertyName, context);
+ literalProperty.write(expression);
+ } else {
+ if (hasValidSignal(object, propertyName)) {
+ QDeclarativeProperty property(object, propertyName);
+ QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
+ QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
+ } else {
+ QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
+ QDeclarativeProperty property(object, propertyName);
+ binding->setTarget(property);
+ binding->setNotifyOnValueChanged(true);
+ QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
+ if (oldBinding)
+ oldBinding->destroy();
+ binding->update();
+ }
+ }
}
+
}
void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h
index 9491411..b3c23bd 100644
--- a/src/declarative/qml/qdeclarativeenginedebug_p.h
+++ b/src/declarative/qml/qdeclarativeenginedebug_p.h
@@ -107,6 +107,7 @@ private:
QDeclarativeObjectData objectData(QObject *);
QDeclarativeObjectProperty propertyData(QObject *, int);
QVariant valueContents(const QVariant &defaultValue) const;
+ void setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue);
static QList<QDeclarativeEngine *> m_engines;
QDeclarativeWatcher *m_watch;
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index b1aecfa..8ae5f2f 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -145,7 +145,7 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *ex
if (!dd->cachedClosures.at(progIdx)) {
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(ep->contextClass->newSharedContext());
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url, data->line));
scriptEngine->popContext();
}
@@ -188,7 +188,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
} else {
scriptContext->pushScope(ep->contextClass->newContext(context, object));
}
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue rv = ep->scriptEngine.evaluate(program, fileName, lineNumber);
ep->scriptEngine.popContext();
return rv;
@@ -206,7 +206,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
} else {
scriptContext->pushScope(ep->contextClass->newContext(context, object));
}
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue rv = ep->scriptEngine.evaluate(program);
ep->scriptEngine.popContext();
return rv;
@@ -369,7 +369,7 @@ QScriptValue QDeclarativeExpressionPrivate::eval(QObject *secondaryScope, bool *
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
data->expressionContext = ep->contextClass->newContext(data->context(), data->me);
scriptContext->pushScope(data->expressionContext);
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
if (data->expressionRewritten) {
data->expressionFunction = scriptEngine->evaluate(data->expression,
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
index f29b3f4..d43443d 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -42,10 +42,13 @@
#include "private/qdeclarativeglobalscriptclass_p.h"
#include <QtCore/qstringlist.h>
+#include <QtCore/qvector.h>
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
#include <QtScript/qscriptvalueiterator.h>
+#include <private/qscriptdeclarativeclass_p.h>
+
QT_BEGIN_NAMESPACE
/*
@@ -55,24 +58,36 @@ QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engi
: QScriptClass(engine)
{
QString eval = QLatin1String("eval");
+ QString version = QLatin1String("version");
- QScriptValue globalObject = engine->globalObject();
+ QScriptValue originalGlobalObject = engine->globalObject();
- m_globalObject = engine->newObject();
QScriptValue newGlobalObject = engine->newObject();
- QScriptValueIterator iter(globalObject);
-
- while (iter.hasNext()) {
- iter.next();
-
- QString name = iter.name();
-
- if (name != eval)
- m_globalObject.setProperty(iter.scriptName(), iter.value());
- newGlobalObject.setProperty(iter.scriptName(), iter.value());
-
- m_illegalNames.insert(name);
+ {
+ QScriptValueIterator iter(originalGlobalObject);
+ QVector<QString> names;
+ QVector<QScriptValue> values;
+ QVector<QScriptValue::PropertyFlags> flags;
+ while (iter.hasNext()) {
+ iter.next();
+
+ QString name = iter.name();
+
+ if (name == version)
+ continue;
+
+ if (name != eval) {
+ names.append(name);
+ values.append(iter.value());
+ flags.append(iter.flags() | QScriptValue::Undeletable);
+ }
+ newGlobalObject.setProperty(iter.scriptName(), iter.value());
+
+ m_illegalNames.insert(name);
+ }
+ m_staticGlobalObject = QScriptDeclarativeClass::newStaticScopeObject(
+ engine, names.size(), names.constData(), values.constData(), flags.constData());
}
newGlobalObject.setScriptClass(this);
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
index fb44e5d..b42b7bd 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -72,13 +72,13 @@ public:
void explicitSetProperty(const QStringList &, const QList<QScriptValue> &);
- const QScriptValue &globalObject() const { return m_globalObject; }
+ const QScriptValue &staticGlobalObject() const { return m_staticGlobalObject; }
const QSet<QString> &illegalNames() const { return m_illegalNames; }
private:
QSet<QString> m_illegalNames;
- QScriptValue m_globalObject;
+ QScriptValue m_staticGlobalObject;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index 4be3472..f4a8588 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
\note the request() method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
- \sa QDeclarativeEngine::addImageProvider()
+ \sa QDeclarativeEngine::addImageProvider(), {declarative/cppextensions/imageprovider}{ImageProvider example}
*/
/*!
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
index c29005a..f26b54f 100644
--- a/src/declarative/qml/qdeclarativeinclude.cpp
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -240,7 +240,7 @@ QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *e
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
scriptContext->pushScope(ep->contextClass->newUrlContext(context, 0, urlString));
- scriptContext->pushScope(ep->globalClass->globalObject());
+ scriptContext->pushScope(ep->globalClass->staticGlobalObject());
QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
scriptContext->pushScope(scope);
scriptContext->setActivationObject(scope);
diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h
index 4627eb3..d1a0a0a 100644
--- a/src/declarative/qml/qdeclarativeinstruction_p.h
+++ b/src/declarative/qml/qdeclarativeinstruction_p.h
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
class QDeclarativeCompiledData;
-class Q_DECLARATIVE_EXPORT QDeclarativeInstruction
+class Q_AUTOTEST_EXPORT QDeclarativeInstruction
{
public:
enum Type {
diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp
index 31ef4c2..7c89672 100644
--- a/src/declarative/qml/qdeclarativelist.cpp
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -341,6 +341,8 @@ QML list properties are typesafe - in this case \c {Fruit} is a QObject type tha
\note QDeclarativeListProperty can only be used for lists of QObject-derived object pointers.
+\sa {Object and List Property Types}
+
*/
/*!
diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
index 399831d..d22798d 100644
--- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
Note: the create() method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
- \sa QDeclarativeEngine::setNetworkAccessManagerFactory()
+ \sa QDeclarativeEngine::setNetworkAccessManagerFactory(), {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example}
*/
/*!
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index aca01b2..3af892d 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -797,6 +797,26 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e)
}
}
+int QDeclarativeObjectMethodScriptClass::enumType(const QMetaObject *meta, const QString &strname)
+{
+ QByteArray str = strname.toUtf8();
+ QByteArray scope;
+ QByteArray name;
+ int scopeIdx = str.lastIndexOf("::");
+ if (scopeIdx != -1) {
+ scope = str.left(scopeIdx);
+ name = str.mid(scopeIdx + 2);
+ } else {
+ name = str;
+ }
+ for (int i = meta->enumeratorCount() - 1; i >= 0; --i) {
+ QMetaEnum m = meta->enumerator(i);
+ if ((m.name() == name) && (scope.isEmpty() || (m.scope() == scope)))
+ return QVariant::Int;
+ }
+ return QVariant::Invalid;
+}
+
QDeclarativeObjectMethodScriptClass::Value QDeclarativeObjectMethodScriptClass::call(Object *o, QScriptContext *ctxt)
{
MethodData *method = static_cast<MethodData *>(o);
@@ -810,7 +830,9 @@ QDeclarativeObjectMethodScriptClass::Value QDeclarativeObjectMethodScriptClass::
// ### Cache
for (int ii = 0; ii < argTypeNames.count(); ++ii) {
argTypes[ii] = QMetaType::type(argTypeNames.at(ii));
- if (argTypes[ii] == QVariant::Invalid)
+ if (argTypes[ii] == QVariant::Invalid)
+ argTypes[ii] = enumType(method->object->metaObject(), argTypeNames.at(ii));
+ if (argTypes[ii] == QVariant::Invalid)
return Value(ctxt, ctxt->throwError(QString::fromLatin1("Unknown method parameter type: %1").arg(QLatin1String(argTypeNames.at(ii)))));
}
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
index 4b27e53..75e384c 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
@@ -80,6 +80,8 @@ protected:
virtual Value property(Object *, const Identifier &);
private:
+ int enumType(const QMetaObject *, const QString &);
+
PersistentIdentifier m_connectId;
PersistentIdentifier m_disconnectId;
QScriptValue m_connect;
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
index 2a3417a..764a8db 100644
--- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -107,8 +107,7 @@ QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &na
return 0;
}
- } else {
- Q_ASSERT(data->type);
+ } else if (data->type) {
QString strName = toString(name);
@@ -134,6 +133,7 @@ QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &na
if (!object) return 0;
return ep->objectClass->queryProperty(object, name, flags, 0);
}
+
}
return 0;
diff --git a/src/declarative/qml/qdeclarativeworkerscript_p.h b/src/declarative/qml/qdeclarativeworkerscript_p.h
index dc73811..2b1f9f9 100644
--- a/src/declarative/qml/qdeclarativeworkerscript_p.h
+++ b/src/declarative/qml/qdeclarativeworkerscript_p.h
@@ -87,7 +87,7 @@ private:
QDeclarativeWorkerScriptEnginePrivate *d;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeWorkerScript : public QObject, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativeWorkerScript : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 90e0ca3..047993e 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -94,7 +94,7 @@ public:
Currently only a single Behavior may be specified for a property;
this Behavior can be enabled and disabled via the \l{enabled} property.
- \sa QtDeclarative
+ \sa {declarative/animation/behaviors}{Behavior example}, QtDeclarative
*/
diff --git a/src/declarative/util/qdeclarativebind_p.h b/src/declarative/util/qdeclarativebind_p.h
index f89c2eb..3dc7dba 100644
--- a/src/declarative/util/qdeclarativebind_p.h
+++ b/src/declarative/util/qdeclarativebind_p.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeBindPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeBind : public QObject, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativeBind : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeBind)
diff --git a/src/declarative/util/qdeclarativeconnections_p.h b/src/declarative/util/qdeclarativeconnections_p.h
index a914166..e8105b4 100644
--- a/src/declarative/util/qdeclarativeconnections_p.h
+++ b/src/declarative/util/qdeclarativeconnections_p.h
@@ -58,7 +58,7 @@ QT_MODULE(Declarative)
class QDeclarativeBoundSignal;
class QDeclarativeContext;
class QDeclarativeConnectionsPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeConnections : public QObject, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativeConnections : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeConnections)
diff --git a/src/declarative/util/qdeclarativefontloader_p.h b/src/declarative/util/qdeclarativefontloader_p.h
index 14335ab..6947547 100644
--- a/src/declarative/util/qdeclarativefontloader_p.h
+++ b/src/declarative/util/qdeclarativefontloader_p.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeFontLoaderPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeFontLoader : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeFontLoader : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeFontLoader)
diff --git a/src/declarative/util/qdeclarativelistaccessor_p.h b/src/declarative/util/qdeclarativelistaccessor_p.h
index d8bb8af..41aacb9 100644
--- a/src/declarative/util/qdeclarativelistaccessor_p.h
+++ b/src/declarative/util/qdeclarativelistaccessor_p.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeEngine;
-class Q_DECLARATIVE_EXPORT QDeclarativeListAccessor
+class Q_AUTOTEST_EXPORT QDeclarativeListAccessor
{
public:
QDeclarativeListAccessor();
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 9ed21a6..deb835d 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -551,9 +551,13 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser
QDeclarativeCustomParserNode node =
qvariant_cast<QDeclarativeCustomParserNode>(value);
- if (node.name() != "ListElement") {
- error(node, QDeclarativeListModel::tr("ListElement: cannot contain nested elements"));
- return false;
+ if (node.name() != listElementTypeName) {
+ const QMetaObject *mo = resolveType(node.name());
+ if (mo != &QDeclarativeListElement::staticMetaObject) {
+ error(node, QDeclarativeListModel::tr("ListElement: cannot contain nested elements"));
+ return false;
+ }
+ listElementTypeName = node.name(); // cache right name for next time
}
{
@@ -650,6 +654,7 @@ QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomPa
{
QList<ListInstruction> instr;
QByteArray data;
+ listElementTypeName = QByteArray(); // unknown
for(int ii = 0; ii < customProps.count(); ++ii) {
const QDeclarativeCustomParserProperty &prop = customProps.at(ii);
diff --git a/src/declarative/util/qdeclarativelistmodel_p.h b/src/declarative/util/qdeclarativelistmodel_p.h
index d09062e..6aff9c6 100644
--- a/src/declarative/util/qdeclarativelistmodel_p.h
+++ b/src/declarative/util/qdeclarativelistmodel_p.h
@@ -135,6 +135,8 @@ private:
bool compileProperty(const QDeclarativeCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data);
bool definesEmptyList(const QString &);
+
+ QByteArray listElementTypeName;
};
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 0a14462..0c2f23d 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -220,18 +220,20 @@ bool QDeclarativeImageRequestHandler::event(QEvent *event)
if (reader->cancelled.count()) {
for (int i = 0; i < reader->cancelled.count(); ++i) {
QDeclarativePixmapReply *job = reader->cancelled.at(i);
- // cancel any jobs already started
QNetworkReply *reply = replies.key(job, 0);
if (reply && reply->isRunning()) {
+ // cancel any jobs already started
replies.remove(reply);
reply->close();
- }
- // remove from pending job list
- for (int j = 0; j < reader->jobs.count(); ++j) {
- if (reader->jobs.at(j) == job) {
- reader->jobs.removeAt(j);
- job->release(true);
- break;
+ job->release(true);
+ } else {
+ // remove from pending job list
+ for (int j = 0; j < reader->jobs.count(); ++j) {
+ if (reader->jobs.at(j) == job) {
+ reader->jobs.removeAt(j);
+ job->release(true);
+ break;
+ }
}
}
}
@@ -306,27 +308,27 @@ void QDeclarativeImageRequestHandler::networkRequestDone()
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
QDeclarativePixmapReply *job = replies.take(reply);
- redirectCount++;
- if (redirectCount < IMAGEREQUESTHANDLER_MAX_REDIRECT_RECURSION) {
- QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
- if (redirect.isValid()) {
- QUrl url = reply->url().resolved(redirect.toUrl());
- QNetworkRequest req(url);
- req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
-
- reply->deleteLater();
- reply = networkAccessManager()->get(req);
-
- QMetaObject::connect(reply, replyDownloadProgress, job, downloadProgress);
- QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
-
- replies.insert(reply, job);
- return;
+ if (job) {
+ redirectCount++;
+ if (redirectCount < IMAGEREQUESTHANDLER_MAX_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ QNetworkRequest req(url);
+ req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
+
+ reply->deleteLater();
+ reply = networkAccessManager()->get(req);
+
+ QMetaObject::connect(reply, replyDownloadProgress, job, downloadProgress);
+ QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
+
+ replies.insert(reply, job);
+ return;
+ }
}
- }
- redirectCount=0;
+ redirectCount=0;
- if (job) {
QImage image;
QDeclarativeImageReaderEvent::ReadError error;
QString errorString;
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 8e3ec82..12c6353 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -145,7 +145,7 @@ QT_BEGIN_NAMESPACE
an Item's parent should be done using the associated change elements
(ParentChange and AnchorChanges, respectively).
- \sa {qmlstate}{States}, QtDeclarative
+ \sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtDeclarative
*/
/*!
diff --git a/src/declarative/util/qdeclarativepropertychanges_p.h b/src/declarative/util/qdeclarativepropertychanges_p.h
index c2ed466..8578086 100644
--- a/src/declarative/util/qdeclarativepropertychanges_p.h
+++ b/src/declarative/util/qdeclarativepropertychanges_p.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativePropertyChangesPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativePropertyChanges : public QDeclarativeStateOperation
+class Q_AUTOTEST_EXPORT QDeclarativePropertyChanges : public QDeclarativeStateOperation
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyChanges)
@@ -79,6 +79,9 @@ public:
class QDeclarativePropertyChangesParser : public QDeclarativeCustomParser
{
public:
+ QDeclarativePropertyChangesParser()
+ : QDeclarativeCustomParser(AcceptsAttachedProperties) {}
+
void compileList(QList<QPair<QByteArray, QVariant> > &list, const QByteArray &pre, const QDeclarativeCustomParserProperty &prop);
virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &);
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p.h
index f45d19f..8b51209 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation_p.h
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p.h
@@ -55,7 +55,7 @@ QT_MODULE(Declarative)
class QDeclarativeProperty;
class QDeclarativeSmoothedAnimationPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeSmoothedAnimation : public QDeclarativeNumberAnimation
+class Q_AUTOTEST_EXPORT QDeclarativeSmoothedAnimation : public QDeclarativeNumberAnimation
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeSmoothedAnimation)
diff --git a/src/declarative/util/qdeclarativesmoothedfollow_p.h b/src/declarative/util/qdeclarativesmoothedfollow_p.h
index 6319192..f852311 100644
--- a/src/declarative/util/qdeclarativesmoothedfollow_p.h
+++ b/src/declarative/util/qdeclarativesmoothedfollow_p.h
@@ -55,7 +55,7 @@ QT_MODULE(Declarative)
class QDeclarativeProperty;
class QDeclarativeSmoothedFollowPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeSmoothedFollow : public QObject,
+class Q_AUTOTEST_EXPORT QDeclarativeSmoothedFollow : public QObject,
public QDeclarativePropertyValueSource
{
Q_OBJECT
diff --git a/src/declarative/util/qdeclarativespringfollow_p.h b/src/declarative/util/qdeclarativespringfollow_p.h
index b829c57..b6277c3 100644
--- a/src/declarative/util/qdeclarativespringfollow_p.h
+++ b/src/declarative/util/qdeclarativespringfollow_p.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeSpringFollowPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeSpringFollow : public QObject,
+class Q_AUTOTEST_EXPORT QDeclarativeSpringFollow : public QObject,
public QDeclarativePropertyValueSource
{
Q_OBJECT
diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h
index 05ad052..4f905b6 100644
--- a/src/declarative/util/qdeclarativestateoperations_p.h
+++ b/src/declarative/util/qdeclarativestateoperations_p.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeParentChangePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+class Q_AUTOTEST_EXPORT QDeclarativeParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeParentChange)
@@ -118,7 +118,7 @@ public:
};
class QDeclarativeStateChangeScriptPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeStateChangeScript : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+class Q_AUTOTEST_EXPORT QDeclarativeStateChangeScript : public QDeclarativeStateOperation, public QDeclarativeActionEvent
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeStateChangeScript)
@@ -251,7 +251,7 @@ private:
};
class QDeclarativeAnchorChangesPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+class Q_AUTOTEST_EXPORT QDeclarativeAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeAnchorChanges)
diff --git a/src/declarative/util/qdeclarativestyledtext_p.h b/src/declarative/util/qdeclarativestyledtext_p.h
index 8d2c42d..d80ff9d 100644
--- a/src/declarative/util/qdeclarativestyledtext_p.h
+++ b/src/declarative/util/qdeclarativestyledtext_p.h
@@ -52,7 +52,7 @@ class QString;
class QDeclarativeStyledTextPrivate;
class QTextLayout;
-class Q_DECLARATIVE_EXPORT QDeclarativeStyledText
+class Q_AUTOTEST_EXPORT QDeclarativeStyledText
{
public:
static void parse(const QString &string, QTextLayout &layout);
diff --git a/src/declarative/util/qdeclarativesystempalette_p.h b/src/declarative/util/qdeclarativesystempalette_p.h
index 9fa6b08..4dfbeff 100644
--- a/src/declarative/util/qdeclarativesystempalette_p.h
+++ b/src/declarative/util/qdeclarativesystempalette_p.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeSystemPalettePrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeSystemPalette : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeSystemPalette : public QObject
{
Q_OBJECT
Q_ENUMS(ColorGroup)
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
index 9e18eb5..576995f 100644
--- a/src/declarative/util/qdeclarativetimer.cpp
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -103,6 +103,8 @@ public:
1000ms has its \e repeat property changed 500ms after starting, the
elapsed time will be reset to 0, and the Timer will be triggered
1000ms later.
+
+ \sa {declarative/toys/clocks}{Clocks example}
*/
QDeclarativeTimer::QDeclarativeTimer(QObject *parent)
diff --git a/src/declarative/util/qdeclarativetimer_p.h b/src/declarative/util/qdeclarativetimer_p.h
index 08c3d4e..93b0965 100644
--- a/src/declarative/util/qdeclarativetimer_p.h
+++ b/src/declarative/util/qdeclarativetimer_p.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeTimerPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeTimer : public QObject, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativeTimer : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeTimer)
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index ab8b116..38ed97e 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
\since 4.7
\brief The Transition element defines animated transitions that occur on state changes.
- \sa {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative}
+ \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative}
*/
/*!
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index bfd25be..0692aaa 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -588,6 +588,8 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
If multiple key roles are specified, the model only adds and reload items
with a combined value of all key roles that is not already present in
the model.
+
+ \sa {declarative/rssnews}{RSS News demo}
*/
QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
diff --git a/src/declarative/util/qdeclarativexmllistmodel_p.h b/src/declarative/util/qdeclarativexmllistmodel_p.h
index 8d848c8..832847e 100644
--- a/src/declarative/util/qdeclarativexmllistmodel_p.h
+++ b/src/declarative/util/qdeclarativexmllistmodel_p.h
@@ -70,7 +70,7 @@ struct QDeclarativeXmlQueryResult {
QStringList keyRoleResultsCache;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeXmlListModel : public QListModelInterface, public QDeclarativeParserStatus
+class Q_AUTOTEST_EXPORT QDeclarativeXmlListModel : public QListModelInterface, public QDeclarativeParserStatus
{
Q_OBJECT
Q_INTERFACES(QDeclarativeParserStatus)
@@ -149,7 +149,7 @@ private:
Q_DISABLE_COPY(QDeclarativeXmlListModel)
};
-class Q_DECLARATIVE_EXPORT QDeclarativeXmlListModelRole : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativeXmlListModelRole : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm
index 1688404..ada927e 100644
--- a/src/gui/accessible/qaccessible_mac_cocoa.mm
+++ b/src/gui/accessible/qaccessible_mac_cocoa.mm
@@ -58,11 +58,15 @@ QT_BEGIN_NAMESPACE
//#define MAC_ACCESSIBILTY_DEVELOPER_MODE
+#ifndef QT_NO_DEBUG_STREAM
#ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
#define MAC_ACCESSIBILTY_DEBUG QT_PREPEND_NAMESPACE(qDebug)
#else
#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(qDebug)
#endif
+#else
+#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(QNoDebug)
+#endif
typedef QMap<QAccessible::Role, NSString *> QMacAccessibiltyRoleMap;
Q_GLOBAL_STATIC(QMacAccessibiltyRoleMap, qMacAccessibiltyRoleMap);
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 969acc4..fea6e8d 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -415,7 +415,10 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg
// At this point, the widget's window should be created and have the correct visual. Now we
// just need to create the EGL surface for it:
- return eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+ EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+ if (surf == EGL_NO_SURFACE)
+ qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
+ return surf;
}
if (x11PixmapData) {
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2de3638..8a419b4 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7312,10 +7312,13 @@ void QGraphicsItem::updateMicroFocus()
{
#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
if (QWidget *fw = QApplication::focusWidget()) {
- for (int i = 0 ; i < scene()->views().count() ; ++i)
- if (scene()->views().at(i) == fw)
- if (QInputContext *inputContext = fw->inputContext())
- inputContext->update();
+ if (scene()) {
+ for (int i = 0 ; i < scene()->views().count() ; ++i) {
+ if (scene()->views().at(i) == fw)
+ if (QInputContext *inputContext = fw->inputContext())
+ inputContext->update();
+ }
+ }
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ca3b56f..e5264da 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -885,8 +885,7 @@ void QGraphicsScenePrivate::removePopup(QGraphicsWidget *widget, bool itemIsDyin
ungrabKeyboard(static_cast<QGraphicsItem *>(widget), itemIsDying);
}
if (!itemIsDying && widget->isVisible()) {
- widget->hide();
- widget->QGraphicsItem::d_ptr->explicitlyHidden = 0;
+ widget->QGraphicsItem::d_ptr->setVisibleHelper(false, /* explicit = */ false);
}
}
}
@@ -4163,6 +4162,25 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
wheelEvent->scenePos(),
wheelEvent->widget());
+#ifdef Q_WS_MAC
+ // On Mac, ignore the event if the first item under the mouse is not the last opened
+ // popup (or one of its descendant)
+ if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) {
+ wheelEvent->accept();
+ return;
+ }
+#else
+ // Find the first popup under the mouse (including the popup's descendants) starting from the last.
+ // Remove all popups after the one found, or all or them if no popup is under the mouse.
+ // Then continue with the event.
+ QList<QGraphicsWidget *>::const_iterator iter = d->popupWidgets.end();
+ while (--iter >= d->popupWidgets.begin() && !wheelCandidates.isEmpty()) {
+ if (wheelCandidates.first() == *iter || (*iter)->isAncestorOf(wheelCandidates.first()))
+ break;
+ d->removePopup(*iter);
+ }
+#endif
+
bool hasSetFocus = false;
foreach (QGraphicsItem *item, wheelCandidates) {
if (!hasSetFocus && item->isEnabled()
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index c4eac95..f5f1bc0 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -63,7 +63,7 @@ embedded {
}
x11 {
HEADERS += image/qpixmap_x11_p.h
- SOURCES += image/qpixmap_x11.cpp
+ SOURCES += image/qpixmap_x11.cpp
}
mac {
HEADERS += image/qpixmap_mac_p.h
@@ -96,7 +96,7 @@ SOURCES += \
unix|win32-g++*:LIBS_PRIVATE += -lpng
win32:!win32-g++*:LIBS += libpng.lib
} else {
- DEFINES *= QT_USE_BUNDLED_LIBPNG
+ DEFINES *= QT_USE_BUNDLED_LIBPNG
!isEqual(QT_ARCH, i386):!isEqual(QT_ARCH, x86_64):DEFINES += PNG_NO_ASSEMBLER_CODE
INCLUDEPATH += ../3rdparty/libpng
SOURCES += ../3rdparty/libpng/png.c \
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 93d5cd3..af43e90 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -301,7 +301,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (!handler && !testFormat.isEmpty()) {
if (false) {
#ifndef QT_NO_IMAGEFORMAT_PNG
- } else if (testFormat == "png") {
+ } else if (testFormat == "png") {
handler = new QPngHandler;
#endif
#ifndef QT_NO_IMAGEFORMAT_BMP
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 2a85fdc..ef719ca 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3065,6 +3065,11 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
break;
}
}
+#ifndef Q_OS_WINCE
+ static bool trackMouseEventLookup = false;
+ typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
+ static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
+#endif
state = translateButtonState(msg.wParam, type, button); // button state
const QPoint widgetPos = mapFromGlobal(QPoint(msg.pt.x, msg.pt.y));
QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
@@ -3129,9 +3134,6 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
#ifndef Q_OS_WINCE
if (curWin != 0) {
- static bool trackMouseEventLookup = false;
- typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
- static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
if (!trackMouseEventLookup) {
trackMouseEventLookup = true;
ptrTrackMouseEvent = (PtrTrackMouseEvent)QLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
@@ -3245,6 +3247,21 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
qt_button_down = 0;
}
+#ifndef Q_OS_WINCE
+ if (type == QEvent::MouseButtonPress
+ && QApplication::activePopupWidget() != activePopupWidget
+ && ptrTrackMouseEvent
+ && curWin) {
+ // Since curWin is already the window we clicked on,
+ // we have to setup the mouse tracking here.
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = 0x00000002; // TME_LEAVE
+ tme.hwndTrack = curWin; // Track on window receiving msgs
+ tme.dwHoverTime = (DWORD)-1; // HOVER_DEFAULT
+ ptrTrackMouseEvent(&tme);
+ }
+#endif
if (type == QEvent::MouseButtonPress
&& QApplication::activePopupWidget() != activePopupWidget
&& replayPopupMouseEvent) {
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 873b8f9..3dc6afc 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -866,14 +866,27 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
UInt32 macModifiers = 0;
GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, 0,
sizeof(macModifiers), 0, &macModifiers);
+#ifdef QT_MAC_USE_COCOA
+ // The unicode characters in the range 0xF700-0xF747 are reserved
+ // by Mac OS X for transient use as keyboard function keys. We
+ // wont send 'text' for such key events. This is done to match
+ // behavior on other platforms.
+ unsigned int *unicodeKey = (unsigned int*)info;
+ if (*unicodeKey >= 0xf700 && *unicodeKey <= 0xf747)
+ text = QString();
+ bool isAccepted;
+#endif
handled_event = QKeyMapper::sendKeyEvent(widget, grab,
(ekind == kEventRawKeyUp) ? QEvent::KeyRelease : QEvent::KeyPress,
qtKey, modifiers, text, ekind == kEventRawKeyRepeat, 0,
macScanCode, macVirtualKey, macModifiers
#ifdef QT_MAC_USE_COCOA
- ,static_cast<bool *>(info)
+ ,&isAccepted
#endif
);
+#ifdef QT_MAC_USE_COCOA
+ *unicodeKey = (unsigned int)isAccepted;
+#endif
}
return handled_event;
}
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 8cef03c..3fc27f4 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -682,10 +682,12 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
NSEvent *event = static_cast<NSEvent *>(keyEvent);
EventRef key_event = static_cast<EventRef>(const_cast<void *>([event eventRef]));
Q_ASSERT(key_event);
+ unsigned int info = 0;
if ([event type] == NSKeyDown) {
NSString *characters = [event characters];
unichar value = [characters characterAtIndex:0];
qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value);
+ info = value;
}
// Redirect keys to alien widgets.
@@ -701,9 +703,8 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
if (mustUseCocoaKeyEvent())
return qt_dispatchKeyEventWithCocoa(keyEvent, widgetToGetEvent);
- bool isAccepted;
- bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &isAccepted, true);
- return consumed && isAccepted;
+ bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &info, true);
+ return consumed && (info != 0);
#endif
}
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 280712a..e57ec77 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2804,7 +2804,7 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
QList<QWidget *> widgets = q->findChildren<QWidget *>();
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
- if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created)) {
+ if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
if (set)
[qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove];
else
@@ -2861,9 +2861,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
}
if (wasWindow) {
oldToolbar = [oldWindow toolbar];
- [oldToolbar retain];
- oldToolbarVisible = [oldToolbar isVisible];
- [oldWindow setToolbar:nil];
+ if (oldToolbar) {
+ [oldToolbar retain];
+ oldToolbarVisible = [oldToolbar isVisible];
+ [oldWindow setToolbar:nil];
+ }
}
#endif
}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 68f9470..3f351d9 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -738,9 +738,6 @@ void QWidgetPrivate::s60UpdateIsOpaque()
if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
return;
- if ((data.window_flags & Qt::FramelessWindowHint) == 0)
- return;
-
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 9c65aa0..0f05c6b 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -1167,7 +1167,7 @@ void QWidgetPrivate::show_sys()
// This is to resolve the problem where popups are opened from the
// system tray and not being implicitly activated
if (q->windowType() == Qt::Popup &&
- (!q->parentWidget() || !q->parentWidget()->isActiveWindow()))
+ !q->parentWidget() && !qApp->activeWindow())
q->activateWindow();
}
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 4bb2ea8..2527662 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -50,17 +50,17 @@
#include "qapplication.h"
#include <w32std.h>
-#include <aknsconstants.h>
+#include <AknsConstants.h>
#include <aknconsts.h>
-#include <aknsitemid.h>
-#include <aknsutils.h>
-#include <aknsdrawutils.h>
-#include <aknsskininstance.h>
-#include <aknsbasicbackgroundcontrolcontext.h>
+#include <AknsItemID.h>
+#include <AknsUtils.h>
+#include <AknsDrawUtils.h>
+#include <AknsSkinInstance.h>
+#include <AknsBasicBackgroundControlContext.h>
#include <avkon.mbg>
#include <aknfontaccess.h>
#include <aknlayoutfont.h>
-#include <aknutils.h>
+#include <AknUtils.h>
#include <aknnavi.h>
#include <gulicon.h>
#include <aknbitmapanimation.h>
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 5148568..0b38aab 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -162,6 +162,8 @@ void qt_cleanup_symbianFontDatabaseExtras()
{
const QSymbianFontDatabaseExtrasImplementation *dbExtras =
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(privateDb()->symbianExtras);
+ if (!dbExtras)
+ return; // initializeDb() has never been called
#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
qDeleteAll(dbExtras->m_extrasHash);
#else // Q_SYMBIAN_HAS_FONTTABLE_API
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 1504066..dcc328f 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -704,6 +704,11 @@ void QComboBoxPrivateContainer::hideEvent(QHideEvent *)
{
emit resetButton();
combo->update();
+ // QGraphicsScenePrivate::removePopup closes the combo box popup, it hides it non-explicitly.
+ // Hiding/showing the QComboBox after this will unexpectedly show the popup as well.
+ // Re-hiding the popup container makes sure it is explicitly hidden.
+ if (QGraphicsProxyWidget *proxy = graphicsProxyWidget())
+ proxy->hide();
}
void QComboBoxPrivateContainer::mousePressEvent(QMouseEvent *e)
diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp
index e8fe299..d3b5869 100644
--- a/src/gui/widgets/qcommandlinkbutton.cpp
+++ b/src/gui/widgets/qcommandlinkbutton.cpp
@@ -118,7 +118,7 @@ public:
int topMargin() const { return 10; }
int leftMargin() const { return 7; }
int rightMargin() const { return 4; }
- int bottomMargin() const { return 4; }
+ int bottomMargin() const { return 10; }
QString description;
QColor currentColor;
@@ -174,8 +174,15 @@ QFont QCommandLinkButtonPrivate::descriptionFont() const
QRect QCommandLinkButtonPrivate::titleRect() const
{
Q_Q(const QCommandLinkButton);
- return q->rect().adjusted(textOffset(), topMargin(),
- -rightMargin(), 0);
+ QRect r = q->rect().adjusted(textOffset(), topMargin(), -rightMargin(), 0);
+ if (description.isEmpty())
+ {
+ QFontMetrics fm(titleFont());
+ r.setTop(r.top() + qMax(0, (q->icon().actualSize(q->iconSize()).height()
+ - fm.height()) / 2));
+ }
+
+ return r;
}
QRect QCommandLinkButtonPrivate::descriptionRect() const
@@ -254,7 +261,7 @@ QSize QCommandLinkButton::minimumSizeHint() const
Q_D(const QCommandLinkButton);
QSize size = sizeHint();
int minimumHeight = qMax(d->descriptionOffset() + d->bottomMargin(),
- iconSize().height() + d->topMargin());
+ icon().actualSize(iconSize()).height() + d->topMargin());
size.setHeight(minimumHeight);
return size;
}
@@ -328,7 +335,8 @@ int QCommandLinkButton::heightForWidth(int width) const
int heightWithoutDescription = d->descriptionOffset() + d->bottomMargin();
// find the width available for the description area
return qMax(heightWithoutDescription + d->descriptionHeight(width),
- iconSize().height() + d->topMargin() + d->bottomMargin());
+ icon().actualSize(iconSize()).height() + d->topMargin() +
+ d->bottomMargin());
}
/*! \reimp */
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 22be2f1..e5647bd 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -130,7 +130,7 @@ public:
GestureArea is an invisible item: it is never painted.
- \sa Gesture, MouseArea
+ \sa Gesture, MouseArea, {declarative/touchinteraction/gestures}{Gestures example}
*/
/*!
diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp
index 14fee8b..4e17b52 100644
--- a/src/multimedia/audio/qaudio_mac.cpp
+++ b/src/multimedia/audio/qaudio_mac.cpp
@@ -68,11 +68,11 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf)
audioFormat.setChannels(sf.mChannelsPerFrame);
audioFormat.setSampleSize(sf.mBitsPerChannel);
audioFormat.setCodec(QString::fromLatin1("audio/pcm"));
- audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
+ audioFormat.setByteOrder((sf.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
QAudioFormat::SampleType type = QAudioFormat::UnSignedInt;
- if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0)
+ if ((sf.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0)
type = QAudioFormat::SignedInt;
- else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0)
+ else if ((sf.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
type = QAudioFormat::Float;
audioFormat.setSampleType(type);
@@ -99,6 +99,9 @@ AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au
case QAudioFormat::Unknown: default: break;
}
+ if (audioFormat.byteOrder() == QAudioFormat::BigEndian)
+ sf.mFormatFlags |= kAudioFormatFlagIsBigEndian;
+
return sf;
}
diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp
index b99fe11..5897e75 100644
--- a/src/multimedia/audio/qaudioinput_mac_p.cpp
+++ b/src/multimedia/audio/qaudioinput_mac_p.cpp
@@ -210,6 +210,11 @@ public:
return true;
}
+ bool empty() const
+ {
+ return position == totalPackets;
+ }
+
private:
UInt32 totalPackets;
UInt32 position;
@@ -275,36 +280,32 @@ public:
if (m_audioConverter != 0) {
QAudioPacketFeeder feeder(m_inputBufferList);
- bool wecan = true;
int copied = 0;
-
const int available = m_buffer->free();
- while (err == noErr && wecan) {
+ while (err == noErr && !feeder.empty()) {
QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available);
- if (region.second > 0) {
- AudioBufferList output;
- output.mNumberBuffers = 1;
- output.mBuffers[0].mNumberChannels = 1;
- output.mBuffers[0].mDataByteSize = region.second;
- output.mBuffers[0].mData = region.first;
-
- UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket;
- err = AudioConverterFillComplexBuffer(m_audioConverter,
- converterCallback,
- &feeder,
- &packetSize,
- &output,
- 0);
-
- region.second = output.mBuffers[0].mDataByteSize;
- copied += region.second;
+ if (region.second == 0)
+ break;
+
+ AudioBufferList output;
+ output.mNumberBuffers = 1;
+ output.mBuffers[0].mNumberChannels = 1;
+ output.mBuffers[0].mDataByteSize = region.second;
+ output.mBuffers[0].mData = region.first;
+
+ UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket;
+ err = AudioConverterFillComplexBuffer(m_audioConverter,
+ converterCallback,
+ &feeder,
+ &packetSize,
+ &output,
+ 0);
+ region.second = output.mBuffers[0].mDataByteSize;
+ copied += region.second;
- m_buffer->releaseWriteRegion(region);
- }
- else
- wecan = false;
+ m_buffer->releaseWriteRegion(region);
}
framesRendered += copied / m_outputFormat.mBytesPerFrame;
diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp
index 9689101..cc52d90 100644
--- a/src/multimedia/audio/qaudiooutput_mac_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp
@@ -358,17 +358,7 @@ bool QAudioOutputPrivate::open()
// Set stream format
streamFormat = toAudioStreamBasicDescription(audioFormat);
- UInt32 size = sizeof(deviceFormat);
- if (AudioUnitGetProperty(audioUnit,
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- 0,
- &deviceFormat,
- &size) != noErr) {
- qWarning() << "QAudioOutput: Unable to retrieve device format";
- return false;
- }
-
+ UInt32 size = sizeof(streamFormat);
if (AudioUnitSetProperty(audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
@@ -392,8 +382,7 @@ bool QAudioOutputPrivate::open()
return false;
}
- periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) *
- streamFormat.mBytesPerFrame;
+ periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame;
if (internalBufferSize < periodSizeBytes * 2)
internalBufferSize = periodSizeBytes * 2;
else
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 90751f4..3112dd6 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -210,12 +210,23 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
#ifdef Q_ADDRCONFIG
hints.ai_flags = Q_ADDRCONFIG;
#endif
+#ifdef Q_OS_SYMBIAN
+# ifdef QHOSTINFO_DEBUG
+ qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+# endif
+#endif
int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
# ifdef Q_ADDRCONFIG
if (result == EAI_BADFLAGS) {
// if the lookup failed with AI_ADDRCONFIG set, try again without it
hints.ai_flags = 0;
+#ifdef Q_OS_SYMBIAN
+# ifdef QHOSTINFO_DEBUG
+ qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+# endif
+ hints.ai_flags &= AI_V4MAPPED | AI_ALL;
+#endif
result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
}
# endif
@@ -224,6 +235,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
addrinfo *node = res;
QList<QHostAddress> addresses;
while (node) {
+#ifdef QHOSTINFO_DEBUG
+ qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
+#endif
if (node->ai_family == AF_INET) {
QHostAddress addr;
addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index a8c602a..f85fa84 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1556,7 +1556,7 @@ QList<QSslError> QSslSocket::sslErrors() const
*/
bool QSslSocket::supportsSsl()
{
- return QSslSocketPrivate::ensureInitialized();
+ return QSslSocketPrivate::supportsSsl();
}
/*!
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 36a0cc7..30428ff 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -72,6 +72,9 @@
QT_BEGIN_NAMESPACE
+bool QSslSocketPrivate::s_libraryLoaded = false;
+bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+
// Useful defines
#define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
@@ -296,8 +299,20 @@ init_context:
}
// Add all our CAs to this store.
- foreach (const QSslCertificate &caCertificate, q->caCertificates())
+ QList<QSslCertificate> expiredCerts;
+ foreach (const QSslCertificate &caCertificate, q->caCertificates()) {
+ // add expired certs later, so that the
+ // valid ones are used before the expired ones
+ if (! caCertificate.isValid()) {
+ expiredCerts.append(caCertificate);
+ } else {
+ q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
+ }
+ }
+ // now add the expired certs
+ foreach (const QSslCertificate &caCertificate, expiredCerts) {
q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
+ }
// Register a custom callback to get all verification errors.
X509_STORE_set_verify_cb_func(ctx->cert_store, q_X509Callback);
@@ -398,19 +413,24 @@ void QSslSocketPrivate::deinitialize()
/*!
\internal
- Declared static in QSslSocketPrivate, makes sure the SSL libraries have
- been initialized.
+ Does the minimum amount of initialization to determine whether SSL
+ is supported or not.
*/
-bool QSslSocketPrivate::ensureInitialized()
+
+bool QSslSocketPrivate::supportsSsl()
+{
+ return ensureLibraryLoaded();
+}
+
+bool QSslSocketPrivate::ensureLibraryLoaded()
{
if (!q_resolveOpenSslSymbols())
return false;
// Check if the library itself needs to be initialized.
QMutexLocker locker(openssl_locks()->initLock());
- static int q_initialized = false;
- if (!q_initialized) {
- q_initialized = true;
+ if (!s_libraryLoaded) {
+ s_libraryLoaded = true;
// Initialize OpenSSL.
q_CRYPTO_set_id_callback(id_function);
@@ -447,10 +467,33 @@ bool QSslSocketPrivate::ensureInitialized()
if (!attempts)
return false;
}
-
- resetDefaultCiphers();
- setDefaultCaCertificates(systemCaCertificates());
}
+ return true;
+}
+
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+ 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)
@@ -481,7 +524,6 @@ bool QSslSocketPrivate::ensureInitialized()
qWarning("could not load crypt32 library"); // should never happen
}
#endif
- return true;
}
/*!
@@ -567,24 +609,24 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
if(!pc)
break;
QByteArray der((const char *)(pc->pbCertEncoded), static_cast<int>(pc->cbCertEncoded));
- QSslCertificate cert(der,QSsl::Der);
+ QSslCertificate cert(der, QSsl::Der);
systemCerts.append(cert);
}
ptrCertCloseStore(hSystemStore, 0);
}
}
#elif defined(Q_OS_AIX)
- systemCerts.append(QSslCertificate::fromPath("/var/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/var/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_SOLARIS)
- systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_HPUX)
- systemCerts.append(QSslCertificate::fromPath("/opt/openssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/opt/openssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
#elif defined(Q_OS_LINUX)
- systemCerts.append(QSslCertificate::fromPath("/etc/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
- systemCerts.append(QSslCertificate::fromPath("/etc/pki/tls/certs/ca-bundle.crt", QSsl::Pem)); // Fedora
- systemCerts.append(QSslCertificate::fromPath("/usr/lib/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
- systemCerts.append(QSslCertificate::fromPath("/usr/share/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
- systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/lib/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/share/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
#endif
return systemCerts;
}
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 42ae98f..09775bc 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
#elif defined(Q_OS_WIN)
-#include <Wincrypt.h>
+#include <wincrypt.h>
#ifndef HCRYPTPROV_LEGACY
#define HCRYPTPROV_LEGACY HCRYPTPROV
#endif
@@ -108,7 +108,8 @@ public:
// that was used for connecting to.
QString verificationPeerName;
- static bool ensureInitialized();
+ static bool supportsSsl();
+ static void ensureInitialized();
static void deinitialize();
static QList<QSslCipher> defaultCiphers();
static QList<QSslCipher> supportedCiphers();
@@ -154,6 +155,13 @@ public:
virtual void disconnectFromHost() = 0;
virtual void disconnected() = 0;
virtual QSslCipher sessionCipher() const = 0;
+
+private:
+ static bool ensureLibraryLoaded();
+ static void ensureCiphersAndCertsLoaded();
+
+ static bool s_libraryLoaded;
+ static bool s_loadedCiphersAndCerts;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b4c85ac..9effb34 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1521,6 +1521,32 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
&& a.d->profile == b.d->profile);
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QGLFormat &f)
+{
+ const QGLFormatPrivate * const d = f.d;
+
+ dbg.nospace() << "QGLFormat("
+ << "options " << d->opts
+ << ", plane " << d->pln
+ << ", depthBufferSize " << d->depthSize
+ << ", accumBufferSize " << d->accumSize
+ << ", stencilBufferSize " << d->stencilSize
+ << ", redBufferSize " << d->redSize
+ << ", greenBufferSize " << d->greenSize
+ << ", blueBufferSize " << d->blueSize
+ << ", alphaBufferSize " << d->alphaSize
+ << ", samples " << d->numSamples
+ << ", swapInterval " << d->swapInterval
+ << ", majorVersion " << d->majorVersion
+ << ", minorVersion " << d->minorVersion
+ << ", profile " << d->profile
+ << ')';
+
+ return dbg.space();
+}
+#endif
+
/*!
Returns false if all the options of the two QGLFormat objects
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index f0b36f7..f85cad5 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -281,6 +281,9 @@ private:
friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
@@ -288,6 +291,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
+#ifndef QT_NO_DEBUG_STREAM
+Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
+
class Q_OPENGL_EXPORT QGLContext
{
Q_DECLARE_PRIVATE(QGLContext)
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 1727a41..cd5dbbe 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -86,7 +86,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
QT_END_INCLUDE_NAMESPACE
# ifdef old_qDebug
# undef qDebug
-# define qDebug QT_QDEBUG_MACRO
+# define qDebug QT_NO_QDEBUG_MACRO
# undef old_qDebug
# endif
class QMacWindowChangeEvent;
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index a6acce0..e375b4f 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -879,9 +879,28 @@ void QNetworkSessionPrivateImpl::close()
lastError = QNetworkSession::OperationNotSupportedError;
emit QNetworkSessionPrivate::error(lastError);
} else if (isOpen) {
- opened = false;
- isOpen = false;
- emit closed();
+ if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+ // We will not wait any disconnect from icd as it might never come
+ Maemo::Icd icd;
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug() << "closing session" << publicConfig.identifier();
+#endif
+ state = QNetworkSession::Closing;
+ emit stateChanged(state);
+
+ opened = false;
+ isOpen = false;
+
+ // we fake a disconnection, session error is not sent
+ updateState(QNetworkSession::Disconnected);
+
+ icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ startTime = QDateTime();
+ } else {
+ opened = false;
+ isOpen = false;
+ emit closed();
+ }
}
}
@@ -896,33 +915,25 @@ void QNetworkSessionPrivateImpl::stop()
emit QNetworkSessionPrivate::error(lastError);
} else {
if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- if (!m_stopTimer.isActive()) {
- Maemo::Icd icd;
+ Maemo::Icd icd;
#ifdef BEARER_MANAGEMENT_DEBUG
- qDebug() << "stopping session" << publicConfig.identifier();
+ qDebug() << "stopping session" << publicConfig.identifier();
#endif
- state = QNetworkSession::Closing;
- emit stateChanged(state);
-
- opened = false;
- isOpen = false;
+ state = QNetworkSession::Closing;
+ emit stateChanged(state);
- icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
- startTime = QDateTime();
+ // we fake a disconnection, a session error is sent also
+ updateState(QNetworkSession::Disconnected);
- /* Note: Session state will change to disconnected
- * as soon as QNetworkConfigurationManager sends
- * corresponding iapStateChanged signal.
- */
+ opened = false;
+ isOpen = false;
- // Make sure that this Session will send closed signal
- // even though ICD connection will not ever get closed
- m_stopTimer.start(ICD_SHORT_CONNECT_TIMEOUT); // 10 seconds wait
- }
+ icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+ startTime = QDateTime();
} else {
opened = false;
isOpen = false;
- emit closed();
+ emit closed();
}
}
}
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index b6e11df..f89ed0a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1303,7 +1303,8 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
#ifdef OCC_FUNCTIONALITY_AVAILABLE
// If the retVal is not true here, it means that the status update may apply to an IAP outside of
// SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
- if (retVal == false && activeConfig.d.data() && activeConfig.d.data()->numericId == accessPointId) {
+ if (retVal == false && activeConfig.isValid() &&
+ toSymbianConfig(privateConfiguration(activeConfig))->numericIdentifier() == accessPointId) {
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed G to: " << state;
#endif
@@ -1311,7 +1312,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
activeConfig = QNetworkConfiguration();
}
state = newState;
- emit q->stateChanged(state);
+ emit stateChanged(state);
retVal = true;
}
#endif
diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp
index 3f2eec7..e10c8b1 100644
--- a/src/plugins/codecs/cn/qgb18030codec.cpp
+++ b/src/plugins/codecs/cn/qgb18030codec.cpp
@@ -319,7 +319,7 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
{
uchar buf[2];
int nbuf = 0;
- QChar replacement = QChar::ReplacementCharacter;
+ ushort replacement = QChar::ReplacementCharacter;
if (state) {
if (state->flags & ConvertInvalidToNull)
replacement = QChar::Null;
@@ -330,6 +330,9 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
int invalid = 0;
QString result;
+ result.resize(len);
+ int unicodeLen = 0;
+ ushort *const resultData = reinterpret_cast<ushort*>(result.data());
//qDebug("QGbkDecoder::toUnicode(const char* chars = \"%s\", int len = %d)", chars, len);
for (int i=0; i<len; i++) {
@@ -338,14 +341,16 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
case 0:
if (ch < 0x80) {
// ASCII
- result += QLatin1Char(ch);
+ resultData[unicodeLen] = ch;
+ ++unicodeLen;
} else if (Is1stByte(ch)) {
// GBK 1st byte?
buf[0] = ch;
nbuf = 1;
} else {
// Invalid
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
break;
@@ -356,21 +361,25 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
int clen = 2;
uint u = qt_Gb18030ToUnicode(buf, clen);
if (clen == 2) {
- result += qValidChar(u);
+ resultData[unicodeLen] = qValidChar(static_cast<ushort>(u));
+ ++unicodeLen;
} else {
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
nbuf = 0;
} else {
// Error
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
nbuf = 0;
}
break;
}
}
+ result.resize(unicodeLen);
if (state) {
state->remainingChars = nbuf;
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index 0b5d389..d4b0fef 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro
+++ b/src/plugins/imageformats/jpeg/jpeg.pro
@@ -7,10 +7,10 @@ HEADERS += qjpeghandler.h
SOURCES += main.cpp \
qjpeghandler.cpp
-wince*: {
- DEFINES += NO_GETENV
- contains(CE_ARCH,x86):CONFIG -= stl exceptions
- contains(CE_ARCH,x86):CONFIG += exceptions_off
+wince*: {
+ DEFINES += NO_GETENV
+ contains(CE_ARCH,x86):CONFIG -= stl exceptions
+ contains(CE_ARCH,x86):CONFIG += exceptions_off
}
#Disable warnings in 3rdparty code due to unused arguments
@@ -18,7 +18,7 @@ symbian: {
QMAKE_CXXFLAGS.CW += -W nounusedarg
TARGET.UID3=0x2001E61B
} else:contains(QMAKE_CC, gcc): {
- QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main
+ QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main
}
contains(QT_CONFIG, system-jpeg) {
diff --git a/src/plugins/imageformats/mng/mng.pro b/src/plugins/imageformats/mng/mng.pro
index c188b47..158f41a 100644
--- a/src/plugins/imageformats/mng/mng.pro
+++ b/src/plugins/imageformats/mng/mng.pro
@@ -17,29 +17,29 @@ contains(QT_CONFIG, system-mng) {
unix|win32-g++*:LIBS += -lmng
win32:!win32-g++*:LIBS += libmng.lib
} else {
- DEFINES += MNG_BUILD_SO
- DEFINES += MNG_NO_INCLUDE_JNG
- INCLUDEPATH += ../../../3rdparty/libmng
- SOURCES += \
- ../../../3rdparty/libmng/libmng_callback_xs.c \
- ../../../3rdparty/libmng/libmng_chunk_io.c \
- ../../../3rdparty/libmng/libmng_chunk_descr.c \
- ../../../3rdparty/libmng/libmng_chunk_prc.c \
- ../../../3rdparty/libmng/libmng_chunk_xs.c \
- ../../../3rdparty/libmng/libmng_cms.c \
- ../../../3rdparty/libmng/libmng_display.c \
- ../../../3rdparty/libmng/libmng_dither.c \
- ../../../3rdparty/libmng/libmng_error.c \
- ../../../3rdparty/libmng/libmng_filter.c \
- ../../../3rdparty/libmng/libmng_hlapi.c \
- ../../../3rdparty/libmng/libmng_jpeg.c \
- ../../../3rdparty/libmng/libmng_object_prc.c \
- ../../../3rdparty/libmng/libmng_pixels.c \
- ../../../3rdparty/libmng/libmng_prop_xs.c \
- ../../../3rdparty/libmng/libmng_read.c \
- ../../../3rdparty/libmng/libmng_trace.c \
- ../../../3rdparty/libmng/libmng_write.c \
- ../../../3rdparty/libmng/libmng_zlib.c
+ DEFINES += MNG_BUILD_SO
+ DEFINES += MNG_NO_INCLUDE_JNG
+ INCLUDEPATH += ../../../3rdparty/libmng
+ SOURCES += \
+ ../../../3rdparty/libmng/libmng_callback_xs.c \
+ ../../../3rdparty/libmng/libmng_chunk_io.c \
+ ../../../3rdparty/libmng/libmng_chunk_descr.c \
+ ../../../3rdparty/libmng/libmng_chunk_prc.c \
+ ../../../3rdparty/libmng/libmng_chunk_xs.c \
+ ../../../3rdparty/libmng/libmng_cms.c \
+ ../../../3rdparty/libmng/libmng_display.c \
+ ../../../3rdparty/libmng/libmng_dither.c \
+ ../../../3rdparty/libmng/libmng_error.c \
+ ../../../3rdparty/libmng/libmng_filter.c \
+ ../../../3rdparty/libmng/libmng_hlapi.c \
+ ../../../3rdparty/libmng/libmng_jpeg.c \
+ ../../../3rdparty/libmng/libmng_object_prc.c \
+ ../../../3rdparty/libmng/libmng_pixels.c \
+ ../../../3rdparty/libmng/libmng_prop_xs.c \
+ ../../../3rdparty/libmng/libmng_read.c \
+ ../../../3rdparty/libmng/libmng_trace.c \
+ ../../../3rdparty/libmng/libmng_write.c \
+ ../../../3rdparty/libmng/libmng_zlib.c
}
contains(QT_CONFIG, system-zlib) {
diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro
index 90868e8..08e471c 100644
--- a/src/plugins/imageformats/tiff/tiff.pro
+++ b/src/plugins/imageformats/tiff/tiff.pro
@@ -16,55 +16,55 @@ contains(QT_CONFIG, system-tiff) {
win32:!win32-g++*:LIBS += libjpeg.lib
}
} else {
- INCLUDEPATH += ../../../3rdparty/libtiff/libtiff
- SOURCES += \
- ../../../3rdparty/libtiff/libtiff/tif_aux.c \
- ../../../3rdparty/libtiff/libtiff/tif_close.c \
- ../../../3rdparty/libtiff/libtiff/tif_codec.c \
- ../../../3rdparty/libtiff/libtiff/tif_color.c \
- ../../../3rdparty/libtiff/libtiff/tif_compress.c \
- ../../../3rdparty/libtiff/libtiff/tif_dir.c \
- ../../../3rdparty/libtiff/libtiff/tif_dirinfo.c \
- ../../../3rdparty/libtiff/libtiff/tif_dirread.c \
- ../../../3rdparty/libtiff/libtiff/tif_dirwrite.c \
- ../../../3rdparty/libtiff/libtiff/tif_dumpmode.c \
- ../../../3rdparty/libtiff/libtiff/tif_error.c \
- ../../../3rdparty/libtiff/libtiff/tif_extension.c \
- ../../../3rdparty/libtiff/libtiff/tif_fax3.c \
- ../../../3rdparty/libtiff/libtiff/tif_fax3sm.c \
- ../../../3rdparty/libtiff/libtiff/tif_flush.c \
- ../../../3rdparty/libtiff/libtiff/tif_getimage.c \
- ../../../3rdparty/libtiff/libtiff/tif_luv.c \
- ../../../3rdparty/libtiff/libtiff/tif_lzw.c \
- ../../../3rdparty/libtiff/libtiff/tif_next.c \
- ../../../3rdparty/libtiff/libtiff/tif_open.c \
- ../../../3rdparty/libtiff/libtiff/tif_packbits.c \
- ../../../3rdparty/libtiff/libtiff/tif_pixarlog.c \
- ../../../3rdparty/libtiff/libtiff/tif_predict.c \
- ../../../3rdparty/libtiff/libtiff/tif_print.c \
- ../../../3rdparty/libtiff/libtiff/tif_read.c \
- ../../../3rdparty/libtiff/libtiff/tif_strip.c \
- ../../../3rdparty/libtiff/libtiff/tif_swab.c \
- ../../../3rdparty/libtiff/libtiff/tif_thunder.c \
- ../../../3rdparty/libtiff/libtiff/tif_tile.c \
- ../../../3rdparty/libtiff/libtiff/tif_version.c \
- ../../../3rdparty/libtiff/libtiff/tif_warning.c \
- ../../../3rdparty/libtiff/libtiff/tif_write.c \
- ../../../3rdparty/libtiff/libtiff/tif_zip.c
- win32:!wince*: {
- SOURCES += ../../../3rdparty/libtiff/libtiff/tif_win32.c
- }
- unix: {
- SOURCES += ../../../3rdparty/libtiff/libtiff/tif_unix.c
- }
- wince*: {
- SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp \
- ../../../3rdparty/libtiff/libtiff/tif_wince.c \
- ../../../3rdparty/libtiff/libtiff/tif_win32.c
- }
- symbian: {
- SOURCES += ../../../3rdparty/libtiff/port/lfind.c
- }
+ INCLUDEPATH += ../../../3rdparty/libtiff/libtiff
+ SOURCES += \
+ ../../../3rdparty/libtiff/libtiff/tif_aux.c \
+ ../../../3rdparty/libtiff/libtiff/tif_close.c \
+ ../../../3rdparty/libtiff/libtiff/tif_codec.c \
+ ../../../3rdparty/libtiff/libtiff/tif_color.c \
+ ../../../3rdparty/libtiff/libtiff/tif_compress.c \
+ ../../../3rdparty/libtiff/libtiff/tif_dir.c \
+ ../../../3rdparty/libtiff/libtiff/tif_dirinfo.c \
+ ../../../3rdparty/libtiff/libtiff/tif_dirread.c \
+ ../../../3rdparty/libtiff/libtiff/tif_dirwrite.c \
+ ../../../3rdparty/libtiff/libtiff/tif_dumpmode.c \
+ ../../../3rdparty/libtiff/libtiff/tif_error.c \
+ ../../../3rdparty/libtiff/libtiff/tif_extension.c \
+ ../../../3rdparty/libtiff/libtiff/tif_fax3.c \
+ ../../../3rdparty/libtiff/libtiff/tif_fax3sm.c \
+ ../../../3rdparty/libtiff/libtiff/tif_flush.c \
+ ../../../3rdparty/libtiff/libtiff/tif_getimage.c \
+ ../../../3rdparty/libtiff/libtiff/tif_luv.c \
+ ../../../3rdparty/libtiff/libtiff/tif_lzw.c \
+ ../../../3rdparty/libtiff/libtiff/tif_next.c \
+ ../../../3rdparty/libtiff/libtiff/tif_open.c \
+ ../../../3rdparty/libtiff/libtiff/tif_packbits.c \
+ ../../../3rdparty/libtiff/libtiff/tif_pixarlog.c \
+ ../../../3rdparty/libtiff/libtiff/tif_predict.c \
+ ../../../3rdparty/libtiff/libtiff/tif_print.c \
+ ../../../3rdparty/libtiff/libtiff/tif_read.c \
+ ../../../3rdparty/libtiff/libtiff/tif_strip.c \
+ ../../../3rdparty/libtiff/libtiff/tif_swab.c \
+ ../../../3rdparty/libtiff/libtiff/tif_thunder.c \
+ ../../../3rdparty/libtiff/libtiff/tif_tile.c \
+ ../../../3rdparty/libtiff/libtiff/tif_version.c \
+ ../../../3rdparty/libtiff/libtiff/tif_warning.c \
+ ../../../3rdparty/libtiff/libtiff/tif_write.c \
+ ../../../3rdparty/libtiff/libtiff/tif_zip.c
+ win32:!wince*: {
+ SOURCES += ../../../3rdparty/libtiff/libtiff/tif_win32.c
+ }
+ unix: {
+ SOURCES += ../../../3rdparty/libtiff/libtiff/tif_unix.c
+ }
+ wince*: {
+ SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp \
+ ../../../3rdparty/libtiff/libtiff/tif_wince.c \
+ ../../../3rdparty/libtiff/libtiff/tif_win32.c
+ }
+ symbian: {
+ SOURCES += ../../../3rdparty/libtiff/port/lfind.c
+ }
}
contains(QT_CONFIG, system-zlib) {
diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index 85415b2..7a6fdf8 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -1,129 +1,127 @@
# MMF Phonon backend
-
-QT += phonon
-TARGET = phonon_mmf
-PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
-
-# Uncomment the following line in order to use the CDrmPlayerUtility client
-# API for audio playback, rather than CMdaAudioPlayerUtility.
-#CONFIG += phonon_mmf_audio_drm
-
-phonon_mmf_audio_drm {
- LIBS += -lDrmAudioPlayUtility
- DEFINES += QT_PHONON_MMF_AUDIO_DRM
-} else {
- LIBS += -lmediaclientaudio
-}
-
-# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
-# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
-# '#include <videoplayer.h>' picks up the Symbian header, as intended.
-PREPEND_INCLUDEPATH = /epoc32/include
-
-PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
-
-INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-
-HEADERS += \
- $$PHONON_MMF_DIR/abstractaudioeffect.h \
- $$PHONON_MMF_DIR/abstractmediaplayer.h \
- $$PHONON_MMF_DIR/abstractplayer.h \
- $$PHONON_MMF_DIR/abstractvideooutput.h \
- $$PHONON_MMF_DIR/abstractvideoplayer.h \
- $$PHONON_MMF_DIR/audioequalizer.h \
- $$PHONON_MMF_DIR/audiooutput.h \
- $$PHONON_MMF_DIR/audioplayer.h \
- $$PHONON_MMF_DIR/backend.h \
- $$PHONON_MMF_DIR/bassboost.h \
- $$PHONON_MMF_DIR/defs.h \
- $$PHONON_MMF_DIR/dummyplayer.h \
- $$PHONON_MMF_DIR/effectfactory.h \
- $$PHONON_MMF_DIR/effectparameter.h \
- $$PHONON_MMF_DIR/environmentalreverb.h \
- $$PHONON_MMF_DIR/loudness.h \
- $$PHONON_MMF_DIR/mediaobject.h \
- $$PHONON_MMF_DIR/mmf_medianode.h \
- $$PHONON_MMF_DIR/stereowidening.h \
- $$PHONON_MMF_DIR/objectdump.h \
- $$PHONON_MMF_DIR/objectdump_symbian.h \
- $$PHONON_MMF_DIR/objecttree.h \
- $$PHONON_MMF_DIR/utils.h \
- $$PHONON_MMF_DIR/videowidget.h
-
-SOURCES += \
- $$PHONON_MMF_DIR/abstractaudioeffect.cpp \
- $$PHONON_MMF_DIR/abstractmediaplayer.cpp \
- $$PHONON_MMF_DIR/abstractplayer.cpp \
- $$PHONON_MMF_DIR/audioequalizer.cpp \
- $$PHONON_MMF_DIR/audiooutput.cpp \
- $$PHONON_MMF_DIR/audioplayer.cpp \
- $$PHONON_MMF_DIR/abstractvideooutput.cpp \
- $$PHONON_MMF_DIR/abstractvideoplayer.cpp \
- $$PHONON_MMF_DIR/backend.cpp \
- $$PHONON_MMF_DIR/bassboost.cpp \
- $$PHONON_MMF_DIR/dummyplayer.cpp \
- $$PHONON_MMF_DIR/effectfactory.cpp \
- $$PHONON_MMF_DIR/effectparameter.cpp \
- $$PHONON_MMF_DIR/environmentalreverb.cpp \
- $$PHONON_MMF_DIR/loudness.cpp \
- $$PHONON_MMF_DIR/mediaobject.cpp \
- $$PHONON_MMF_DIR/mmf_medianode.cpp \
- $$PHONON_MMF_DIR/stereowidening.cpp \
- $$PHONON_MMF_DIR/objectdump.cpp \
- $$PHONON_MMF_DIR/objectdump_symbian.cpp \
- $$PHONON_MMF_DIR/objecttree.cpp \
- $$PHONON_MMF_DIR/utils.cpp \
- $$PHONON_MMF_DIR/videowidget.cpp
-
-# Test for whether the build environment supports video rendering to graphics
-# surfaces.
symbian {
- exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
- HEADERS += \
- $$PHONON_MMF_DIR/videooutput_surface.h \
- $$PHONON_MMF_DIR/videoplayer_surface.h
- SOURCES += \
- $$PHONON_MMF_DIR/videooutput_surface.cpp \
- $$PHONON_MMF_DIR/videoplayer_surface.cpp
- DEFINES += PHONON_MMF_VIDEO_SURFACES
- } else {
- HEADERS += \
- $$PHONON_MMF_DIR/ancestormovemonitor.h \
- $$PHONON_MMF_DIR/videooutput_dsa.h \
- $$PHONON_MMF_DIR/videoplayer_dsa.h
- SOURCES += \
- $$PHONON_MMF_DIR/ancestormovemonitor.cpp \
- $$PHONON_MMF_DIR/videooutput_dsa.cpp \
- $$PHONON_MMF_DIR/videoplayer_dsa.cpp \
- }
+ QT += phonon
+ TARGET = phonon_mmf
+ PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
+
+ # Uncomment the following line in order to use the CDrmPlayerUtility client
+ # API for audio playback, rather than CMdaAudioPlayerUtility.
+ #CONFIG += phonon_mmf_audio_drm
+
+ phonon_mmf_audio_drm {
+ LIBS += -lDrmAudioPlayUtility
+ DEFINES += QT_PHONON_MMF_AUDIO_DRM
+ } else {
+ LIBS += -lmediaclientaudio
+ }
+
+ # This is necessary because both epoc32/include and Phonon contain videoplayer.h.
+ # By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
+ # '#include <videoplayer.h>' picks up the Symbian header, as intended.
+ PREPEND_INCLUDEPATH = /epoc32/include
+
+ PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
+
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+
+ HEADERS += \
+ $$PHONON_MMF_DIR/abstractaudioeffect.h \
+ $$PHONON_MMF_DIR/abstractmediaplayer.h \
+ $$PHONON_MMF_DIR/abstractplayer.h \
+ $$PHONON_MMF_DIR/abstractvideooutput.h \
+ $$PHONON_MMF_DIR/abstractvideoplayer.h \
+ $$PHONON_MMF_DIR/audioequalizer.h \
+ $$PHONON_MMF_DIR/audiooutput.h \
+ $$PHONON_MMF_DIR/audioplayer.h \
+ $$PHONON_MMF_DIR/backend.h \
+ $$PHONON_MMF_DIR/bassboost.h \
+ $$PHONON_MMF_DIR/defs.h \
+ $$PHONON_MMF_DIR/dummyplayer.h \
+ $$PHONON_MMF_DIR/effectfactory.h \
+ $$PHONON_MMF_DIR/effectparameter.h \
+ $$PHONON_MMF_DIR/environmentalreverb.h \
+ $$PHONON_MMF_DIR/loudness.h \
+ $$PHONON_MMF_DIR/mediaobject.h \
+ $$PHONON_MMF_DIR/mmf_medianode.h \
+ $$PHONON_MMF_DIR/stereowidening.h \
+ $$PHONON_MMF_DIR/objectdump.h \
+ $$PHONON_MMF_DIR/objectdump_symbian.h \
+ $$PHONON_MMF_DIR/objecttree.h \
+ $$PHONON_MMF_DIR/utils.h \
+ $$PHONON_MMF_DIR/videowidget.h
+
+ SOURCES += \
+ $$PHONON_MMF_DIR/abstractaudioeffect.cpp \
+ $$PHONON_MMF_DIR/abstractmediaplayer.cpp \
+ $$PHONON_MMF_DIR/abstractplayer.cpp \
+ $$PHONON_MMF_DIR/audioequalizer.cpp \
+ $$PHONON_MMF_DIR/audiooutput.cpp \
+ $$PHONON_MMF_DIR/audioplayer.cpp \
+ $$PHONON_MMF_DIR/abstractvideooutput.cpp \
+ $$PHONON_MMF_DIR/abstractvideoplayer.cpp \
+ $$PHONON_MMF_DIR/backend.cpp \
+ $$PHONON_MMF_DIR/bassboost.cpp \
+ $$PHONON_MMF_DIR/dummyplayer.cpp \
+ $$PHONON_MMF_DIR/effectfactory.cpp \
+ $$PHONON_MMF_DIR/effectparameter.cpp \
+ $$PHONON_MMF_DIR/environmentalreverb.cpp \
+ $$PHONON_MMF_DIR/loudness.cpp \
+ $$PHONON_MMF_DIR/mediaobject.cpp \
+ $$PHONON_MMF_DIR/mmf_medianode.cpp \
+ $$PHONON_MMF_DIR/stereowidening.cpp \
+ $$PHONON_MMF_DIR/objectdump.cpp \
+ $$PHONON_MMF_DIR/objectdump_symbian.cpp \
+ $$PHONON_MMF_DIR/objecttree.cpp \
+ $$PHONON_MMF_DIR/utils.cpp \
+ $$PHONON_MMF_DIR/videowidget.cpp
+
+ # Test for whether the build environment supports video rendering to graphics
+ # surfaces.
+ symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
+ HEADERS += \
+ $$PHONON_MMF_DIR/videooutput_surface.h \
+ $$PHONON_MMF_DIR/videoplayer_surface.h
+ SOURCES += \
+ $$PHONON_MMF_DIR/videooutput_surface.cpp \
+ $$PHONON_MMF_DIR/videoplayer_surface.cpp
+ DEFINES += PHONON_MMF_VIDEO_SURFACES
+ } else {
+ HEADERS += \
+ $$PHONON_MMF_DIR/ancestormovemonitor.h \
+ $$PHONON_MMF_DIR/videooutput_dsa.h \
+ $$PHONON_MMF_DIR/videoplayer_dsa.h
+ SOURCES += \
+ $$PHONON_MMF_DIR/ancestormovemonitor.cpp \
+ $$PHONON_MMF_DIR/videooutput_dsa.cpp \
+ $$PHONON_MMF_DIR/videoplayer_dsa.cpp \
+ }
+
+ LIBS += -lcone
+ LIBS += -lws32
+
+ # This is only needed for debug builds, but is always linked against.
+ LIBS += -lhal
+
+ TARGET.CAPABILITY = all -tcb
+
+ LIBS += -lmediaclientvideo # For CVideoPlayerUtility
+ LIBS += -lcone # For CCoeEnv
+ LIBS += -lws32 # For RWindow
+ LIBS += -lefsrv # For file server
+ LIBS += -lapgrfx -lapmime # For recognizer
+ LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry
+ LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
+
+ # These are for effects.
+ LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
+
+ # This is needed for having the .qtplugin file properly created on Symbian.
+ QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
+
+ target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
+ INSTALLS += target
+
+ include(../../qpluginbase.pri)
+
+ TARGET.UID3=0x2001E629
}
-
-LIBS += -lcone
-LIBS += -lws32
-
-# This is only needed for debug builds, but is always linked against.
-LIBS += -lhal
-
-TARGET.CAPABILITY = all -tcb
-
-LIBS += -lmediaclientvideo # For CVideoPlayerUtility
-LIBS += -lcone # For CCoeEnv
-LIBS += -lws32 # For RWindow
-LIBS += -lefsrv # For file server
-LIBS += -lapgrfx -lapmime # For recognizer
-LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry
-LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream
-
-# These are for effects.
-LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
-
-# This is needed for having the .qtplugin file properly created on Symbian.
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
-
-target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
-INSTALLS += target
-
-include(../../qpluginbase.pri)
-
-TARGET.UID3=0x2001E629
-
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index 45caeb0..101c6a8 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4480,4 +4480,6 @@ EXPORTS
?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4479 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int)
?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4480 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject
?textDirection@QLocale@@QBE?AW4LayoutDirection@Qt@@XZ @ 4481 NONAME ; enum Qt::LayoutDirection QLocale::textDirection(void) const
+ ?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4482 NONAME ; long long QIODevicePrivate::peek(char *, long long)
+ ?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4483 NONAME ; class QByteArray QIODevicePrivate::peek(long long)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 0aac72b..ddc8cf4 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -4097,4 +4097,8 @@ EXPORTS
?setHeader@QDeclarativeGridView@@QAEXPAVQDeclarativeComponent@@@Z @ 4096 NONAME ; void QDeclarativeGridView::setHeader(class QDeclarativeComponent *)
?header@QDeclarativeGridView@@QBEPAVQDeclarativeComponent@@XZ @ 4097 NONAME ; class QDeclarativeComponent * QDeclarativeGridView::header(void) const
?footerChanged@QDeclarativeGridView@@IAEXXZ @ 4098 NONAME ; void QDeclarativeGridView::footerChanged(void)
+ ?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 4099 NONAME ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
+ ?parentFunctions@QDeclarativeMetaType@@SA?AV?$QList@P6A?AW4AutoParentResult@QDeclarativePrivate@@PAVQObject@@0@Z@@XZ @ 4100 NONAME ; class QList<enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *)> QDeclarativeMetaType::parentFunctions(void)
+ ?inputMethodEvent@QDeclarativeTextInput@@MAEXPAVQInputMethodEvent@@@Z @ 4101 NONAME ; void QDeclarativeTextInput::inputMethodEvent(class QInputMethodEvent *)
+ ?doUpdate@QDeclarativeBorderImage@@AAEXXZ @ 4102 NONAME ; void QDeclarativeBorderImage::doUpdate(void)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index d439927..6e20131 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12820,4 +12820,8 @@ EXPORTS
?textOption@QStaticText@@QBE?AVQTextOption@@XZ @ 12819 NONAME ; class QTextOption QStaticText::textOption(void) const
?isRightToLeft@QTextEngine@@QBE_NXZ @ 12820 NONAME ; bool QTextEngine::isRightToLeft(void) const
?textDirection@QTextBlock@@QBE?AW4LayoutDirection@Qt@@XZ @ 12821 NONAME ; enum Qt::LayoutDirection QTextBlock::textDirection(void) const
+ ?convertInPlace@QImageData@@QAE_NW4Format@QImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12822 NONAME ; bool QImageData::convertInPlace(enum QImage::Format, class QFlags<enum Qt::ImageConversionFlag>)
+ ?createPixmapForImage@QRasterPixmapData@@IAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 12823 NONAME ; void QRasterPixmapData::createPixmapForImage(class QImage &, class QFlags<enum Qt::ImageConversionFlag>, bool)
+ ??0Tab@QTextOption@@QAE@MW4TabType@1@VQChar@@@Z @ 12824 NONAME ; QTextOption::Tab::Tab(float, enum QTextOption::TabType, class QChar)
+ ?fromData@QRasterPixmapData@@UAE_NPBEIPBDV?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12825 NONAME ; bool QRasterPixmapData::fromData(unsigned char const *, unsigned int, char const *, class QFlags<enum Qt::ImageConversionFlag>)
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 48cad39..7b9e777 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3707,4 +3707,6 @@ EXPORTS
_ZrsR11QDataStreamR12QEasingCurve @ 3706 NONAME
_ZNK7QLocale13textDirectionEv @ 3707 NONAME
_ZNK7QString13isRightToLeftEv @ 3708 NONAME
+ _ZN16QIODevicePrivate4peekEPcx @ 3709 NONAME
+ _ZN16QIODevicePrivate4peekEx @ 3710 NONAME
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index f997454..96e74a6 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -3681,4 +3681,9 @@ EXPORTS
_ZNK17QDeclarativeState7isNamedEv @ 3680 NONAME
_ZNK20QDeclarativeGridView6footerEv @ 3681 NONAME
_ZNK20QDeclarativeGridView6headerEv @ 3682 NONAME
+ _ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 3683 NONAME
+ _ZN20QDeclarativeMetaType15parentFunctionsEv @ 3684 NONAME
+ _ZN21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3685 NONAME
+ _ZN23QDeclarativeBorderImage8doUpdateEv @ 3686 NONAME
+ _ZThn8_N21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3687 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b59ddee..e7d865b 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12017,4 +12017,7 @@ EXPORTS
_ZNK11QStaticText10textOptionEv @ 12016 NONAME
_ZNK11QTextEngine13isRightToLeftEv @ 12017 NONAME
_ZNK14QWidgetPrivate22childAtRecursiveHelperERK6QPointbb @ 12018 NONAME
+ _ZN10QImageData14convertInPlaceEN6QImage6FormatE6QFlagsIN2Qt19ImageConversionFlagEE @ 12019 NONAME
+ _ZN17QRasterPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 12020 NONAME
+ _ZN17QRasterPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 12021 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 3269d97..288b3ab 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -439,4 +439,6 @@ EXPORTS
_ZN23QScriptDeclarativeClass7compareEPNS_6ObjectES1_ @ 438 NONAME
_ZN25QScriptEngineAgentPrivate11atStatementERKN5QTJSC17DebuggerCallFrameEii @ 439 NONAME
_ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEii @ 440 NONAME
+ _ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngine @ 441 NONAME
+ _ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngineiPK7QStringPK12QScriptValuePK6QFlagsINS5_12PropertyFlagEE @ 442 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index a093e4c..4addb84 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -175,13 +175,6 @@ symbian: {
particlesImport.path = c:$$QT_IMPORTS_BASE_DIR/Qt/labs/particles
DEPLOYMENT += folderlistmodelImport gesturesImport particlesImport
-
- contains(QT_CONFIG, webkit): {
- webkitImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
- webkitImport.sources += $$QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative/qmldir
- webkitImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
- DEPLOYMENT += webkitImport
- }
}
graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index 1ba105d..9ea3080 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -25,6 +25,10 @@ symbian {
# Workaround for abld toolchain problem to make ARMV6 qtmain.lib link with GCCE apps
symbian-abld: QMAKE_CXXFLAGS.ARMCC += --dllimport_runtime
+
+ # Having MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA will cause s60main.lib be unlinkable
+ # against GCCE apps, so remove it
+ MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
} else {
error("$$_FILE_ is intended only for Symbian!")
}
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index e2999c1..7bccffe 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -64,6 +64,7 @@
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptglobalobject_p.h"
#include "bridge/qscriptactivationobject_p.h"
+#include "bridge/qscriptstaticscopeobject_p.h"
#ifndef QT_NO_QOBJECT
#include <QtCore/qcoreapplication.h>
@@ -437,6 +438,53 @@ qsreal ToNumber(const QString &value)
#endif
+static const qsreal MsPerSecond = 1000.0;
+
+static inline int MsFromTime(qsreal t)
+{
+ int r = int(::fmod(t, MsPerSecond));
+ return (r >= 0) ? r : r + int(MsPerSecond);
+}
+
+/*!
+ \internal
+ Converts a JS date value (milliseconds) to a QDateTime (local time).
+*/
+QDateTime MsToDateTime(JSC::ExecState *exec, qsreal t)
+{
+ if (qIsNaN(t))
+ return QDateTime();
+ JSC::GregorianDateTime tm;
+ JSC::msToGregorianDateTime(exec, t, /*output UTC=*/true, tm);
+ int ms = MsFromTime(t);
+ QDateTime convertedUTC = QDateTime(QDate(tm.year + 1900, tm.month + 1, tm.monthDay),
+ QTime(tm.hour, tm.minute, tm.second, ms), Qt::UTC);
+ return convertedUTC.toLocalTime();
+}
+
+/*!
+ \internal
+ Converts a QDateTime to a JS date value (milliseconds).
+*/
+qsreal DateTimeToMs(JSC::ExecState *exec, const QDateTime &dt)
+{
+ if (!dt.isValid())
+ return qSNaN();
+ QDateTime utc = dt.toUTC();
+ QDate date = utc.date();
+ QTime time = utc.time();
+ JSC::GregorianDateTime tm;
+ tm.year = date.year() - 1900;
+ tm.month = date.month() - 1;
+ tm.monthDay = date.day();
+ tm.weekDay = date.dayOfWeek();
+ tm.yearDay = date.dayOfYear();
+ tm.hour = time.hour();
+ tm.minute = time.minute();
+ tm.second = time.second();
+ return JSC::gregorianDateTimeToMS(exec, tm, time.msec(), /*inputIsUTC=*/true);
+}
+
void GlobalClientData::mark(JSC::MarkStack& markStack)
{
engine->mark(markStack);
@@ -905,6 +953,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
JSC::ExecState* exec = globalObject->globalExec();
scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());
+ staticScopeObjectStructure = QScriptStaticScopeObject::createStructure(JSC::jsNull());
qobjectPrototype = new (exec) QScript::QObjectPrototype(exec, QScript::QObjectPrototype::createStructure(globalObject->objectPrototype()), globalObject->prototypeFunctionStructure());
qobjectWrapperObjectStructure = QScriptObject::createStructure(qobjectPrototype);
@@ -1770,15 +1819,7 @@ void QScriptEnginePrivate::setProperty(JSC::ExecState *exec, JSC::JSValue object
} else if (flags != QScriptValue::KeepExistingFlags) {
if (thisObject->hasOwnProperty(exec, id))
thisObject->deleteProperty(exec, id); // ### hmmm - can't we just update the attributes?
- unsigned attribs = 0;
- if (flags & QScriptValue::ReadOnly)
- attribs |= JSC::ReadOnly;
- if (flags & QScriptValue::SkipInEnumeration)
- attribs |= JSC::DontEnum;
- if (flags & QScriptValue::Undeletable)
- attribs |= JSC::DontDelete;
- attribs |= flags & QScriptValue::UserRange;
- thisObject->putWithAttributes(exec, id, value, attribs);
+ thisObject->putWithAttributes(exec, id, value, propertyFlagsToJSCAttributes(flags));
} else {
JSC::PutPropertySlot slot;
thisObject->put(exec, id, value, slot);
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 56366e2..c71465d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -50,7 +50,6 @@
#include "bridge/qscriptobject_p.h"
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptvariant_p.h"
-#include "utils/qscriptdate_p.h"
#include "DateConstructor.h"
#include "DateInstance.h"
@@ -119,6 +118,9 @@ namespace QScript
inline QString ToString(qsreal);
#endif
+ QDateTime MsToDateTime(JSC::ExecState *, qsreal);
+ qsreal DateTimeToMs(JSC::ExecState *, const QDateTime &);
+
//some conversion helper functions
inline QScriptEnginePrivate *scriptEngineFromExec(const JSC::ExecState *exec);
bool isFunction(JSC::JSValue value);
@@ -205,6 +207,7 @@ public:
inline QScriptValue scriptValueFromJSCValue(JSC::JSValue value);
inline JSC::JSValue scriptValueToJSCValue(const QScriptValue &value);
+ static inline unsigned propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags);
static inline JSC::JSValue jscValueFromVariant(JSC::ExecState*, const QVariant &value);
static QVariant jscValueToVariant(JSC::ExecState*, JSC::JSValue value, int targetType);
@@ -346,6 +349,7 @@ public:
JSC::ExecState *currentFrame;
WTF::RefPtr<JSC::Structure> scriptObjectStructure;
+ WTF::RefPtr<JSC::Structure> staticScopeObjectStructure;
QScript::QObjectPrototype *qobjectPrototype;
WTF::RefPtr<JSC::Structure> qobjectWrapperObjectStructure;
@@ -639,6 +643,19 @@ inline JSC::JSValue QScriptEnginePrivate::scriptValueToJSCValue(const QScriptVal
return vv->jscValue;
}
+inline unsigned QScriptEnginePrivate::propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags)
+{
+ unsigned attribs = 0;
+ if (flags & QScriptValue::ReadOnly)
+ attribs |= JSC::ReadOnly;
+ if (flags & QScriptValue::SkipInEnumeration)
+ attribs |= JSC::DontEnum;
+ if (flags & QScriptValue::Undeletable)
+ attribs |= JSC::DontDelete;
+ attribs |= flags & QScriptValue::UserRange;
+ return attribs;
+}
+
inline QScriptValuePrivate::~QScriptValuePrivate()
{
if (engine)
@@ -846,7 +863,7 @@ inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, qsreal v
inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, const QDateTime &value)
{
- return newDate(exec, QScript::FromDateTime(value));
+ return newDate(exec, QScript::DateTimeToMs(exec, value));
}
inline JSC::JSValue QScriptEnginePrivate::newObject()
@@ -979,12 +996,12 @@ inline JSC::UString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JS
return str;
}
-inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *, JSC::JSValue value)
+inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *exec, JSC::JSValue value)
{
if (!isDate(value))
return QDateTime();
qsreal t = static_cast<JSC::DateInstance*>(JSC::asObject(value))->internalNumber();
- return QScript::ToDateTime(t, Qt::LocalTime);
+ return QScript::MsToDateTime(exec, t);
}
inline QObject *QScriptEnginePrivate::toQObject(JSC::ExecState *exec, JSC::JSValue value)
diff --git a/src/script/bridge/bridge.pri b/src/script/bridge/bridge.pri
index 09e2dfb..ab0a322 100644
--- a/src/script/bridge/bridge.pri
+++ b/src/script/bridge/bridge.pri
@@ -6,6 +6,7 @@ SOURCES += \
$$PWD/qscriptqobject.cpp \
$$PWD/qscriptglobalobject.cpp \
$$PWD/qscriptactivationobject.cpp \
+ $$PWD/qscriptstaticscopeobject.cpp \
$$PWD/qscriptdeclarativeobject.cpp \
$$PWD/qscriptdeclarativeclass.cpp
@@ -17,5 +18,6 @@ HEADERS += \
$$PWD/qscriptqobject_p.h \
$$PWD/qscriptglobalobject_p.h \
$$PWD/qscriptactivationobject_p.h \
+ $$PWD/qscriptstaticscopeobject_p.h \
$$PWD/qscriptdeclarativeobject_p.h \
$$PWD/qscriptdeclarativeclass_p.h
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index 1093448..8080b9f 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -24,6 +24,7 @@
#include "qscriptdeclarativeclass_p.h"
#include "qscriptdeclarativeobject_p.h"
#include "qscriptobject_p.h"
+#include "qscriptstaticscopeobject_p.h"
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
#include <QtScript/qscriptengineagent.h>
@@ -549,4 +550,39 @@ QScriptContext *QScriptDeclarativeClass::context() const
return d_ptr->context;
}
+/*!
+ Creates a scope object with a fixed set of undeletable properties.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(
+ QScriptEngine *engine, int propertyCount, const QString *names,
+ const QScriptValue *values, const QScriptValue::PropertyFlags *flags)
+{
+ QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+ QScript::APIShim shim(eng_p);
+ JSC::ExecState *exec = eng_p->currentFrame;
+ QScriptStaticScopeObject::PropertyInfo *props = new QScriptStaticScopeObject::PropertyInfo[propertyCount];
+ for (int i = 0; i < propertyCount; ++i) {
+ unsigned attribs = QScriptEnginePrivate::propertyFlagsToJSCAttributes(flags[i]);
+ Q_ASSERT_X(attribs & JSC::DontDelete, Q_FUNC_INFO, "All properties must be undeletable");
+ JSC::Identifier id = JSC::Identifier(exec, names[i]);
+ JSC::JSValue jsval = eng_p->scriptValueToJSCValue(values[i]);
+ props[i] = QScriptStaticScopeObject::PropertyInfo(id, jsval, attribs);
+ }
+ QScriptValue result = eng_p->scriptValueFromJSCValue(new (exec)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure,
+ propertyCount, props));
+ delete[] props;
+ return result;
+}
+
+/*!
+ Creates a static scope object that's initially empty, but to which new
+ properties can be added.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(QScriptEngine *engine)
+{
+ QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+ QScript::APIShim shim(eng_p);
+ return eng_p->scriptValueFromJSCValue(new (eng_p->currentFrame)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure));
+}
+
QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 714a67c..420b133 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -92,6 +92,11 @@ public:
static QScriptValue scopeChainValue(QScriptContext *, int index);
static QScriptContext *pushCleanContext(QScriptEngine *);
+ static QScriptValue newStaticScopeObject(
+ QScriptEngine *, int propertyCount, const QString *names,
+ const QScriptValue *values, const QScriptValue::PropertyFlags *flags);
+ static QScriptValue newStaticScopeObject(QScriptEngine *);
+
class Q_SCRIPT_EXPORT PersistentIdentifier
{
public:
diff --git a/src/script/bridge/qscriptstaticscopeobject.cpp b/src/script/bridge/qscriptstaticscopeobject.cpp
new file mode 100644
index 0000000..44548a4
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** 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 QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "config.h"
+#include "qscriptstaticscopeobject_p.h"
+
+namespace JSC
+{
+ ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptStaticScopeObject));
+}
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QScriptStaticScopeObject
+ \internal
+
+ Represents a static scope object.
+
+ This class allows the VM to determine at JS script compile time whether
+ the object has a given property or not. If the object has the property,
+ a fast, index-based read/write operation will be used. If the object
+ doesn't have the property, the compiler knows it can safely skip this
+ object when dynamically resolving the property. Either way, this can
+ greatly improve performance.
+
+ \sa QScriptContext::pushScope()
+*/
+
+const JSC::ClassInfo QScriptStaticScopeObject::info = { "QScriptStaticScopeObject", 0, 0, 0 };
+
+/*!
+ Creates a static scope object with a fixed set of undeletable properties.
+
+ It's not possible to add new properties to the object after construction.
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+ int propertyCount, const PropertyInfo* props)
+ : JSC::JSVariableObject(structure, new Data(/*canGrow=*/false))
+{
+ int index = growRegisterArray(propertyCount);
+ for (int i = 0; i < propertyCount; ++i, --index) {
+ const PropertyInfo& prop = props[i];
+ JSC::SymbolTableEntry entry(index, prop.attributes);
+ symbolTable().add(prop.identifier.ustring().rep(), entry);
+ registerAt(index) = prop.value;
+ }
+}
+
+/*!
+ Creates an empty static scope object.
+
+ Properties can be added to the object after construction, either by
+ calling QScriptValue::setProperty(), or by pushing the object on the
+ scope chain; variable declarations ("var" statements) and function
+ declarations in JavaScript will create properties on the scope object.
+
+ Note that once the scope object has been used in a closure and the
+ resulting function has been compiled, it's no longer safe to add
+ properties to the scope object (because the VM will bypass this
+ object the next time the function is executed).
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure)
+ : JSC::JSVariableObject(structure, new Data(/*canGrow=*/true))
+{
+}
+
+QScriptStaticScopeObject::~QScriptStaticScopeObject()
+{
+ delete d;
+}
+
+bool QScriptStaticScopeObject::getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)
+{
+ return symbolTableGet(propertyName, slot);
+}
+
+bool QScriptStaticScopeObject::getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)
+{
+ return symbolTableGet(propertyName, descriptor);
+}
+
+void QScriptStaticScopeObject::putWithAttributes(JSC::ExecState* exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes)
+{
+ if (symbolTablePutWithAttributes(propertyName, value, attributes))
+ return;
+ Q_ASSERT(d_ptr()->canGrow);
+ addSymbolTableProperty(propertyName, value, attributes);
+}
+
+void QScriptStaticScopeObject::put(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&)
+{
+ if (symbolTablePut(propertyName, value))
+ return;
+ Q_ASSERT(d_ptr()->canGrow);
+ addSymbolTableProperty(propertyName, value, /*attributes=*/0);
+}
+
+bool QScriptStaticScopeObject::deleteProperty(JSC::ExecState*, const JSC::Identifier&)
+{
+ return false;
+}
+
+void QScriptStaticScopeObject::markChildren(JSC::MarkStack& markStack)
+{
+ JSC::Register* registerArray = d_ptr()->registerArray.get();
+ if (!registerArray)
+ return;
+ markStack.appendValues(reinterpret_cast<JSC::JSValue*>(registerArray), d_ptr()->registerArraySize);
+}
+
+void QScriptStaticScopeObject::addSymbolTableProperty(const JSC::Identifier& name, JSC::JSValue value, unsigned attributes)
+{
+ int index = growRegisterArray(1);
+ JSC::SymbolTableEntry newEntry(index, attributes | JSC::DontDelete);
+ symbolTable().add(name.ustring().rep(), newEntry);
+ registerAt(index) = value;
+}
+
+/*!
+ Grows the register array by \a count elements, and returns the offset of
+ the newly added elements (note that the register file grows downwards,
+ starting at index -1).
+*/
+int QScriptStaticScopeObject::growRegisterArray(int count)
+{
+ size_t oldSize = d_ptr()->registerArraySize;
+ size_t newSize = oldSize + count;
+ JSC::Register* registerArray = new JSC::Register[newSize];
+ if (d_ptr()->registerArray)
+ memcpy(registerArray + count, d_ptr()->registerArray.get(), oldSize * sizeof(JSC::Register));
+ setRegisters(registerArray + newSize, registerArray);
+ d_ptr()->registerArraySize = newSize;
+ return -oldSize - 1;
+}
+
+QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptstaticscopeobject_p.h b/src/script/bridge/qscriptstaticscopeobject_p.h
new file mode 100644
index 0000000..0a0e7ef
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSCRIPTSTATICSCOPEOBJECT_P_H
+#define QSCRIPTSTATICSCOPEOBJECT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobjectdefs.h>
+
+#include "JSVariableObject.h"
+
+QT_BEGIN_NAMESPACE
+
+class QScriptStaticScopeObject : public JSC::JSVariableObject {
+public:
+ struct PropertyInfo {
+ PropertyInfo(const JSC::Identifier& i, JSC::JSValue v, unsigned a)
+ : identifier(i), value(v), attributes(a)
+ { }
+ PropertyInfo() {}
+
+ JSC::Identifier identifier;
+ JSC::JSValue value;
+ unsigned attributes;
+ };
+
+ QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+ int propertyCount, const PropertyInfo*);
+ QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure);
+ virtual ~QScriptStaticScopeObject();
+
+ virtual bool isDynamicScope() const { return false; }
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+
+ virtual void putWithAttributes(JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes);
+ virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&);
+
+ virtual bool deleteProperty(JSC::ExecState*, const JSC::Identifier& propertyName);
+
+ virtual void markChildren(JSC::MarkStack&);
+
+ virtual const JSC::ClassInfo* classInfo() const { return &info; }
+ static const JSC::ClassInfo info;
+
+ static WTF::PassRefPtr<JSC::Structure> createStructure(JSC::JSValue proto) {
+ return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, StructureFlags));
+ }
+
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::NeedsThisConversion | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::JSVariableObject::StructureFlags;
+
+ struct Data : public JSVariableObjectData {
+ Data(bool canGrow_)
+ : JSVariableObjectData(&symbolTable, /*registers=*/0),
+ canGrow(canGrow_), registerArraySize(0)
+ { }
+ bool canGrow;
+ int registerArraySize;
+ JSC::SymbolTable symbolTable;
+ };
+
+ Data* d_ptr() const { return static_cast<Data*>(JSVariableObject::d); }
+
+private:
+ void addSymbolTableProperty(const JSC::Identifier&, JSC::JSValue, unsigned attributes);
+ int growRegisterArray(int);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/script/script.pri b/src/script/script.pri
index 2ee1a82..9cd71d3 100644
--- a/src/script/script.pri
+++ b/src/script/script.pri
@@ -1,4 +1,3 @@
include($$PWD/api/api.pri)
include($$PWD/bridge/bridge.pri)
include($$PWD/parser/parser.pri)
-include($$PWD/utils/utils.pri)
diff --git a/src/script/utils/qscriptdate.cpp b/src/script/utils/qscriptdate.cpp
deleted file mode 100644
index 5980256..0000000
--- a/src/script/utils/qscriptdate.cpp
+++ /dev/null
@@ -1,365 +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 QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qscriptdate_p.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtCore/qstringlist.h>
-
-#include <math.h>
-
-#ifndef Q_WS_WIN
-# include <time.h>
-# include <sys/time.h>
-#else
-# include <windows.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-namespace QScript {
-
-qsreal ToInteger(qsreal n);
-
-static const qsreal HoursPerDay = 24.0;
-static const qsreal MinutesPerHour = 60.0;
-static const qsreal SecondsPerMinute = 60.0;
-static const qsreal msPerSecond = 1000.0;
-static const qsreal msPerMinute = 60000.0;
-static const qsreal msPerHour = 3600000.0;
-static const qsreal msPerDay = 86400000.0;
-
-static qsreal LocalTZA = 0.0; // initialized at startup
-
-static inline qsreal TimeWithinDay(qsreal t)
-{
- qsreal r = ::fmod(t, msPerDay);
- return (r >= 0) ? r : r + msPerDay;
-}
-
-static inline int HourFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerHour), HoursPerDay));
- return (r >= 0) ? r : r + int(HoursPerDay);
-}
-
-static inline int MinFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerMinute), MinutesPerHour));
- return (r >= 0) ? r : r + int(MinutesPerHour);
-}
-
-static inline int SecFromTime(qsreal t)
-{
- int r = int(::fmod(::floor(t / msPerSecond), SecondsPerMinute));
- return (r >= 0) ? r : r + int(SecondsPerMinute);
-}
-
-static inline int msFromTime(qsreal t)
-{
- int r = int(::fmod(t, msPerSecond));
- return (r >= 0) ? r : r + int(msPerSecond);
-}
-
-static inline qsreal Day(qsreal t)
-{
- return ::floor(t / msPerDay);
-}
-
-static inline qsreal DaysInYear(qsreal y)
-{
- if (::fmod(y, 4))
- return 365;
-
- else if (::fmod(y, 100))
- return 366;
-
- else if (::fmod(y, 400))
- return 365;
-
- return 366;
-}
-
-static inline qsreal DayFromYear(qsreal y)
-{
- return 365 * (y - 1970)
- + ::floor((y - 1969) / 4)
- - ::floor((y - 1901) / 100)
- + ::floor((y - 1601) / 400);
-}
-
-static inline qsreal TimeFromYear(qsreal y)
-{
- return msPerDay * DayFromYear(y);
-}
-
-static inline qsreal YearFromTime(qsreal t)
-{
- int y = 1970;
- y += (int) ::floor(t / (msPerDay * 365.2425));
-
- qsreal t2 = TimeFromYear(y);
- return (t2 > t) ? y - 1 : ((t2 + msPerDay * DaysInYear(y)) <= t) ? y + 1 : y;
-}
-
-static inline bool InLeapYear(qsreal t)
-{
- qsreal x = DaysInYear(YearFromTime(t));
- if (x == 365)
- return 0;
-
- Q_ASSERT (x == 366);
- return 1;
-}
-
-static inline qsreal DayWithinYear(qsreal t)
-{
- return Day(t) - DayFromYear(YearFromTime(t));
-}
-
-static inline qsreal MonthFromTime(qsreal t)
-{
- qsreal d = DayWithinYear(t);
- qsreal l = InLeapYear(t);
-
- if (d < 31.0)
- return 0;
-
- else if (d < 59.0 + l)
- return 1;
-
- else if (d < 90.0 + l)
- return 2;
-
- else if (d < 120.0 + l)
- return 3;
-
- else if (d < 151.0 + l)
- return 4;
-
- else if (d < 181.0 + l)
- return 5;
-
- else if (d < 212.0 + l)
- return 6;
-
- else if (d < 243.0 + l)
- return 7;
-
- else if (d < 273.0 + l)
- return 8;
-
- else if (d < 304.0 + l)
- return 9;
-
- else if (d < 334.0 + l)
- return 10;
-
- else if (d < 365.0 + l)
- return 11;
-
- return qSNaN(); // ### assert?
-}
-
-static inline qsreal DateFromTime(qsreal t)
-{
- int m = (int) ToInteger(MonthFromTime(t));
- qsreal d = DayWithinYear(t);
- qsreal l = InLeapYear(t);
-
- switch (m) {
- case 0: return d + 1.0;
- case 1: return d - 30.0;
- case 2: return d - 58.0 - l;
- case 3: return d - 89.0 - l;
- case 4: return d - 119.0 - l;
- case 5: return d - 150.0 - l;
- case 6: return d - 180.0 - l;
- case 7: return d - 211.0 - l;
- case 8: return d - 242.0 - l;
- case 9: return d - 272.0 - l;
- case 10: return d - 303.0 - l;
- case 11: return d - 333.0 - l;
- }
-
- return qSNaN(); // ### assert
-}
-
-static inline qsreal WeekDay(qsreal t)
-{
- qsreal r = ::fmod (Day(t) + 4.0, 7.0);
- return (r >= 0) ? r : r + 7.0;
-}
-
-
-static inline qsreal MakeTime(qsreal hour, qsreal min, qsreal sec, qsreal ms)
-{
- return ((hour * MinutesPerHour + min) * SecondsPerMinute + sec) * msPerSecond + ms;
-}
-
-static inline qsreal DayFromMonth(qsreal month, qsreal leap)
-{
- switch ((int) month) {
- case 0: return 0;
- case 1: return 31.0;
- case 2: return 59.0 + leap;
- case 3: return 90.0 + leap;
- case 4: return 120.0 + leap;
- case 5: return 151.0 + leap;
- case 6: return 181.0 + leap;
- case 7: return 212.0 + leap;
- case 8: return 243.0 + leap;
- case 9: return 273.0 + leap;
- case 10: return 304.0 + leap;
- case 11: return 334.0 + leap;
- }
-
- return qSNaN(); // ### assert?
-}
-
-static qsreal MakeDay(qsreal year, qsreal month, qsreal day)
-{
- year += ::floor(month / 12.0);
-
- month = ::fmod(month, 12.0);
- if (month < 0)
- month += 12.0;
-
- qsreal t = TimeFromYear(year);
- qsreal leap = InLeapYear(t);
-
- day += ::floor(t / msPerDay);
- day += DayFromMonth(month, leap);
-
- return day - 1;
-}
-
-static inline qsreal MakeDate(qsreal day, qsreal time)
-{
- return day * msPerDay + time;
-}
-
-static inline qsreal DaylightSavingTA(double t)
-{
-#ifndef Q_WS_WIN
- long int tt = (long int)(t / msPerSecond);
- struct tm *tmtm = localtime((const time_t*)&tt);
- if (! tmtm)
- return 0;
- return (tmtm->tm_isdst > 0) ? msPerHour : 0;
-#else
- Q_UNUSED(t);
- /// ### implement me
- return 0;
-#endif
-}
-
-static inline qsreal LocalTime(qsreal t)
-{
- return t + LocalTZA + DaylightSavingTA(t);
-}
-
-static inline qsreal UTC(qsreal t)
-{
- return t - LocalTZA - DaylightSavingTA(t - LocalTZA);
-}
-
-static inline qsreal TimeClip(qsreal t)
-{
- if (! qIsFinite(t) || fabs(t) > 8.64e15)
- return qSNaN();
- return ToInteger(t);
-}
-
-static qsreal getLocalTZA()
-{
-#ifndef Q_WS_WIN
- struct tm* t;
- time_t curr;
- time(&curr);
- t = localtime(&curr);
- time_t locl = mktime(t);
- t = gmtime(&curr);
- time_t globl = mktime(t);
- return double(locl - globl) * 1000.0;
-#else
- TIME_ZONE_INFORMATION tzInfo;
- GetTimeZoneInformation(&tzInfo);
- return -tzInfo.Bias * 60.0 * 1000.0;
-#endif
-}
-
-/*!
- \internal
-
- Converts the QDateTime \a dt to an ECMA Date value (in UTC form).
-*/
-qsreal FromDateTime(const QDateTime &dt)
-{
- if (!dt.isValid())
- return qSNaN();
- if (!LocalTZA) // ### move
- LocalTZA = getLocalTZA();
- QDate date = dt.date();
- QTime taim = dt.time();
- int year = date.year();
- int month = date.month() - 1;
- int day = date.day();
- int hours = taim.hour();
- int mins = taim.minute();
- int secs = taim.second();
- int ms = taim.msec();
- double t = MakeDate(MakeDay(year, month, day),
- MakeTime(hours, mins, secs, ms));
- if (dt.timeSpec() == Qt::LocalTime)
- t = UTC(t);
- return TimeClip(t);
-}
-
-/*!
- \internal
-
- Converts the ECMA Date value \tt (in UTC form) to QDateTime
- according to \a spec.
-*/
-QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec)
-{
- if (qIsNaN(t))
- return QDateTime();
- if (!LocalTZA) // ### move
- LocalTZA = getLocalTZA();
- if (spec == Qt::LocalTime)
- t = LocalTime(t);
- int year = int(YearFromTime(t));
- int month = int(MonthFromTime(t) + 1);
- int day = int(DateFromTime(t));
- int hours = HourFromTime(t);
- int mins = MinFromTime(t);
- int secs = SecFromTime(t);
- int ms = msFromTime(t);
- return QDateTime(QDate(year, month, day), QTime(hours, mins, secs, ms), spec);
-}
-
-} // namespace QScript
-
-QT_END_NAMESPACE
diff --git a/src/script/utils/qscriptdate_p.h b/src/script/utils/qscriptdate_p.h
deleted file mode 100644
index b9c9fd4..0000000
--- a/src/script/utils/qscriptdate_p.h
+++ /dev/null
@@ -1,52 +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 QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSCRIPTDATE_P_H
-#define QSCRIPTDATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qdatetime.h>
-
-QT_BEGIN_NAMESPACE
-
-typedef double qsreal;
-
-namespace QScript
-{
- qsreal FromDateTime(const QDateTime &dt);
- QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec);
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/script/utils/utils.pri b/src/script/utils/utils.pri
deleted file mode 100644
index d8302d5..0000000
--- a/src/script/utils/utils.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-SOURCES += \
- $$PWD/qscriptdate.cpp
-
-HEADERS += \
- $$PWD/qscriptdate_p.h
diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index d53c11c..319ba9b 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -6,7 +6,7 @@ QT -= gui
include (../xmlpatterns.pri)
-wince*|symbian*: {
+wince*|symbian: {
QT += network
addFiles.sources = \
$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro
index 259be4c..531fed2 100644
--- a/tests/auto/corelib.pro
+++ b/tests/auto/corelib.pro
@@ -101,3 +101,10 @@ SUBDIRS=\
selftests \
utf8 \
+symbian:SUBDIRS -= \
+ qtconcurrentfilter \
+ qtconcurrentiteratekernel \
+ qtconcurrentmap \
+ qtconcurrentrun \
+ qtconcurrentthreadengine \
+
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index e2d3ee4..dcd1a85 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -694,7 +694,7 @@ void tst_QDeclarativeDebug::queryExpressionResult()
delete q_expr;
q_expr = m_dbg->queryExpressionResult(objectId, expr, this);
- QCOMPARE(q_expr->expression(), expr);
+ QCOMPARE(q_expr->expression().toString(), expr);
waitForQuery(q_expr);
QCOMPARE(q_expr->result(), result);
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
new file mode 100644
index 0000000..092bc2b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js
@@ -0,0 +1 @@
+;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
new file mode 100644
index 0000000..56e7885
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml
@@ -0,0 +1,8 @@
+import Qt 4.7
+import "qtbug_11600.js" as Test
+
+QtObject {
+ id: goo
+
+ property bool test: undefined == goo.Test.foo
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
new file mode 100644
index 0000000..6efb9c1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+
+QtObject {
+ property bool test: false
+ Component.onCompleted: {
+ try {
+ console.log(sorryNoSuchProperty);
+ } catch (e) {
+ test = true;
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
index 4395ba3..2548005 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml
@@ -1,10 +1,10 @@
import Qt 4.7
+import Qt.test 1.0
-Item {
+MyQmlObject {
id: root
property int foo: 12
- property int console: 11
property bool test1: foo == 12
property bool test2: console != 11
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 7bb8a8e..849879e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -86,6 +86,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(bool trueProperty READ trueProperty CONSTANT)
Q_PROPERTY(bool falseProperty READ falseProperty CONSTANT)
Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int console READ console CONSTANT)
Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged)
Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged)
Q_PROPERTY(QDeclarativeListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
@@ -142,6 +143,7 @@ public:
QRegExp regExp() { return m_regExp; }
void setRegExp(const QRegExp &regExp) { m_regExp = regExp; }
+ int console() const { return 11; }
signals:
void basicSignal();
void argumentSignal(int a, QString b, qreal c);
@@ -555,7 +557,9 @@ Q_DECLARE_METATYPE(QScriptValue);
class MyInvokableObject : public QObject
{
Q_OBJECT
+ Q_ENUMS(TestEnum)
public:
+ enum TestEnum { EnumValue1, EnumValue2 };
MyInvokableObject() { reset(); }
int invoked() const { return m_invoked; }
@@ -587,6 +591,8 @@ public:
Q_INVOKABLE void method_overload(int a) { invoke(16); m_actuals << a; }
Q_INVOKABLE void method_overload(int a, int b) { invoke(17); m_actuals << a << b; }
+ Q_INVOKABLE void method_with_enum(TestEnum e) { invoke(18); m_actuals << (int)e; }
+
private:
void invoke(int idx) { if (m_invoked != -1) m_invokedError = true; m_invoked = idx;}
int m_invoked;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 50da55d..43900ae 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -155,6 +155,8 @@ private slots:
void eval();
void function();
void qtbug_10696();
+ void qtbug_11606();
+ void qtbug_11600();
void include();
@@ -1719,6 +1721,13 @@ void tst_qdeclarativeecmascript::callQtInvokables()
QCOMPARE(o.actuals().count(), 2);
QCOMPARE(o.actuals().at(0), QVariant(10));
QCOMPARE(o.actuals().at(1), QVariant(11));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_with_enum(9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 18);
+ QCOMPARE(o.actuals().count(), 1);
+ QCOMPARE(o.actuals().at(0), QVariant(9));
}
// QTBUG-5675
@@ -2503,6 +2512,25 @@ void tst_qdeclarativeecmascript::qtbug_10696()
delete o;
}
+void tst_qdeclarativeecmascript::qtbug_11606()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_11606.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::qtbug_11600()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_11600.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test").toBool(), true);
+ delete o;
+}
+
+
QTEST_MAIN(tst_qdeclarativeecmascript)
#include "tst_qdeclarativeecmascript.moc"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt
new file mode 100644
index 0000000..c83e5ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt
@@ -0,0 +1 @@
+4:5:Illegal property name
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
new file mode 100644
index 0000000..6077de4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml
@@ -0,0 +1,5 @@
+import Qt 4.7
+
+QtObject {
+ property int parseInt
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 413843a..3ce356e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -370,6 +370,7 @@ void tst_qdeclarativelanguage::errors_data()
QTest::newRow("destroyedSignal") << "destroyedSignal.qml" << "destroyedSignal.errors.txt" << false;
QTest::newRow("assignToNamespace") << "assignToNamespace.qml" << "assignToNamespace.errors.txt" << false;
QTest::newRow("invalidOn") << "invalidOn.qml" << "invalidOn.errors.txt" << false;
+ QTest::newRow("invalidProperty") << "invalidProperty.qml" << "invalidProperty.errors.txt" << false;
}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 3d66733..f15ac8f 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -559,6 +559,18 @@ void tst_qdeclarativelistmodel::error_data()
QTest::newRow("QML elements not allowed in ListElement")
<< "import Qt 4.7\nListModel { ListElement { a: Item { } } }"
<< "ListElement: cannot contain nested elements";
+
+ QTest::newRow("qualified ListElement supported")
+ << "import Qt 4.7 as Foo\nFoo.ListModel { Foo.ListElement { a: 123 } }"
+ << "";
+
+ QTest::newRow("qualified ListElement required")
+ << "import Qt 4.7 as Foo\nFoo.ListModel { ListElement { a: 123 } }"
+ << "ListElement is not a type";
+
+ QTest::newRow("unknown qualified ListElement not allowed")
+ << "import Qt 4.7\nListModel { Foo.ListElement { a: 123 } }"
+ << "Foo.ListElement - Foo is not a namespace";
}
void tst_qdeclarativelistmodel::error()
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
index a6f3ab8..9a5ea55 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
@@ -10,10 +10,10 @@ Rectangle {
Item {
id: wrapper
objectName: "wrapper"
- height: ListView.prevSection != ListView.section ? 40 : 20;
+ height: ListView.previousSection != ListView.section ? 40 : 20;
width: 240
Rectangle {
- y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0
+ y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
height: 20
width: parent.width
color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white"
@@ -27,21 +27,26 @@ Rectangle {
text: name
}
Text {
- x: 120
+ x: 100
id: textNumber
objectName: "textNumber"
text: number
}
Text {
+ objectName: "nextSection"
+ x: 150
+ text: wrapper.ListView.nextSection
+ }
+ Text {
x: 200
text: wrapper.y
}
}
Rectangle {
color: "#99bb99"
- height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0
+ height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
width: parent.width
- visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false
+ visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false
Text { text: wrapper.ListView.section }
}
}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 048f0f3..e13bd94 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -902,6 +902,8 @@ void tst_QDeclarativeListView::sections()
QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20));
+ QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QCOMPARE(next->text().toInt(), (i+1)/5);
}
// Remove section boundary
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
index d047a2a..b0b7a3b 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -47,6 +47,7 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativeloader_p.h>
#include "testhttpserver.h"
+#include "../../../shared/util.h"
#define SERVER_PORT 14450
@@ -176,9 +177,7 @@ void tst_QDeclarativeLoader::clear()
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
- QTest::qWait(500);
-
- QVERIFY(loader->item() == 0);
+ QTRY_VERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
QCOMPARE(loader->status(), QDeclarativeLoader::Null);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
@@ -239,8 +238,8 @@ void tst_QDeclarativeLoader::urlToComponent()
"}" )
, TEST_FILE(""));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
- QTest::qWait(500);
- QVERIFY(loader != 0);
+ QTest::qWait(200);
+ QTRY_VERIFY(loader != 0);
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml b/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml
new file mode 100644
index 0000000..6dd108e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml
@@ -0,0 +1,16 @@
+import Qt 4.7
+
+Rectangle {
+ width: 300; height: 200;
+
+ property bool leftToRight: false
+
+ Flow {
+ objectName: "flow"
+ flow: leftToRight ? Flow.LeftToRight : Flow.TopToBottom
+ spacing: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+ Rectangle { color: "red"; width: 100; height: 50 }
+ Rectangle { color: "blue"; width: 100; height: 50 }
+ }
+} \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 62ec707..0663991 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -75,6 +75,7 @@ private slots:
void test_repeater();
void test_flow();
void test_flow_resize();
+ void test_flow_implicit_resize();
void test_conflictinganchors();
private:
QDeclarativeView *createView(const QString &filename);
@@ -655,6 +656,28 @@ void tst_QDeclarativePositioners::test_flow_resize()
delete canvas;
}
+void tst_QDeclarativePositioners::test_flow_implicit_resize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flow-testimplicitsize.qml");
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlow *flow = canvas->rootObject()->findChild<QDeclarativeFlow*>("flow");
+ QVERIFY(flow != 0);
+
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ canvas->rootObject()->setProperty("leftToRight", true);
+ QCOMPARE(flow->width(), 220.0);
+ QCOMPARE(flow->height(), 50.0);
+
+ canvas->rootObject()->setProperty("leftToRight", false);
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ delete canvas;
+}
+
QString warningMessage;
void interceptWarnings(QtMsgType type, const char *msg)
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js
index c165e29..30499e9 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js
@@ -5,3 +5,7 @@ function loadComponent() {
return component.status;
}
+function createComponent() {
+ var component = Qt.createComponent("createComponentData.qml");
+ return component.createObject(null);
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
index aae7a91..33203c7 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml
@@ -3,8 +3,10 @@ import "createComponent_lib.js" as Test
Item {
property int status: Component.Null
+ property int readValue: 0
Component.onCompleted: {
status = Test.loadComponent()
+ readValue = Test.createComponent().test;
}
}
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index fb100a5..895ee6c 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -365,14 +365,12 @@ void tst_qdeclarativeqt::createComponent()
void tst_qdeclarativeqt::createComponent_pragmaLibrary()
{
// Currently, just loading createComponent_lib.qml causes crash on some platforms
- /*
QDeclarativeComponent component(&engine, TEST_FILE("createComponent_lib.qml"));
QObject *object = component.create();
QVERIFY(object != 0);
-
- QEXPECT_FAIL("", "QTBUG-11507", Continue);
QCOMPARE(object->property("status").toInt(), int(QDeclarativeComponent::Ready));
- */
+ QCOMPARE(object->property("readValue").toInt(), int(1913));
+ delete object;
}
void tst_qdeclarativeqt::createQmlObject()
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 2913ddd..639b2f3 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -263,7 +263,6 @@ void tst_qdeclarativestates::attachedPropertyChanges()
MyAttached *att = qobject_cast<MyAttached*>(attObj);
QVERIFY(att);
- QEXPECT_FAIL("", "QTBUG-11283", Abort);
QCOMPARE(att->foo(), 1);
}
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments.qml b/tests/auto/declarative/qdeclarativetext/data/alignments.qml
index b10c335..b1f701b 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments.qml
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments.qml
@@ -20,8 +20,6 @@ Rectangle {
id: t
anchors.fill: parent
- font.family: "Misc Fixed"
- font.pixelSize: 8
horizontalAlignment: TextEdit.AlignRight
verticalAlignment: TextEdit.AlignBottom
wrapMode: TextEdit.WordWrap
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
index b0ad381..99de219 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
index 98232ce..cb85251 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
index b606ba5..ddca549 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
index a8f095d..1b50a81 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
index c2a0679..f041b86 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
index c019551..c75e0d1 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
index 08d581a..b06a5da 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
index d607955..e468857 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
index 2acfb9e..576715f 100644
--- a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
+++ b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 91b3ca0..8a4f152 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -424,6 +424,13 @@ void tst_qdeclarativetext::alignments()
QFETCH(int, vAlign);
QFETCH(QString, expectfile);
+#ifdef Q_WS_X11
+ // Font-specific, but not likely platform-specific, so only test on one platform
+ QFont fn;
+ fn.setRawName("-misc-fixed-medium-r-*-*-8-*-*-*-*-*-*-*");
+ QApplication::setFont(fn);
+#endif
+
QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml");
canvas->show();
@@ -443,7 +450,7 @@ void tst_qdeclarativetext::alignments()
QImage expect(expectfile);
-#ifdef Q_OS_LINUX
+#ifdef Q_WS_X11
// Font-specific, but not likely platform-specific, so only test on one platform
QCOMPARE(actual,expect);
#endif
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml b/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
index b10c335..b1f701b 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments.qml
@@ -20,8 +20,6 @@ Rectangle {
id: t
anchors.fill: parent
- font.family: "Misc Fixed"
- font.pixelSize: 8
horizontalAlignment: TextEdit.AlignRight
verticalAlignment: TextEdit.AlignBottom
wrapMode: TextEdit.WordWrap
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
index b0ad381..99de219 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
index 98232ce..cb85251 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
index b606ba5..ddca549 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
index a8f095d..1b50a81 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
index c2a0679..f041b86 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
index c019551..c75e0d1 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
index 08d581a..b06a5da 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
index d607955..e468857 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
index 2acfb9e..576715f 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
+++ b/tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 009d354..f1a367f 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -325,6 +325,13 @@ void tst_qdeclarativetextedit::alignments()
QFETCH(int, vAlign);
QFETCH(QString, expectfile);
+#ifdef Q_WS_X11
+ // Font-specific, but not likely platform-specific, so only test on one platform
+ QFont fn;
+ fn.setRawName("-misc-fixed-medium-r-*-*-8-*-*-*-*-*-*-*");
+ QApplication::setFont(fn);
+#endif
+
QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml");
canvas->show();
@@ -344,7 +351,7 @@ void tst_qdeclarativetextedit::alignments()
QImage expect(expectfile);
-#ifdef Q_OS_LINUX
+#ifdef Q_WS_X11
// Font-specific, but not likely platform-specific, so only test on one platform
QCOMPARE(actual,expect);
#endif
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 1ea2a95..9660430 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -43,6 +43,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeitem.h>
+#include <QtGui/qmenubar.h>
#include "../../../shared/util.h"
#include "qmlruntime.h"
#include "../../../shared/util.h"
@@ -52,6 +53,12 @@
#define SRCDIR "."
#endif
+#if defined(Q_OS_MAC) || defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
+# define MENUBAR_HEIGHT(mw) 0
+#else
+# define MENUBAR_HEIGHT(mw) (mw->menuBar()->height())
+#endif
+
class tst_QDeclarativeViewer : public QObject
{
@@ -75,47 +82,55 @@ tst_QDeclarativeViewer::tst_QDeclarativeViewer()
{
}
+#define TEST_INITIAL_SIZES(viewer) { \
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject()); \
+ QVERIFY(rootItem); \
+\
+ QCOMPARE(rootItem->width(), 200.0); \
+ QCOMPARE(rootItem->height(), 300.0); \
+ QTRY_COMPARE(viewer->view()->size(), QSize(200, 300)); \
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300)); \
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer))); \
+ QCOMPARE(viewer->size(), viewer->sizeHint()); \
+}
+
void tst_QDeclarativeViewer::orientation()
{
- QWidget window;
- QDeclarativeViewer *viewer = new QDeclarativeViewer(&window);
+ QDeclarativeViewer *viewer = new QDeclarativeViewer();
QVERIFY(viewer);
viewer->open(SRCDIR "/data/orientation.qml");
QVERIFY(viewer->view());
QVERIFY(viewer->menuBar());
QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
QVERIFY(rootItem);
- window.show();
+ viewer->show();
- QApplication::setActiveWindow(&window);
- QTest::qWaitForWindowShown(&window);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&window));
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
- QCOMPARE(rootItem->width(), 200.0);
- QCOMPARE(rootItem->height(), 300.0);
- QTRY_COMPARE(viewer->view()->size(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
- QCOMPARE(viewer->size(), viewer->sizeHint());
+ TEST_INITIAL_SIZES(viewer);
viewer->rotateOrientation();
qApp->processEvents();
+ qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 300.0);
QCOMPARE(rootItem->height(), 200.0);
QTRY_COMPARE(viewer->view()->size(), QSize(300, 200));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(300, 200));
- QCOMPARE(viewer->size(), QSize(300, 200+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(300, 200 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
viewer->rotateOrientation();
qApp->processEvents();
+ qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);
QTRY_COMPARE(viewer->view()->size(), 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());
}
@@ -135,13 +150,7 @@ void tst_QDeclarativeViewer::loading()
QTest::qWaitForWindowShown(viewer);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
- // initial size
- QTRY_COMPARE(rootItem->width(), 200.0);
- QTRY_COMPARE(rootItem->height(), 300.0);
- QCOMPARE(viewer->view()->size(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
- QCOMPARE(viewer->size(), viewer->sizeHint());
+ TEST_INITIAL_SIZES(viewer);
viewer->resize(QSize(400, 500));
qApp->processEvents();
@@ -243,14 +252,7 @@ void tst_QDeclarativeViewer::resizing()
QTest::qWaitForWindowShown(viewer);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
- // initial size
- QCOMPARE(rootItem->width(), 200.0);
- QCOMPARE(rootItem->height(), 300.0);
- 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(), viewer->sizeHint());
+ TEST_INITIAL_SIZES(viewer);
viewer->setSizeToView(false);
diff --git a/tests/auto/declarative/qdeclarativewebview/data/basic.qml b/tests/auto/declarative/qdeclarativewebview/data/basic.qml
index a5a8d34..ff5d3fd 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/basic.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/basic.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
WebView {
url: "basic.html"
diff --git a/tests/auto/declarative/qdeclarativewebview/data/elements.qml b/tests/auto/declarative/qdeclarativewebview/data/elements.qml
index 5af76ed..3adfff8 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/elements.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/elements.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
WebView {
url: "elements.html"
diff --git a/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml b/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml
index 4141166..9f07a51 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
WebView {
url: "javaScript.html"
diff --git a/tests/auto/declarative/qdeclarativewebview/data/loadError.qml b/tests/auto/declarative/qdeclarativewebview/data/loadError.qml
index 2061b5f..a0cc4c8 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/loadError.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/loadError.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
WebView {
url: "does-not-exist.html"
diff --git a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml
index d066c07..e5967b5 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml
@@ -1,7 +1,7 @@
// Demonstrates opening new WebViews from HTML
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
Grid {
columns: 3
diff --git a/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml
index 45684ff..569f4a5 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
Item {
width: 240
diff --git a/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml b/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml
index b14bcf9..1edd436 100644
--- a/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml
+++ b/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import org.webkit 1.0
+import QtWebKit 1.0
WebView {
html: "<p>This is a <b>string</b> set on the WebView"
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index a8fd2b4..cfaa3fa 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -220,3 +220,11 @@ win32:SUBDIRS -= qtextpiecetable
qstylesheetstyle \
qtextpiecetable \
+symbian:SUBDIRS -= \
+ qhelpcontentmodel \
+ qhelpenginecore \
+ qhelpgenerator \
+ qhelpindexmodel \
+ qhelpprojectdata \
+ qsystemtrayicon \
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
index 195c0e6..d4ebe49 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
@@ -2,3 +2,6 @@
.*/lupdate/testdata/good/parsecpp2/main.cpp:55: Excess closing brace .*
.*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .*
.*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .*
+.*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:126: Discarding unconsumed meta data
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
index feb885c..06e6fe0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
@@ -112,3 +112,16 @@ void ToBeUsed::caller()
{
tr("NameSpace::ToBeUsed");
}
+
+
+
+// QTBUG-11818
+//% "Foo"
+QObject::tr("Hello World");
+QObject::tr("Hello World");
+//% "Bar"
+QApplication::translate("QObject", "Hello World");
+QApplication::translate("QObject", "Hello World");
+//% "Baz"
+clear = me;
+QObject::tr("Hello World");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
index 6f48e27..806f56f 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
@@ -10,6 +10,18 @@
</message>
</context>
<context>
+ <name>QObject</name>
+ <message>
+ <location filename="main.cpp" line="120"/>
+ <location filename="main.cpp" line="121"/>
+ <location filename="main.cpp" line="123"/>
+ <location filename="main.cpp" line="124"/>
+ <location filename="main.cpp" line="127"/>
+ <source>Hello World</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>TopLevel</name>
<message>
<location filename="main.cpp" line="82"/>
diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro
index bef2fe9..e887df4 100755
--- a/tests/auto/mediaobject/mediaobject.pro
+++ b/tests/auto/mediaobject/mediaobject.pro
@@ -14,7 +14,7 @@ wince*{
DEFINES += tst_MediaObject=tst_MediaObject_waveout
}
-symbian*:{
+symbian:{
addFiles.sources = media/test.sdp
addFiles.path = media
DEPLOYMENT += addFiles
diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro
index b0d537a..d7cb7f3 100644
--- a/tests/auto/networkselftest/networkselftest.pro
+++ b/tests/auto/networkselftest/networkselftest.pro
@@ -8,7 +8,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT = addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = rfc3252.txt
addFiles.path = .
DEPLOYMENT = addFiles
diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro
index c528c93..f83e0aa 100644
--- a/tests/auto/patternistexamples/patternistexamples.pro
+++ b/tests/auto/patternistexamples/patternistexamples.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_patternistexamples.cpp
CONFIG += qtestlib
-wince*|symbian*: {
+wince*|symbian: {
snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
snippets.path = patternist
widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index e8b1ce9..3193764 100644
--- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -3,11 +3,12 @@
######################################################################
TEMPLATE = app
-!symbian*: {
+!symbian: {
DEPENDPATH += .
INCLUDEPATH += .
}
-wince*|symbian*:TARGET = ../desktopsettingsaware
+wince*:TARGET = ../desktopsettingsaware
+symbian:TARGET = desktopsettingsaware
# Input
SOURCES += main.cpp
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index e68af26..30eb751 100644
--- a/tests/auto/qapplication/test/test.pro
+++ b/tests/auto/qapplication/test/test.pro
@@ -11,7 +11,7 @@ wince* {
DEPLOYMENT = additional deploy someTest
}
-symbian*: {
+symbian: {
additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe
additional.path = desktopsettingsaware
someTest.sources = test.pro
diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro
index a6286ec..e1734e0 100644
--- a/tests/auto/qaudiooutput/qaudiooutput.pro
+++ b/tests/auto/qaudiooutput/qaudiooutput.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qaudiooutput.cpp
QT = core multimedia
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
!symbian {
diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro
index a534d14..3813e4e 100644
--- a/tests/auto/qchar/qchar.pro
+++ b/tests/auto/qchar/qchar.pro
@@ -3,12 +3,12 @@ SOURCES += tst_qchar.cpp
QT = core
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += NormalizationTest.txt
DEPLOYMENT = deploy
}
-symbian*: {
+symbian: {
DEFINES += SRCDIR=""
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 62a38af..0f8cad1 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -10,13 +10,13 @@ win32 {
}
}
-wince*|symbian*: {
+wince*|symbian: {
copier.sources = ../copier/copier.exe
copier.path = copier
paster.sources = ../paster/paster.exe
paster.path = paster
- symbian*: {
+ symbian: {
load(data_caging_paths)
rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
diff --git a/tests/auto/qcryptographichash/qcryptographichash.pro b/tests/auto/qcryptographichash/qcryptographichash.pro
index aa9a7c4..7e1a866 100644
--- a/tests/auto/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/qcryptographichash/qcryptographichash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qcryptographichash.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro
index ece886c..d60b52d 100644
--- a/tests/auto/qdiriterator/qdiriterator.pro
+++ b/tests/auto/qdiriterator/qdiriterator.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qdiriterator.cpp
RESOURCES += qdiriterator.qrc
QT = core
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = entrylist recursiveDirs foo
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro
index 61914b5..5434ada 100644
--- a/tests/auto/qdom/qdom.pro
+++ b/tests/auto/qdom/qdom.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qdom.cpp
QT = core xml
QT -= gui
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = testdata doubleNamespaces.xml umlaut.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qfile/qfile.pro b/tests/auto/qfile/qfile.pro
index 33fd2fd..0383e30 100644
--- a/tests/auto/qfile/qfile.pro
+++ b/tests/auto/qfile/qfile.pro
@@ -5,5 +5,5 @@ wince*:{
SUBDIRS = test stdinprocess
}
-!symbian*:SUBDIRS += largefile
+!symbian:SUBDIRS += largefile
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 2038514..ef5ed22 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -6,7 +6,7 @@ QT = core
RESOURCES += qfileinfo.qrc
-wince*:|symbian*: {
+wince*:|symbian: {
deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp
res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
res.path = resources
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index 33d479a..9618962 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -9,7 +9,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = rfc3252.txt
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index 401c9eb..cc6f585 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -6,7 +6,7 @@ win32:!wince*: LIBS += -lUser32
!wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince*|symbian*: {
+wince*|symbian: {
rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
renderFiles.sources = testData\\render\\*
@@ -17,4 +17,4 @@ wince*:{
DEFINES += SRCDIR=\\\".\\\"
}
-symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # Min 1Mb, max 16Mb
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 6fedb82..86b98a2 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qhash.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index 23a73c4..c0be518 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -13,7 +13,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT = addFiles webFiles cgi
DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
webFiles.sources = webserver/*
webFiles.path = webserver
cgi.sources = webserver/cgi-bin/*
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index b9c8622..cabab3f 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -12,7 +12,7 @@ wince*: {
}
addPlugins.path = imageformats
DEPLOYMENT += addFiles addPlugins
-} else:symbian* {
+} else:symbian {
addFiles.sources = icons
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index 3e0bd69..6469211 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -6,7 +6,7 @@ wince*: {
addImages.path = images
DEPLOYMENT += addImages
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
addImages.sources = images/*
addImages.path = images
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index 402e94b..f8fc7fa 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -27,7 +27,7 @@ wince*: {
DEFINES += SRCDIR=\\\".\\\"
}
-symbian*: {
+symbian: {
images.sources = images
images.path = .
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index 2171c3e..f25472f 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -10,7 +10,7 @@ wince*: {
addFiles.path = images
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
addFiles.sources = images\\*.*
addFiles.path = images
DEPLOYMENT += addFiles
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index 2d0bdea..92709fe 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -15,7 +15,7 @@ QT += sql
#}
symbian {
- TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+ TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
qt_not_deployed {
contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
sqlite.path = /sys/bin
diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro
index 0dfe1e9..c99f1d9 100644
--- a/tests/auto/qlayout/qlayout.pro
+++ b/tests/auto/qlayout/qlayout.pro
@@ -6,7 +6,7 @@ load(qttest_p4)
SOURCES += tst_qlayout.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = baseline
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index e15d7ed..4c647c0 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -16,7 +16,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\"\\\"
-}else:symbian* {
+}else:symbian {
binDep.sources = \
mylib.dll \
system.trolltech.test.mylib.dll
diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro
index 1a3d7f2..4651fd3 100644
--- a/tests/auto/qline/qline.pro
+++ b/tests/auto/qline/qline.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
QT -= gui
SOURCES += tst_qline.cpp
-unix:!mac:!symbian*:!vxworks:LIBS+=-lm
+unix:!mac:!symbian:!vxworks:LIBS+=-lm
diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro
index 287e946..3911a64 100644
--- a/tests/auto/qlocalsocket/qlocalsocket.pro
+++ b/tests/auto/qlocalsocket/qlocalsocket.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = lackey test
-!wince*:!symbian*: SUBDIRS += example
+!wince*:!symbian: SUBDIRS += example
symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro
index a0a6420..adce164 100644
--- a/tests/auto/qmenubar/qmenubar.pro
+++ b/tests/auto/qmenubar/qmenubar.pro
@@ -2,5 +2,5 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qmenubar.cpp
-contains(QT_CONFIG, qt3support):!symbian*:QT += qt3support
+contains(QT_CONFIG, qt3support):!symbian:QT += qt3support
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index a8ec478..510a70e 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -13,7 +13,7 @@ wince*: {
}
-symbian*: {
+symbian: {
addFiles.sources = animations\\*
addFiles.path = animations
DEPLOYMENT += addFiles
diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro
index c8446d1..69dc98d 100644
--- a/tests/auto/qpainter/qpainter.pro
+++ b/tests/auto/qpainter/qpainter.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
contains(QT_CONFIG, qt3support): QT += qt3support
SOURCES += tst_qpainter.cpp
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qpathclipper/qpathclipper.pro b/tests/auto/qpathclipper/qpathclipper.pro
index 930a6f2..590fba0 100644
--- a/tests/auto/qpathclipper/qpathclipper.pro
+++ b/tests/auto/qpathclipper/qpathclipper.pro
@@ -5,6 +5,6 @@ SOURCES += tst_qpathclipper.cpp paths.cpp
requires(contains(QT_CONFIG,private_tests))
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index a3577bd..c3ee192 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qpixmap.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
task31722_0.sources = convertFromImage/task31722_0/*.png
task31722_0.path = convertFromImage/task31722_0
@@ -18,7 +18,7 @@ wince*|symbian*: {
wince*: {
DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
DEPLOYMENT_PLUGIN += qmng
LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
contains(QT_CONFIG, openvg) {
diff --git a/tests/auto/qprocess/testDetached/testDetached.pro b/tests/auto/qprocess/testDetached/testDetached.pro
index 319cfa6..80a616b 100644
--- a/tests/auto/qprocess/testDetached/testDetached.pro
+++ b/tests/auto/qprocess/testDetached/testDetached.pro
@@ -5,6 +5,6 @@ CONFIG -= app_bundle
INSTALLS =
DESTDIR = ./
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x14000
}
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index 3e47b52..17e36af 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -20,7 +20,7 @@ QMAKE_EXTRA_TARGETS = runtime_resource
PRE_TARGETDEPS += $${runtime_resource.target}
QT = core
-wince*|symbian*:{
+wince*|symbian:{
deploy.sources += runtime_resource.rcc parentdir.txt
test.sources = testqrc/*
test.path = testqrc
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index 7d0f5d0..fc35f66 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -9,7 +9,7 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = script
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 5e59950..6885adf 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -51,6 +51,8 @@
#include <QtCore/qnumeric.h>
#include <stdlib.h>
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QObjectList)
Q_DECLARE_METATYPE(QScriptProgram)
@@ -169,6 +171,8 @@ private slots:
void qRegExpInport_data();
void qRegExpInport();
void reentrency();
+ void newFixedStaticScopeObject();
+ void newGrowingStaticScopeObject();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -4955,5 +4959,243 @@ void tst_QScriptEngine::reentrency()
QCOMPARE(eng.evaluate("foo() + hello").toInt32(), 5+6+9);
}
+void tst_QScriptEngine::newFixedStaticScopeObject()
+{
+ QScriptEngine eng;
+ static const int propertyCount = 4;
+ QString names[] = { "foo", "bar", "baz", "Math" };
+ QScriptValue values[] = { 123, "ciao", true, false };
+ QScriptValue::PropertyFlags flags[] = { QScriptValue::Undeletable,
+ QScriptValue::ReadOnly | QScriptValue::Undeletable,
+ QScriptValue::SkipInEnumeration | QScriptValue::Undeletable,
+ QScriptValue::Undeletable };
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount, names, values, flags);
+
+ // Query property.
+ for (int i = 0; i < propertyCount; ++i) {
+ for (int x = 0; x < 2; ++x) {
+ if (x) {
+ // Properties can't be deleted.
+ scope.setProperty(names[i], QScriptValue());
+ }
+ QVERIFY(scope.property(names[i]).equals(values[i]));
+ QCOMPARE(scope.propertyFlags(names[i]), flags[i]);
+ }
+ }
+
+ // Property that doesn't exist.
+ QVERIFY(!scope.property("noSuchProperty").isValid());
+ QCOMPARE(scope.propertyFlags("noSuchProperty"), QScriptValue::PropertyFlags());
+
+ // Write to writable property.
+ {
+ QScriptValue oldValue = scope.property("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ scope.setProperty("foo", newValue);
+ QVERIFY(scope.property("foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(scope.property("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ scope.setProperty("bar", 456);
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Iterate.
+ {
+ QScriptValueIterator it(scope);
+ QSet<QString> iteratedNames;
+ while (it.hasNext()) {
+ it.next();
+ iteratedNames.insert(it.name());
+ }
+ for (int i = 0; i < propertyCount; ++i)
+ QVERIFY(iteratedNames.contains(names[i]));
+ }
+
+ // Push it on the scope chain of a new context.
+ QScriptContext *ctx = eng.pushContext();
+ ctx->pushScope(scope);
+ QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+ QVERIFY(ctx->activationObject().equals(scope));
+
+ // Read property from JS.
+ for (int i = 0; i < propertyCount; ++i) {
+ for (int x = 0; x < 2; ++x) {
+ if (x) {
+ // Property can't be deleted from JS.
+ QScriptValue ret = eng.evaluate(QString::fromLatin1("delete %0").arg(names[i]));
+ QVERIFY(ret.equals(false));
+ }
+ QVERIFY(eng.evaluate(names[i]).equals(values[i]));
+ }
+ }
+
+ // Property that doesn't exist.
+ QVERIFY(eng.evaluate("noSuchProperty").equals("ReferenceError: Can't find variable: noSuchProperty"));
+
+ // Write property from JS.
+ {
+ QScriptValue oldValue = eng.evaluate("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(eng.evaluate("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+ // Create a closure and return properties from there.
+ {
+ QScriptValue props = eng.evaluate("(function() { var baz = 'shadow'; return [foo, bar, baz, Math, Array]; })()");
+ QVERIFY(props.isArray());
+ // "foo" and "bar" come from scope object.
+ QVERIFY(props.property(0).equals(scope.property("foo")));
+ QVERIFY(props.property(1).equals(scope.property("bar")));
+ // "baz" shadows property in scope object.
+ QVERIFY(props.property(2).equals("shadow"));
+ // "Math" comes from scope object, and shadows Global Object's "Math".
+ QVERIFY(props.property(3).equals(scope.property("Math")));
+ QVERIFY(!props.property(3).equals(eng.globalObject().property("Math")));
+ // "Array" comes from Global Object.
+ QVERIFY(props.property(4).equals(eng.globalObject().property("Array")));
+ }
+
+ // As with normal JS, assigning to an undefined variable will create
+ // the property on the Global Object, not the inner scope.
+ QVERIFY(!eng.globalObject().property("newProperty").isValid());
+ QVERIFY(eng.evaluate("(function() { newProperty = 789; })()").isUndefined());
+ QVERIFY(!scope.property("newProperty").isValid());
+ QVERIFY(eng.globalObject().property("newProperty").isNumber());
+
+ // Nested static scope.
+ {
+ static const int propertyCount2 = 2;
+ QString names2[] = { "foo", "hum" };
+ QScriptValue values2[] = { 321, "hello" };
+ QScriptValue::PropertyFlags flags2[] = { QScriptValue::Undeletable,
+ QScriptValue::ReadOnly | QScriptValue::Undeletable };
+ QScriptValue scope2 = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount2, names2, values2, flags2);
+ ctx->pushScope(scope2);
+
+ // "foo" shadows scope.foo.
+ QVERIFY(eng.evaluate("foo").equals(scope2.property("foo")));
+ QVERIFY(!eng.evaluate("foo").equals(scope.property("foo")));
+ // "hum" comes from scope2.
+ QVERIFY(eng.evaluate("hum").equals(scope2.property("hum")));
+ // "Array" comes from Global Object.
+ QVERIFY(eng.evaluate("Array").equals(eng.globalObject().property("Array")));
+
+ ctx->popScope();
+ }
+
+ QScriptValue fun = eng.evaluate("(function() { return foo; })");
+ QVERIFY(fun.isFunction());
+ eng.popContext();
+ // Function's scope chain persists after popContext().
+ QVERIFY(fun.call().equals(scope.property("foo")));
+}
+
+void tst_QScriptEngine::newGrowingStaticScopeObject()
+{
+ QScriptEngine eng;
+ QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng);
+
+ // Initially empty.
+ QVERIFY(!QScriptValueIterator(scope).hasNext());
+ QVERIFY(!scope.property("foo").isValid());
+
+ // Add a static property.
+ scope.setProperty("foo", 123);
+ QVERIFY(scope.property("foo").equals(123));
+ QCOMPARE(scope.propertyFlags("foo"), QScriptValue::Undeletable);
+
+ // Modify existing property.
+ scope.setProperty("foo", 456);
+ QVERIFY(scope.property("foo").equals(456));
+
+ // Add a read-only property.
+ scope.setProperty("bar", "ciao", QScriptValue::ReadOnly);
+ QVERIFY(scope.property("bar").equals("ciao"));
+ QCOMPARE(scope.propertyFlags("bar"), QScriptValue::ReadOnly | QScriptValue::Undeletable);
+
+ // Attempt to modify read-only property.
+ scope.setProperty("bar", "hello");
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Properties can't be deleted.
+ scope.setProperty("foo", QScriptValue());
+ QVERIFY(scope.property("foo").equals(456));
+ scope.setProperty("bar", QScriptValue());
+ QVERIFY(scope.property("bar").equals("ciao"));
+
+ // Iterate.
+ {
+ QScriptValueIterator it(scope);
+ QSet<QString> iteratedNames;
+ while (it.hasNext()) {
+ it.next();
+ iteratedNames.insert(it.name());
+ }
+ QCOMPARE(iteratedNames.size(), 2);
+ QVERIFY(iteratedNames.contains("foo"));
+ QVERIFY(iteratedNames.contains("bar"));
+ }
+
+ // Push it on the scope chain of a new context.
+ QScriptContext *ctx = eng.pushContext();
+ ctx->pushScope(scope);
+ QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+ QVERIFY(ctx->activationObject().equals(scope));
+
+ // Read property from JS.
+ QVERIFY(eng.evaluate("foo").equals(scope.property("foo")));
+ QVERIFY(eng.evaluate("bar").equals(scope.property("bar")));
+
+ // Write property from JS.
+ {
+ QScriptValue oldValue = eng.evaluate("foo");
+ QVERIFY(oldValue.isNumber());
+ QScriptValue newValue = oldValue.toNumber() * 2;
+ QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+ scope.setProperty("foo", oldValue);
+ QVERIFY(eng.evaluate("foo").equals(oldValue));
+ }
+
+ // Write to read-only property.
+ QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+ // Shadow property.
+ QVERIFY(eng.evaluate("Math").equals(eng.globalObject().property("Math")));
+ scope.setProperty("Math", "fake Math");
+ QVERIFY(eng.evaluate("Math").equals(scope.property("Math")));
+
+ // Variable declarations will create properties on the scope.
+ eng.evaluate("var baz = 456");
+ QVERIFY(scope.property("baz").equals(456));
+
+ // Function declarations will create properties on the scope.
+ eng.evaluate("function fun() { return baz; }");
+ QVERIFY(scope.property("fun").isFunction());
+ QVERIFY(scope.property("fun").call().equals(scope.property("baz")));
+
+ // Demonstrate the limitation of a growable static scope: Once a function that
+ // uses the scope has been compiled, it won't pick up properties that are added
+ // to the scope later.
+ {
+ QScriptValue fun = eng.evaluate("(function() { return futureProperty; })");
+ QVERIFY(fun.isFunction());
+ QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+ scope.setProperty("futureProperty", "added after the function was compiled");
+ // If scope were dynamic, this would return the new property.
+ QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+ }
+
+ eng.popContext();
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/auto/qsemaphore/tst_qsemaphore.cpp b/tests/auto/qsemaphore/tst_qsemaphore.cpp
index ace33dc..7cede30 100644
--- a/tests/auto/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/qsemaphore/tst_qsemaphore.cpp
@@ -63,6 +63,7 @@ private slots:
void tryAcquire();
void tryAcquireWithTimeout_data();
void tryAcquireWithTimeout();
+ void tryAcquireWithTimeoutStarvation();
void release();
void available();
void producerConsumer();
@@ -232,8 +233,8 @@ void tst_QSemaphore::tryAcquireWithTimeout_data()
{
QTest::addColumn<int>("timeout");
- QTest::newRow("") << 1000;
- QTest::newRow("") << 10000;
+ QTest::newRow("1s") << 1000;
+ QTest::newRow("10s") << 10000;
}
void tst_QSemaphore::tryAcquireWithTimeout()
@@ -316,6 +317,50 @@ void tst_QSemaphore::tryAcquireWithTimeout()
QCOMPARE(semaphore.available(), 0);
}
+void tst_QSemaphore::tryAcquireWithTimeoutStarvation()
+{
+ class Thread : public QThread
+ {
+ public:
+ QSemaphore startup;
+ QSemaphore *semaphore;
+ int amountToConsume, timeout;
+
+ void run()
+ {
+ startup.release();
+ forever {
+ if (!semaphore->tryAcquire(amountToConsume, timeout))
+ break;
+ semaphore->release(amountToConsume);
+ }
+ }
+ };
+
+ QSemaphore semaphore;
+ semaphore.release(1);
+
+ Thread consumer;
+ consumer.semaphore = &semaphore;
+ consumer.amountToConsume = 1;
+ consumer.timeout = 1000;
+
+ // start the thread and wait for it to start consuming
+ consumer.start();
+ consumer.startup.acquire();
+
+ // try to consume more than the thread we started is, and provide a longer
+ // timeout... we should timeout, not wait indefinitely
+ QVERIFY(!semaphore.tryAcquire(consumer.amountToConsume * 2, consumer.timeout * 2));
+
+ // the consumer should still be running
+ QVERIFY(consumer.isRunning() && !consumer.isFinished());
+
+ // acquire, and wait for smallConsumer to timeout
+ semaphore.acquire();
+ QVERIFY(consumer.wait());
+}
+
void tst_QSemaphore::release()
{ DEPENDS_ON("acquire"); }
diff --git a/tests/auto/qset/qset.pro b/tests/auto/qset/qset.pro
index 05ad07d..b45a015 100644
--- a/tests/auto/qset/qset.pro
+++ b/tests/auto/qset/qset.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qset.cpp
QT = core
-symbian*: {
+symbian: {
TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
}
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index 383a085..bb1981c 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -1,7 +1,7 @@
load(qttest_p4)
SOURCES += tst_qsound.cpp
-wince*|symbian*: {
+wince*|symbian: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
!symbian:DEFINES += SRCDIR=\\\"\\\"
diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro
index 5ec2b9d..b11e408 100644
--- a/tests/auto/qsplitter/qsplitter.pro
+++ b/tests/auto/qsplitter/qsplitter.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qsplitter.cpp
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = extradata.txt setSizes3.dat
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 1ffe369..11f5943 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
TARGET.EPOCHEAPSIZE = 0x200000 0x800000
SOURCES += tst_qstyle.cpp
-wince*|symbian*: {
+wince*|symbian: {
!symbian:DEFINES += SRCDIR=\\\".\\\"
addPixmap.sources = task_25863.png
addPixmap.path = .
diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro
index 370a695..8b1f664 100644
--- a/tests/auto/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/qtcpsocket/qtcpsocket.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
!wince*: SUBDIRS = test stressTest
-wince*|symbian*|vxworks* : SUBDIRS = test
+wince*|symbian|vxworks* : SUBDIRS = test
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
index cba5a74..aa1fbb5 100644
--- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -4,7 +4,7 @@ HEADERS +=
SOURCES += tst_qtextboundaryfinder.cpp
!symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
-wince*|symbian*:{
+wince*|symbian:{
addFiles.sources = data
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro
index e159a3c..88061a9 100644
--- a/tests/auto/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/qtextbrowser/qtextbrowser.pro
@@ -1,11 +1,11 @@
load(qttest_p4)
SOURCES += tst_qtextbrowser.cpp
-!symbian*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = *.html
addFiles.path = .
addDir.sources = subdir/*
diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro
index 3efabad..43813da 100644
--- a/tests/auto/qtextedit/qtextedit.pro
+++ b/tests/auto/qtextedit/qtextedit.pro
@@ -5,7 +5,7 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtextedit.cpp
-wince*|symbian*: {
+wince*|symbian: {
addImages.sources = fullWidthSelection/*
addImages.path = fullWidthSelection
DEPLOYMENT += addImages
diff --git a/tests/auto/qthread/qthread.pro b/tests/auto/qthread/qthread.pro
index 4ea8fe5..0b042ab 100644
--- a/tests/auto/qthread/qthread.pro
+++ b/tests/auto/qthread/qthread.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthread.cpp
QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro
index 376ba65..3071098 100644
--- a/tests/auto/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/qthreadstorage/qthreadstorage.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
SOURCES += tst_qthreadstorage.cpp
QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro
index 4ff5486..68a5362 100644
--- a/tests/auto/qtipc/qsharedmemory/test/test.pro
+++ b/tests/auto/qtipc/qsharedmemory/test/test.pro
@@ -24,7 +24,7 @@ addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
addFiles.path = .
DEPLOYMENT += addFiles
DEFINES += SRCDIR=\\\".\\\"
-}else:symbian*{
+}else:symbian{
requires(contains(QT_CONFIG,script))
QT += gui script
addFiles.sources = ../../lackey/scripts
diff --git a/tests/auto/qtransform/qtransform.pro b/tests/auto/qtransform/qtransform.pro
index 298feb2..92bef8c 100644
--- a/tests/auto/qtransform/qtransform.pro
+++ b/tests/auto/qtransform/qtransform.pro
@@ -2,6 +2,6 @@ load(qttest_p4)
HEADERS +=
SOURCES += tst_qtransform.cpp
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro
index 2b08b4a..5b742f7 100644
--- a/tests/auto/qtranslator/qtranslator.pro
+++ b/tests/auto/qtranslator/qtranslator.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
SOURCES += tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = hellotr_la.qm msgfmt_from_po.qm
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qtwidgets/qtwidgets.pro b/tests/auto/qtwidgets/qtwidgets.pro
index b762acb..9c33cd1 100644
--- a/tests/auto/qtwidgets/qtwidgets.pro
+++ b/tests/auto/qtwidgets/qtwidgets.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-symbian*:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
+symbian:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
SOURCES += tst_qtwidgets.cpp mainwindow.cpp
HEADERS += mainwindow.h
diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro
index 44d3d30..9c0d009 100644
--- a/tests/auto/qudpsocket/test/test.pro
+++ b/tests/auto/qudpsocket/test/test.pro
@@ -14,7 +14,7 @@ win32 {
DESTDIR = ../
}
-wince*|symbian*: {
+wince*|symbian: {
addApp.sources = ../clientserver/clientserver.exe
addApp.path = clientserver
DEPLOYMENT += addApp
diff --git a/tests/auto/qwmatrix/qwmatrix.pro b/tests/auto/qwmatrix/qwmatrix.pro
index 58ea706..bab298b 100644
--- a/tests/auto/qwmatrix/qwmatrix.pro
+++ b/tests/auto/qwmatrix/qwmatrix.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
SOURCES += tst_qwmatrix.cpp
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro
index 304fc54..5fb7fe2 100644
--- a/tests/auto/qxml/qxml.pro
+++ b/tests/auto/qxml/qxml.pro
@@ -3,7 +3,7 @@ load(qttest_p4)
SOURCES += tst_qxml.cpp
QT = core xml
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = 0x010D.xml
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro
index 4c00d73..339fa55 100644
--- a/tests/auto/qxmlformatter/qxmlformatter.pro
+++ b/tests/auto/qxmlformatter/qxmlformatter.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qxmlformatter.cpp
include (../xmlpatterns.pri)
-wince*|symbian*:{
+wince*|symbian:{
addFiles.sources = baselines input
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index cfab564..ae73488 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -18,7 +18,7 @@ wince* {
include (../xmlpatterns.pri)
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = pushBaselines input.xml
addFiles.path = .
diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
index bfdec58..c107470 100644
--- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
@@ -12,7 +12,7 @@ QT += network xml
QT -= gui
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = encodings parser xmldocs
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro
index f82a7b3..8f076be 100644
--- a/tests/auto/qxmlstream/qxmlstream.pro
+++ b/tests/auto/qxmlstream/qxmlstream.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxmlstream.cpp
QT = core xml network
-wince*|symbian*: {
+wince*|symbian: {
addFiles.sources = data XML-Test-Suite
addFiles.path = .
DEPLOYMENT += addFiles
diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp
index d4f3165..eaa23e9 100644
--- a/tests/benchmarks/gui/text/qtext/main.cpp
+++ b/tests/benchmarks/gui/text/qtext/main.cpp
@@ -82,6 +82,10 @@ private slots:
void constructControl();
void constructDocument();
+ void newLineReplacement();
+ void formatManipulation();
+
+ void layout_data();
void layout();
void paintLayoutToPixmap();
void paintLayoutToPixmap_painterFill();
@@ -95,7 +99,7 @@ private slots:
void paintControlToPixmap_painterFill();
private:
- QSize setupTextLayout(QTextLayout *layout);
+ QSize setupTextLayout(QTextLayout *layout, bool wrap = true, int wrapWidth = 100);
QString m_lorem;
QString m_shortLorem;
@@ -227,10 +231,8 @@ void tst_QText::odfWriting_images()
delete doc;
}
-QSize tst_QText::setupTextLayout(QTextLayout *layout)
+QSize tst_QText::setupTextLayout(QTextLayout *layout, bool wrap, int wrapWidth)
{
- bool wrap = true;
- int wrapWidth = 300;
layout->setCacheEnabled(true);
int height = 0;
@@ -242,7 +244,6 @@ QSize tst_QText::setupTextLayout(QTextLayout *layout)
lineWidth = wrapWidth;
layout->beginLayout();
-
while (1) {
QTextLine line = layout->createLine();
if (!line.isValid())
@@ -284,17 +285,60 @@ void tst_QText::constructDocument()
}
}
+//this step is needed before giving the string to a QTextLayout
+void tst_QText::newLineReplacement()
+{
+ QString text = QString::fromLatin1("H\ne\nl\nl\no\n\nW\no\nr\nl\nd");
+
+ QBENCHMARK {
+ QString tmp = text;
+ tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);
+ }
+}
+
+void tst_QText::formatManipulation()
+{
+ QFont font;
+
+ QBENCHMARK {
+ QTextCharFormat format;
+ format.setFont(font);
+ }
+}
+
+void tst_QText::layout_data()
+{
+ QTest::addColumn<bool>("wrap");
+ QTest::newRow("wrap") << true;
+ QTest::newRow("nowrap") << false;
+}
+
void tst_QText::layout()
{
+ QFETCH(bool,wrap);
QTextLayout layout(m_shortLorem);
- setupTextLayout(&layout);
+ setupTextLayout(&layout, wrap);
QBENCHMARK {
QTextLayout layout(m_shortLorem);
- setupTextLayout(&layout);
+ setupTextLayout(&layout, wrap);
}
}
+//### requires tst_QText to be a friend of QTextLayout
+/*void tst_QText::stackTextLayout()
+{
+ QStackTextEngine engine(m_shortLorem, qApp->font());
+ QTextLayout layout(&engine);
+ setupTextLayout(&layout);
+
+ QBENCHMARK {
+ QStackTextEngine engine(m_shortLorem, qApp->font());
+ QTextLayout layout(&engine);
+ setupTextLayout(&layout);
+ }
+}*/
+
void tst_QText::paintLayoutToPixmap()
{
QTextLayout layout(m_shortLorem);
diff --git a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
index 35e2f28..4610046 100644
--- a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
@@ -42,6 +42,8 @@
#include <qtest.h>
#include <QtScript>
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
//TESTED_FILES=
class tst_QScriptEngine : public QObject
@@ -74,6 +76,8 @@ private slots:
void nativeCall();
void translation_data();
void translation();
+ void readScopeProperty_data();
+ void readScopeProperty();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -288,5 +292,53 @@ void tst_QScriptEngine::translation()
}
}
+void tst_QScriptEngine::readScopeProperty_data()
+{
+ QTest::addColumn<bool>("staticScope");
+ QTest::addColumn<bool>("nestedScope");
+ QTest::newRow("single dynamic scope") << false << false;
+ QTest::newRow("single static scope") << true << false;
+ QTest::newRow("double dynamic scope") << false << true;
+ QTest::newRow("double static scope") << true << true;
+}
+
+void tst_QScriptEngine::readScopeProperty()
+{
+ QFETCH(bool, staticScope);
+ QFETCH(bool, nestedScope);
+
+ QScriptEngine engine;
+ QScriptContext *ctx = engine.pushContext();
+
+ QScriptValue scope;
+ if (staticScope)
+ scope = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ else
+ scope = engine.newObject();
+ scope.setProperty("foo", 123);
+ ctx->pushScope(scope);
+
+ if (nestedScope) {
+ QScriptValue scope2;
+ if (staticScope)
+ scope2 = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+ else
+ scope2 = engine.newObject();
+ scope2.setProperty("bar", 456); // ensure a miss in inner scope
+ ctx->pushScope(scope2);
+ }
+
+ QScriptValue fun = engine.evaluate("(function() {\n"
+ " for (var i = 0; i < 10000; ++i) {\n"
+ " foo; foo; foo; foo; foo; foo; foo; foo;\n"
+ " }\n"
+ "})");
+ engine.popContext();
+ QVERIFY(fun.isFunction());
+ QBENCHMARK {
+ fun.call();
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index c66eb53..c3de09e 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
-std::ostream &operator<<( std::ostream &s, const QString &val ) {
+std::ostream &operator<<(std::ostream &s, const QString &val) {
s << val.toLocal8Bit().data();
return s;
}
@@ -89,7 +89,7 @@ bool writeToFile(const char* text, const QString &filename)
return true;
}
-Configure::Configure( int& argc, char** argv )
+Configure::Configure(int& argc, char** argv)
{
useUnixSeparators = false;
// Default values for indentation
@@ -111,7 +111,7 @@ Configure::Configure( int& argc, char** argv )
*/
dictionary[ "CONFIGCMD" ] = argv[ 0 ];
- for ( i = 1; i < argc; i++ )
+ for (i = 1; i < argc; i++)
configCmdLine += argv[ i ];
@@ -127,7 +127,7 @@ Configure::Configure( int& argc, char** argv )
#else
const QString installPath = buildPath;
#endif
- if(sourceDir != buildDir) { //shadow builds!
+ if (sourceDir != buildDir) { //shadow builds!
if (!findFile("perl") && !findFile("perl.exe")) {
cout << "Error: Creating a shadow build of Qt requires" << endl
<< "perl to be in the PATH environment";
@@ -140,37 +140,37 @@ Configure::Configure( int& argc, char** argv )
{ //duplicate qmake
QStack<QString> qmake_dirs;
qmake_dirs.push("qmake");
- while(!qmake_dirs.isEmpty()) {
+ while (!qmake_dirs.isEmpty()) {
QString dir = qmake_dirs.pop();
QString od(buildPath + "/" + dir);
QString id(sourcePath + "/" + dir);
QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries);
- for(int i = 0; i < entries.size(); ++i) {
+ for (int i = 0; i < entries.size(); ++i) {
QFileInfo fi(entries.at(i));
- if(fi.isDir()) {
+ if (fi.isDir()) {
qmake_dirs.push(dir + "/" + fi.fileName());
QDir().mkpath(od + "/" + fi.fileName());
} else {
- QDir().mkpath(od );
+ QDir().mkpath(od);
bool justCopy = true;
const QString fname = fi.fileName();
const QString outFile(od + "/" + fname), inFile(id + "/" + fname);
- if(fi.fileName() == "Makefile") { //ignore
- } else if(fi.suffix() == "h" || fi.suffix() == "cpp") {
+ if (fi.fileName() == "Makefile") { //ignore
+ } else if (fi.suffix() == "h" || fi.suffix() == "cpp") {
QTemporaryFile tmpFile;
- if(tmpFile.open()) {
+ if (tmpFile.open()) {
QTextStream stream(&tmpFile);
stream << "#include \"" << inFile << "\"" << endl;
justCopy = false;
stream.flush();
tmpFile.flush();
- if(filesDiffer(tmpFile.fileName(), outFile)) {
+ if (filesDiffer(tmpFile.fileName(), outFile)) {
QFile::remove(outFile);
tmpFile.copy(outFile);
}
}
}
- if(justCopy && filesDiffer(inFile, outFile))
+ if (justCopy && filesDiffer(inFile, outFile))
QFile::copy(inFile, outFile);
}
}
@@ -179,13 +179,13 @@ Configure::Configure( int& argc, char** argv )
{ //make a syncqt script(s) that can be used in the shadow
QFile syncqt(buildPath + "/bin/syncqt");
- if(syncqt.open(QFile::WriteOnly)) {
+ if (syncqt.open(QFile::WriteOnly)) {
QTextStream stream(&syncqt);
stream << "#!/usr/bin/perl -w" << endl
<< "require \"" << sourcePath + "/bin/syncqt\";" << endl;
}
QFile syncqt_bat(buildPath + "/bin/syncqt.bat");
- if(syncqt_bat.open(QFile::WriteOnly)) {
+ if (syncqt_bat.open(QFile::WriteOnly)) {
QTextStream stream(&syncqt_bat);
stream << "@echo off" << endl
<< "set QTDIR=" << QDir::toNativeSeparators(sourcePath) << endl
@@ -197,26 +197,26 @@ Configure::Configure( int& argc, char** argv )
// make patch_capabilities and createpackage scripts for Symbian that can be used from the shadow build
QFile patch_capabilities(buildPath + "/bin/patch_capabilities");
- if(patch_capabilities.open(QFile::WriteOnly)) {
+ if (patch_capabilities.open(QFile::WriteOnly)) {
QTextStream stream(&patch_capabilities);
stream << "#!/usr/bin/perl -w" << endl
<< "require \"" << sourcePath + "/bin/patch_capabilities\";" << endl;
}
QFile patch_capabilities_bat(buildPath + "/bin/patch_capabilities.bat");
- if(patch_capabilities_bat.open(QFile::WriteOnly)) {
+ if (patch_capabilities_bat.open(QFile::WriteOnly)) {
QTextStream stream(&patch_capabilities_bat);
stream << "@echo off" << endl
<< "call " << fixSeparators(sourcePath) << fixSeparators("/bin/patch_capabilities.bat %*") << endl;
patch_capabilities_bat.close();
}
QFile createpackage(buildPath + "/bin/createpackage");
- if(createpackage.open(QFile::WriteOnly)) {
+ if (createpackage.open(QFile::WriteOnly)) {
QTextStream stream(&createpackage);
stream << "#!/usr/bin/perl -w" << endl
<< "require \"" << sourcePath + "/bin/createpackage\";" << endl;
}
QFile createpackage_bat(buildPath + "/bin/createpackage.bat");
- if(createpackage_bat.open(QFile::WriteOnly)) {
+ if (createpackage_bat.open(QFile::WriteOnly)) {
QTextStream stream(&createpackage_bat);
stream << "@echo off" << endl
<< "call " << fixSeparators(sourcePath) << fixSeparators("/bin/createpackage.bat %*") << endl;
@@ -228,7 +228,7 @@ Configure::Configure( int& argc, char** argv )
QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");
//copy the mkspecs
buildDir.mkpath("mkspecs");
- if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
+ if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
dictionary["DONE"] = "error";
return;
@@ -304,7 +304,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "VERSION" ] = version;
{
QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)");
- if(version_re.exactMatch(version)) {
+ if (version_re.exactMatch(version)) {
dictionary[ "VERSION_MAJOR" ] = version_re.cap(1);
dictionary[ "VERSION_MINOR" ] = version_re.cap(2);
dictionary[ "VERSION_PATCH" ] = version_re.cap(3);
@@ -372,9 +372,9 @@ Configure::Configure( int& argc, char** argv )
QString tmp = dictionary[ "QMAKESPEC" ];
if (tmp.contains("\\")) {
- tmp = tmp.mid( tmp.lastIndexOf( "\\" ) + 1 );
+ tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
} else {
- tmp = tmp.mid( tmp.lastIndexOf("/") + 1 );
+ tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
}
dictionary[ "QMAKESPEC" ] = tmp;
@@ -439,12 +439,12 @@ void Configure::parseCmdLine()
#if !defined(EVAL)
if (argCount < 1) // skip rest if no arguments
;
- else if( configCmdLine.at(i) == "-redo" ) {
+ else if (configCmdLine.at(i) == "-redo") {
dictionary[ "REDO" ] = "yes";
configCmdLine.clear();
reloadCmdLine();
}
- else if( configCmdLine.at(i) == "-loadconfig" ) {
+ else if (configCmdLine.at(i) == "-loadconfig") {
++i;
if (i != argCount) {
dictionary[ "REDO" ] = "yes";
@@ -460,9 +460,9 @@ void Configure::parseCmdLine()
#endif
// Look first for XQMAKESPEC
- for(int j = 0 ; j < argCount; ++j)
+ for (int j = 0 ; j < argCount; ++j)
{
- if( configCmdLine.at(j) == "-xplatform") {
+ if (configCmdLine.at(j) == "-xplatform") {
++j;
if (j == argCount)
break;
@@ -472,46 +472,46 @@ void Configure::parseCmdLine()
}
}
- for( ; i<configCmdLine.size(); ++i ) {
+ for (; i<configCmdLine.size(); ++i) {
bool continueElse[] = {false, false};
- if( configCmdLine.at(i) == "-help"
+ if (configCmdLine.at(i) == "-help"
|| configCmdLine.at(i) == "-h"
- || configCmdLine.at(i) == "-?" )
+ || configCmdLine.at(i) == "-?")
dictionary[ "HELP" ] = "yes";
#if !defined(EVAL)
- else if( configCmdLine.at(i) == "-qconfig" ) {
+ else if (configCmdLine.at(i) == "-qconfig") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "QCONFIG" ] = configCmdLine.at(i);
}
- else if ( configCmdLine.at(i) == "-buildkey" ) {
+ else if (configCmdLine.at(i) == "-buildkey") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "USER_BUILD_KEY" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-release" ) {
+ else if (configCmdLine.at(i) == "-release") {
dictionary[ "BUILD" ] = "release";
if (dictionary[ "BUILDALL" ] == "auto")
dictionary[ "BUILDALL" ] = "no";
- } else if( configCmdLine.at(i) == "-debug" ) {
+ } else if (configCmdLine.at(i) == "-debug") {
dictionary[ "BUILD" ] = "debug";
if (dictionary[ "BUILDALL" ] == "auto")
dictionary[ "BUILDALL" ] = "no";
- } else if( configCmdLine.at(i) == "-debug-and-release" )
+ } else if (configCmdLine.at(i) == "-debug-and-release")
dictionary[ "BUILDALL" ] = "yes";
- else if( configCmdLine.at(i) == "-shared" )
+ else if (configCmdLine.at(i) == "-shared")
dictionary[ "SHARED" ] = "yes";
- else if( configCmdLine.at(i) == "-static" )
+ else if (configCmdLine.at(i) == "-static")
dictionary[ "SHARED" ] = "no";
- else if( configCmdLine.at(i) == "-developer-build" )
+ else if (configCmdLine.at(i) == "-developer-build")
dictionary[ "BUILDDEV" ] = "yes";
- else if( configCmdLine.at(i) == "-nokia-developer" ) {
+ else if (configCmdLine.at(i) == "-nokia-developer") {
cout << "Detected -nokia-developer option" << endl;
cout << "Nokia employees and agents are allowed to use this software under" << endl;
cout << "the authority of Nokia Corporation and/or its subsidiary(-ies)" << endl;
@@ -522,45 +522,45 @@ void Configure::parseCmdLine()
dictionary[ "SYMBIAN_DEFFILES" ] = "no";
}
}
- else if( configCmdLine.at(i) == "-opensource" ) {
+ else if (configCmdLine.at(i) == "-opensource") {
dictionary[ "BUILDTYPE" ] = "opensource";
}
- else if( configCmdLine.at(i) == "-commercial" ) {
+ else if (configCmdLine.at(i) == "-commercial") {
dictionary[ "BUILDTYPE" ] = "commercial";
}
- else if( configCmdLine.at(i) == "-ltcg" ) {
+ else if (configCmdLine.at(i) == "-ltcg") {
dictionary[ "LTCG" ] = "yes";
}
- else if( configCmdLine.at(i) == "-no-ltcg" ) {
+ else if (configCmdLine.at(i) == "-no-ltcg") {
dictionary[ "LTCG" ] = "no";
}
#endif
- else if( configCmdLine.at(i) == "-platform" ) {
+ else if (configCmdLine.at(i) == "-platform") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "QMAKESPEC" ] = configCmdLine.at(i);
dictionary[ "QMAKESPEC_FROM" ] = "commandline";
- } else if( configCmdLine.at(i) == "-arch" ) {
+ } else if (configCmdLine.at(i) == "-arch") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "ARCHITECTURE" ] = configCmdLine.at(i);
if (configCmdLine.at(i) == "boundschecker") {
dictionary[ "ARCHITECTURE" ] = "generic"; // Boundschecker uses the generic arch,
qtConfig += "boundschecker"; // but also needs this CONFIG option
}
- } else if( configCmdLine.at(i) == "-embedded" ) {
+ } else if (configCmdLine.at(i) == "-embedded") {
dictionary[ "EMBEDDED" ] = "yes";
- } else if( configCmdLine.at(i) == "-xplatform") {
+ } else if (configCmdLine.at(i) == "-xplatform") {
++i;
// do nothing
}
#if !defined(EVAL)
- else if( configCmdLine.at(i) == "-no-zlib" ) {
+ else if (configCmdLine.at(i) == "-no-zlib") {
// No longer supported since Qt 4.4.0
// But save the information for later so that we can print a warning
//
@@ -572,72 +572,72 @@ void Configure::parseCmdLine()
// There's no guarantee that Qt will build under those conditions
dictionary[ "ZLIB_FORCED" ] = "yes";
- } else if( configCmdLine.at(i) == "-qt-zlib" ) {
+ } else if (configCmdLine.at(i) == "-qt-zlib") {
dictionary[ "ZLIB" ] = "qt";
- } else if( configCmdLine.at(i) == "-system-zlib" ) {
+ } else if (configCmdLine.at(i) == "-system-zlib") {
dictionary[ "ZLIB" ] = "system";
}
// Image formats --------------------------------------------
- else if( configCmdLine.at(i) == "-no-gif" )
+ else if (configCmdLine.at(i) == "-no-gif")
dictionary[ "GIF" ] = "no";
else if( configCmdLine.at(i) == "-qt-gif" )
dictionary[ "GIF" ] = "auto";
- else if( configCmdLine.at(i) == "-no-libtiff" ) {
- dictionary[ "TIFF"] = "no";
- dictionary[ "LIBTIFF" ] = "no";
- } else if( configCmdLine.at(i) == "-qt-libtiff" ) {
+ else if (configCmdLine.at(i) == "-no-libtiff") {
+ dictionary[ "TIFF"] = "no";
+ dictionary[ "LIBTIFF" ] = "no";
+ } else if (configCmdLine.at(i) == "-qt-libtiff") {
dictionary[ "TIFF" ] = "plugin";
dictionary[ "LIBTIFF" ] = "qt";
- } else if( configCmdLine.at(i) == "-system-libtiff" ) {
+ } else if (configCmdLine.at(i) == "-system-libtiff") {
dictionary[ "TIFF" ] = "plugin";
- dictionary[ "LIBTIFF" ] = "system";
+ dictionary[ "LIBTIFF" ] = "system";
}
- else if( configCmdLine.at(i) == "-no-libjpeg" ) {
+ else if (configCmdLine.at(i) == "-no-libjpeg") {
dictionary[ "JPEG" ] = "no";
dictionary[ "LIBJPEG" ] = "no";
- } else if( configCmdLine.at(i) == "-qt-libjpeg" ) {
+ } else if (configCmdLine.at(i) == "-qt-libjpeg") {
dictionary[ "JPEG" ] = "plugin";
dictionary[ "LIBJPEG" ] = "qt";
- } else if( configCmdLine.at(i) == "-system-libjpeg" ) {
+ } else if (configCmdLine.at(i) == "-system-libjpeg") {
dictionary[ "JPEG" ] = "plugin";
dictionary[ "LIBJPEG" ] = "system";
}
- else if( configCmdLine.at(i) == "-no-libpng" ) {
+ else if (configCmdLine.at(i) == "-no-libpng") {
dictionary[ "PNG" ] = "no";
dictionary[ "LIBPNG" ] = "no";
- } else if( configCmdLine.at(i) == "-qt-libpng" ) {
+ } else if (configCmdLine.at(i) == "-qt-libpng") {
dictionary[ "PNG" ] = "qt";
dictionary[ "LIBPNG" ] = "qt";
- } else if( configCmdLine.at(i) == "-system-libpng" ) {
+ } else if (configCmdLine.at(i) == "-system-libpng") {
dictionary[ "PNG" ] = "qt";
dictionary[ "LIBPNG" ] = "system";
}
- else if( configCmdLine.at(i) == "-no-libmng" ) {
+ else if (configCmdLine.at(i) == "-no-libmng") {
dictionary[ "MNG" ] = "no";
dictionary[ "LIBMNG" ] = "no";
- } else if( configCmdLine.at(i) == "-qt-libmng" ) {
+ } else if (configCmdLine.at(i) == "-qt-libmng") {
dictionary[ "MNG" ] = "qt";
dictionary[ "LIBMNG" ] = "qt";
- } else if( configCmdLine.at(i) == "-system-libmng" ) {
+ } else if (configCmdLine.at(i) == "-system-libmng") {
dictionary[ "MNG" ] = "qt";
dictionary[ "LIBMNG" ] = "system";
}
// Text Rendering --------------------------------------------
- else if( configCmdLine.at(i) == "-no-freetype" )
+ else if (configCmdLine.at(i) == "-no-freetype")
dictionary[ "FREETYPE" ] = "no";
- else if( configCmdLine.at(i) == "-qt-freetype" )
+ else if (configCmdLine.at(i) == "-qt-freetype")
dictionary[ "FREETYPE" ] = "yes";
// CE- C runtime --------------------------------------------
- else if( configCmdLine.at(i) == "-crt" ) {
+ else if (configCmdLine.at(i) == "-crt") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
QDir cDir(configCmdLine.at(i));
if (!cDir.exists())
@@ -661,9 +661,9 @@ void Configure::parseCmdLine()
dictionary[ "CETEST_REQUESTED" ] = "yes";
}
// Qt/CE - signing tool -------------------------------------
- else if( configCmdLine.at(i) == "-signature") {
+ else if (configCmdLine.at(i) == "-signature") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
QFileInfo info(configCmdLine.at(i));
if (!info.exists())
@@ -672,57 +672,57 @@ void Configure::parseCmdLine()
dictionary[ "CE_SIGNATURE" ] = QDir::toNativeSeparators(info.absoluteFilePath());
}
// Styles ---------------------------------------------------
- else if( configCmdLine.at(i) == "-qt-style-windows" )
+ else if (configCmdLine.at(i) == "-qt-style-windows")
dictionary[ "STYLE_WINDOWS" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-windows" )
+ else if (configCmdLine.at(i) == "-no-style-windows")
dictionary[ "STYLE_WINDOWS" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-windowsce" )
+ else if (configCmdLine.at(i) == "-qt-style-windowsce")
dictionary[ "STYLE_WINDOWSCE" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-windowsce" )
+ else if (configCmdLine.at(i) == "-no-style-windowsce")
dictionary[ "STYLE_WINDOWSCE" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-windowsmobile" )
+ else if (configCmdLine.at(i) == "-qt-style-windowsmobile")
dictionary[ "STYLE_WINDOWSMOBILE" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-windowsmobile" )
+ else if (configCmdLine.at(i) == "-no-style-windowsmobile")
dictionary[ "STYLE_WINDOWSMOBILE" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-windowsxp" )
+ else if (configCmdLine.at(i) == "-qt-style-windowsxp")
dictionary[ "STYLE_WINDOWSXP" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-windowsxp" )
+ else if (configCmdLine.at(i) == "-no-style-windowsxp")
dictionary[ "STYLE_WINDOWSXP" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-windowsvista" )
+ else if (configCmdLine.at(i) == "-qt-style-windowsvista")
dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-windowsvista" )
+ else if (configCmdLine.at(i) == "-no-style-windowsvista")
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-plastique" )
+ else if (configCmdLine.at(i) == "-qt-style-plastique")
dictionary[ "STYLE_PLASTIQUE" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-plastique" )
+ else if (configCmdLine.at(i) == "-no-style-plastique")
dictionary[ "STYLE_PLASTIQUE" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-cleanlooks" )
+ else if (configCmdLine.at(i) == "-qt-style-cleanlooks")
dictionary[ "STYLE_CLEANLOOKS" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-cleanlooks" )
+ else if (configCmdLine.at(i) == "-no-style-cleanlooks")
dictionary[ "STYLE_CLEANLOOKS" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-motif" )
+ else if (configCmdLine.at(i) == "-qt-style-motif")
dictionary[ "STYLE_MOTIF" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-motif" )
+ else if (configCmdLine.at(i) == "-no-style-motif")
dictionary[ "STYLE_MOTIF" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-cde" )
+ else if (configCmdLine.at(i) == "-qt-style-cde")
dictionary[ "STYLE_CDE" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-cde" )
+ else if (configCmdLine.at(i) == "-no-style-cde")
dictionary[ "STYLE_CDE" ] = "no";
- else if( configCmdLine.at(i) == "-qt-style-s60" )
+ else if (configCmdLine.at(i) == "-qt-style-s60")
dictionary[ "STYLE_S60" ] = "yes";
- else if( configCmdLine.at(i) == "-no-style-s60" )
+ else if (configCmdLine.at(i) == "-no-style-s60")
dictionary[ "STYLE_S60" ] = "no";
// Qt 3 Support ---------------------------------------------
- else if( configCmdLine.at(i) == "-no-qt3support" )
+ else if (configCmdLine.at(i) == "-no-qt3support")
dictionary[ "QT3SUPPORT" ] = "no";
// Work around compiler nesting limitation
@@ -732,156 +732,156 @@ void Configure::parseCmdLine()
}
// OpenGL Support -------------------------------------------
- else if( configCmdLine.at(i) == "-no-opengl" ) {
+ else if (configCmdLine.at(i) == "-no-opengl") {
dictionary[ "OPENGL" ] = "no";
- } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) {
+ } else if (configCmdLine.at(i) == "-opengl-es-cm") {
dictionary[ "OPENGL" ] = "yes";
dictionary[ "OPENGL_ES_CM" ] = "yes";
- } else if ( configCmdLine.at(i) == "-opengl-es-2" ) {
+ } else if (configCmdLine.at(i) == "-opengl-es-2") {
dictionary[ "OPENGL" ] = "yes";
dictionary[ "OPENGL_ES_2" ] = "yes";
}
// OpenVG Support -------------------------------------------
- else if( configCmdLine.at(i) == "-openvg" ) {
+ else if (configCmdLine.at(i) == "-openvg") {
dictionary[ "OPENVG" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-openvg" ) {
+ } else if (configCmdLine.at(i) == "-no-openvg") {
dictionary[ "OPENVG" ] = "no";
}
// Databases ------------------------------------------------
- else if( configCmdLine.at(i) == "-qt-sql-mysql" )
+ else if (configCmdLine.at(i) == "-qt-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-mysql" )
+ else if (configCmdLine.at(i) == "-plugin-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-mysql" )
+ else if (configCmdLine.at(i) == "-no-sql-mysql")
dictionary[ "SQL_MYSQL" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-odbc" )
+ else if (configCmdLine.at(i) == "-qt-sql-odbc")
dictionary[ "SQL_ODBC" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-odbc" )
+ else if (configCmdLine.at(i) == "-plugin-sql-odbc")
dictionary[ "SQL_ODBC" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-odbc" )
+ else if (configCmdLine.at(i) == "-no-sql-odbc")
dictionary[ "SQL_ODBC" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-oci" )
+ else if (configCmdLine.at(i) == "-qt-sql-oci")
dictionary[ "SQL_OCI" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-oci" )
+ else if (configCmdLine.at(i) == "-plugin-sql-oci")
dictionary[ "SQL_OCI" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-oci" )
+ else if (configCmdLine.at(i) == "-no-sql-oci")
dictionary[ "SQL_OCI" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-psql" )
+ else if (configCmdLine.at(i) == "-qt-sql-psql")
dictionary[ "SQL_PSQL" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-psql" )
+ else if (configCmdLine.at(i) == "-plugin-sql-psql")
dictionary[ "SQL_PSQL" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-psql" )
+ else if (configCmdLine.at(i) == "-no-sql-psql")
dictionary[ "SQL_PSQL" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-tds" )
+ else if (configCmdLine.at(i) == "-qt-sql-tds")
dictionary[ "SQL_TDS" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-tds" )
+ else if (configCmdLine.at(i) == "-plugin-sql-tds")
dictionary[ "SQL_TDS" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-tds" )
+ else if (configCmdLine.at(i) == "-no-sql-tds")
dictionary[ "SQL_TDS" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-db2" )
+ else if (configCmdLine.at(i) == "-qt-sql-db2")
dictionary[ "SQL_DB2" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-db2" )
+ else if (configCmdLine.at(i) == "-plugin-sql-db2")
dictionary[ "SQL_DB2" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-db2" )
+ else if (configCmdLine.at(i) == "-no-sql-db2")
dictionary[ "SQL_DB2" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-sqlite" )
+ else if (configCmdLine.at(i) == "-qt-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-sqlite" )
+ else if (configCmdLine.at(i) == "-plugin-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-sqlite" )
+ else if (configCmdLine.at(i) == "-no-sql-sqlite")
dictionary[ "SQL_SQLITE" ] = "no";
- else if( configCmdLine.at(i) == "-system-sqlite" )
+ else if (configCmdLine.at(i) == "-system-sqlite")
dictionary[ "SQL_SQLITE_LIB" ] = "system";
- else if( configCmdLine.at(i) == "-qt-sql-sqlite2" )
+ else if (configCmdLine.at(i) == "-qt-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-sqlite2" )
+ else if (configCmdLine.at(i) == "-plugin-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-sqlite2" )
+ else if (configCmdLine.at(i) == "-no-sql-sqlite2")
dictionary[ "SQL_SQLITE2" ] = "no";
- else if( configCmdLine.at(i) == "-qt-sql-ibase" )
+ else if (configCmdLine.at(i) == "-qt-sql-ibase")
dictionary[ "SQL_IBASE" ] = "yes";
- else if( configCmdLine.at(i) == "-plugin-sql-ibase" )
+ else if (configCmdLine.at(i) == "-plugin-sql-ibase")
dictionary[ "SQL_IBASE" ] = "plugin";
- else if( configCmdLine.at(i) == "-no-sql-ibase" )
+ else if (configCmdLine.at(i) == "-no-sql-ibase")
dictionary[ "SQL_IBASE" ] = "no";
#endif
// IDE project generation -----------------------------------
- else if( configCmdLine.at(i) == "-no-dsp" )
+ else if (configCmdLine.at(i) == "-no-dsp")
dictionary[ "DSPFILES" ] = "no";
- else if( configCmdLine.at(i) == "-dsp" )
+ else if (configCmdLine.at(i) == "-dsp")
dictionary[ "DSPFILES" ] = "yes";
- else if( configCmdLine.at(i) == "-no-vcp" )
+ else if (configCmdLine.at(i) == "-no-vcp")
dictionary[ "VCPFILES" ] = "no";
- else if( configCmdLine.at(i) == "-vcp" )
+ else if (configCmdLine.at(i) == "-vcp")
dictionary[ "VCPFILES" ] = "yes";
- else if( configCmdLine.at(i) == "-no-vcproj" )
+ else if (configCmdLine.at(i) == "-no-vcproj")
dictionary[ "VCPROJFILES" ] = "no";
- else if( configCmdLine.at(i) == "-vcproj" )
+ else if (configCmdLine.at(i) == "-vcproj")
dictionary[ "VCPROJFILES" ] = "yes";
- else if( configCmdLine.at(i) == "-no-incredibuild-xge" )
+ else if (configCmdLine.at(i) == "-no-incredibuild-xge")
dictionary[ "INCREDIBUILD_XGE" ] = "no";
- else if( configCmdLine.at(i) == "-incredibuild-xge" )
+ else if (configCmdLine.at(i) == "-incredibuild-xge")
dictionary[ "INCREDIBUILD_XGE" ] = "yes";
- else if( configCmdLine.at(i) == "-native-gestures" )
+ else if (configCmdLine.at(i) == "-native-gestures")
dictionary[ "NATIVE_GESTURES" ] = "yes";
- else if( configCmdLine.at(i) == "-no-native-gestures" )
+ else if (configCmdLine.at(i) == "-no-native-gestures")
dictionary[ "NATIVE_GESTURES" ] = "no";
#if !defined(EVAL)
// Symbian Support -------------------------------------------
- else if (configCmdLine.at(i) == "-fpu" )
+ else if (configCmdLine.at(i) == "-fpu")
{
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-s60" )
+ else if (configCmdLine.at(i) == "-s60")
dictionary[ "S60" ] = "yes";
- else if( configCmdLine.at(i) == "-no-s60" )
+ else if (configCmdLine.at(i) == "-no-s60")
dictionary[ "S60" ] = "no";
- else if( configCmdLine.at(i) == "-usedeffiles" )
+ else if (configCmdLine.at(i) == "-usedeffiles")
dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
- else if( configCmdLine.at(i) == "-no-usedeffiles" )
+ else if (configCmdLine.at(i) == "-no-usedeffiles")
dictionary[ "SYMBIAN_DEFFILES" ] = "no";
// Others ---------------------------------------------------
- else if (configCmdLine.at(i) == "-fast" )
+ else if (configCmdLine.at(i) == "-fast")
dictionary[ "FAST" ] = "yes";
- else if (configCmdLine.at(i) == "-no-fast" )
+ else if (configCmdLine.at(i) == "-no-fast")
dictionary[ "FAST" ] = "no";
- else if( configCmdLine.at(i) == "-stl" )
+ else if (configCmdLine.at(i) == "-stl")
dictionary[ "STL" ] = "yes";
- else if( configCmdLine.at(i) == "-no-stl" )
+ else if (configCmdLine.at(i) == "-no-stl")
dictionary[ "STL" ] = "no";
- else if ( configCmdLine.at(i) == "-exceptions" )
+ else if (configCmdLine.at(i) == "-exceptions")
dictionary[ "EXCEPTIONS" ] = "yes";
- else if ( configCmdLine.at(i) == "-no-exceptions" )
+ else if (configCmdLine.at(i) == "-no-exceptions")
dictionary[ "EXCEPTIONS" ] = "no";
- else if ( configCmdLine.at(i) == "-rtti" )
+ else if (configCmdLine.at(i) == "-rtti")
dictionary[ "RTTI" ] = "yes";
- else if ( configCmdLine.at(i) == "-no-rtti" )
+ else if (configCmdLine.at(i) == "-no-rtti")
dictionary[ "RTTI" ] = "no";
- else if( configCmdLine.at(i) == "-accessibility" )
+ else if (configCmdLine.at(i) == "-accessibility")
dictionary[ "ACCESSIBILITY" ] = "yes";
- else if( configCmdLine.at(i) == "-no-accessibility" ) {
+ else if (configCmdLine.at(i) == "-no-accessibility") {
dictionary[ "ACCESSIBILITY" ] = "no";
cout << "Setting accessibility to NO" << endl;
}
@@ -907,63 +907,63 @@ void Configure::parseCmdLine()
else if (configCmdLine.at(i) == "-iwmmxt")
dictionary[ "IWMMXT" ] = "yes";
- else if( configCmdLine.at(i) == "-no-openssl" ) {
+ else if (configCmdLine.at(i) == "-no-openssl") {
dictionary[ "OPENSSL"] = "no";
- } else if( configCmdLine.at(i) == "-openssl" ) {
+ } else if (configCmdLine.at(i) == "-openssl") {
dictionary[ "OPENSSL" ] = "yes";
- } else if( configCmdLine.at(i) == "-openssl-linked" ) {
+ } else if (configCmdLine.at(i) == "-openssl-linked") {
dictionary[ "OPENSSL" ] = "linked";
- } else if( configCmdLine.at(i) == "-no-qdbus" ) {
+ } else if (configCmdLine.at(i) == "-no-qdbus") {
dictionary[ "DBUS" ] = "no";
- } else if( configCmdLine.at(i) == "-qdbus" ) {
+ } else if (configCmdLine.at(i) == "-qdbus") {
dictionary[ "DBUS" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-dbus" ) {
+ } else if (configCmdLine.at(i) == "-no-dbus") {
dictionary[ "DBUS" ] = "no";
- } else if( configCmdLine.at(i) == "-dbus" ) {
+ } else if (configCmdLine.at(i) == "-dbus") {
dictionary[ "DBUS" ] = "yes";
- } else if( configCmdLine.at(i) == "-dbus-linked" ) {
+ } else if (configCmdLine.at(i) == "-dbus-linked") {
dictionary[ "DBUS" ] = "linked";
- } else if( configCmdLine.at(i) == "-no-script" ) {
+ } else if (configCmdLine.at(i) == "-no-script") {
dictionary[ "SCRIPT" ] = "no";
- } else if( configCmdLine.at(i) == "-script" ) {
+ } else if (configCmdLine.at(i) == "-script") {
dictionary[ "SCRIPT" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-scripttools" ) {
+ } else if (configCmdLine.at(i) == "-no-scripttools") {
dictionary[ "SCRIPTTOOLS" ] = "no";
- } else if( configCmdLine.at(i) == "-scripttools" ) {
+ } else if (configCmdLine.at(i) == "-scripttools") {
dictionary[ "SCRIPTTOOLS" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-xmlpatterns" ) {
+ } else if (configCmdLine.at(i) == "-no-xmlpatterns") {
dictionary[ "XMLPATTERNS" ] = "no";
- } else if( configCmdLine.at(i) == "-xmlpatterns" ) {
+ } else if (configCmdLine.at(i) == "-xmlpatterns") {
dictionary[ "XMLPATTERNS" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-multimedia" ) {
+ } else if (configCmdLine.at(i) == "-no-multimedia") {
dictionary[ "MULTIMEDIA" ] = "no";
- } else if( configCmdLine.at(i) == "-multimedia" ) {
+ } else if (configCmdLine.at(i) == "-multimedia") {
dictionary[ "MULTIMEDIA" ] = "yes";
- } else if( configCmdLine.at(i) == "-audio-backend" ) {
+ } else if (configCmdLine.at(i) == "-audio-backend") {
dictionary[ "AUDIO_BACKEND" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-audio-backend" ) {
+ } else if (configCmdLine.at(i) == "-no-audio-backend") {
dictionary[ "AUDIO_BACKEND" ] = "no";
- } else if( configCmdLine.at(i) == "-no-phonon" ) {
+ } else if (configCmdLine.at(i) == "-no-phonon") {
dictionary[ "PHONON" ] = "no";
- } else if( configCmdLine.at(i) == "-phonon" ) {
+ } else if (configCmdLine.at(i) == "-phonon") {
dictionary[ "PHONON" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-phonon-backend" ) {
+ } else if (configCmdLine.at(i) == "-no-phonon-backend") {
dictionary[ "PHONON_BACKEND" ] = "no";
- } else if( configCmdLine.at(i) == "-phonon-backend" ) {
+ } else if (configCmdLine.at(i) == "-phonon-backend") {
dictionary[ "PHONON_BACKEND" ] = "yes";
- } else if( configCmdLine.at(i) == "-phonon-wince-ds9" ) {
+ } else if (configCmdLine.at(i) == "-phonon-wince-ds9") {
dictionary[ "DIRECTSHOW" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-webkit" ) {
+ } else if (configCmdLine.at(i) == "-no-webkit") {
dictionary[ "WEBKIT" ] = "no";
- } else if( configCmdLine.at(i) == "-webkit" ) {
+ } else if (configCmdLine.at(i) == "-webkit") {
dictionary[ "WEBKIT" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-declarative" ) {
+ } else if (configCmdLine.at(i) == "-no-declarative") {
dictionary[ "DECLARATIVE" ] = "no";
- } else if( configCmdLine.at(i) == "-declarative" ) {
+ } else if (configCmdLine.at(i) == "-declarative") {
dictionary[ "DECLARATIVE" ] = "yes";
- } else if( configCmdLine.at(i) == "-no-plugin-manifests" ) {
+ } else if (configCmdLine.at(i) == "-no-plugin-manifests") {
dictionary[ "PLUGIN_MANIFESTS" ] = "no";
- } else if( configCmdLine.at(i) == "-plugin-manifests" ) {
+ } else if (configCmdLine.at(i) == "-plugin-manifests") {
dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
}
@@ -973,53 +973,53 @@ void Configure::parseCmdLine()
if (!continueElse[0]) {
}
- else if( configCmdLine.at(i) == "-internal" )
+ else if (configCmdLine.at(i) == "-internal")
dictionary[ "QMAKE_INTERNAL" ] = "yes";
- else if( configCmdLine.at(i) == "-no-qmake" )
+ else if (configCmdLine.at(i) == "-no-qmake")
dictionary[ "BUILD_QMAKE" ] = "no";
- else if( configCmdLine.at(i) == "-qmake" )
+ else if (configCmdLine.at(i) == "-qmake")
dictionary[ "BUILD_QMAKE" ] = "yes";
- else if( configCmdLine.at(i) == "-dont-process" )
+ else if (configCmdLine.at(i) == "-dont-process")
dictionary[ "NOPROCESS" ] = "yes";
- else if( configCmdLine.at(i) == "-process" )
+ else if (configCmdLine.at(i) == "-process")
dictionary[ "NOPROCESS" ] = "no";
- else if( configCmdLine.at(i) == "-no-qmake-deps" )
+ else if (configCmdLine.at(i) == "-no-qmake-deps")
dictionary[ "DEPENDENCIES" ] = "no";
- else if( configCmdLine.at(i) == "-qmake-deps" )
+ else if (configCmdLine.at(i) == "-qmake-deps")
dictionary[ "DEPENDENCIES" ] = "yes";
- else if( configCmdLine.at(i) == "-qtnamespace" ) {
+ else if (configCmdLine.at(i) == "-qtnamespace") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
qmakeDefines += "QT_NAMESPACE="+configCmdLine.at(i);
dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
- } else if( configCmdLine.at(i) == "-qtlibinfix" ) {
+ } else if (configCmdLine.at(i) == "-qtlibinfix") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
dictionary[ "QT_INSTALL_PLUGINS" ] =
QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
}
- } else if( configCmdLine.at(i) == "-D" ) {
+ } else if (configCmdLine.at(i) == "-D") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
qmakeDefines += configCmdLine.at(i);
- } else if( configCmdLine.at(i) == "-I" ) {
+ } else if (configCmdLine.at(i) == "-I") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
qmakeIncludes += configCmdLine.at(i);
- } else if( configCmdLine.at(i) == "-L" ) {
+ } else if (configCmdLine.at(i) == "-L") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
QFileInfo check(configCmdLine.at(i));
if (!check.isDir()) {
@@ -1028,9 +1028,9 @@ void Configure::parseCmdLine()
break;
}
qmakeLibs += QString("-L" + configCmdLine.at(i));
- } else if( configCmdLine.at(i) == "-l" ) {
+ } else if (configCmdLine.at(i) == "-l") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
qmakeLibs += QString("-l" + configCmdLine.at(i));
} else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
@@ -1039,16 +1039,16 @@ void Configure::parseCmdLine()
psqlLibs = configCmdLine.at(i);
}
- else if( ( configCmdLine.at(i) == "-override-version" ) || ( configCmdLine.at(i) == "-version-override" ) ){
+ else if ((configCmdLine.at(i) == "-override-version") || (configCmdLine.at(i) == "-version-override")){
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "VERSION" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-saveconfig" ) {
+ else if (configCmdLine.at(i) == "-saveconfig") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
dictionary[ "CUSTOMCONFIG" ] = "_" + configCmdLine.at(i);
}
@@ -1059,98 +1059,98 @@ void Configure::parseCmdLine()
else if (configCmdLine.at(i) == "-nomake") {
++i;
- if (i==argCount)
+ if (i == argCount)
break;
disabledBuildParts += configCmdLine.at(i);
}
// Directories ----------------------------------------------
- else if( configCmdLine.at(i) == "-prefix" ) {
+ else if (configCmdLine.at(i) == "-prefix") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_PREFIX" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-bindir" ) {
+ else if (configCmdLine.at(i) == "-bindir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-libdir" ) {
+ else if (configCmdLine.at(i) == "-libdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_LIBS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-docdir" ) {
+ else if (configCmdLine.at(i) == "-docdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_DOCS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-headerdir" ) {
+ else if (configCmdLine.at(i) == "-headerdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_HEADERS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-plugindir" ) {
+ else if (configCmdLine.at(i) == "-plugindir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_PLUGINS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-importdir" ) {
+ else if (configCmdLine.at(i) == "-importdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-datadir" ) {
+ else if (configCmdLine.at(i) == "-datadir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_DATA" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-translationdir" ) {
+ else if (configCmdLine.at(i) == "-translationdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_TRANSLATIONS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-examplesdir" ) {
+ else if (configCmdLine.at(i) == "-examplesdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_EXAMPLES" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-demosdir" ) {
+ else if (configCmdLine.at(i) == "-demosdir") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_INSTALL_DEMOS" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-hostprefix" ) {
+ else if (configCmdLine.at(i) == "-hostprefix") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "QT_HOST_PREFIX" ] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i) == "-make" ) {
+ else if (configCmdLine.at(i) == "-make") {
++i;
- if(i==argCount)
+ if (i == argCount)
break;
dictionary[ "MAKE" ] = configCmdLine.at(i);
}
@@ -1167,14 +1167,14 @@ void Configure::parseCmdLine()
dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i);
}
- else if( configCmdLine.at(i).indexOf( QRegExp( "^-(en|dis)able-" ) ) != -1 ) {
+ else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
// Scan to see if any specific modules and drivers are enabled or disabled
- for( QStringList::Iterator module = modules.begin(); module != modules.end(); ++module ) {
- if( configCmdLine.at(i) == QString( "-enable-" ) + (*module) ) {
+ for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
+ if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
enabledModules += (*module);
break;
}
- else if( configCmdLine.at(i) == QString( "-disable-" ) + (*module) ) {
+ else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
disabledModules += (*module);
break;
}
@@ -1208,25 +1208,25 @@ void Configure::parseCmdLine()
}
cout << "See the README file for a list of supported operating systems and compilers." << endl;
} else {
- if( dictionary[ "QMAKESPEC" ].endsWith( "-icc" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc.net" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" ) ||
- dictionary[ "QMAKESPEC" ].endsWith( "-msvc2010" )) {
- if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake";
+ if (dictionary[ "QMAKESPEC" ].endsWith("-icc") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc.net") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2002") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2003") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2005") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2008") ||
+ dictionary[ "QMAKESPEC" ].endsWith("-msvc2010")) {
+ if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "nmake";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
- } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) {
- if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "mingw32-make";
+ } else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
+ if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
if (Environment::detectExecutable("sh.exe")) {
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++-sh";
} else {
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
}
} else {
- if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "make";
+ if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
}
}
@@ -1282,19 +1282,19 @@ void Configure::parseCmdLine()
#if !defined(EVAL)
- for( QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis ) {
- modules.removeAll( (*dis) );
+ for (QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis) {
+ modules.removeAll((*dis));
}
- for( QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena ) {
- if( modules.indexOf( (*ena) ) == -1 )
+ for (QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena) {
+ if (modules.indexOf((*ena)) == -1)
modules += (*ena);
}
qtConfig += modules;
- for( QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it )
+ for (QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it)
qtConfig.removeAll(*it);
- if( ( dictionary[ "REDO" ] != "yes" ) && ( dictionary[ "HELP" ] != "yes" ) )
+ if ((dictionary[ "REDO" ] != "yes") && (dictionary[ "HELP" ] != "yes"))
saveCmdLine();
#endif
}
@@ -1314,7 +1314,7 @@ void Configure::validateArgs()
QStringList stringList = dir.entryList();
QStringList::Iterator it;
- for( it = stringList.begin(); it != stringList.end(); ++it )
+ for (it = stringList.begin(); it != stringList.end(); ++it)
allConfigs << it->remove("qconfig-").remove(".h");
allConfigs << "full";
@@ -1335,11 +1335,11 @@ void Configure::validateArgs()
// If the internal configurations failed, try others.
QStringList::Iterator config;
- for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) {
- if( (*config) == dictionary[ "QCONFIG" ] )
+ for (config = allConfigs.begin(); config != allConfigs.end(); ++config) {
+ if ((*config) == dictionary[ "QCONFIG" ])
break;
}
- if( config == allConfigs.end() ) {
+ if (config == allConfigs.end()) {
dictionary[ "HELP" ] = "yes";
cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ;
}
@@ -1492,7 +1492,7 @@ void Configure::applySpecSpecifics()
dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ];
dictionary[ "QT_INSTALL_PREFIX" ] = "";
- } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
+ } else if (dictionary[ "XQMAKESPEC" ].startsWith("symbian")) {
dictionary[ "ACCESSIBILITY" ] = "no";
dictionary[ "STYLE_WINDOWSXP" ] = "no";
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
@@ -1541,7 +1541,7 @@ void Configure::applySpecSpecifics()
// Disable building docs and translations for now
disabledBuildParts << "docs" << "translations";
- } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
+ } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong.
//TODO
dictionary[ "STYLE_WINDOWSXP" ] = "no";
dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
@@ -1567,22 +1567,22 @@ void Configure::applySpecSpecifics()
QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths)
{
QDir d;
- for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) {
+ for (QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it) {
// Remove any leading or trailing ", this is commonly used in the environment
// variables
QString path = (*it);
- if ( path.startsWith( "\"" ) )
- path = path.right( path.length() - 1 );
- if ( path.endsWith( "\"" ) )
- path = path.left( path.length() - 1 );
- if( d.exists(path + QDir::separator() + fileName) ) {
+ if (path.startsWith("\""))
+ path = path.right(path.length() - 1);
+ if (path.endsWith("\""))
+ path = path.left(path.length() - 1);
+ if (d.exists(path + QDir::separator() + fileName)) {
return (path);
}
}
return QString();
}
-QString Configure::locateFile( const QString &fileName )
+QString Configure::locateFile(const QString &fileName)
{
QString file = fileName.toLower();
QStringList paths;
@@ -1593,7 +1593,7 @@ QString Configure::locateFile( const QString &fileName )
#endif
if (file.endsWith(".h"))
paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts);
- else if ( file.endsWith( ".lib" ) )
+ else if (file.endsWith(".lib"))
paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts);
else
paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts);
@@ -1605,7 +1605,7 @@ QString Configure::locateFile( const QString &fileName )
bool Configure::displayHelp()
{
- if( dictionary[ "HELP" ] == "yes" ) {
+ if (dictionary[ "HELP" ] == "yes") {
desc("Usage: configure [-buildkey <key>]\n"
// desc("Usage: configure [-prefix dir] [-bindir <dir>] [-libdir <dir>]\n"
// "[-docdir <dir>] [-headerdir <dir>] [-plugindir <dir>]\n"
@@ -1898,21 +1898,21 @@ QString Configure::findFileInPaths(const QString &fileName, const QString &paths
#endif
QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts);
QDir d;
- for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) {
+ for (QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it) {
// Remove any leading or trailing ", this is commonly used in the environment
// variables
QString path = (*it);
- if ( path.startsWith( '\"' ) )
- path = path.right( path.length() - 1 );
- if ( path.endsWith( '\"' ) )
- path = path.left( path.length() - 1 );
- if( d.exists( path + QDir::separator() + fileName ) )
+ if (path.startsWith('\"'))
+ path = path.right(path.length() - 1);
+ if (path.endsWith('\"'))
+ path = path.left(path.length() - 1);
+ if (d.exists(path + QDir::separator() + fileName))
return path;
}
return QString();
}
-bool Configure::findFile( const QString &fileName )
+bool Configure::findFile(const QString &fileName)
{
const QString file = fileName.toLower();
const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH"));
@@ -1923,7 +1923,7 @@ bool Configure::findFile( const QString &fileName )
if (file.endsWith(".h")) {
if (!mingwPath.isNull()) {
if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull())
- return true;
+ return true;
//now let's try the additional compiler path
QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32");
foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
@@ -1932,9 +1932,9 @@ bool Configure::findFile( const QString &fileName )
}
}
paths = QString::fromLocal8Bit(getenv("INCLUDE"));
- } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) {
+ } else if (file.endsWith(".lib") || file.endsWith(".a")) {
if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull())
- return true;
+ return true;
paths = QString::fromLocal8Bit(getenv("LIB"));
} else {
paths = pathEnvVar;
@@ -2041,15 +2041,15 @@ bool Configure::checkAvailability(const QString &part)
available = true; // Built in, we have a fork
else if (part == "SQL_SQLITE_LIB") {
if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
- // Symbian has multiple .lib/.dll files we need to find
+ // Symbian has multiple .lib/.dll files we need to find
if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
- available = true; // There is sqlite_symbian plugin which exports the necessary stuff
- dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
- } else {
- available = findFile("sqlite3.h") && findFile("sqlite3.lib");
- if (available)
- dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
- }
+ available = true; // There is sqlite_symbian plugin which exports the necessary stuff
+ dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3";
+ } else {
+ available = findFile("sqlite3.h") && findFile("sqlite3.lib");
+ if (available)
+ dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib";
+ }
} else
available = true;
} else if (part == "SQL_SQLITE2")
@@ -2066,7 +2066,7 @@ bool Configure::checkAvailability(const QString &part)
available = (dictionary[ "ARCHITECTURE" ] == "windowsce");
else if (part == "SSE2")
available = (dictionary.value("QMAKESPEC") != "win32-msvc");
- else if (part == "3DNOW" )
+ else if (part == "3DNOW")
available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h");
else if (part == "MMX" || part == "SSE")
available = (dictionary.value("QMAKESPEC") != "win32-msvc");
@@ -2125,7 +2125,7 @@ bool Configure::checkAvailability(const QString &part)
available = true;
} else if (part == "WEBKIT") {
available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++");
- if( dictionary[ "SHARED" ] == "no" ) {
+ if (dictionary[ "SHARED" ] == "no") {
cout << endl << "WARNING: Using static linking will disable the WebKit module." << endl
<< endl;
available = false;
@@ -2290,7 +2290,7 @@ bool Configure::verifyConfiguration()
cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl
<< "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl
<< "(Press any key to continue..)";
- if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
+ if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue
@@ -2301,14 +2301,14 @@ bool Configure::verifyConfiguration()
<< "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl
<< "Oracle driver, as the current build will most likely fail." << endl;
cout << "(Press any key to continue..)";
- if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
+ if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
}
if (dictionary["QMAKESPEC"].endsWith("win32-msvc.net")) {
cout << "WARNING: The makespec win32-msvc.net is deprecated. Consider using" << endl
<< "win32-msvc2002 or win32-msvc2003 instead." << endl;
cout << "(Press any key to continue..)";
- if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
+ if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
}
if (0 != dictionary["ARM_FPU_TYPE"].size()) {
@@ -2323,7 +2323,7 @@ bool Configure::verifyConfiguration()
cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl
<< "QtScript module. If you continue, we will turn on the QtScript module." << endl
<< "(Press any key to continue..)";
- if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
+ if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
dictionary["SCRIPT"] = "yes";
@@ -2423,13 +2423,13 @@ void Configure::generateOutputVars()
{
// Generate variables for output
// Build key ----------------------------------------------------
- if ( dictionary.contains("BUILD_KEY") ) {
+ if (dictionary.contains("BUILD_KEY")) {
qmakeVars += dictionary.value("BUILD_KEY");
}
QString build = dictionary[ "BUILD" ];
bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
- if ( build == "debug") {
+ if (build == "debug") {
if (buildAll)
qtConfig += "release";
qtConfig += "debug";
@@ -2440,142 +2440,142 @@ void Configure::generateOutputVars()
}
// Compression --------------------------------------------------
- if( dictionary[ "ZLIB" ] == "qt" )
+ if (dictionary[ "ZLIB" ] == "qt")
qtConfig += "zlib";
- else if( dictionary[ "ZLIB" ] == "system" )
+ else if (dictionary[ "ZLIB" ] == "system")
qtConfig += "system-zlib";
// Image formates -----------------------------------------------
- if( dictionary[ "GIF" ] == "no" )
+ if (dictionary[ "GIF" ] == "no")
qtConfig += "no-gif";
- else if( dictionary[ "GIF" ] == "yes" )
+ else if (dictionary[ "GIF" ] == "yes")
qtConfig += "gif";
- else if( dictionary[ "GIF" ] == "plugin" )
+ else if (dictionary[ "GIF" ] == "plugin")
qmakeFormatPlugins += "gif";
- if( dictionary[ "TIFF" ] == "no" )
+ if (dictionary[ "TIFF" ] == "no")
qtConfig += "no-tiff";
- else if( dictionary[ "TIFF" ] == "plugin" )
+ else if (dictionary[ "TIFF" ] == "plugin")
qmakeFormatPlugins += "tiff";
- if( dictionary[ "LIBTIFF" ] == "system" )
+ if (dictionary[ "LIBTIFF" ] == "system")
qtConfig += "system-tiff";
- if( dictionary[ "JPEG" ] == "no" )
+ if (dictionary[ "JPEG" ] == "no")
qtConfig += "no-jpeg";
- else if( dictionary[ "JPEG" ] == "plugin" )
+ else if (dictionary[ "JPEG" ] == "plugin")
qmakeFormatPlugins += "jpeg";
- if( dictionary[ "LIBJPEG" ] == "system" )
+ if (dictionary[ "LIBJPEG" ] == "system")
qtConfig += "system-jpeg";
- if( dictionary[ "PNG" ] == "no" )
+ if (dictionary[ "PNG" ] == "no")
qtConfig += "no-png";
else if( dictionary[ "PNG" ] == "qt" )
qtConfig += "png";
- if( dictionary[ "LIBPNG" ] == "system" )
+ if (dictionary[ "LIBPNG" ] == "system")
qtConfig += "system-png";
- if( dictionary[ "MNG" ] == "no" )
+ if (dictionary[ "MNG" ] == "no")
qtConfig += "no-mng";
else if( dictionary[ "MNG" ] == "qt" )
qtConfig += "mng";
- if( dictionary[ "LIBMNG" ] == "system" )
+ if (dictionary[ "LIBMNG" ] == "system")
qtConfig += "system-mng";
// Text rendering --------------------------------------------------
- if( dictionary[ "FREETYPE" ] == "yes" )
+ if (dictionary[ "FREETYPE" ] == "yes")
qtConfig += "freetype";
// Styles -------------------------------------------------------
- if ( dictionary[ "STYLE_WINDOWS" ] == "yes" )
+ if (dictionary[ "STYLE_WINDOWS" ] == "yes")
qmakeStyles += "windows";
- if ( dictionary[ "STYLE_PLASTIQUE" ] == "yes" )
+ if (dictionary[ "STYLE_PLASTIQUE" ] == "yes")
qmakeStyles += "plastique";
- if ( dictionary[ "STYLE_CLEANLOOKS" ] == "yes" )
+ if (dictionary[ "STYLE_CLEANLOOKS" ] == "yes")
qmakeStyles += "cleanlooks";
- if ( dictionary[ "STYLE_WINDOWSXP" ] == "yes" )
+ if (dictionary[ "STYLE_WINDOWSXP" ] == "yes")
qmakeStyles += "windowsxp";
- if ( dictionary[ "STYLE_WINDOWSVISTA" ] == "yes" )
+ if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes")
qmakeStyles += "windowsvista";
- if ( dictionary[ "STYLE_MOTIF" ] == "yes" )
+ if (dictionary[ "STYLE_MOTIF" ] == "yes")
qmakeStyles += "motif";
- if ( dictionary[ "STYLE_SGI" ] == "yes" )
+ if (dictionary[ "STYLE_SGI" ] == "yes")
qmakeStyles += "sgi";
- if ( dictionary[ "STYLE_WINDOWSCE" ] == "yes" )
+ if (dictionary[ "STYLE_WINDOWSCE" ] == "yes")
qmakeStyles += "windowsce";
- if ( dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes" )
+ if (dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes")
qmakeStyles += "windowsmobile";
- if ( dictionary[ "STYLE_CDE" ] == "yes" )
+ if (dictionary[ "STYLE_CDE" ] == "yes")
qmakeStyles += "cde";
- if ( dictionary[ "STYLE_S60" ] == "yes" )
+ if (dictionary[ "STYLE_S60" ] == "yes")
qmakeStyles += "s60";
// Databases ----------------------------------------------------
- if ( dictionary[ "SQL_MYSQL" ] == "yes" )
+ if (dictionary[ "SQL_MYSQL" ] == "yes")
qmakeSql += "mysql";
- else if ( dictionary[ "SQL_MYSQL" ] == "plugin" )
+ else if (dictionary[ "SQL_MYSQL" ] == "plugin")
qmakeSqlPlugins += "mysql";
- if ( dictionary[ "SQL_ODBC" ] == "yes" )
+ if (dictionary[ "SQL_ODBC" ] == "yes")
qmakeSql += "odbc";
- else if ( dictionary[ "SQL_ODBC" ] == "plugin" )
+ else if (dictionary[ "SQL_ODBC" ] == "plugin")
qmakeSqlPlugins += "odbc";
- if ( dictionary[ "SQL_OCI" ] == "yes" )
+ if (dictionary[ "SQL_OCI" ] == "yes")
qmakeSql += "oci";
- else if ( dictionary[ "SQL_OCI" ] == "plugin" )
+ else if (dictionary[ "SQL_OCI" ] == "plugin")
qmakeSqlPlugins += "oci";
- if ( dictionary[ "SQL_PSQL" ] == "yes" )
+ if (dictionary[ "SQL_PSQL" ] == "yes")
qmakeSql += "psql";
- else if ( dictionary[ "SQL_PSQL" ] == "plugin" )
+ else if (dictionary[ "SQL_PSQL" ] == "plugin")
qmakeSqlPlugins += "psql";
- if ( dictionary[ "SQL_TDS" ] == "yes" )
+ if (dictionary[ "SQL_TDS" ] == "yes")
qmakeSql += "tds";
- else if ( dictionary[ "SQL_TDS" ] == "plugin" )
+ else if (dictionary[ "SQL_TDS" ] == "plugin")
qmakeSqlPlugins += "tds";
- if ( dictionary[ "SQL_DB2" ] == "yes" )
+ if (dictionary[ "SQL_DB2" ] == "yes")
qmakeSql += "db2";
- else if ( dictionary[ "SQL_DB2" ] == "plugin" )
+ else if (dictionary[ "SQL_DB2" ] == "plugin")
qmakeSqlPlugins += "db2";
- if ( dictionary[ "SQL_SQLITE" ] == "yes" )
+ if (dictionary[ "SQL_SQLITE" ] == "yes")
qmakeSql += "sqlite";
- else if ( dictionary[ "SQL_SQLITE" ] == "plugin" )
+ else if (dictionary[ "SQL_SQLITE" ] == "plugin")
qmakeSqlPlugins += "sqlite";
- if ( dictionary[ "SQL_SQLITE_LIB" ] == "system" )
+ if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
qmakeConfig += "system-sqlite";
- if ( dictionary[ "SQL_SQLITE2" ] == "yes" )
+ if (dictionary[ "SQL_SQLITE2" ] == "yes")
qmakeSql += "sqlite2";
- else if ( dictionary[ "SQL_SQLITE2" ] == "plugin" )
+ else if (dictionary[ "SQL_SQLITE2" ] == "plugin")
qmakeSqlPlugins += "sqlite2";
- if ( dictionary[ "SQL_IBASE" ] == "yes" )
+ if (dictionary[ "SQL_IBASE" ] == "yes")
qmakeSql += "ibase";
- else if ( dictionary[ "SQL_IBASE" ] == "plugin" )
+ else if (dictionary[ "SQL_IBASE" ] == "plugin")
qmakeSqlPlugins += "ibase";
// Other options ------------------------------------------------
- if( dictionary[ "BUILDALL" ] == "yes" ) {
+ if (dictionary[ "BUILDALL" ] == "yes") {
qmakeConfig += "build_all";
}
qmakeConfig += dictionary[ "BUILD" ];
dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ];
- if ( dictionary[ "SHARED" ] == "yes" ) {
+ if (dictionary[ "SHARED" ] == "yes") {
QString version = dictionary[ "VERSION" ];
if (!version.isEmpty()) {
qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf("."));
@@ -2586,13 +2586,13 @@ void Configure::generateOutputVars()
dictionary[ "QMAKE_OUTDIR" ] += "_static";
}
- if( dictionary[ "ACCESSIBILITY" ] == "yes" )
+ if (dictionary[ "ACCESSIBILITY" ] == "yes")
qtConfig += "accessibility";
- if( !qmakeLibs.isEmpty() )
- qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join( " " ));
+ if (!qmakeLibs.isEmpty())
+ qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join(" "));
- if( !dictionary["QT_LFLAGS_SQLITE"].isEmpty() )
+ if (!dictionary["QT_LFLAGS_SQLITE"].isEmpty())
qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]);
if (dictionary[ "QT3SUPPORT" ] == "yes")
@@ -2601,26 +2601,26 @@ void Configure::generateOutputVars()
if (dictionary[ "OPENGL" ] == "yes")
qtConfig += "opengl";
- if ( dictionary["OPENGL_ES_CM"] == "yes" ) {
+ if (dictionary["OPENGL_ES_CM"] == "yes") {
qtConfig += "opengles1";
qtConfig += "egl";
}
- if ( dictionary["OPENGL_ES_2"] == "yes" ) {
+ if (dictionary["OPENGL_ES_2"] == "yes") {
qtConfig += "opengles2";
qtConfig += "egl";
}
- if ( dictionary["OPENVG"] == "yes" ) {
+ if (dictionary["OPENVG"] == "yes") {
qtConfig += "openvg";
qtConfig += "egl";
}
- if ( dictionary["S60"] == "yes" ) {
+ if (dictionary["S60"] == "yes") {
qtConfig += "s60";
}
- if ( dictionary["DIRECTSHOW"] == "yes" )
+ if (dictionary["DIRECTSHOW"] == "yes")
qtConfig += "directshow";
if (dictionary[ "OPENSSL" ] == "yes")
@@ -2680,7 +2680,7 @@ void Configure::generateOutputVars()
qtConfig += "declarative";
}
- if( dictionary[ "NATIVE_GESTURES" ] == "yes" )
+ if (dictionary[ "NATIVE_GESTURES" ] == "yes")
qtConfig += "native-gestures";
// We currently have no switch for QtSvg, so add it unconditionally.
@@ -2703,7 +2703,7 @@ void Configure::generateOutputVars()
}
}
- if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) )
+ if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"]))
qmakeConfig += "cross_compile";
// Directories and settings for .qmake.cache --------------------
@@ -2711,31 +2711,31 @@ void Configure::generateOutputVars()
// if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX
// if prefix is empty (WINCE), make all of them empty, if they aren't set
bool qipempty = false;
- if(dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
+ if (dictionary[ "QT_INSTALL_PREFIX" ].isEmpty())
qipempty = true;
- if( !dictionary[ "QT_INSTALL_DOCS" ].size() )
- dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/doc" );
- if( !dictionary[ "QT_INSTALL_HEADERS" ].size() )
- dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/include" );
- if( !dictionary[ "QT_INSTALL_LIBS" ].size() )
- dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" );
- if( !dictionary[ "QT_INSTALL_BINS" ].size() )
- dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" );
- if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() )
- dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" );
- if( !dictionary[ "QT_INSTALL_IMPORTS" ].size() )
- dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/imports" );
- if( !dictionary[ "QT_INSTALL_DATA" ].size() )
- dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] );
- if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() )
- dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" );
- if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() )
- dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
- if( !dictionary[ "QT_INSTALL_DEMOS" ].size() )
- dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/demos" );
-
- if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
+ if (!dictionary[ "QT_INSTALL_DOCS" ].size())
+ dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/doc");
+ if (!dictionary[ "QT_INSTALL_HEADERS" ].size())
+ dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/include");
+ if (!dictionary[ "QT_INSTALL_LIBS" ].size())
+ dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/lib");
+ if (!dictionary[ "QT_INSTALL_BINS" ].size())
+ dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/bin");
+ if (!dictionary[ "QT_INSTALL_PLUGINS" ].size())
+ dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins");
+ if (!dictionary[ "QT_INSTALL_IMPORTS" ].size())
+ dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/imports");
+ if (!dictionary[ "QT_INSTALL_DATA" ].size())
+ dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ]);
+ if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size())
+ dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/translations");
+ if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size())
+ dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/examples");
+ if (!dictionary[ "QT_INSTALL_DEMOS" ].size())
+ dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/demos");
+
+ if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ];
qmakeVars += QString("OBJECTS_DIR = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true);
@@ -2743,13 +2743,13 @@ void Configure::generateOutputVars()
qmakeVars += QString("RCC_DIR = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true);
if (!qmakeDefines.isEmpty())
- qmakeVars += QString("DEFINES += ") + qmakeDefines.join( " " );
+ qmakeVars += QString("DEFINES += ") + qmakeDefines.join(" ");
if (!qmakeIncludes.isEmpty())
- qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join( " " ));
+ qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join(" "));
if (!opensslLibs.isEmpty())
qmakeVars += opensslLibs;
else if (dictionary[ "OPENSSL" ] == "linked") {
- if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") )
+ if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian"))
qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto");
else
qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
@@ -2757,15 +2757,15 @@ void Configure::generateOutputVars()
if (!psqlLibs.isEmpty())
qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1);
if (!qmakeSql.isEmpty())
- qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " );
+ qmakeVars += QString("sql-drivers += ") + qmakeSql.join(" ");
if (!qmakeSqlPlugins.isEmpty())
- qmakeVars += QString("sql-plugins += ") + qmakeSqlPlugins.join( " " );
+ qmakeVars += QString("sql-plugins += ") + qmakeSqlPlugins.join(" ");
if (!qmakeStyles.isEmpty())
- qmakeVars += QString("styles += ") + qmakeStyles.join( " " );
+ qmakeVars += QString("styles += ") + qmakeStyles.join(" ");
if (!qmakeStylePlugins.isEmpty())
- qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join( " " );
+ qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join(" ");
if (!qmakeFormatPlugins.isEmpty())
- qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join( " " );
+ qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join(" ");
if (dictionary["QMAKESPEC"].endsWith("-g++")) {
QString includepath = qgetenv("INCLUDE");
@@ -2777,22 +2777,22 @@ void Configure::generateOutputVars()
qmakeVars += QString("QMAKE_LIBDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator);
}
- if( !dictionary[ "QMAKESPEC" ].length() ) {
+ if (!dictionary[ "QMAKESPEC" ].length()) {
cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
<< "be defined as an environment variable, or specified as an" << endl
<< "argument with -platform" << endl;
dictionary[ "HELP" ] = "yes";
QStringList winPlatforms;
- QDir mkspecsDir( sourcePath + "/mkspecs" );
+ QDir mkspecsDir(sourcePath + "/mkspecs");
const QFileInfoList &specsList = mkspecsDir.entryInfoList();
- for(int i = 0; i < specsList.size(); ++i) {
+ for (int i = 0; i < specsList.size(); ++i) {
const QFileInfo &fi = specsList.at(i);
- if( fi.fileName().left( 5 ) == "win32" ) {
+ if (fi.fileName().left(5) == "win32") {
winPlatforms += fi.fileName();
}
}
- cout << "Available platforms are: " << qPrintable(winPlatforms.join( ", " )) << endl;
+ cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl;
dictionary[ "DONE" ] = "error";
}
}
@@ -2801,24 +2801,24 @@ void Configure::generateOutputVars()
void Configure::generateCachefile()
{
// Generate .qmake.cache
- QFile cacheFile( buildPath + "/.qmake.cache" );
- if( cacheFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
- QTextStream cacheStream( &cacheFile );
- for( QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var ) {
+ QFile cacheFile(buildPath + "/.qmake.cache");
+ if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
+ QTextStream cacheStream(&cacheFile);
+ for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) {
cacheStream << (*var) << endl;
}
- cacheStream << "CONFIG += " << qmakeConfig.join( " " ) << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl;
+ cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl;
QStringList buildParts;
buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations";
foreach(QString item, disabledBuildParts) {
buildParts.removeAll(item);
}
- cacheStream << "QT_BUILD_PARTS = " << buildParts.join( " " ) << endl;
+ cacheStream << "QT_BUILD_PARTS = " << buildParts.join(" ") << endl;
QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec);
- if(QFile::exists(mkspec_path))
+ if (QFile::exists(mkspec_path))
cacheStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl;
else
cacheStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl;
@@ -2843,60 +2843,60 @@ void Configure::generateCachefile()
}
// embedded
- if( !dictionary["KBD_DRIVERS"].isEmpty())
+ if (!dictionary["KBD_DRIVERS"].isEmpty())
cacheStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
- if( !dictionary["GFX_DRIVERS"].isEmpty())
+ if (!dictionary["GFX_DRIVERS"].isEmpty())
cacheStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
- if( !dictionary["MOUSE_DRIVERS"].isEmpty())
+ if (!dictionary["MOUSE_DRIVERS"].isEmpty())
cacheStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
- if( !dictionary["DECORATIONS"].isEmpty())
+ if (!dictionary["DECORATIONS"].isEmpty())
cacheStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
- if( !dictionary["QMAKE_RPATHDIR"].isEmpty() )
+ if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
cacheStream << "QMAKE_RPATHDIR += "<<dictionary["QMAKE_RPATHDIR"];
cacheStream.flush();
cacheFile.close();
}
- QFile configFile( dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri" );
- if( configFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file.
- QTextStream configStream( &configFile );
+ QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri");
+ if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
+ QTextStream configStream(&configFile);
configStream << "CONFIG+= ";
configStream << dictionary[ "BUILD" ];
- if( dictionary[ "SHARED" ] == "yes" )
+ if (dictionary[ "SHARED" ] == "yes")
configStream << " shared";
else
configStream << " static";
- if( dictionary[ "LTCG" ] == "yes" )
+ if (dictionary[ "LTCG" ] == "yes")
configStream << " ltcg";
- if( dictionary[ "STL" ] == "yes" )
+ if (dictionary[ "STL" ] == "yes")
configStream << " stl";
- if ( dictionary[ "EXCEPTIONS" ] == "yes" )
+ if (dictionary[ "EXCEPTIONS" ] == "yes")
configStream << " exceptions";
- if ( dictionary[ "EXCEPTIONS" ] == "no" )
+ if (dictionary[ "EXCEPTIONS" ] == "no")
configStream << " exceptions_off";
- if ( dictionary[ "RTTI" ] == "yes" )
+ if (dictionary[ "RTTI" ] == "yes")
configStream << " rtti";
- if ( dictionary[ "MMX" ] == "yes" )
+ if (dictionary[ "MMX" ] == "yes")
configStream << " mmx";
- if ( dictionary[ "3DNOW" ] == "yes" )
+ if (dictionary[ "3DNOW" ] == "yes")
configStream << " 3dnow";
- if ( dictionary[ "SSE" ] == "yes" )
+ if (dictionary[ "SSE" ] == "yes")
configStream << " sse";
- if ( dictionary[ "SSE2" ] == "yes" )
+ if (dictionary[ "SSE2" ] == "yes")
configStream << " sse2";
- if ( dictionary[ "IWMMXT" ] == "yes" )
+ if (dictionary[ "IWMMXT" ] == "yes")
configStream << " iwmmxt";
- if ( dictionary["INCREDIBUILD_XGE"] == "yes" )
+ if (dictionary["INCREDIBUILD_XGE"] == "yes")
configStream << " incredibuild_xge";
- if ( dictionary["PLUGIN_MANIFESTS"] == "no" )
+ if (dictionary["PLUGIN_MANIFESTS"] == "no")
configStream << " no_plugin_manifest";
- if ( dictionary.contains("SYMBIAN_DEFFILES") ) {
- if(dictionary["SYMBIAN_DEFFILES"] == "yes" ) {
+ if (dictionary.contains("SYMBIAN_DEFFILES")) {
+ if (dictionary["SYMBIAN_DEFFILES"] == "yes") {
configStream << " def_files";
- } else if ( dictionary["SYMBIAN_DEFFILES"] == "no" ) {
+ } else if (dictionary["SYMBIAN_DEFFILES"] == "no") {
configStream << " def_files_disabled";
}
}
@@ -2917,17 +2917,17 @@ void Configure::generateCachefile()
configStream << "#Qt for Windows CE c-runtime deployment" << endl
<< "QT_CE_C_RUNTIME = " << fixSeparators(dictionary[ "CE_CRT" ], true) << endl;
- if(dictionary["CE_SIGNATURE"] != QLatin1String("no"))
+ if (dictionary["CE_SIGNATURE"] != QLatin1String("no"))
configStream << "DEFAULT_SIGNATURE=" << dictionary["CE_SIGNATURE"] << endl;
- if(!dictionary["QMAKE_RPATHDIR"].isEmpty())
+ if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
configStream << "QMAKE_RPATHDIR += " << dictionary["QMAKE_RPATHDIR"] << endl;
if (!dictionary["QT_LIBINFIX"].isEmpty())
configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
configStream << "#Qt for Symbian FPU settings" << endl;
- if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
+ if (!dictionary["ARM_FPU_TYPE"].isEmpty()) {
configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
}
if (!dictionary["QT_NAMESPACE"].isEmpty()) {
@@ -2947,10 +2947,10 @@ QString Configure::addDefine(QString def)
defD.replace(QRegExp("=.*"), "");
def.replace(QRegExp("="), " ");
- if(def.startsWith("QT_NO_")) {
+ if (def.startsWith("QT_NO_")) {
defNeg = defD;
defNeg.replace("QT_NO_", "QT_");
- } else if(def.startsWith("QT_")) {
+ } else if (def.startsWith("QT_")) {
defNeg = defD;
defNeg.replace("QT_", "QT_NO_");
}
@@ -2976,30 +2976,30 @@ QString Configure::addDefine(QString def)
void Configure::generateConfigfiles()
{
QDir(buildPath).mkpath("src/corelib/global");
- QString outName( buildPath + "/src/corelib/global/qconfig.h" );
+ QString outName(buildPath + "/src/corelib/global/qconfig.h");
QTemporaryFile tmpFile;
QTextStream tmpStream;
- if(tmpFile.open()) {
+ if (tmpFile.open()) {
tmpStream.setDevice(&tmpFile);
- if( dictionary[ "QCONFIG" ] == "full" ) {
+ if (dictionary[ "QCONFIG" ] == "full") {
tmpStream << "/* Everything */" << endl;
} else {
- QString configName( "qconfig-" + dictionary[ "QCONFIG" ] + ".h" );
+ QString configName("qconfig-" + dictionary[ "QCONFIG" ] + ".h");
tmpStream << "/* Copied from " << configName << "*/" << endl;
tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl;
- QFile inFile( sourcePath + "/src/corelib/global/" + configName );
- if( inFile.open( QFile::ReadOnly ) ) {
+ QFile inFile(sourcePath + "/src/corelib/global/" + configName);
+ if (inFile.open(QFile::ReadOnly)) {
QByteArray buffer = inFile.readAll();
- tmpFile.write( buffer.constData(), buffer.size() );
+ tmpFile.write(buffer.constData(), buffer.size());
inFile.close();
}
tmpStream << "#endif // QT_BOOTSTRAPPED" << endl;
}
tmpStream << endl;
- if( dictionary[ "SHARED" ] == "yes" ) {
+ if (dictionary[ "SHARED" ] == "yes") {
tmpStream << "#ifndef QT_DLL" << endl;
tmpStream << "#define QT_DLL" << endl;
tmpStream << "#endif" << endl;
@@ -3025,7 +3025,7 @@ void Configure::generateConfigfiles()
tmpStream << "/* Machine byte-order */" << endl;
tmpStream << "#define Q_BIG_ENDIAN 4321" << endl;
tmpStream << "#define Q_LITTLE_ENDIAN 1234" << endl;
- if ( QSysInfo::ByteOrder == QSysInfo::BigEndian )
+ if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
tmpStream << "#define Q_BYTE_ORDER Q_BIG_ENDIAN" << endl;
else
tmpStream << "#define Q_BYTE_ORDER Q_LITTLE_ENDIAN" << endl;
@@ -3033,67 +3033,67 @@ void Configure::generateConfigfiles()
tmpStream << endl << "// Compile time features" << endl;
tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl;
QStringList qconfigList;
- if(dictionary["STL"] == "no") qconfigList += "QT_NO_STL";
- if(dictionary["STYLE_WINDOWS"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWS";
- if(dictionary["STYLE_PLASTIQUE"] != "yes") qconfigList += "QT_NO_STYLE_PLASTIQUE";
- if(dictionary["STYLE_CLEANLOOKS"] != "yes") qconfigList += "QT_NO_STYLE_CLEANLOOKS";
- if(dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
+ if (dictionary["STL"] == "no") qconfigList += "QT_NO_STL";
+ if (dictionary["STYLE_WINDOWS"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWS";
+ if (dictionary["STYLE_PLASTIQUE"] != "yes") qconfigList += "QT_NO_STYLE_PLASTIQUE";
+ if (dictionary["STYLE_CLEANLOOKS"] != "yes") qconfigList += "QT_NO_STYLE_CLEANLOOKS";
+ if (dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
qconfigList += "QT_NO_STYLE_WINDOWSXP";
- if(dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
- if(dictionary["STYLE_MOTIF"] != "yes") qconfigList += "QT_NO_STYLE_MOTIF";
- if(dictionary["STYLE_CDE"] != "yes") qconfigList += "QT_NO_STYLE_CDE";
- if(dictionary["STYLE_S60"] != "yes") qconfigList += "QT_NO_STYLE_S60";
- if(dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE";
- if(dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
- if(dictionary["STYLE_GTK"] != "yes") qconfigList += "QT_NO_STYLE_GTK";
-
- if(dictionary["GIF"] == "yes") qconfigList += "QT_BUILTIN_GIF_READER=1";
- if(dictionary["PNG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_PNG";
- if(dictionary["MNG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_MNG";
- if(dictionary["JPEG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
- if(dictionary["TIFF"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
- if(dictionary["ZLIB"] == "no") {
+ if (dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
+ if (dictionary["STYLE_MOTIF"] != "yes") qconfigList += "QT_NO_STYLE_MOTIF";
+ if (dictionary["STYLE_CDE"] != "yes") qconfigList += "QT_NO_STYLE_CDE";
+ if (dictionary["STYLE_S60"] != "yes") qconfigList += "QT_NO_STYLE_S60";
+ if (dictionary["STYLE_WINDOWSCE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSCE";
+ if (dictionary["STYLE_WINDOWSMOBILE"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSMOBILE";
+ if (dictionary["STYLE_GTK"] != "yes") qconfigList += "QT_NO_STYLE_GTK";
+
+ if (dictionary["GIF"] == "yes") qconfigList += "QT_BUILTIN_GIF_READER=1";
+ if (dictionary["PNG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_PNG";
+ if (dictionary["MNG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_MNG";
+ if (dictionary["JPEG"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_JPEG";
+ if (dictionary["TIFF"] == "no") qconfigList += "QT_NO_IMAGEFORMAT_TIFF";
+ if (dictionary["ZLIB"] == "no") {
qconfigList += "QT_NO_ZLIB";
qconfigList += "QT_NO_COMPRESS";
}
- if(dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY";
- if(dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS";
- if(dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL";
- if(dictionary["OPENVG"] == "no") qconfigList += "QT_NO_OPENVG";
- if(dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL";
- if(dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL";
- if(dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS";
- if(dictionary["IPV6"] == "no") qconfigList += "QT_NO_IPV6";
- if(dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT";
- if(dictionary["DECLARATIVE"] == "no") qconfigList += "QT_NO_DECLARATIVE";
- if(dictionary["PHONON"] == "no") qconfigList += "QT_NO_PHONON";
- if(dictionary["MULTIMEDIA"] == "no") qconfigList += "QT_NO_MULTIMEDIA";
- if(dictionary["XMLPATTERNS"] == "no") qconfigList += "QT_NO_XMLPATTERNS";
- if(dictionary["SCRIPT"] == "no") qconfigList += "QT_NO_SCRIPT";
- if(dictionary["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS";
- if(dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE";
- if(dictionary["S60"] == "no") qconfigList += "QT_NO_S60";
- if(dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES";
-
- if(dictionary["OPENGL_ES_CM"] == "no" &&
+ if (dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY";
+ if (dictionary["EXCEPTIONS"] == "no") qconfigList += "QT_NO_EXCEPTIONS";
+ if (dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL";
+ if (dictionary["OPENVG"] == "no") qconfigList += "QT_NO_OPENVG";
+ if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL";
+ if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL";
+ if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS";
+ if (dictionary["IPV6"] == "no") qconfigList += "QT_NO_IPV6";
+ if (dictionary["WEBKIT"] == "no") qconfigList += "QT_NO_WEBKIT";
+ if (dictionary["DECLARATIVE"] == "no") qconfigList += "QT_NO_DECLARATIVE";
+ if (dictionary["PHONON"] == "no") qconfigList += "QT_NO_PHONON";
+ if (dictionary["MULTIMEDIA"] == "no") qconfigList += "QT_NO_MULTIMEDIA";
+ if (dictionary["XMLPATTERNS"] == "no") qconfigList += "QT_NO_XMLPATTERNS";
+ if (dictionary["SCRIPT"] == "no") qconfigList += "QT_NO_SCRIPT";
+ if (dictionary["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS";
+ if (dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE";
+ if (dictionary["S60"] == "no") qconfigList += "QT_NO_S60";
+ if (dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES";
+
+ if (dictionary["OPENGL_ES_CM"] == "no" &&
dictionary["OPENGL_ES_2"] == "no" &&
dictionary["OPENVG"] == "no") qconfigList += "QT_NO_EGL";
- if(dictionary["OPENGL_ES_CM"] == "yes" ||
+ if (dictionary["OPENGL_ES_CM"] == "yes" ||
dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES";
- if(dictionary["OPENGL_ES_CM"] == "yes") qconfigList += "QT_OPENGL_ES_1";
- if(dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2";
- if(dictionary["SQL_MYSQL"] == "yes") qconfigList += "QT_SQL_MYSQL";
- if(dictionary["SQL_ODBC"] == "yes") qconfigList += "QT_SQL_ODBC";
- if(dictionary["SQL_OCI"] == "yes") qconfigList += "QT_SQL_OCI";
- if(dictionary["SQL_PSQL"] == "yes") qconfigList += "QT_SQL_PSQL";
- if(dictionary["SQL_TDS"] == "yes") qconfigList += "QT_SQL_TDS";
- if(dictionary["SQL_DB2"] == "yes") qconfigList += "QT_SQL_DB2";
- if(dictionary["SQL_SQLITE"] == "yes") qconfigList += "QT_SQL_SQLITE";
- if(dictionary["SQL_SQLITE2"] == "yes") qconfigList += "QT_SQL_SQLITE2";
- if(dictionary["SQL_IBASE"] == "yes") qconfigList += "QT_SQL_IBASE";
+ if (dictionary["OPENGL_ES_CM"] == "yes") qconfigList += "QT_OPENGL_ES_1";
+ if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2";
+ if (dictionary["SQL_MYSQL"] == "yes") qconfigList += "QT_SQL_MYSQL";
+ if (dictionary["SQL_ODBC"] == "yes") qconfigList += "QT_SQL_ODBC";
+ if (dictionary["SQL_OCI"] == "yes") qconfigList += "QT_SQL_OCI";
+ if (dictionary["SQL_PSQL"] == "yes") qconfigList += "QT_SQL_PSQL";
+ if (dictionary["SQL_TDS"] == "yes") qconfigList += "QT_SQL_TDS";
+ if (dictionary["SQL_DB2"] == "yes") qconfigList += "QT_SQL_DB2";
+ if (dictionary["SQL_SQLITE"] == "yes") qconfigList += "QT_SQL_SQLITE";
+ if (dictionary["SQL_SQLITE2"] == "yes") qconfigList += "QT_SQL_SQLITE2";
+ if (dictionary["SQL_IBASE"] == "yes") qconfigList += "QT_SQL_IBASE";
if (dictionary["GRAPHICS_SYSTEM"] == "openvg") qconfigList += "QT_GRAPHICSSYSTEM_OPENVG";
if (dictionary["GRAPHICS_SYSTEM"] == "opengl") qconfigList += "QT_GRAPHICSSYSTEM_OPENGL";
@@ -3115,14 +3115,14 @@ void Configure::generateConfigfiles()
for (int i = 0; i < qconfigList.count(); ++i)
tmpStream << addDefine(qconfigList.at(i));
- if(dictionary["EMBEDDED"] == "yes")
+ if (dictionary["EMBEDDED"] == "yes")
{
// Check for keyboard, mouse, gfx.
QStringList kbdDrivers = dictionary["KBD_DRIVERS"].split(" ");;
QStringList allKbdDrivers;
allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um";
foreach(QString kbd, allKbdDrivers) {
- if( !kbdDrivers.contains(kbd))
+ if (!kbdDrivers.contains(kbd))
tmpStream<<"#define QT_NO_QWS_KBD_"<<kbd.toUpper()<<endl;
}
@@ -3130,7 +3130,7 @@ void Configure::generateConfigfiles()
QStringList allMouseDrivers;
allMouseDrivers << "pc"<<"bus"<<"linuxtp"<<"yopy"<<"vr41xx"<<"tslib"<<"qvfb";
foreach(QString mouse, allMouseDrivers) {
- if( !mouseDrivers.contains(mouse) )
+ if (!mouseDrivers.contains(mouse))
tmpStream<<"#define QT_NO_QWS_MOUSE_"<<mouse.toUpper()<<endl;
}
@@ -3138,7 +3138,7 @@ void Configure::generateConfigfiles()
QStringList allGfxDrivers;
allGfxDrivers<<"linuxfb"<<"transformed"<<"qvfb"<<"vnc"<<"multiscreen"<<"ahi";
foreach(QString gfx, allGfxDrivers) {
- if( !gfxDrivers.contains(gfx))
+ if (!gfxDrivers.contains(gfx))
tmpStream<<"#define QT_NO_QWS_"<<gfx.toUpper()<<endl;
}
@@ -3149,22 +3149,22 @@ void Configure::generateConfigfiles()
tmpStream<<"#define QT_QWS_DEPTH_"+depth<<endl;
}
- if( dictionary[ "QT_CUPS" ] == "no")
+ if (dictionary[ "QT_CUPS" ] == "no")
tmpStream<<"#define QT_NO_CUPS"<<endl;
- if( dictionary[ "QT_ICONV" ] == "no")
+ if (dictionary[ "QT_ICONV" ] == "no")
tmpStream<<"#define QT_NO_ICONV"<<endl;
- if(dictionary[ "QT_GLIB" ] == "no")
+ if (dictionary[ "QT_GLIB" ] == "no")
tmpStream<<"#define QT_NO_GLIB"<<endl;
- if(dictionary[ "QT_LPR" ] == "no")
+ if (dictionary[ "QT_LPR" ] == "no")
tmpStream<<"#define QT_NO_LPR"<<endl;
- if(dictionary[ "QT_INOTIFY" ] == "no" )
+ if (dictionary[ "QT_INOTIFY" ] == "no")
tmpStream<<"#define QT_NO_INOTIFY"<<endl;
- if(dictionary[ "QT_SXE" ] == "no")
+ if (dictionary[ "QT_SXE" ] == "no")
tmpStream<<"#define QT_NO_SXE"<<endl;
tmpStream.flush();
@@ -3176,7 +3176,7 @@ void Configure::generateConfigfiles()
tmpFile.copy(outName);
tmpFile.close();
- if(!QFile::exists(buildPath + "/include/QtCore/qconfig.h")) {
+ 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",
@@ -3207,7 +3207,7 @@ void Configure::generateConfigfiles()
}
outName = defSpec + "/qmake.conf";
- ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
+ ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
QFile qmakeConfFile(outName);
if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) {
QTextStream qmakeConfStream;
@@ -3231,7 +3231,7 @@ void Configure::generateConfigfiles()
<< "/* Build date */" << endl
<< "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
<< endl;
- if(!dictionary[ "QT_HOST_PREFIX" ].isNull())
+ if (!dictionary[ "QT_HOST_PREFIX" ].isNull())
tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl;
tmpStream << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary["QT_INSTALL_PREFIX"]) << "\";" << endl
<< "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << escapeSeparators(dictionary["QT_INSTALL_DOCS"]) << "\";" << endl
@@ -3246,7 +3246,7 @@ void Configure::generateConfigfiles()
<< "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << escapeSeparators(dictionary["QT_INSTALL_DEMOS"]) << "\";" << endl
//<< "static const char qt_configure_settings_path_str [256] = \"qt_stngpath=" << escapeSeparators(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl
;
- if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
+ if (!dictionary[ "QT_HOST_PREFIX" ].isNull()) {
tmpStream << "#else" << endl
<< "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << escapeSeparators(dictionary[ "QT_HOST_PREFIX" ]) << "\";" << endl
<< "static const char qt_configure_documentation_path_str[512 + 12] = \"qt_docspath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/doc", true) <<"\";" << endl
@@ -3261,7 +3261,7 @@ void Configure::generateConfigfiles()
<< "static const char qt_configure_demos_path_str [512 + 12] = \"qt_demopath=" << fixSeparators(dictionary[ "QT_HOST_PREFIX" ] + "/demos", true) <<"\";" << endl
<< "#endif //QT_BOOTSTRAPPED" << endl;
}
- tmpStream << "/* strlen( \"qt_lcnsxxxx\" ) == 12 */" << endl
+ tmpStream << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl
<< "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl
<< "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl
<< "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;" << endl
@@ -3282,8 +3282,8 @@ void Configure::generateConfigfiles()
tmpFile2.flush();
// Replace old qconfig.cpp with new one
- ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
- QFile::remove( outName );
+ ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
+ QFile::remove(outName);
tmpFile2.copy(outName);
tmpFile2.close();
}
@@ -3298,8 +3298,8 @@ void Configure::generateConfigfiles()
tmpFile3.flush();
outName = buildPath + "/src/corelib/global/qconfig_eval.cpp";
- ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL );
- QFile::remove( outName );
+ ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL);
+ QFile::remove(outName);
if (dictionary["EDITION"] == "Evaluation" || qmakeDefines.contains("QT_EVAL"))
tmpFile3.copy(outName);
@@ -3343,9 +3343,9 @@ void Configure::displayConfig()
}
cout << "Configuration:" << endl;
- cout << " " << qmakeConfig.join( "\r\n " ) << endl;
+ cout << " " << qmakeConfig.join("\r\n ") << endl;
cout << "Qt Configuration:" << endl;
- cout << " " << qtConfig.join( "\r\n " ) << endl;
+ cout << " " << qtConfig.join("\r\n ") << endl;
cout << endl;
if (dictionary.contains("XQMAKESPEC"))
@@ -3437,51 +3437,51 @@ void Configure::displayConfig()
if (dictionary.contains("SYMBIAN_DEFFILES")) {
cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
- if(dictionary["SYMBIAN_DEFFILES"] == "no") {
+ if (dictionary["SYMBIAN_DEFFILES"] == "no") {
cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
cout << " This feature is only intended for use during development, NEVER for release builds." << endl;
}
}
- if(dictionary["ASSISTANT_WEBKIT"] == "yes")
+ if (dictionary["ASSISTANT_WEBKIT"] == "yes")
cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
- if(checkAvailability("INCREDIBUILD_XGE"))
+ if (checkAvailability("INCREDIBUILD_XGE"))
cout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
- if( !qmakeDefines.isEmpty() ) {
+ if (!qmakeDefines.isEmpty()) {
cout << "Defines.....................";
- for( QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs )
+ for (QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs)
cout << (*defs) << " ";
cout << endl;
}
- if( !qmakeIncludes.isEmpty() ) {
+ if (!qmakeIncludes.isEmpty()) {
cout << "Include paths...............";
- for( QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs )
+ for (QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs)
cout << (*incs) << " ";
cout << endl;
}
- if( !qmakeLibs.isEmpty() ) {
+ if (!qmakeLibs.isEmpty()) {
cout << "Additional libraries........";
- for( QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs )
+ for (QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs)
cout << (*libs) << " ";
cout << endl;
}
- if( dictionary[ "QMAKE_INTERNAL" ] == "yes" ) {
+ if (dictionary[ "QMAKE_INTERNAL" ] == "yes") {
cout << "Using internal configuration." << endl;
}
- if( dictionary[ "SHARED" ] == "no" ) {
+ if (dictionary[ "SHARED" ] == "no") {
cout << "WARNING: Using static linking will disable the use of plugins." << endl;
cout << " Make sure you compile ALL needed modules into the library." << endl;
}
- if( dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty() ) {
+ if (dictionary[ "OPENSSL" ] == "linked" && opensslLibs.isEmpty()) {
cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
cout << "library names through OPENSSL_LIBS." << endl;
cout << "For example:" << endl;
cout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
}
- if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
+ if (dictionary[ "ZLIB_FORCED" ] == "yes") {
QString which_zlib = "supplied";
- if( dictionary[ "ZLIB" ] == "system")
+ if (dictionary[ "ZLIB" ] == "system")
which_zlib = "system";
cout << "NOTE: The -no-zlib option was supplied but is no longer supported." << endl
@@ -3510,17 +3510,17 @@ void Configure::generateHeaders()
void Configure::buildQmake()
{
- if( dictionary[ "BUILD_QMAKE" ] == "yes" ) {
+ if (dictionary[ "BUILD_QMAKE" ] == "yes") {
QStringList args;
// Build qmake
QString pwd = QDir::currentPath();
- QDir::setCurrent(buildPath + "/qmake" );
+ QDir::setCurrent(buildPath + "/qmake");
QString makefile = "Makefile";
{
QFile out(makefile);
- if(out.open(QFile::WriteOnly | QFile::Text)) {
+ if (out.open(QFile::WriteOnly | QFile::Text)) {
QTextStream stream(&out);
stream << "#AutoGenerated by configure.exe" << endl
<< "BUILD_PATH = " << QDir::convertSeparators(buildPath) << endl
@@ -3533,7 +3533,7 @@ void Configure::buildQmake()
stream << "\n\n";
QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);
- if(in.open(QFile::ReadOnly | QFile::Text)) {
+ if (in.open(QFile::ReadOnly | QFile::Text)) {
QString d = in.readAll();
//### need replaces (like configure.sh)? --Sam
stream << d << endl;
@@ -3549,14 +3549,14 @@ void Configure::buildQmake()
cout << "Creating qmake..." << endl;
int exitCode = Environment::execute(args, QStringList(), QStringList());
- if( exitCode ) {
+ if (exitCode) {
args.clear();
args += dictionary[ "MAKE" ];
args += "-f";
args += makefile;
args += "clean";
exitCode = Environment::execute(args, QStringList(), QStringList());
- if(exitCode) {
+ if (exitCode) {
cout << "Cleaning qmake failed, return code " << exitCode << endl << endl;
dictionary[ "DONE" ] = "error";
} else {
@@ -3571,7 +3571,7 @@ void Configure::buildQmake()
}
}
}
- QDir::setCurrent( pwd );
+ QDir::setCurrent(pwd);
}
}
#endif
@@ -3590,7 +3590,7 @@ void Configure::buildHostTools()
<< "src/tools"
<< "tools/linguist/lrelease";
- if(dictionary["XQMAKESPEC"].startsWith("wince"))
+ if (dictionary["XQMAKESPEC"].startsWith("wince"))
hostToolsDirs << "tools/checksdk";
if (dictionary[ "CETEST" ] == "yes")
@@ -3626,7 +3626,7 @@ void Configure::buildHostTools()
args += dictionary["MAKE"];
args += "clean";
exitCode = Environment::execute(args, QStringList(), QStringList());
- if(exitCode) {
+ if (exitCode) {
cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl;
dictionary["DONE"] = "error";
break;
@@ -3645,24 +3645,24 @@ void Configure::buildHostTools()
QDir::setCurrent(pwd);
}
-void Configure::findProjects( const QString& dirName )
+void Configure::findProjects(const QString& dirName)
{
- if( dictionary[ "NOPROCESS" ] == "no" ) {
- QDir dir( dirName );
+ if (dictionary[ "NOPROCESS" ] == "no") {
+ QDir dir(dirName);
QString entryName;
int makeListNumber;
ProjectType qmakeTemplate;
const QFileInfoList &list = dir.entryInfoList(QStringList(QLatin1String("*.pro")),
QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
- for(int i = 0; i < list.size(); ++i) {
+ for (int i = 0; i < list.size(); ++i) {
const QFileInfo &fi = list.at(i);
- if(fi.fileName() != "qmake.pro") {
+ if (fi.fileName() != "qmake.pro") {
entryName = dirName + "/" + fi.fileName();
- if(fi.isDir()) {
- findProjects( entryName );
+ if (fi.isDir()) {
+ findProjects(entryName);
} else {
- qmakeTemplate = projectType( fi.absoluteFilePath() );
- switch ( qmakeTemplate ) {
+ qmakeTemplate = projectType(fi.absoluteFilePath());
+ switch (qmakeTemplate) {
case Lib:
case Subdirs:
makeListNumber = 1;
@@ -3689,33 +3689,33 @@ void Configure::appendMakeItem(int inList, const QString &item)
dir = "/" + item;
dir.prepend("/src");
makeList[inList].append(new MakeItem(sourcePath + dir,
- item + ".pro", buildPath + dir + "/Makefile", Lib ) );
- if( dictionary[ "DSPFILES" ] == "yes" ) {
- makeList[inList].append( new MakeItem(sourcePath + dir,
- item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib ) );
+ item + ".pro", buildPath + dir + "/Makefile", Lib));
+ if (dictionary[ "DSPFILES" ] == "yes") {
+ makeList[inList].append(new MakeItem(sourcePath + dir,
+ item + ".pro", buildPath + dir + "/" + item + ".dsp", Lib));
}
- if( dictionary[ "VCPFILES" ] == "yes" ) {
- makeList[inList].append( new MakeItem(sourcePath + dir,
- item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib ) );
+ if (dictionary[ "VCPFILES" ] == "yes") {
+ makeList[inList].append(new MakeItem(sourcePath + dir,
+ item + ".pro", buildPath + dir + "/" + item + ".vcp", Lib));
}
- if( dictionary[ "VCPROJFILES" ] == "yes" ) {
- makeList[inList].append( new MakeItem(sourcePath + dir,
- item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib ) );
+ if (dictionary[ "VCPROJFILES" ] == "yes") {
+ makeList[inList].append(new MakeItem(sourcePath + dir,
+ item + ".pro", buildPath + dir + "/" + item + ".vcproj", Lib));
}
}
void Configure::generateMakefiles()
{
- if( dictionary[ "NOPROCESS" ] == "no" ) {
+ if (dictionary[ "NOPROCESS" ] == "no") {
#if !defined(EVAL)
cout << "Creating makefiles in src..." << endl;
#endif
QString spec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ];
- if( spec != "win32-msvc" )
+ if (spec != "win32-msvc")
dictionary[ "DSPFILES" ] = "no";
- if( spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
+ if (spec != "win32-msvc.net" && !spec.startsWith("win32-msvc2") && !spec.startsWith(QLatin1String("wince")))
dictionary[ "VCPROJFILES" ] = "no";
int i = 0;
@@ -3730,10 +3730,10 @@ void Configure::generateMakefiles()
QString dirPath = fixSeparators(buildPath + dirName);
QStringList args;
- args << fixSeparators( buildPath + "/bin/qmake" );
+ args << fixSeparators(buildPath + "/bin/qmake");
if (doDsp) {
- if( dictionary[ "DEPENDENCIES" ] == "no" )
+ if (dictionary[ "DEPENDENCIES" ] == "no")
args << "-nodepend";
args << "-tp" << "vc";
doDsp = false; // DSP files will be done
@@ -3748,21 +3748,21 @@ void Configure::generateMakefiles()
args << (sourcePath + "/projects.pro");
args << "-o";
args << buildPath;
- if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
+ if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
args << dictionary[ "QMAKEADDITIONALARGS" ];
- QDir::setCurrent( fixSeparators( dirPath ) );
- if( int exitCode = Environment::execute(args, QStringList(), QStringList()) ) {
+ QDir::setCurrent(fixSeparators(dirPath));
+ if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
cout << "Qmake failed, return code " << exitCode << endl << endl;
dictionary[ "DONE" ] = "error";
}
}
} else {
findProjects(sourcePath);
- for ( i=0; i<3; i++ ) {
- for ( int j=0; j<makeList[i].size(); ++j) {
+ for (i=0; i<3; i++) {
+ for (int j=0; j<makeList[i].size(); ++j) {
MakeItem *it=makeList[i][j];
- QString dirPath = fixSeparators( it->directory + "/" );
+ QString dirPath = fixSeparators(it->directory + "/");
QString projectName = it->proFile;
QString makefileName = buildPath + "/" + dirPath + it->target;
@@ -3773,7 +3773,7 @@ void Configure::generateMakefiles()
QStringList args;
- args << fixSeparators( buildPath + "/bin/qmake" );
+ args << fixSeparators(buildPath + "/bin/qmake");
args << sourcePath + "/" + dirPath + projectName;
args << dictionary[ "QMAKE_ALL_ARGS" ];
@@ -3782,10 +3782,10 @@ void Configure::generateMakefiles()
args << it->target;
args << "-spec";
args << spec;
- if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
+ if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty())
args << dictionary[ "QMAKEADDITIONALARGS" ];
- QDir::setCurrent( fixSeparators( dirPath ) );
+ QDir::setCurrent(fixSeparators(dirPath));
QFile file(makefileName);
if (!file.open(QFile::WriteOnly)) {
@@ -3803,7 +3803,7 @@ void Configure::generateMakefiles()
}
}
}
- QDir::setCurrent( pwd );
+ QDir::setCurrent(pwd);
} else {
cout << "Processing of project files have been disabled." << endl;
cout << "Only use this option if you really know what you're doing." << endl << endl;
@@ -3817,7 +3817,7 @@ void Configure::showSummary()
if (!dictionary.contains("XQMAKESPEC")) {
cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
- } else if(dictionary.value("QMAKESPEC").startsWith("wince")) {
+ } else if (dictionary.value("QMAKESPEC").startsWith("wince")) {
// we are cross compiling for Windows CE
cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl
<< "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl
@@ -3829,24 +3829,24 @@ void Configure::showSummary()
}
}
-Configure::ProjectType Configure::projectType( const QString& proFileName )
+Configure::ProjectType Configure::projectType(const QString& proFileName)
{
- QFile proFile( proFileName );
- if( proFile.open( QFile::ReadOnly ) ) {
+ QFile proFile(proFileName);
+ if (proFile.open(QFile::ReadOnly)) {
QString buffer = proFile.readLine(1024);
while (!buffer.isEmpty()) {
- QStringList segments = buffer.split(QRegExp( "\\s" ));
+ QStringList segments = buffer.split(QRegExp("\\s"));
QStringList::Iterator it = segments.begin();
- if(segments.size() >= 3) {
+ if (segments.size() >= 3) {
QString keyword = (*it++);
QString operation = (*it++);
QString value = (*it++);
- if( keyword == "TEMPLATE" ) {
- if( value == "lib" )
+ if (keyword == "TEMPLATE") {
+ if (value == "lib")
return Lib;
- else if( value == "subdirs" )
+ else if (value == "subdirs")
return Subdirs;
}
}
@@ -3932,11 +3932,11 @@ bool Configure::showLicense(QString orgLicenseFile)
return false;
}
QStringList licenseContent = QString(file.readAll()).split('\n');
- while(i < licenseContent.size()) {
+ while (i < licenseContent.size()) {
cout << licenseContent.at(i) << endl;
if (++i % screenHeight == 0) {
cout << "(Press any key for more..)";
- if(_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
+ if (_getch() == 3) // _Any_ keypress w/no echo(eat <Enter> for stdout)
exit(0); // Exit cleanly for Ctrl+C
cout << "\r"; // Overwrite text above
}
@@ -4018,13 +4018,13 @@ void Configure::readLicense()
void Configure::reloadCmdLine()
{
- if( dictionary[ "REDO" ] == "yes" ) {
- QFile inFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
- if( inFile.open( QFile::ReadOnly ) ) {
- QTextStream inStream( &inFile );
+ if (dictionary[ "REDO" ] == "yes") {
+ QFile inFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
+ if (inFile.open(QFile::ReadOnly)) {
+ QTextStream inStream(&inFile);
QString buffer;
inStream >> buffer;
- while( buffer.length() ) {
+ while (buffer.length()) {
configCmdLine += buffer;
inStream >> buffer;
}
@@ -4035,11 +4035,11 @@ void Configure::reloadCmdLine()
void Configure::saveCmdLine()
{
- if( dictionary[ "REDO" ] != "yes" ) {
- QFile outFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" );
- if( outFile.open( QFile::WriteOnly | QFile::Text ) ) {
- QTextStream outStream( &outFile );
- for( QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it ) {
+ if (dictionary[ "REDO" ] != "yes") {
+ QFile outFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache");
+ if (outFile.open(QFile::WriteOnly | QFile::Text)) {
+ QTextStream outStream(&outFile);
+ for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) {
outStream << (*it) << " " << endl;
}
outStream.flush();
@@ -4063,23 +4063,23 @@ bool
Configure::filesDiffer(const QString &fn1, const QString &fn2)
{
QFile file1(fn1), file2(fn2);
- if(!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
+ if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly))
return true;
const int chunk = 2048;
int used1 = 0, used2 = 0;
char b1[chunk], b2[chunk];
- while(!file1.atEnd() && !file2.atEnd()) {
- if(!used1)
+ while (!file1.atEnd() && !file2.atEnd()) {
+ if (!used1)
used1 = file1.read(b1, chunk);
- if(!used2)
+ if (!used2)
used2 = file2.read(b2, chunk);
- if(used1 > 0 && used2 > 0) {
+ if (used1 > 0 && used2 > 0) {
const int cmp = qMin(used1, used2);
- if(memcmp(b1, b2, cmp))
+ if (memcmp(b1, b2, cmp))
return true;
- if((used1 -= cmp))
+ if ((used1 -= cmp))
memcpy(b1, b1+cmp, used1);
- if((used2 -= cmp))
+ if ((used2 -= cmp))
memcpy(b2, b2+cmp, used2);
}
}
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index b3e7e84..609bd3d 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1761,7 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
if (!tor)
goto case_default;
if (!sourcetext.isEmpty())
- yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
+ yyMsg() << "//% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
utf8 = (yyTok == Tok_trUtf8);
line = yyLineNo;
yyTok = getToken();
@@ -1858,6 +1858,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
gotctx:
recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
}
+ sourcetext.clear(); // Will have warned about that already
extracomment.clear();
msgid.clear();
extra.clear();
@@ -1867,7 +1868,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
if (!tor)
goto case_default;
if (!sourcetext.isEmpty())
- yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
+ yyMsg() << "//% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
utf8 = (yyTok == Tok_translateUtf8);
line = yyLineNo;
yyTok = getToken();
@@ -1913,6 +1914,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
}
recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
}
+ sourcetext.clear(); // Will have warned about that already
extracomment.clear();
msgid.clear();
extra.clear();
@@ -2079,9 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
case Tok_Semicolon:
prospectiveContext.clear();
prefix.clear();
- extracomment.clear();
- msgid.clear();
- extra.clear();
+ if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) {
+ yyMsg() << "Discarding unconsumed meta data\n";
+ sourcetext.clear();
+ extracomment.clear();
+ msgid.clear();
+ extra.clear();
+ }
yyTokColonSeen = false;
yyTok = getToken();
break;
diff --git a/tools/qdoc3/codechunk.h b/tools/qdoc3/codechunk.h
index e78873c..a0c554e 100644
--- a/tools/qdoc3/codechunk.h
+++ b/tools/qdoc3/codechunk.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
/*
The CodeChunk class represents a tiny piece of C++ code.
- The class provides convertion between a list of lexemes and a string. It adds
+ The class provides conversion between a list of lexemes and a string. It adds
spaces at the right place for consistent style. The tiny pieces of code it
represents are data types, enum values, and default parameter values.
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 818a91f..33ceaf5 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -257,6 +257,7 @@ QString CodeMarker::typified(const QString &string)
QString CodeMarker::taggedNode(const Node* node)
{
QString tag;
+ QString name = node->name();
switch (node->type()) {
case Node::Namespace:
@@ -277,11 +278,20 @@ QString CodeMarker::taggedNode(const Node* node)
case Node::Property:
tag = QLatin1String("@property");
break;
+#ifdef QDOC_QML
+ case Node::Fake:
+ if (node->subType() == Node::QmlClass) {
+ if (node->name().startsWith(QLatin1String("QML:")))
+ name = name.mid(4); // remove the "QML:" prefix
+ }
+ tag = QLatin1String("@property");
+ break;
+#endif
default:
tag = QLatin1String("@unknown");
break;
}
- return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
+ return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
+ QLatin1String("</") + tag + QLatin1Char('>');
}
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 13678af..e4870e3 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -728,7 +728,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
if (n)
classNode = static_cast<const ClassNode*>(n);
}
- return new QmlClassNode(tre->root(), names[0], classNode);
+ if (names[0].startsWith("Q"))
+ 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
@@ -752,6 +755,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
QString type;
QmlClassNode* qmlClass = 0;
if (splitQmlMethodArg(doc,arg,type,element)) {
+ if (element.startsWith(QLatin1String("Q")))
+ element = QLatin1String("QML:") + element;
Node* n = tre->findNode(QStringList(element),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
qmlClass = static_cast<QmlClassNode*>(n);
@@ -1850,16 +1855,40 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
else if (key == "WRITE") {
tre->addPropertyFunction(property, value, PropertyNode::Setter);
property->setWritable(true);
- } else if (key == "STORED")
+ }
+ else if (key == "STORED")
property->setStored(value.toLower() == "true");
- else if (key == "DESIGNABLE")
- property->setDesignable(value.toLower() == "true");
+ else if (key == "DESIGNABLE") {
+ QString v = value.toLower();
+ if (v == "true")
+ property->setDesignable(true);
+ else if (v == "false")
+ property->setDesignable(false);
+ else {
+ property->setDesignable(false);
+ property->setRuntimeDesFunc(value);
+ }
+ }
else if (key == "RESET")
tre->addPropertyFunction(property, value, PropertyNode::Resetter);
else if (key == "NOTIFY") {
tre->addPropertyFunction(property, value, PropertyNode::Notifier);
}
-
+ else if (key == "SCRIPTABLE") {
+ QString v = value.toLower();
+ if (v == "true")
+ property->setScriptable(true);
+ else if (v == "false")
+ property->setScriptable(false);
+ else {
+ property->setScriptable(false);
+ property->setRuntimeScrFunc(value);
+ }
+ }
+ else if (key == "COSTANT")
+ property->setConstant();
+ else if (key == "FINAL")
+ property->setFinal();
}
match(Tok_RightParen);
return true;
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index be734ac..d7a9c9e 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1,3 +1,4 @@
+
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
@@ -1465,7 +1466,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
writeFunctions((*s),cn,marker);
}
else if ((*s).name == "Member Type Documentation") {
- writeNestedClasses((*s),cn,marker);
writeEnumerations((*s),cn,marker);
writeTypedefs((*s),cn,marker);
}
@@ -1475,6 +1475,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
else if ((*s).name == "Property Documentation") {
writeProperties((*s),cn,marker);
}
+ else if ((*s).name == "Macro Documentation") {
+ writeMacros((*s),cn,marker);
+ }
++s;
}
writer.writeEndElement(); // </cxxClass>
@@ -4573,7 +4576,8 @@ void DitaXmlGenerator::writeLocation(const Node* n)
s2 = CXXTYPEDEFDECLARATIONFILE;
s3 = CXXTYPEDEFDECLARATIONFILELINE;
}
- else if (n->type() == Node::Property) {
+ else if ((n->type() == Node::Property) ||
+ (n->type() == Node::Variable)) {
s1 = CXXVARIABLEAPIITEMLOCATION;
s2 = CXXVARIABLEDECLARATIONFILE;
s3 = CXXVARIABLEDECLARATIONFILELINE;
@@ -4716,6 +4720,8 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
writer.writeStartElement(CXXFUNCTIONPARAMETER);
writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE);
writer.writeCharacters((*p).leftType());
+ if (!(*p).rightType().isEmpty())
+ writer.writeCharacters((*p).rightType());
writer.writeEndElement(); // <cxxFunctionParameterDeclaredType>
writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME);
writer.writeCharacters((*p).name());
@@ -4732,12 +4738,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
}
}
-void DitaXmlGenerator::writeNestedClasses(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker)
-{
-}
-
void DitaXmlGenerator::writeEnumerations(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
@@ -4888,12 +4888,6 @@ void DitaXmlGenerator::writeTypedefs(const Section& s,
}
}
-void DitaXmlGenerator::writeDataMembers(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker)
-{
-}
-
void DitaXmlGenerator::writeProperties(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
@@ -4914,9 +4908,9 @@ void DitaXmlGenerator::writeProperties(const Section& s,
writer.writeAttribute("value",pn->accessString());
writer.writeEndElement(); // <cxxVariableAccessSpecifier>
- if (!pn->dataType().isEmpty()) {
+ if (!pn->qualifiedDataType().isEmpty()) {
writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
- writer.writeCharacters(pn->dataType());
+ writer.writeCharacters(pn->qualifiedDataType());
writer.writeEndElement(); // <cxxVariableDeclaredType>
}
QString fq = fullQualification(pn);
@@ -4925,11 +4919,49 @@ void DitaXmlGenerator::writeProperties(const Section& s,
writer.writeCharacters(fq);
writer.writeEndElement(); // <cxxVariableScopedName>
}
+
+ writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+ writer.writeCharacters("Q_PROPERTY(");
+ writer.writeCharacters(pn->qualifiedDataType());
+ writer.writeCharacters(" ");
+ writer.writeCharacters(pn->name());
+ writePropParams("READ",pn->getters());
+ writePropParams("WRITE",pn->setters());
+ writePropParams("RESET",pn->resetters());
+ writePropParams("NOTIFY",pn->notifiers());
+ if (pn->isDesignable() != pn->designableDefault()) {
+ writer.writeCharacters(" DESIGNABLE ");
+ if (!pn->runtimeDesignabilityFunction().isEmpty())
+ writer.writeCharacters(pn->runtimeDesignabilityFunction());
+ else
+ writer.writeCharacters(pn->isDesignable() ? "true" : "false");
+ }
+ if (pn->isScriptable() != pn->scriptableDefault()) {
+ writer.writeCharacters(" SCRIPTABLE ");
+ if (!pn->runtimeScriptabilityFunction().isEmpty())
+ writer.writeCharacters(pn->runtimeScriptabilityFunction());
+ else
+ writer.writeCharacters(pn->isScriptable() ? "true" : "false");
+ }
+ if (pn->isWritable() != pn->writableDefault()) {
+ writer.writeCharacters(" STORED ");
+ writer.writeCharacters(pn->isStored() ? "true" : "false");
+ }
+ if (pn->isUser() != pn->userDefault()) {
+ writer.writeCharacters(" USER ");
+ writer.writeCharacters(pn->isUser() ? "true" : "false");
+ }
+ if (pn->isConstant())
+ writer.writeCharacters(" CONSTANT");
+ if (pn->isFinal())
+ writer.writeCharacters(" FINAL");
+ writer.writeCharacters(")");
+ writer.writeEndElement(); // <cxxVariablePrototype>
+
writer.writeStartElement(CXXVARIABLENAMELOOKUP);
writer.writeCharacters(pn->parent()->name() + "::" + pn->name());
writer.writeEndElement(); // <cxxVariableNameLookup>
-
if (pn->overriddenFrom() != 0) {
PropertyNode* opn = (PropertyNode*)pn->overriddenFrom();
writer.writeStartElement(CXXVARIABLEREIMPLEMENTED);
@@ -4954,4 +4986,169 @@ void DitaXmlGenerator::writeProperties(const Section& s,
}
}
+void DitaXmlGenerator::writeDataMembers(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker)
+{
+ NodeList::ConstIterator m = s.members.begin();
+ while (m != s.members.end()) {
+ if ((*m)->type() == Node::Variable) {
+ const VariableNode* vn = static_cast<const VariableNode*>(*m);
+ writer.writeStartElement(CXXVARIABLE);
+ writer.writeAttribute("id",vn->guid());
+ writer.writeStartElement(APINAME);
+ writer.writeCharacters(vn->name());
+ writer.writeEndElement(); // </apiName>
+ generateBrief(vn,marker);
+ writer.writeStartElement(CXXVARIABLEDETAIL);
+ writer.writeStartElement(CXXVARIABLEDEFINITION);
+ writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER);
+ writer.writeAttribute("value",vn->accessString());
+ writer.writeEndElement(); // <cxxVariableAccessSpecifier>
+
+ if (vn->isStatic()) {
+ writer.writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC);
+ writer.writeAttribute("name","static");
+ writer.writeAttribute("value","static");
+ writer.writeEndElement(); // <cxxVariableStorageClassSpecifierStatic>
+ }
+
+ writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
+ writer.writeCharacters(vn->leftType());
+ if (!vn->rightType().isEmpty())
+ writer.writeCharacters(vn->rightType());
+ writer.writeEndElement(); // <cxxVariableDeclaredType>
+
+ QString fq = fullQualification(vn);
+ if (!fq.isEmpty()) {
+ writer.writeStartElement(CXXVARIABLESCOPEDNAME);
+ writer.writeCharacters(fq);
+ writer.writeEndElement(); // <cxxVariableScopedName>
+ }
+
+ writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+ writer.writeCharacters(vn->leftType() + " ");
+ //writer.writeCharacters(vn->parent()->name() + "::" + vn->name());
+ writer.writeCharacters(vn->name());
+ if (!vn->rightType().isEmpty())
+ writer.writeCharacters(vn->rightType());
+ writer.writeEndElement(); // <cxxVariablePrototype>
+
+ writer.writeStartElement(CXXVARIABLENAMELOOKUP);
+ writer.writeCharacters(vn->parent()->name() + "::" + vn->name());
+ writer.writeEndElement(); // <cxxVariableNameLookup>
+
+ writeLocation(vn);
+ writer.writeEndElement(); // <cxxVariableDefinition>
+ writer.writeStartElement(APIDESC);
+
+ if (!vn->doc().isEmpty()) {
+ generateBody(vn, marker);
+ }
+
+ writer.writeEndElement(); // </apiDesc>
+ writer.writeEndElement(); // </cxxVariableDetail>
+ writer.writeEndElement(); // </cxxVariable>
+ }
+ ++m;
+ }
+}
+
+void DitaXmlGenerator::writeMacros(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker)
+{
+ NodeList::ConstIterator m = s.members.begin();
+ while (m != s.members.end()) {
+ if ((*m)->type() == Node::Function) {
+ const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
+ if (fn->isMacro()) {
+ writer.writeStartElement(CXXDEFINE);
+ writer.writeAttribute("id",fn->guid());
+ writer.writeStartElement(APINAME);
+ writer.writeCharacters(fn->name());
+ writer.writeEndElement(); // </apiName>
+ generateBrief(fn,marker);
+ writer.writeStartElement(CXXDEFINEDETAIL);
+ writer.writeStartElement(CXXDEFINEDEFINITION);
+ writer.writeStartElement(CXXDEFINEACCESSSPECIFIER);
+ writer.writeAttribute("value",fn->accessString());
+ writer.writeEndElement(); // <cxxDefineAccessSpecifier>
+
+ writer.writeStartElement(CXXDEFINEPROTOTYPE);
+ writer.writeCharacters("#define ");
+ writer.writeCharacters(fn->name());
+ if (fn->metaness() == FunctionNode::MacroWithParams) {
+ QStringList params = fn->parameterNames();
+ if (!params.isEmpty()) {
+ writer.writeCharacters("(");
+ for (int i = 0; i < params.size(); ++i) {
+ if (params[i].isEmpty())
+ writer.writeCharacters("...");
+ else
+ writer.writeCharacters(params[i]);
+ if ((i+1) < params.size())
+ writer.writeCharacters(", ");
+ }
+ writer.writeCharacters(")");
+ }
+ }
+ writer.writeEndElement(); // <cxxDefinePrototype>
+
+ writer.writeStartElement(CXXDEFINENAMELOOKUP);
+ writer.writeCharacters(fn->name());
+ writer.writeEndElement(); // <cxxDefineNameLookup>
+
+ if (fn->reimplementedFrom() != 0) {
+ FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
+ writer.writeStartElement(CXXDEFINEREIMPLEMENTED);
+ writer.writeAttribute("href",rfn->ditaXmlHref());
+ writer.writeCharacters(marker->plainFullName(rfn));
+ writer.writeEndElement(); // </cxxDefineReimplemented>
+ }
+
+ if (fn->metaness() == FunctionNode::MacroWithParams) {
+ QStringList params = fn->parameterNames();
+ if (!params.isEmpty()) {
+ writer.writeStartElement(CXXDEFINEPARAMETERS);
+ for (int i = 0; i < params.size(); ++i) {
+ writer.writeStartElement(CXXDEFINEPARAMETER);
+ writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME);
+ writer.writeCharacters(params[i]);
+ writer.writeEndElement(); // <cxxDefineParameterDeclarationName>
+ writer.writeEndElement(); // <cxxDefineParameter>
+ }
+ writer.writeEndElement(); // <cxxDefineParameters>
+ }
+ }
+
+ writeLocation(fn);
+ writer.writeEndElement(); // <cxxDefineDefinition>
+ writer.writeStartElement(APIDESC);
+
+ if (!fn->doc().isEmpty()) {
+ generateBody(fn, marker);
+ }
+
+ writer.writeEndElement(); // </apiDesc>
+ writer.writeEndElement(); // </cxxDefineDetail>
+ writer.writeEndElement(); // </cxxDefine>
+ }
+ }
+ ++m;
+ }
+}
+
+void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist)
+{
+ NodeList::const_iterator n = nlist.begin();
+ while (n != nlist.end()) {
+ writer.writeCharacters(" ");
+ writer.writeCharacters(tag);
+ writer.writeCharacters(" ");
+ writer.writeCharacters((*n)->name());
+ ++n;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 8c7e439..446f735 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -118,9 +118,6 @@ class DitaXmlGenerator : public PageGenerator
const ClassNode* cn,
CodeMarker* marker);
void writeParameters(const FunctionNode* fn, CodeMarker* marker);
- void writeNestedClasses(const Section& s,
- const ClassNode* cn,
- CodeMarker* marker);
void writeEnumerations(const Section& s,
const ClassNode* cn,
CodeMarker* marker);
@@ -133,6 +130,10 @@ class DitaXmlGenerator : public PageGenerator
void writeProperties(const Section& s,
const ClassNode* cn,
CodeMarker* marker);
+ void writeMacros(const Section& s,
+ const ClassNode* cn,
+ CodeMarker* marker);
+ void writePropParams(const QString& tag, const NodeList& nlist);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 339c390..b93db4f 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1891,6 +1891,16 @@ void HtmlGenerator::generateFooter(const Node *node)
else
{
out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << " <!-- <script type=\"text/javascript\">\n";
+ out() << " var _gaq = _gaq || [];\n";
+ out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
+ out() << " _gaq.push(['_trackPageview']);\n";
+ out() << " (function() {\n";
+ out() << " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
+ out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
+ out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
+ out() << " })();\n";
+ out() << " </script> -->\n";
out() << "</body>\n";
}
out() << "</html>\n";
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 26957ac..b077074 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -923,6 +923,14 @@ FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype)
}
/*!
+ Returns the fake node's title. This is used for the page title.
+*/
+QString FakeNode::title() const
+{
+ return tle;
+}
+
+/*!
Returns the fake node's full title, which is usually
just title(), but for some SubType values is different
from title()
@@ -1287,21 +1295,39 @@ void FunctionNode::debug() const
/*!
\class PropertyNode
+
+ This class describes one instance of using the Q_PROPERTY macro.
*/
/*!
+ The constructor sets the \a parent and the \a name, but
+ everything else is set to default values.
*/
PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
: LeafNode(Property, parent, name),
sto(Trool_Default),
des(Trool_Default),
+ scr(Trool_Default),
+ wri(Trool_Default),
+ usr(Trool_Default),
+ cst(false),
+ fnl(false),
overrides(0)
{
+ // nothing.
}
/*!
+ Sets this property's \e {overridden from} property to
+ \a baseProperty, which indicates that this property
+ overrides \a baseProperty. To begin with, all the values
+ in this property are set to the corresponding values in
+ \a baseProperty.
+
+ We probably should ensure that the constant and final
+ attributes are not being overridden improperly.
*/
-void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
+void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
{
for (int i = 0; i < NumFunctionRoles; ++i) {
if (funcs[i].isEmpty())
@@ -1311,6 +1337,12 @@ void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
sto = baseProperty->sto;
if (des == Trool_Default)
des = baseProperty->des;
+ if (scr == Trool_Default)
+ scr = baseProperty->scr;
+ if (wri == Trool_Default)
+ wri = baseProperty->wri;
+ if (usr == Trool_Default)
+ usr = baseProperty->usr;
overrides = baseProperty;
}
@@ -1336,7 +1368,9 @@ QString PropertyNode::qualifiedDataType() const
}
}
-/*!
+/*! Converts the \a boolean value to an enum representation
+ of the boolean type, which includes an enum value for the
+ \e {default value} of the item, i.e. true, false, or default.
*/
PropertyNode::Trool PropertyNode::toTrool(bool boolean)
{
@@ -1344,6 +1378,15 @@ PropertyNode::Trool PropertyNode::toTrool(bool boolean)
}
/*!
+ Converts the enum \a troolean back to a boolean value.
+ If \a troolean is neither the true enum value nor the
+ false enum value, the boolean value returned is
+ \a defaultValue.
+
+ Note that runtimeDesignabilityFunction() should be called
+ first. If that function returns the name of a function, it
+ means the function must be called at runtime to determine
+ whether the property is Designable.
*/
bool PropertyNode::fromTrool(Trool troolean, bool defaultValue)
{
@@ -1392,7 +1435,10 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
const ClassNode* cn)
: FakeNode(parent, name, QmlClass), cnode(cn)
{
- setTitle((qmlOnly ? "" : "QML ") + name + " Element");
+ if (name.startsWith(QLatin1String("QML:")))
+ setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element"));
+ else
+ setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element"));
}
/*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 37f2f26..e9f2d74 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -153,7 +153,7 @@ class Node
void setStatus(Status status) { sta = status; }
void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; }
void setSince(const QString &since) { sinc = since; }
- void setRelates(InnerNode *pseudoParent);
+ void setRelates(InnerNode* pseudoParent);
void setModuleName(const QString &module) { mod = module; }
void setLink(LinkType linkType, const QString &link, const QString &desc);
void setUrl(const QString &url);
@@ -167,8 +167,8 @@ class Node
virtual bool isQmlNode() const { return false; }
Type type() const { return typ; }
virtual SubType subType() const { return NoSubType; }
- InnerNode *parent() const { return par; }
- InnerNode *relates() const { return rel; }
+ InnerNode* parent() const { return par; }
+ InnerNode* relates() const { return rel; }
const QString& name() const { return nam; }
QMap<LinkType, QPair<QString,QString> > links() const { return linkMap; }
QString moduleName() const;
@@ -195,7 +195,7 @@ class Node
QString ditaXmlHref();
protected:
- Node(Type type, InnerNode *parent, const QString& name);
+ Node(Type type, InnerNode* parent, const QString& name);
private:
@@ -212,8 +212,8 @@ class Node
PageType pageTyp : 4;
Status sta : 3;
#endif
- InnerNode *par;
- InnerNode *rel;
+ InnerNode* par;
+ InnerNode* rel;
QString nam;
Location loc;
Doc d;
@@ -228,35 +228,35 @@ class Node
class FunctionNode;
class EnumNode;
-typedef QList<Node *> NodeList;
+typedef QList<Node*> NodeList;
class InnerNode : public Node
{
public:
virtual ~InnerNode();
- Node *findNode(const QString& name);
- Node *findNode(const QString& name, Type type);
- FunctionNode *findFunctionNode(const QString& name);
- FunctionNode *findFunctionNode(const FunctionNode *clone);
+ Node* findNode(const QString& name);
+ Node* findNode(const QString& name, Type type);
+ FunctionNode* findFunctionNode(const QString& name);
+ FunctionNode* findFunctionNode(const FunctionNode* clone);
void addInclude(const QString &include);
void setIncludes(const QStringList &includes);
- void setOverload(const FunctionNode *func, bool overlode);
+ void setOverload(const FunctionNode* func, bool overlode);
void normalizeOverloads();
void makeUndocumentedChildrenInternal();
void deleteChildren();
void removeFromRelated();
virtual bool isInnerNode() const;
- const Node *findNode(const QString& name) const;
- const Node *findNode(const QString& name, Type type) const;
- const FunctionNode *findFunctionNode(const QString& name) const;
- const FunctionNode *findFunctionNode(const FunctionNode *clone) const;
- const EnumNode *findEnumNodeForValue(const QString &enumValue) const;
+ const Node* findNode(const QString& name) const;
+ const Node* findNode(const QString& name, Type type) const;
+ const FunctionNode* findFunctionNode(const QString& name) const;
+ const FunctionNode* findFunctionNode(const FunctionNode* clone) const;
+ const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
const NodeList & childNodes() const { return children; }
const NodeList & relatedNodes() const { return related; }
int count() const { return children.size(); }
- int overloadNumber(const FunctionNode *func) const;
+ int overloadNumber(const FunctionNode* func) const;
int numOverloads(const QString& funcName) const;
NodeList overloads(const QString &funcName) const;
const QStringList& includes() const { return inc; }
@@ -269,23 +269,23 @@ class InnerNode : public Node
virtual void setAbstract(bool ) { }
protected:
- InnerNode(Type type, InnerNode *parent, const QString& name);
+ InnerNode(Type type, InnerNode* parent, const QString& name);
private:
friend class Node;
- static bool isSameSignature(const FunctionNode *f1, const FunctionNode *f2);
- void addChild(Node *child);
- void removeChild(Node *child);
- void removeRelated(Node *pseudoChild);
+ static bool isSameSignature(const FunctionNode* f1, const FunctionNode* f2);
+ void addChild(Node* child);
+ void removeChild(Node* child);
+ void removeRelated(Node* pseudoChild);
QStringList pageKeywds;
QStringList inc;
NodeList children;
NodeList enumChildren;
NodeList related;
- QMap<QString, Node *> childMap;
- QMap<QString, Node *> primaryFunctionMap;
+ QMap<QString, Node*> childMap;
+ QMap<QString, Node*> primaryFunctionMap;
QMap<QString, NodeList> secondaryFunctionMap;
};
@@ -304,7 +304,7 @@ class LeafNode : public Node
class NamespaceNode : public InnerNode
{
public:
- NamespaceNode(InnerNode *parent, const QString& name);
+ NamespaceNode(InnerNode* parent, const QString& name);
virtual ~NamespaceNode() { }
};
@@ -329,11 +329,11 @@ struct RelatedClass
class ClassNode : public InnerNode
{
public:
- ClassNode(InnerNode *parent, const QString& name);
+ ClassNode(InnerNode* parent, const QString& name);
virtual ~ClassNode() { }
void addBaseClass(Access access,
- ClassNode *node,
+ ClassNode* node,
const QString &dataTypeWithTemplateArgs = "");
void fixBaseClasses();
@@ -363,17 +363,17 @@ class FakeNode : public InnerNode
{
public:
- FakeNode(InnerNode *parent, const QString& name, SubType subType);
+ FakeNode(InnerNode* parent, const QString& name, SubType subType);
virtual ~FakeNode() { }
void setTitle(const QString &title) { tle = title; }
void setSubTitle(const QString &subTitle) { stle = subTitle; }
- void addGroupMember(Node *node) { gr.append(node); }
+ void addGroupMember(Node* node) { gr.append(node); }
SubType subType() const { return sub; }
- QString title() const { return tle; }
- QString fullTitle() const;
- QString subTitle() const;
+ virtual QString title() const;
+ virtual QString fullTitle() const;
+ virtual QString subTitle() const;
const NodeList &groupMembers() const { return gr; }
virtual QString nameForLists() const { return title(); }
@@ -388,7 +388,7 @@ class FakeNode : public InnerNode
class QmlClassNode : public FakeNode
{
public:
- QmlClassNode(InnerNode *parent,
+ QmlClassNode(InnerNode* parent,
const QString& name,
const ClassNode* cn);
virtual ~QmlClassNode();
@@ -411,7 +411,7 @@ class QmlClassNode : public FakeNode
class QmlBasicTypeNode : public FakeNode
{
public:
- QmlBasicTypeNode(InnerNode *parent,
+ QmlBasicTypeNode(InnerNode* parent,
const QString& name);
virtual ~QmlBasicTypeNode() { }
virtual bool isQmlNode() const { return true; }
@@ -498,41 +498,41 @@ class TypedefNode;
class EnumNode : public LeafNode
{
public:
- EnumNode(InnerNode *parent, const QString& name);
+ EnumNode(InnerNode* parent, const QString& name);
virtual ~EnumNode() { }
void addItem(const EnumItem& item);
- void setFlagsType(TypedefNode *typedeff);
+ void setFlagsType(TypedefNode* typedeff);
bool hasItem(const QString &name) const { return names.contains(name); }
const QList<EnumItem>& items() const { return itms; }
Access itemAccess(const QString& name) const;
- const TypedefNode *flagsType() const { return ft; }
+ const TypedefNode* flagsType() const { return ft; }
QString itemValue(const QString &name) const;
private:
QList<EnumItem> itms;
QSet<QString> names;
- const TypedefNode *ft;
+ const TypedefNode* ft;
};
class TypedefNode : public LeafNode
{
public:
- TypedefNode(InnerNode *parent, const QString& name);
+ TypedefNode(InnerNode* parent, const QString& name);
virtual ~TypedefNode() { }
- const EnumNode *associatedEnum() const { return ae; }
+ const EnumNode* associatedEnum() const { return ae; }
private:
- void setAssociatedEnum(const EnumNode *enume);
+ void setAssociatedEnum(const EnumNode* enume);
friend class EnumNode;
- const EnumNode *ae;
+ const EnumNode* ae;
};
-inline void EnumNode::setFlagsType(TypedefNode *typedeff)
+inline void EnumNode::setFlagsType(TypedefNode* typedeff)
{
ft = typedeff;
typedeff->setAssociatedEnum(this);
@@ -584,8 +584,8 @@ class FunctionNode : public LeafNode
Native };
enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
- FunctionNode(InnerNode *parent, const QString &name);
- FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached);
+ FunctionNode(InnerNode* parent, const QString &name);
+ FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
virtual ~FunctionNode() { }
void setReturnType(const QString& returnType) { rt = returnType; }
@@ -598,8 +598,8 @@ class FunctionNode : public LeafNode
void setReimp(bool r);
void addParameter(const Parameter& parameter);
inline void setParameters(const QList<Parameter>& parameters);
- void borrowParameterNames(const FunctionNode *source);
- void setReimplementedFrom(FunctionNode *from);
+ void borrowParameterNames(const FunctionNode* source);
+ void setReimplementedFrom(FunctionNode* from);
const QString& returnType() const { return rt; }
Metaness metaness() const { return met; }
@@ -616,9 +616,9 @@ class FunctionNode : public LeafNode
int numOverloads() const;
const QList<Parameter>& parameters() const { return params; }
QStringList parameterNames() const;
- const FunctionNode *reimplementedFrom() const { return rf; }
- const QList<FunctionNode *> &reimplementedBy() const { return rb; }
- const PropertyNode *associatedProperty() const { return ap; }
+ const FunctionNode* reimplementedFrom() const { return rf; }
+ const QList<FunctionNode*> &reimplementedBy() const { return rb; }
+ const PropertyNode* associatedProperty() const { return ap; }
const QStringList& parentPath() const { return pp; }
QStringList reconstructParams(bool values = false) const;
@@ -632,7 +632,7 @@ class FunctionNode : public LeafNode
void debug() const;
private:
- void setAssociatedProperty(PropertyNode *property);
+ void setAssociatedProperty(PropertyNode* property);
friend class InnerNode;
friend class PropertyNode;
@@ -652,9 +652,9 @@ class FunctionNode : public LeafNode
bool reimp: 1;
bool att: 1;
QList<Parameter> params;
- const FunctionNode *rf;
- const PropertyNode *ap;
- QList<FunctionNode *> rb;
+ const FunctionNode* rf;
+ const PropertyNode* ap;
+ QList<FunctionNode*> rb;
};
class PropertyNode : public LeafNode
@@ -663,16 +663,22 @@ class PropertyNode : public LeafNode
enum FunctionRole { Getter, Setter, Resetter, Notifier };
enum { NumFunctionRoles = Notifier + 1 };
- PropertyNode(InnerNode *parent, const QString& name);
+ PropertyNode(InnerNode* parent, const QString& name);
virtual ~PropertyNode() { }
void setDataType(const QString& dataType) { dt = dataType; }
- void addFunction(FunctionNode *function, FunctionRole role);
- void addSignal(FunctionNode *function, FunctionRole role);
+ void addFunction(FunctionNode* function, FunctionRole role);
+ void addSignal(FunctionNode* function, FunctionRole role);
void setStored(bool stored) { sto = toTrool(stored); }
void setDesignable(bool designable) { des = toTrool(designable); }
+ void setScriptable(bool scriptable) { scr = toTrool(scriptable); }
void setWritable(bool writable) { wri = toTrool(writable); }
- void setOverriddenFrom(const PropertyNode *baseProperty);
+ void setUser(bool user) { usr = toTrool(user); }
+ void setOverriddenFrom(const PropertyNode* baseProperty);
+ void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
+ void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
+ void setConstant() { cst = true; }
+ void setFinal() { fnl = true; }
const QString &dataType() const { return dt; }
QString qualifiedDataType() const;
@@ -684,8 +690,20 @@ class PropertyNode : public LeafNode
NodeList notifiers() const { return functions(Notifier); }
bool isStored() const { return fromTrool(sto, storedDefault()); }
bool isDesignable() const { return fromTrool(des, designableDefault()); }
+ bool isScriptable() const { return fromTrool(scr, scriptableDefault()); }
+ const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
+ const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
bool isWritable() const { return fromTrool(wri, writableDefault()); }
- const PropertyNode *overriddenFrom() const { return overrides; }
+ bool isUser() const { return fromTrool(usr, userDefault()); }
+ bool isConstant() const { return cst; }
+ bool isFinal() const { return fnl; }
+ const PropertyNode* overriddenFrom() const { return overrides; }
+
+ bool storedDefault() const { return true; }
+ bool userDefault() const { return false; }
+ bool designableDefault() const { return !setters().isEmpty(); }
+ bool scriptableDefault() const { return true; }
+ bool writableDefault() const { return !setters().isEmpty(); }
private:
enum Trool { Trool_True, Trool_False, Trool_Default };
@@ -693,16 +711,18 @@ class PropertyNode : public LeafNode
static Trool toTrool(bool boolean);
static bool fromTrool(Trool troolean, bool defaultValue);
- bool storedDefault() const { return true; }
- bool designableDefault() const { return !setters().isEmpty(); }
- bool writableDefault() const { return !setters().isEmpty(); }
-
QString dt;
+ QString runtimeDesFunc;
+ QString runtimeScrFunc;
NodeList funcs[NumFunctionRoles];
Trool sto;
Trool des;
+ Trool scr;
Trool wri;
- const PropertyNode *overrides;
+ Trool usr;
+ bool cst;
+ bool fnl;
+ const PropertyNode* overrides;
};
inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
@@ -710,13 +730,13 @@ inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
params = parameters;
}
-inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
{
funcs[(int)role].append(function);
function->setAssociatedProperty(this);
}
-inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
{
funcs[(int)role].append(function);
}
@@ -732,7 +752,7 @@ inline NodeList PropertyNode::functions() const
class VariableNode : public LeafNode
{
public:
- VariableNode(InnerNode *parent, const QString &name);
+ VariableNode(InnerNode* parent, const QString &name);
virtual ~VariableNode() { }
void setLeftType(const QString &leftType) { lt = leftType; }
@@ -750,15 +770,16 @@ class VariableNode : public LeafNode
bool sta;
};
-inline VariableNode::VariableNode(InnerNode *parent, const QString &name)
+inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
: LeafNode(Variable, parent, name), sta(false)
{
+ // nothing.
}
class TargetNode : public LeafNode
{
public:
- TargetNode(InnerNode *parent, const QString& name);
+ TargetNode(InnerNode* parent, const QString& name);
virtual ~TargetNode() { }
virtual bool isInnerNode() const;
diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp
index cd364ef..a187c2e 100644
--- a/tools/qdoc3/pagegenerator.cpp
+++ b/tools/qdoc3/pagegenerator.cpp
@@ -209,7 +209,8 @@ QString PageGenerator::fileBase(const Node *node) const
*/
if ((p->subType() == Node::QmlClass) ||
(p->subType() == Node::QmlBasicType)) {
- base.prepend("qml-");
+ if (!base.startsWith(QLatin1String("QML:")))
+ base.prepend("qml-");
}
#endif
if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index 74fd802..0433c9f 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -6,7 +6,7 @@ include(qt-defines.qdocconf)
project = Qml
description = Qml Reference Documentation
-url = http://qt.nokia.com/doc/4.6/
+url = http://qt.nokia.com/doc/4.7/
qmlonly = true
edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \
@@ -21,7 +21,7 @@ edition.DesktopLight.groups = -graphicsview-api
qhp.projects = Qml
qhp.Qml.file = qml.qhp
-qhp.Qml.namespace = com.trolltech.qml.460
+qhp.Qml.namespace = com.trolltech.qml.470
qhp.Qml.virtualFolder = qdoc
qhp.Qml.indexTitle = Qml Reference
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 09cbc45..140b81f 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -22,43 +22,43 @@ qhp.Qt.indexTitle = Qt Reference Documentation
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.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 \
- 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 \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.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 \
+ 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 \
+ style/style.css
@@ -141,7 +141,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
imagedirs = $QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
$QT_SOURCE_TREE/doc/src/declarative/pics \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html
tagfile = $QT_BUILD_TREE/doc/html/qt.tags
base = file:$QT_BUILD_TREE/doc/html
diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
index e517b33..7701cae 100644
--- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
@@ -30,33 +30,43 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.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
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.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 \
+ 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 \
+ style/style.css
language = Cpp
@@ -102,7 +112,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
imagedirs = $QT_SOURCE_TREE/doc/src/ja_JP/images \
$QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/declarative/pics \
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html_ja_JP
tagfile = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags
base = file:$QT_BUILD_TREE/doc/html_ja_JP
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index 909a2d4..be459d8 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -52,6 +52,17 @@ 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 \
@@ -99,7 +110,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \
$QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs
imagedirs = $QT_SOURCE_TREE/doc/src/images \
$QT_SOURCE_TREE/examples \
- $QT_SOURCE_TREE/doc/src/template/images
+ $QT_SOURCE_TREE/doc/src/declarative/pics \
+ $QT_SOURCE_TREE/doc/src/template/images
outputdir = $QT_BUILD_TREE/doc/html_zh_CN
tagfile = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags
base = file:$QT_BUILD_TREE/doc/html_zh_CN
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 1fb000b..b82e337 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -11,7 +11,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \
" <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \
" <fieldset>\n" \
- " <input type=\"text\" value=\"\" id=\"pageType\" name=\"searchstring\">\n" \
+ " <input type=\"text\" value=\"\" id=\"pageType2\" name=\"searchstring\">\n" \
" </fieldset>\n" \
" </form></div>\n" \
" <div id=\"nav-topright\">\n" \
@@ -160,7 +160,9 @@ 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><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea></p>\n" \
+ " <p>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><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" \
" </div>\n" \
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 31bbf54..d31de4d 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1952,9 +1952,13 @@ QString Tree::fullDocumentLocation(const Node *node) const
else if (node->type() == Node::Fake) {
#ifdef QDOC_QML
if ((node->subType() == Node::QmlClass) ||
- (node->subType() == Node::QmlBasicType))
- return "qml-" + node->fileBase() + ".html";
- else
+ (node->subType() == Node::QmlBasicType)) {
+ QString fb = node->fileBase();
+ if (fb.startsWith(QLatin1String("QML:")))
+ return node->fileBase() + ".html";
+ else
+ return "qml-" + node->fileBase() + ".html";
+ } else
#endif
parentName = node->fileBase() + ".html";
}
diff --git a/tools/qml/deviceorientation_maemo.cpp b/tools/qml/deviceorientation_maemo5.cpp
index 443edc8..e942579 100644
--- a/tools/qml/deviceorientation_maemo.cpp
+++ b/tools/qml/deviceorientation_maemo5.cpp
@@ -124,4 +124,4 @@ DeviceOrientation* DeviceOrientation::instance()
return o;
}
-#include "deviceorientation_maemo.moc"
+#include "deviceorientation_maemo5.moc"
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp
index 3ae2b5e..8aa029f 100644
--- a/tools/qml/loggerwidget.cpp
+++ b/tools/qml/loggerwidget.cpp
@@ -39,29 +39,48 @@
**
****************************************************************************/
-#include "loggerwidget.h"
#include <qglobal.h>
#include <QDebug>
#include <QSettings>
#include <QActionGroup>
#include <QMenu>
+#include <QPlainTextEdit>
+#ifdef Q_WS_MAEMO_5
+# include <QScrollArea>
+# include <QVBoxLayout>
+# include "texteditautoresizer_maemo5.h"
+#endif
+
+#include "loggerwidget.h"
QT_BEGIN_NAMESPACE
LoggerWidget::LoggerWidget(QWidget *parent) :
- QPlainTextEdit(parent),
+ QMainWindow(parent),
m_visibilityOrigin(SettingsOrigin)
{
setAttribute(Qt::WA_QuitOnClose, false);
setWindowTitle(tr("Warnings"));
+ m_plainTextEdit = new QPlainTextEdit();
+
+#ifdef Q_WS_MAEMO_5
+ new TextEditAutoResizer(m_plainTextEdit);
+ setAttribute(Qt::WA_Maemo5StackedWindow);
+ QScrollArea *area = new QScrollArea();
+ area->setWidget(m_plainTextEdit);
+ area->setWidgetResizable(true);
+ setCentralWidget(area);
+#else
+ setCentralWidget(m_plainTextEdit);
+#endif
readSettings();
setupPreferencesMenu();
}
void LoggerWidget::append(const QString &msg)
{
- appendPlainText(msg);
+ m_plainTextEdit->appendPlainText(msg);
if (!isVisible() && (defaultVisibility() == AutoShowWarnings))
setVisible(true);
diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h
index fd20c41..13c319f 100644
--- a/tools/qml/loggerwidget.h
+++ b/tools/qml/loggerwidget.h
@@ -42,12 +42,17 @@
#ifndef LOGGERWIDGET_H
#define LOGGERWIDGET_H
-#include <QPlainTextEdit>
+#include <QMainWindow>
+#include <QMetaType>
QT_BEGIN_NAMESPACE
-class LoggerWidget : public QPlainTextEdit {
-Q_OBJECT
+class QPlainTextEdit;
+class QMenu;
+class QAction;
+
+class LoggerWidget : public QMainWindow {
+ Q_OBJECT
public:
LoggerWidget(QWidget *parent=0);
@@ -80,6 +85,7 @@ private:
QMenu *m_preferencesMenu;
QAction *m_showWidgetAction;
+ QPlainTextEdit *m_plainTextEdit;
enum ConfigOrigin { CommandLineOrigin, SettingsOrigin };
ConfigOrigin m_visibilityOrigin;
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index a75023b..900a464 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -119,7 +119,7 @@ void usage()
qWarning(" -fullscreen............................... run fullscreen");
qWarning(" -stayontop................................ keep viewer window on top");
qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content");
- qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view");
+ qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view (default)");
qWarning(" -qmlbrowser .............................. use a QML-based file browser");
qWarning(" -warnings [show|hide]..................... show warnings in a separate log window");
qWarning(" -recordfile <output> ..................... set video recording file");
diff --git a/tools/qml/proxysettings.cpp b/tools/qml/proxysettings.cpp
index 3255e42..ffaa4c0 100644
--- a/tools/qml/proxysettings.cpp
+++ b/tools/qml/proxysettings.cpp
@@ -48,11 +48,14 @@
QT_BEGIN_NAMESPACE
ProxySettings::ProxySettings (QWidget * parent)
- : QDialog (parent), Ui::ProxySettings()
+ : QDialog (parent), Ui::ProxySettings()
{
setupUi (this);
+#if !defined Q_WS_MAEMO_5
+ // the onscreen keyboard can't cope with masks
proxyServerEdit->setInputMask ("000.000.000.000;_");
+#endif
QIntValidator *validator = new QIntValidator (0, 9999, this);
proxyPortEdit->setValidator (validator);
diff --git a/tools/qml/proxysettings.h b/tools/qml/proxysettings.h
index 325929a..5d4d137 100644
--- a/tools/qml/proxysettings.h
+++ b/tools/qml/proxysettings.h
@@ -44,7 +44,11 @@
#include <QDialog>
#include <QNetworkProxy>
+#ifdef Q_WS_MAEMO_5
+#include "ui_proxysettings_maemo5.h"
+#else
#include "ui_proxysettings.h"
+#endif
QT_BEGIN_NAMESPACE
/**
diff --git a/tools/qml/proxysettings_maemo5.ui b/tools/qml/proxysettings_maemo5.ui
new file mode 100644
index 0000000..83f0c2a
--- /dev/null
+++ b/tools/qml/proxysettings_maemo5.ui
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ProxySettings</class>
+ <widget class="QDialog" name="ProxySettings">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>449</width>
+ <height>164</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>HTTP Proxy</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="leftMargin">
+ <number>16</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>16</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="proxyCheckBox">
+ <property name="text">
+ <string>Use HTTP Proxy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" rowspan="2">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" rowspan="2">
+ <widget class="QWidget" name="widget" native="true">
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="serverAddressLabel">
+ <property name="text">
+ <string>Server</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="proxyServerEdit">
+ <property name="placeholderText">
+ <string>Name or IP</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Port</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="proxyPortEdit">
+ <property name="text">
+ <string>8080</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="usernameLabel">
+ <property name="text">
+ <string>Username</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="usernameEdit"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="text">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="passwordEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>proxyCheckBox</tabstop>
+ <tabstop>proxyServerEdit</tabstop>
+ <tabstop>proxyPortEdit</tabstop>
+ <tabstop>usernameEdit</tabstop>
+ <tabstop>passwordEdit</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>318</x>
+ <y>100</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>116</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ProxySettings</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>318</x>
+ <y>100</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>116</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tools/qml/qdeclarativetester.h b/tools/qml/qdeclarativetester.h
index d49c9b8..021869d 100644
--- a/tools/qml/qdeclarativetester.h
+++ b/tools/qml/qdeclarativetester.h
@@ -48,6 +48,9 @@
#include <QImage>
#include <QUrl>
#include <qmlruntime.h>
+#include <qdeclarativelist.h>
+#include <qdeclarative.h>
+#include <QAbstractAnimation>
QT_BEGIN_NAMESPACE
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index 58d8cc1..3e5a88b 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -19,10 +19,12 @@ SOURCES += $$PWD/qmlruntime.cpp \
RESOURCES = $$PWD/qmlruntime.qrc
maemo5 {
QT += dbus
- SOURCES += $$PWD/deviceorientation_maemo.cpp
+ HEADERS += $$PWD/texteditautoresizer_maemo5.h
+ SOURCES += $$PWD/deviceorientation_maemo5.cpp
+ FORMS = $$PWD/recopts_maemo5.ui \
+ $$PWD/proxysettings_maemo5.ui
} else {
SOURCES += $$PWD/deviceorientation.cpp
+ FORMS = $$PWD/recopts.ui \
+ $$PWD/proxysettings.ui
}
-
-FORMS = $$PWD/recopts.ui \
- $$PWD/proxysettings.ui
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 9cdec77..63efff1 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -29,6 +29,9 @@ wince* {
QT += webkit
}
}
+maemo5 {
+ QT += maemo5
+}
symbian {
TARGET.UID3 = 0x20021317
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 676881d..94fcc82 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -44,15 +44,23 @@
#ifdef hz
#undef hz
#endif
-#include "ui_recopts.h"
+#ifdef Q_WS_MAEMO_5
+# include <QMaemo5ValueButton>
+# include <QMaemo5ListPickSelector>
+# include <QWidgetAction>
+# include <QStringListModel>
+# include "ui_recopts_maemo5.h"
+#else
+# include "ui_recopts.h"
+#endif
#include "qmlruntime.h"
#include <qdeclarativecontext.h>
#include <qdeclarativeengine.h>
#include <qdeclarativenetworkaccessmanagerfactory.h>
#include "qdeclarative.h"
-#include <private/qabstractanimation_p.h>
#include <QAbstractAnimation>
+#include <private/qabstractanimation_p.h>
#include <QSettings>
#include <QXmlStreamReader>
@@ -136,24 +144,59 @@ private:
};
-class SizedMenuBar : public QMenuBar
-{
+
+#if defined(Q_WS_MAEMO_5)
+
+class Maemo5PickerAction : public QWidgetAction {
Q_OBJECT
public:
- SizedMenuBar(QWidget *parent, QWidget *referenceWidget)
- : QMenuBar(parent), refWidget(referenceWidget)
+ Maemo5PickerAction(const QString &text, QActionGroup *actions, QObject *parent)
+ : QWidgetAction(parent), m_text(text), m_actions(actions)
+ { }
+
+ QWidget *createWidget(QWidget *parent)
{
+ QMaemo5ValueButton *button = new QMaemo5ValueButton(m_text, parent);
+ button->setValueLayout(QMaemo5ValueButton::ValueUnderTextCentered);
+ QMaemo5ListPickSelector *pick = new QMaemo5ListPickSelector(button);
+ button->setPickSelector(pick);
+ if (m_actions) {
+ QStringList sl;
+ int curIdx = -1, idx = 0;
+ foreach (QAction *a, m_actions->actions()) {
+ sl << a->text();
+ if (a->isChecked())
+ curIdx = idx;
+ idx++;
+ }
+ pick->setModel(new QStringListModel(sl));
+ pick->setCurrentIndex(curIdx);
+ } else {
+ button->setEnabled(false);
+ }
+ connect(pick, SIGNAL(selected(QString)), this, SLOT(emitTriggered()));
+ return button;
}
- virtual QSize sizeHint() const
+private slots:
+ void emitTriggered()
{
- return QSize(refWidget->sizeHint().width(), QMenuBar::sizeHint().height());
+ QMaemo5ListPickSelector *pick = qobject_cast<QMaemo5ListPickSelector *>(sender());
+ if (!pick)
+ return;
+ int idx = pick->currentIndex();
+
+ if (m_actions && idx >= 0 && idx < m_actions->actions().count())
+ m_actions->actions().at(idx)->trigger();
}
private:
- QWidget *refWidget;
+ QString m_text;
+ QPointer<QActionGroup> m_actions;
};
+#endif // Q_WS_MAEMO_5
+
static struct { const char *name, *args; } ffmpegprofiles[] = {
{"Maximum Quality", "-sameq"},
{"High Quality", "-qmax 2"},
@@ -170,7 +213,9 @@ public:
RecordingDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this);
+#ifndef Q_WS_MAEMO_5
hz->setValidator(new QDoubleValidator(hz));
+#endif
for (int i=0; ffmpegprofiles[i].name; ++i) {
profile->addItem(ffmpegprofiles[i].name);
}
@@ -197,6 +242,132 @@ public:
return ffmpegprofiles[i].args[0] ? QLatin1String(ffmpegprofiles[i].args) : customargs;
}
+ void setOriginalSize(const QSize &s)
+ {
+ QString str = tr("Original (%1x%2)").arg(s.width()).arg(s.height());
+
+#ifdef Q_WS_MAEMO_5
+ sizeCombo->setItemText(0, str);
+#else
+ sizeOriginal->setText(str);
+ if (sizeWidth->value()<=1) {
+ sizeWidth->setValue(s.width());
+ sizeHeight->setValue(s.height());
+ }
+#endif
+ }
+
+ void showffmpegOptions(bool b)
+ {
+#ifdef Q_WS_MAEMO_5
+ profileLabel->setVisible(b);
+ profile->setVisible(b);
+ ffmpegHelp->setVisible(b);
+ args->setVisible(b);
+#else
+ ffmpegOptions->setVisible(b);
+#endif
+ }
+
+ void showRateOptions(bool b)
+ {
+#ifdef Q_WS_MAEMO_5
+ rateLabel->setVisible(b);
+ rateCombo->setVisible(b);
+#else
+ rateOptions->setVisible(b);
+#endif
+ }
+
+ void setVideoRate(int rate)
+ {
+#ifdef Q_WS_MAEMO_5
+ int idx;
+ if (rate >= 60)
+ idx = 0;
+ else if (rate >= 50)
+ idx = 2;
+ else if (rate >= 25)
+ idx = 3;
+ else if (rate >= 24)
+ idx = 4;
+ else if (rate >= 20)
+ idx = 5;
+ else if (rate >= 15)
+ idx = 6;
+ else
+ idx = 7;
+ rateCombo->setCurrentIndex(idx);
+#else
+ if (rate == 24)
+ hz24->setChecked(true);
+ else if (rate == 25)
+ hz25->setChecked(true);
+ else if (rate == 50)
+ hz50->setChecked(true);
+ else if (rate == 60)
+ hz60->setChecked(true);
+ else {
+ hzCustom->setChecked(true);
+ hz->setText(QString::number(rate));
+ }
+#endif
+ }
+
+ int videoRate() const
+ {
+#ifdef Q_WS_MAEMO_5
+ switch (rateCombo->currentIndex()) {
+ case 0: return 60;
+ case 1: return 50;
+ case 2: return 25;
+ case 3: return 24;
+ case 4: return 20;
+ case 5: return 15;
+ case 7: return 10;
+ default: return 60;
+ }
+#else
+ if (hz24->isChecked())
+ return 24;
+ else if (hz25->isChecked())
+ return 25;
+ else if (hz50->isChecked())
+ return 50;
+ else if (hz60->isChecked())
+ return 60;
+ else {
+ return hz->text().toInt();
+ }
+#endif
+ }
+
+ QSize videoSize() const
+ {
+#ifdef Q_WS_MAEMO_5
+ switch (sizeCombo->currentIndex()) {
+ case 0: return QSize();
+ case 1: return QSize(640,480);
+ case 2: return QSize(320,240);
+ case 3: return QSize(1280,720);
+ default: return QSize();
+ }
+#else
+ if (sizeOriginal->isChecked())
+ return QSize();
+ else if (size720p->isChecked())
+ return QSize(1280,720);
+ else if (sizeVGA->isChecked())
+ return QSize(640,480);
+ else if (sizeQVGA->isChecked())
+ return QSize(320,240);
+ else
+ return QSize(sizeWidth->value(), sizeHeight->value());
+#endif
+ }
+
+
+
private slots:
void pickProfile(int i)
{
@@ -363,15 +534,10 @@ QString QDeclarativeViewer::getVideoFileName()
return QFileDialog::getSaveFileName(this, title, "", types.join(";; "));
}
-
QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
-#if defined(Q_OS_SYMBIAN)
: QMainWindow(parent, flags)
-#else
- : QWidget(parent, flags)
-#endif
- , loggerWindow(new LoggerWidget())
- , frame_stream(0), mb(0)
+ , loggerWindow(new LoggerWidget(this))
+ , frame_stream(0)
, orientation(0)
, showWarningsWindow(0)
, m_scriptOptions(0)
@@ -381,6 +547,10 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
{
QDeclarativeViewer::registerTypes();
setWindowTitle(tr("Qt QML Viewer"));
+#ifdef Q_WS_MAEMO_5
+ setAttribute(Qt::WA_Maemo5StackedWindow);
+// setPalette(QApplication::palette("QLabel"));
+#endif
devicemode = false;
canvas = 0;
@@ -393,9 +563,9 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
senseFfmpeg();
senseImageMagick();
if (!ffmpegAvailable)
- recdlg->ffmpegOptions->hide();
+ recdlg->showffmpegOptions(false);
if (!ffmpegAvailable && !convertAvailable)
- recdlg->rateOptions->hide();
+ recdlg->showRateOptions(false);
QString warn;
if (!ffmpegAvailable) {
if (!convertAvailable)
@@ -422,33 +592,27 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
QObject::connect(warningsWidget(), SIGNAL(closed()), this, SLOT(warningsWidgetClosed()));
if (!(flags & Qt::FramelessWindowHint)) {
- createMenu(menuBar(),0);
+ createMenu();
changeOrientation(orientation->actions().value(0));
+ } else {
+ setMenuBar(0);
}
-#if !defined(Q_OS_SYMBIAN)
- QVBoxLayout *layout = new QVBoxLayout;
- layout->setMargin(0);
- layout->setSpacing(0);
- setLayout(layout);
- if (mb)
- layout->addWidget(mb);
- layout->addWidget(canvas);
-#else
setCentralWidget(canvas);
-#endif
+
namFactory = new NetworkAccessManagerFactory;
canvas->engine()->setNetworkAccessManagerFactory(namFactory);
- connect(&autoStartTimer, SIGNAL(triggered()), this, SLOT(autoStartRecording()));
- connect(&autoStopTimer, SIGNAL(triggered()), this, SLOT(autoStopRecording()));
- connect(&recordTimer, SIGNAL(triggered()), this, SLOT(recordFrame()));
+ connect(&autoStartTimer, SIGNAL(timeout()), this, SLOT(autoStartRecording()));
+ connect(&autoStopTimer, SIGNAL(timeout()), this, SLOT(autoStopRecording()));
+ connect(&recordTimer, SIGNAL(timeout()), this, SLOT(recordFrame()));
connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
this, SLOT(orientationChanged()), Qt::QueuedConnection);
- autoStartTimer.setRunning(false);
- autoStopTimer.setRunning(false);
- recordTimer.setRunning(false);
- recordTimer.setRepeating(true);
+ autoStartTimer.setSingleShot(true);
+ autoStopTimer.setSingleShot(true);
+ recordTimer.setSingleShot(false);
+
+ QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(appAboutToQuit()));
}
QDeclarativeViewer::~QDeclarativeViewer()
@@ -468,26 +632,6 @@ void QDeclarativeViewer::enableExperimentalGestures()
canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
}
-int QDeclarativeViewer::menuBarHeight() const
-{
- if (!(windowFlags() & Qt::FramelessWindowHint))
- return menuBar()->height();
- else
- return 0; // don't create menu
-}
-
-QMenuBar *QDeclarativeViewer::menuBar() const
-{
-#if !defined(Q_OS_SYMBIAN)
- if (!mb)
- mb = new SizedMenuBar((QWidget*)this, canvas);
-#else
- mb = QMainWindow::menuBar();
-#endif
-
- return mb;
-}
-
QDeclarativeView *QDeclarativeViewer::view() const
{
return canvas;
@@ -498,120 +642,128 @@ LoggerWidget *QDeclarativeViewer::warningsWidget() const
return loggerWindow;
}
-void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
+void QDeclarativeViewer::createMenu()
{
- QObject *parent = flatmenu ? (QObject*)flatmenu : (QObject*)menu;
-
- QMenu *fileMenu = flatmenu ? flatmenu : menu->addMenu(tr("&File"));
-
- QAction *openAction = new QAction(tr("&Open..."), parent);
+ QAction *openAction = new QAction(tr("&Open..."), this);
openAction->setShortcut(QKeySequence("Ctrl+O"));
connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
- fileMenu->addAction(openAction);
- QAction *reloadAction = new QAction(tr("&Reload"), parent);
+ QAction *reloadAction = new QAction(tr("&Reload"), this);
reloadAction->setShortcut(QKeySequence("Ctrl+R"));
connect(reloadAction, SIGNAL(triggered()), this, SLOT(reload()));
- fileMenu->addAction(reloadAction);
-
-#if !defined(Q_OS_SYMBIAN)
- if (flatmenu) flatmenu->addSeparator();
-
- QMenu *recordMenu = flatmenu ? flatmenu : menu->addMenu(tr("&Recording"));
- QAction *snapshotAction = new QAction(tr("&Take Snapshot\tF3"), parent);
+ QAction *snapshotAction = new QAction(tr("&Take Snapshot"), this);
+ snapshotAction->setShortcut(QKeySequence("F3"));
connect(snapshotAction, SIGNAL(triggered()), this, SLOT(takeSnapShot()));
- recordMenu->addAction(snapshotAction);
- recordAction = new QAction(tr("Start Recording &Video\tF9"), parent);
+ recordAction = new QAction(tr("Start Recording &Video"), this);
+ recordAction->setShortcut(QKeySequence("F9"));
connect(recordAction, SIGNAL(triggered()), this, SLOT(toggleRecordingWithSelection()));
- recordMenu->addAction(recordAction);
- QAction *recordOptions = new QAction(tr("Video &Options..."), parent);
+ QAction *recordOptions = new QAction(tr("Video &Options..."), this);
connect(recordOptions, SIGNAL(triggered()), this, SLOT(chooseRecordingOptions()));
- if (flatmenu)
- flatmenu->addAction(recordOptions);
-
- if (flatmenu) flatmenu->addSeparator();
-
- QMenu *debugMenu = flatmenu ? flatmenu->addMenu(tr("&Debugging")) : menu->addMenu(tr("&Debugging"));
-
- QAction *slowAction = new QAction(tr("&Slow Down Animations"), parent);
+ QAction *slowAction = new QAction(tr("&Slow Down Animations"), this);
slowAction->setShortcut(QKeySequence("Ctrl+."));
slowAction->setCheckable(true);
connect(slowAction, SIGNAL(triggered(bool)), this, SLOT(setSlowMode(bool)));
- debugMenu->addAction(slowAction);
- showWarningsWindow = new QAction(tr("Show Warnings"), parent);
+ showWarningsWindow = new QAction(tr("Show Warnings"), this);
showWarningsWindow->setCheckable((true));
showWarningsWindow->setChecked(loggerWindow->isVisible());
connect(showWarningsWindow, SIGNAL(triggered(bool)), this, SLOT(showWarnings(bool)));
-#if !defined(Q_OS_SYMBIAN)
- debugMenu->addAction(showWarningsWindow);
-#endif
-
- if (flatmenu) flatmenu->addSeparator();
-
-#endif // Q_OS_SYMBIAN
-
- QMenu *settingsMenu = flatmenu ? flatmenu : menu->addMenu(tr("S&ettings"));
- QAction *proxyAction = new QAction(tr("Http &proxy..."), parent);
+ QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this);
connect(proxyAction, SIGNAL(triggered()), this, SLOT(showProxySettings()));
- settingsMenu->addAction(proxyAction);
-#if !defined(Q_OS_SYMBIAN)
- if (!flatmenu)
- settingsMenu->addAction(recordOptions);
- settingsMenu->addMenu(loggerWindow->preferencesMenu());
-#else
- QAction *fullscreenAction = new QAction(tr("Full Screen"), parent);
+ QAction *fullscreenAction = new QAction(tr("Full Screen"), this);
fullscreenAction->setCheckable(true);
connect(fullscreenAction, SIGNAL(triggered()), this, SLOT(toggleFullScreen()));
- settingsMenu->addAction(fullscreenAction);
-#endif
-
- if (flatmenu) flatmenu->addSeparator();
-
- QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
- orientation = new QActionGroup(parent);
-
- QAction *rotateOrientation = new QAction(tr("Rotate orientation"), parent);
+ QAction *rotateOrientation = new QAction(tr("Rotate orientation"), this);
rotateOrientation->setShortcut(QKeySequence("Ctrl+T"));
- settingsMenu->addAction(rotateOrientation);
connect(rotateOrientation, SIGNAL(triggered()), this, SLOT(rotateOrientation()));
+ orientation = new QActionGroup(this);
orientation->setExclusive(true);
connect(orientation, SIGNAL(triggered(QAction*)), this, SLOT(changeOrientation(QAction*)));
- orientation->addAction(tr("orientation: Portrait"));
- orientation->addAction(tr("orientation: Landscape"));
- orientation->addAction(tr("orientation: Portrait (Inverted)"));
- orientation->addAction(tr("orientation: Landscape (Inverted)"));
- QList<QAction *> actions = orientation->actions();
- for (int i=0; i<actions.count(); i++) {
- propertiesMenu->addAction(actions[i]);
- actions[i]->setCheckable(true);
- }
-
- if (flatmenu) flatmenu->addSeparator();
+ QAction *portraitAction = new QAction(tr("Portrait"), this);
+ portraitAction->setCheckable(true);
+ QAction *landscapeAction = new QAction(tr("Landscape"), this);
+ landscapeAction->setCheckable(true);
+ QAction *portraitInvAction = new QAction(tr("Portrait (inverted)"), this);
+ portraitInvAction->setCheckable(true);
+ QAction *landscapeInvAction = new QAction(tr("Landscape (inverted)"), this);
+ landscapeInvAction->setCheckable(true);
- QMenu *helpMenu = flatmenu ? flatmenu : menu->addMenu(tr("&Help"));
- QAction *aboutAction = new QAction(tr("&About Qt..."), parent);
+ QAction *aboutAction = new QAction(tr("&About Qt..."), this);
connect(aboutAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
- helpMenu->addAction(aboutAction);
- QAction *quitAction = new QAction(tr("&Quit"), parent);
+ QAction *quitAction = new QAction(tr("&Quit"), this);
quitAction->setShortcut(QKeySequence("Ctrl+Q"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+
+ QMenuBar *menu = menuBar();
+ if (!menu)
+ return;
+
+#if defined(Q_WS_MAEMO_5)
+ menu->addAction(openAction);
+ menu->addAction(reloadAction);
+
+ menu->addAction(snapshotAction);
+ menu->addAction(recordAction);
+
+ menu->addAction(recordOptions);
+ menu->addAction(proxyAction);
+
+ menu->addAction(slowAction);
+ menu->addAction(showWarningsWindow);
+
+ orientation->addAction(landscapeAction);
+ orientation->addAction(portraitAction);
+ menu->addAction(new Maemo5PickerAction(tr("Set orientation"), orientation, this));
+ menu->addAction(fullscreenAction);
+ return;
+#endif // Q_WS_MAEMO_5
+
+ QMenu *fileMenu = menu->addMenu(tr("&File"));
+ fileMenu->addAction(openAction);
+ fileMenu->addAction(reloadAction);
fileMenu->addSeparator();
fileMenu->addAction(quitAction);
- if (menu) {
- menu->setFixedHeight(menu->sizeHint().height());
- menu->setMinimumWidth(10);
- }
+
+#if !defined(Q_OS_SYMBIAN)
+ QMenu *recordMenu = menu->addMenu(tr("&Recording"));
+ recordMenu->addAction(snapshotAction);
+ recordMenu->addAction(recordAction);
+
+ QMenu *debugMenu = menu->addMenu(tr("&Debugging"));
+ debugMenu->addAction(slowAction);
+ debugMenu->addAction(showWarningsWindow);
+#endif // ! Q_OS_SYMBIAN
+
+ QMenu *settingsMenu = menu->addMenu(tr("S&ettings"));
+ settingsMenu->addAction(proxyAction);
+#if !defined(Q_OS_SYMBIAN)
+ settingsMenu->addAction(recordOptions);
+ settingsMenu->addMenu(loggerWindow->preferencesMenu());
+#else // ! Q_OS_SYMBIAN
+ settingsMenu->addAction(fullscreenAction);
+#endif // Q_OS_SYMBIAN
+ settingsMenu->addAction(rotateOrientation);
+
+ QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
+
+ orientation->addAction(portraitAction);
+ orientation->addAction(landscapeAction);
+ orientation->addAction(portraitInvAction);
+ orientation->addAction(landscapeInvAction);
+ propertiesMenu->addActions(orientation->actions());
+
+ QMenu *helpMenu = menu->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAction);
}
void QDeclarativeViewer::showProxySettings()
@@ -685,25 +837,11 @@ void QDeclarativeViewer::chooseRecordingOptions()
recdlg->file->setText(record_file);
// Size
- recdlg->sizeOriginal->setText(tr("Original (%1x%2)").arg(canvas->width()).arg(canvas->height()));
- if (recdlg->sizeWidth->value()<=1) {
- recdlg->sizeWidth->setValue(canvas->width());
- recdlg->sizeHeight->setValue(canvas->height());
- }
+ recdlg->setOriginalSize(canvas->size());
// Rate
- if (record_rate == 24)
- recdlg->hz24->setChecked(true);
- else if (record_rate == 25)
- recdlg->hz25->setChecked(true);
- else if (record_rate == 50)
- recdlg->hz50->setChecked(true);
- else if (record_rate == 60)
- recdlg->hz60->setChecked(true);
- else {
- recdlg->hzCustom->setChecked(true);
- recdlg->hz->setText(QString::number(record_rate));
- }
+ recdlg->setVideoRate(record_rate);
+
// Profile
recdlg->setArguments(record_args.join(" "));
@@ -711,28 +849,9 @@ void QDeclarativeViewer::chooseRecordingOptions()
// File
record_file = recdlg->file->text();
// Size
- if (recdlg->sizeOriginal->isChecked())
- record_outsize = QSize();
- else if (recdlg->size720p->isChecked())
- record_outsize = QSize(1280,720);
- else if (recdlg->sizeVGA->isChecked())
- record_outsize = QSize(640,480);
- else if (recdlg->sizeQVGA->isChecked())
- record_outsize = QSize(320,240);
- else
- record_outsize = QSize(recdlg->sizeWidth->value(),recdlg->sizeHeight->value());
+ record_outsize = recdlg->videoSize();
// Rate
- if (recdlg->hz24->isChecked())
- record_rate = 24;
- else if (recdlg->hz25->isChecked())
- record_rate = 25;
- else if (recdlg->hz50->isChecked())
- record_rate = 50;
- else if (recdlg->hz60->isChecked())
- record_rate = 60;
- else {
- record_rate = recdlg->hz->text().toDouble();
- }
+ record_rate = recdlg->videoRate();
// Profile
record_args = recdlg->arguments().split(" ",QString::SkipEmptyParts);
}
@@ -740,7 +859,7 @@ void QDeclarativeViewer::chooseRecordingOptions()
void QDeclarativeViewer::toggleRecordingWithSelection()
{
- if (!recordTimer.isRunning()) {
+ if (!recordTimer.isActive()) {
if (record_file.isEmpty()) {
QString fileName = getVideoFileName();
if (fileName.isEmpty())
@@ -759,7 +878,7 @@ void QDeclarativeViewer::toggleRecording()
toggleRecordingWithSelection();
return;
}
- bool recording = !recordTimer.isRunning();
+ bool recording = !recordTimer.isActive();
recordAction->setText(recording ? tr("&Stop Recording Video\tF9") : tr("&Start Recording Video\tF9"));
setRecording(recording);
}
@@ -807,8 +926,9 @@ void QDeclarativeViewer::statusChanged()
initialSize = canvas->initialSize();
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
if (!isFullScreen() && !isMaximized()) {
- resize(QSize(initialSize.width(), initialSize.height()+menuBarHeight()));
- updateSizeHints();
+ canvas->setFixedSize(initialSize);
+ resize(1, 1); // workaround for QMainWindowLayout NOT shrinking the window if the centralWidget() shrink
+ QTimer::singleShot(0, this, SLOT(updateSizeHints()));
}
}
}
@@ -917,7 +1037,7 @@ void QDeclarativeViewer::setAutoRecord(int from, int to)
if (from==0) from=1; // ensure resized
record_autotime = to-from;
autoStartTimer.setInterval(from);
- autoStartTimer.setRunning(true);
+ autoStartTimer.start();
}
void QDeclarativeViewer::setRecordArgs(const QStringList& a)
@@ -1019,7 +1139,7 @@ void QDeclarativeViewer::senseFfmpeg()
void QDeclarativeViewer::setRecording(bool on)
{
- if (on == recordTimer.isRunning())
+ if (on == recordTimer.isActive())
return;
int period = int(1000/record_rate+0.5);
@@ -1028,7 +1148,7 @@ void QDeclarativeViewer::setRecording(bool on)
if (on) {
canvas->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
recordTimer.setInterval(period);
- recordTimer.setRunning(true);
+ recordTimer.start();
frame_fmt = record_file.right(4).toLower();
frame = QImage(canvas->width(),canvas->height(),QImage::Format_RGB32);
if (frame_fmt != ".png" && (!convertAvailable || frame_fmt != ".gif")) {
@@ -1059,7 +1179,7 @@ void QDeclarativeViewer::setRecording(bool on)
}
} else {
canvas->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
- recordTimer.setRunning(false);
+ recordTimer.stop();
if (frame_stream) {
qDebug() << "Saving video...";
frame_stream->close();
@@ -1139,7 +1259,7 @@ void QDeclarativeViewer::setRecording(bool on)
frames.clear();
}
}
- qDebug() << "Recording: " << (recordTimer.isRunning()?"ON":"OFF");
+ qDebug() << "Recording: " << (recordTimer.isActive()?"ON":"OFF");
}
void QDeclarativeViewer::ffmpegFinished(int code)
@@ -1147,11 +1267,21 @@ void QDeclarativeViewer::ffmpegFinished(int code)
qDebug() << "ffmpeg returned" << code << frame_stream->readAllStandardError();
}
+void QDeclarativeViewer::appAboutToQuit()
+{
+ // avoid QGLContext errors about invalid contexts on exit
+ canvas->setViewport(0);
+
+ // avoid crashes if messages are received after app has closed
+ delete loggerWindow;
+ loggerWindow = 0;
+}
+
void QDeclarativeViewer::autoStartRecording()
{
setRecording(true);
autoStopTimer.setInterval(record_autotime);
- autoStopTimer.setRunning(true);
+ autoStopTimer.start();
}
void QDeclarativeViewer::autoStopRecording()
@@ -1181,14 +1311,14 @@ void QDeclarativeViewer::changeOrientation(QAction *action)
return;
action->setChecked(true);
- QString o = action->text().split(QLatin1Char(':')).value(1).trimmed();
+ QString o = action->text();
if (o == QLatin1String("Portrait"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait);
else if (o == QLatin1String("Landscape"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::Landscape);
- else if (o == QLatin1String("Portrait (Inverted)"))
+ else if (o == QLatin1String("Portrait (inverted)"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::PortraitInverted);
- else if (o == QLatin1String("Landscape (Inverted)"))
+ else if (o == QLatin1String("Landscape (inverted)"))
DeviceOrientation::instance()->setOrientation(DeviceOrientation::LandscapeInverted);
}
@@ -1197,9 +1327,11 @@ void QDeclarativeViewer::orientationChanged()
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
if (canvas->rootObject()) {
QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size();
- QSize newSize(rootObjectSize.width(), rootObjectSize.height()+menuBarHeight());
- if (size() != newSize) {
- resize(newSize);
+ 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
}
}
}
@@ -1253,16 +1385,15 @@ void QDeclarativeViewer::updateSizeHints()
{
if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
QSize newWindowSize = canvas->sizeHint();
- newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
if (!isFullScreen() && !isMaximized()) {
- resize(newWindowSize);
- setFixedSize(newWindowSize);
+ 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));
}
} else { // QDeclarativeView::SizeRootObjectToView
canvas->setMinimumSize(QSize(0,0));
canvas->setMaximumSize(QSize(16777215,16777215));
- setMinimumSize(QSize(0,0));
- setMaximumSize(QSize(16777215,16777215));
}
}
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 27bd217..e70e69f 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -43,8 +43,7 @@
#define QDECLARATIVEVIEWER_H
#include <QMainWindow>
-#include <QMenuBar>
-#include <private/qdeclarativetimer_p.h>
+#include <QTimer>
#include <QTime>
#include <QList>
@@ -62,17 +61,16 @@ class QNetworkReply;
class QNetworkCookieJar;
class NetworkAccessManagerFactory;
class QTranslator;
+class QActionGroup;
+class QMenuBar;
class QDeclarativeViewer
-#if defined(Q_OS_SYMBIAN)
: public QMainWindow
-#else
- : public QWidget
-#endif
{
-Q_OBJECT
+ Q_OBJECT
+
public:
- QDeclarativeViewer(QWidget *parent=0, Qt::WindowFlags flags=0);
+ QDeclarativeViewer(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~QDeclarativeViewer();
static void registerTypes();
@@ -95,7 +93,7 @@ public:
void setRecordFile(const QString&);
void setRecordArgs(const QStringList&);
void setRecording(bool on);
- bool isRecording() const { return recordTimer.isRunning(); }
+ bool isRecording() const { return recordTimer.isActive(); }
void setAutoRecord(int from, int to);
void setDeviceKeys(bool);
void setNetworkCacheSize(int size);
@@ -103,11 +101,8 @@ public:
void addPluginPath(const QString& plugin);
void setUseGL(bool use);
void setUseNativeFileBrowser(bool);
- void updateSizeHints();
void setSizeToView(bool sizeToView);
- QMenuBar *menuBar() const;
-
QDeclarativeView *view() const;
LoggerWidget *warningsWidget() const;
@@ -132,9 +127,11 @@ public slots:
protected:
virtual void keyPressEvent(QKeyEvent *);
virtual bool event(QEvent *);
- void createMenu(QMenuBar *menu, QMenu *flatmenu);
+ void createMenu();
private slots:
+ void appAboutToQuit();
+
void autoStartRecording();
void autoStopRecording();
void recordFrame();
@@ -148,21 +145,22 @@ private slots:
void warningsWidgetOpened();
void warningsWidgetClosed();
+ void updateSizeHints();
+
private:
QString getVideoFileName();
- int menuBarHeight() const;
LoggerWidget *loggerWindow;
QDeclarativeView *canvas;
QSize initialSize;
QString currentFileOrUrl;
- QDeclarativeTimer recordTimer;
+ QTimer recordTimer;
QString frame_fmt;
QImage frame;
QList<QImage*> frames;
QProcess* frame_stream;
- QDeclarativeTimer autoStartTimer;
- QDeclarativeTimer autoStopTimer;
+ QTimer autoStartTimer;
+ QTimer autoStopTimer;
QString record_dither;
QString record_file;
QSize record_outsize;
@@ -173,7 +171,6 @@ private:
QAction *recordAction;
QString currentSkin;
bool scaleSkin;
- mutable QMenuBar *mb;
RecordingDialog *recdlg;
void senseImageMagick();
diff --git a/tools/qml/recopts_maemo5.ui b/tools/qml/recopts_maemo5.ui
new file mode 100644
index 0000000..3bb5eca
--- /dev/null
+++ b/tools/qml/recopts_maemo5.ui
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RecordingOptions</class>
+ <widget class="QDialog" name="RecordingOptions">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>469</width>
+ <height>142</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Video options</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" columnstretch="0,2,0">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinAndMaxSize</enum>
+ </property>
+ <property name="leftMargin">
+ <number>16</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>16</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>16</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="file"/>
+ </item>
+ <item row="0" column="2" rowspan="3">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>72</width>
+ <height>56</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Size</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sizeCombo">
+ <item>
+ <property name="text">
+ <string/>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>VGA</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>QVGA</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>720p</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="2" column="0" rowspan="2">
+ <widget class="QLabel" name="rateLabel">
+ <property name="text">
+ <string>Rate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" rowspan="2">
+ <widget class="QComboBox" name="rateCombo">
+ <item>
+ <property name="text">
+ <string>60 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>50 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>25 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>24 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>20 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>15 Hz</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>10 Hz</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="args"/>
+ </item>
+ <item row="4" column="1">
+ <widget class="QComboBox" name="profile"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="profileLabel">
+ <property name="text">
+ <string>Profile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" colspan="2">
+ <widget class="QLabel" name="warning">
+ <property name="text">
+ <string notr="true">warning</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" rowspan="3">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QPushButton" name="pickfile">
+ <property name="text">
+ <string>File</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QPushButton" name="ffmpegHelp">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>60</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>258</x>
+ <y>424</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>92</x>
+ <y>219</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>profile</sender>
+ <signal>activated(int)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>pickProfile(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>92</x>
+ <y>329</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>48</x>
+ <y>194</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>args</sender>
+ <signal>textEdited(QString)</signal>
+ <receiver>RecordingOptions</receiver>
+ <slot>storeCustomArgs(QString)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>128</x>
+ <y>357</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>102</x>
+ <y>189</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+ <slots>
+ <signal>filePicked(QString)</signal>
+ <signal>argumentsPicked(QString)</signal>
+ <slot>pickFile()</slot>
+ <slot>pickProfile(int)</slot>
+ <slot>storeCustomArgs(QString)</slot>
+ </slots>
+</ui>
diff --git a/tools/qml/texteditautoresizer_maemo5.h b/tools/qml/texteditautoresizer_maemo5.h
new file mode 100644
index 0000000..bb5567a
--- /dev/null
+++ b/tools/qml/texteditautoresizer_maemo5.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** 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 examples 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 <QtGui/qplaintextedit.h>
+#include <QtGui/qtextedit.h>
+#include <QtGui/qabstractkineticscroller.h>
+#include <QtGui/qscrollarea.h>
+#include <QtDebug>
+
+#ifndef TEXTEDITAUTORESIZER_H
+#define TEXTEDITAUTORESIZER_H
+
+class TextEditAutoResizer : public QObject
+{
+ Q_OBJECT
+public:
+ TextEditAutoResizer(QWidget *parent)
+ : QObject(parent), plainTextEdit(qobject_cast<QPlainTextEdit *>(parent)),
+ textEdit(qobject_cast<QTextEdit *>(parent)), edit(qobject_cast<QFrame *>(parent))
+ {
+ // parent must either inherit QPlainTextEdit or QTextEdit!
+ Q_ASSERT(plainTextEdit || textEdit);
+
+ connect(parent, SIGNAL(textChanged()), this, SLOT(textEditChanged()));
+ connect(parent, SIGNAL(cursorPositionChanged()), this, SLOT(textEditChanged()));
+
+ textEditChanged();
+ }
+
+private Q_SLOTS:
+ inline void textEditChanged();
+
+private:
+ QPlainTextEdit *plainTextEdit;
+ QTextEdit *textEdit;
+ QFrame *edit;
+};
+
+void TextEditAutoResizer::textEditChanged()
+{
+ QTextDocument *doc = textEdit ? textEdit->document() : plainTextEdit->document();
+ QRect cursor = textEdit ? textEdit->cursorRect() : plainTextEdit->cursorRect();
+
+ QSize s = doc->size().toSize();
+ if (plainTextEdit)
+ s.setHeight((s.height() + 2) * edit->fontMetrics().lineSpacing());
+
+ const QRect fr = edit->frameRect();
+ const QRect cr = edit->contentsRect();
+
+ edit->setMinimumHeight(qMax(70, s.height() + (fr.height() - cr.height() - 1)));
+
+ // make sure the cursor is visible in case we have a QAbstractScrollArea parent
+ QPoint pos = edit->pos();
+ QWidget *pw = edit->parentWidget();
+ while (pw) {
+ if (qobject_cast<QScrollArea *>(pw))
+ break;
+ pw = pw->parentWidget();
+ }
+
+ if (pw) {
+ QScrollArea *area = static_cast<QScrollArea *>(pw);
+ QPoint scrollto = area->widget()->mapFrom(edit, cursor.center());
+ QPoint margin(10 + cursor.width(), 2 * cursor.height());
+
+ if (QAbstractKineticScroller *scroller = area->property("kineticScroller").value<QAbstractKineticScroller *>()) {
+ scroller->ensureVisible(scrollto, margin.x(), margin.y());
+ } else {
+ area->ensureVisible(scrollto.x(), scrollto.y(), margin.x(), margin.y());
+ }
+ }
+}
+
+#endif