summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-16 02:09:27 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-16 02:09:27 (GMT)
commitdd703f7a7e676f26dcb3ad634d75e0c9f677db43 (patch)
treef29f903c584349fe7ef67d43613f9fddaeb85aba
parent081fafe395d52ae42b57c36d1279e6ac05ae2cde (diff)
parente56c5483fe8b292545bb9f004d796abd8ae00589 (diff)
downloadQt-dd703f7a7e676f26dcb3ad634d75e0c9f677db43.zip
Qt-dd703f7a7e676f26dcb3ad634d75e0c9f677db43.tar.gz
Qt-dd703f7a7e676f26dcb3ad634d75e0c9f677db43.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Conflicts: src/declarative/qml/qdeclarativeengine.cpp tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
-rwxr-xr-xconfigure46
-rwxr-xr-xconfigure.exebin1008128 -> 1224192 bytes
-rw-r--r--demos/declarative/declarative.pro1
-rw-r--r--demos/declarative/flickr/common/qmldir20
-rw-r--r--demos/declarative/minehunt/MinehuntCore/Explosion.qml1
-rw-r--r--demos/declarative/minehunt/minehunt.cpp7
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml91
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml9
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml142
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml16
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml13
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/Tag.qml22
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/images/box-shadow.pngbin0 -> 588 bytes
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/images/cardboard.pngbin0 -> 8844 bytes
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/qmldir6
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/script/script.js25
-rw-r--r--demos/declarative/photoviewer/photoviewer.qml47
-rw-r--r--demos/declarative/samegame/SamegameCore/BoomBlock.qml1
-rw-r--r--demos/declarative/samegame/SamegameCore/qmldir6
-rw-r--r--demos/declarative/snake/content/Cookie.qml1
-rw-r--r--demos/declarative/snake/content/Link.qml1
-rw-r--r--demos/declarative/snake/snake.qml10
-rw-r--r--demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml4
-rw-r--r--demos/embedded/anomaly/anomaly.pro2
-rw-r--r--demos/embedded/flightinfo/flightinfo.pro2
-rw-r--r--demos/embedded/lightmaps/lightmaps.pro2
-rw-r--r--demos/embedded/weatherinfo/weatherinfo.pro2
-rw-r--r--dist/changes-4.5.410
-rw-r--r--doc/src/declarative/declarativeui.qdoc4
-rw-r--r--doc/src/declarative/elements.qdoc1
-rw-r--r--doc/src/declarative/extending.qdoc62
-rw-r--r--doc/src/declarative/globalobject.qdoc12
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc22
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc48
-rw-r--r--doc/src/development/developing-on-mac.qdoc4
-rw-r--r--doc/src/development/qmake-manual.qdoc40
-rw-r--r--doc/src/examples/svgalib.qdoc3
-rw-r--r--doc/src/images/quick_screens.pngbin0 -> 128730 bytes
-rw-r--r--doc/src/platforms/supported-platforms.qdoc2
-rw-r--r--doc/src/qt4-intro.qdoc2
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc5
-rw-r--r--examples/animation/animatedtiles/animatedtiles.pro5
-rw-r--r--examples/animation/appchooser/appchooser.pro5
-rw-r--r--examples/animation/easing/easing.pro5
-rw-r--r--examples/animation/moveblocks/moveblocks.pro5
-rw-r--r--examples/animation/states/states.pro5
-rw-r--r--examples/animation/stickman/stickman.pro5
-rw-r--r--examples/declarative/animations/color-animation.qml1
-rw-r--r--examples/declarative/colorbrowser/colorbrowser.qml4
-rw-r--r--examples/declarative/dynamic/dynamic.qml1
-rw-r--r--examples/declarative/extending/adding/main.cpp2
-rw-r--r--examples/declarative/extending/attached/main.cpp12
-rw-r--r--examples/declarative/extending/binding/main.cpp15
-rw-r--r--examples/declarative/extending/coercion/main.cpp8
-rw-r--r--examples/declarative/extending/default/main.cpp8
-rw-r--r--examples/declarative/extending/extended/main.cpp2
-rw-r--r--examples/declarative/extending/grouped/main.cpp10
-rw-r--r--examples/declarative/extending/properties/main.cpp4
-rw-r--r--examples/declarative/extending/signal/main.cpp12
-rw-r--r--examples/declarative/extending/valuesource/main.cpp14
-rw-r--r--examples/declarative/imageprovider/imageprovider.cpp1
-rw-r--r--examples/declarative/imageprovider/imageprovider.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml1
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro5
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro2
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro2
-rw-r--r--examples/network/network-chat/network-chat.pro3
-rw-r--r--examples/qws/svgalib/README12
-rw-r--r--examples/qws/svgalib/svgalibpaintdevice.cpp2
-rw-r--r--examples/qws/svgalib/svgalibpaintengine.cpp45
-rw-r--r--examples/qws/svgalib/svgalibpaintengine.h6
-rw-r--r--examples/sql/masterdetail/masterdetail.pro5
-rw-r--r--examples/sql/sql.pro6
-rw-r--r--mkspecs/common/symbian/symbian.conf7
-rw-r--r--mkspecs/features/symbian/application_icon.prf2
-rw-r--r--mkspecs/features/symbian/platform_paths.prf96
-rw-r--r--mkspecs/symbian-abld/qplatformdefs.h (renamed from src/imports/webkit/webkitqmlplugin_export.h)14
-rw-r--r--mkspecs/symbian-sbsv2/qplatformdefs.h (renamed from src/plugins/audio/symbian/symbianaudio.h)37
-rw-r--r--qmake/generators/symbian/symmake.cpp79
-rw-r--r--qmake/generators/symbian/symmake.h14
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_soft.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/utils.cpp22
-rw-r--r--src/3rdparty/phonon/waveout/mediaobject.cpp2
-rw-r--r--src/3rdparty/phonon/waveout/mediaobject.h2
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog13
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp2
-rw-r--r--src/activeqt/control/qaxserverbase.cpp6
-rw-r--r--src/corelib/codecs/codecs.pri3
-rw-r--r--src/corelib/codecs/qsimplecodec.cpp12
-rw-r--r--src/corelib/codecs/qsimplecodec_p.h4
-rw-r--r--src/corelib/codecs/qtextcodec.cpp41
-rw-r--r--src/corelib/codecs/qtextcodec_symbian.cpp678
-rw-r--r--src/corelib/codecs/qutfcodec.cpp39
-rw-r--r--src/corelib/concurrent/qfuturewatcher.cpp2
-rw-r--r--src/corelib/global/qglobal.h10
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp2
-rw-r--r--src/corelib/io/qiodevice.cpp3
-rw-r--r--src/corelib/io/qprocess_win.cpp2
-rw-r--r--src/corelib/io/qresource.cpp8
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/io/qurl.cpp6
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp8
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h6
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qtimer.cpp14
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/tools/qchar.cpp271
-rw-r--r--src/corelib/tools/qeasingcurve.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp185
-rw-r--r--src/corelib/tools/qunicodetables.cpp3694
-rw-r--r--src/corelib/tools/qunicodetables_p.h55
-rw-r--r--src/corelib/tools/qvarlengtharray.h3
-rw-r--r--src/declarative/QmlChanges.txt44
-rw-r--r--src/declarative/graphicsitems/graphicsitems.pri4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h40
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativegraphicsobjectcontainer.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp538
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h36
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp89
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h31
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp130
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp176
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp96
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp56
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp6
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp6
-rw-r--r--src/declarative/qml/qdeclarative.h22
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp142
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h28
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp171
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp29
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp20
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp57
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager_p.h3
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp93
-rw-r--r--src/declarative/qml/qdeclarativecontext.h7
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h45
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass.cpp26
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass_p.h1
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p.h3
-rw-r--r--src/declarative/qml/qdeclarativedeclarativedata_p.h17
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp5
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp193
-rw-r--r--src/declarative/qml/qdeclarativeengine.h4
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h3
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp24
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp180
-rw-r--r--src/declarative/qml/qdeclarativeexpression_p.h19
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp2
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp12
-rw-r--r--src/declarative/qml/qdeclarativenotifier.cpp110
-rw-r--r--src/declarative/qml/qdeclarativenotifier_p.h272
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp156
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h3
-rw-r--r--src/declarative/qml/qdeclarativeparser.cpp5
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h6
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp155
-rw-r--r--src/declarative/qml/qdeclarativeproperty_p.h3
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h17
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass.cpp7
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp17
-rw-r--r--src/declarative/qml/qdeclarativevme_p.h2
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp2
-rw-r--r--src/declarative/qml/qml.pri2
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp118
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h21
-rw-r--r--src/declarative/util/qdeclarativeanimation_p_p.h13
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp19
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp41
-rw-r--r--src/declarative/util/qdeclarativestate.cpp62
-rw-r--r--src/declarative/util/qdeclarativestate_p.h8
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp250
-rw-r--r--src/declarative/util/qdeclarativestateoperations_p.h9
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager.cpp26
-rw-r--r--src/declarative/util/qdeclarativeutilmodule.cpp76
-rw-r--r--src/declarative/util/qdeclarativeview.cpp23
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp55
-rw-r--r--src/gui/dialogs/qdialog.cpp11
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm27
-rw-r--r--src/gui/dialogs/qfiledialog_win_p.h2
-rw-r--r--src/gui/dialogs/qfontdialog.cpp20
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm395
-rw-r--r--src/gui/dialogs/qfontdialog_p.h12
-rw-r--r--src/gui/dialogs/qprintdialog.h2
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp38
-rw-r--r--src/gui/egl/qegl.cpp9
-rw-r--r--src/gui/egl/qegl_x11.cpp2
-rw-r--r--src/gui/embedded/qwsmanager_qws.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.h10
-rw-r--r--src/gui/image/qpixmap_x11_p.h2
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp16
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp162
-rw-r--r--src/gui/itemviews/qtreeview_p.h14
-rw-r--r--src/gui/kernel/qapplication_s60.cpp2
-rw-r--r--src/gui/kernel/qapplication_win.cpp5
-rw-r--r--src/gui/kernel/qcocoaapplicationdelegate_mac.mm13
-rw-r--r--src/gui/kernel/qcursor.cpp3
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp1
-rw-r--r--src/gui/kernel/qdesktopwidget_win.cpp4
-rw-r--r--src/gui/kernel/qkeymapper_win.cpp2
-rw-r--r--src/gui/kernel/qkeymapper_x11.cpp2
-rw-r--r--src/gui/kernel/qt_s60_p.h4
-rw-r--r--src/gui/kernel/qwidget_mac.mm12
-rw-r--r--src/gui/kernel/qwidget_s60.cpp24
-rw-r--r--src/gui/kernel/qwidget_win.cpp4
-rw-r--r--src/gui/kernel/qwidget_wince.cpp4
-rw-r--r--src/gui/painting/qcolor.cpp11
-rw-r--r--src/gui/painting/qcolormap.qdoc10
-rw-r--r--src/gui/painting/qcups.cpp3
-rw-r--r--src/gui/painting/qdrawhelper.cpp3
-rw-r--r--src/gui/painting/qdrawutil.cpp4
-rw-r--r--src/gui/painting/qmemrotate_p.h3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp13
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
-rw-r--r--src/gui/painting/qpaintengineex_p.h3
-rw-r--r--src/gui/painting/qpainter.cpp53
-rw-r--r--src/gui/painting/qpainter.h12
-rw-r--r--src/gui/painting/qregion.cpp40
-rw-r--r--src/gui/painting/qstroker.cpp116
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp2
-rw-r--r--src/gui/painting/qtransform.h7
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp25
-rw-r--r--src/gui/s60framework/qs60maindocument.h2
-rw-r--r--src/gui/s60framework/s60framework.pri2
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/styles/qstylehelper.cpp3
-rw-r--r--src/gui/styles/styles.pri24
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp7
-rw-r--r--src/gui/text/qfontengine_ft.cpp72
-rw-r--r--src/gui/text/qfontengine_ft_p.h16
-rw-r--r--src/gui/text/qfontengine_mac.mm2
-rw-r--r--src/gui/text/qfontengine_qpf.cpp14
-rw-r--r--src/gui/text/qstatictext.cpp6
-rw-r--r--src/gui/text/qtextengine_p.h1
-rw-r--r--src/gui/text/qtextformat.cpp3
-rw-r--r--src/gui/text/qtextlayout.cpp2
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp4
-rw-r--r--src/gui/util/util.pri2
-rw-r--r--src/gui/widgets/qdockarealayout.cpp17
-rw-r--r--src/gui/widgets/qlineedit_p.cpp2
-rw-r--r--src/gui/widgets/qmainwindow.cpp25
-rw-r--r--src/gui/widgets/qmenu_mac.mm2
-rw-r--r--src/gui/widgets/qmenu_p.h2
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp8
-rw-r--r--src/gui/widgets/qmenu_wince.cpp25
-rw-r--r--src/gui/widgets/qmenubar.cpp51
-rw-r--r--src/gui/widgets/qmenubar_p.h5
-rw-r--r--src/gui/widgets/qscrollbar.cpp1
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/multimedia/multimedia.pro6
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp5
-rw-r--r--src/imports/multimedia/qdeclarativevideo.cpp5
-rw-r--r--src/imports/particles/particles.cpp69
-rw-r--r--src/imports/particles/particles.pro20
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp (renamed from src/declarative/graphicsitems/qdeclarativeparticles.cpp)27
-rw-r--r--src/imports/particles/qdeclarativeparticles_p.h (renamed from src/declarative/graphicsitems/qdeclarativeparticles_p.h)14
-rw-r--r--src/imports/particles/qmldir1
-rw-r--r--src/imports/qimportbase.pri2
-rw-r--r--src/imports/webkit/plugin.cpp2
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp8
-rw-r--r--src/imports/webkit/qdeclarativewebview_p.h7
-rw-r--r--src/imports/webkit/qdeclarativewebview_p_p.h4
-rw-r--r--src/imports/webkit/webkit.pro10
-rw-r--r--src/imports/widgets/widgets.cpp6
-rw-r--r--src/imports/widgets/widgets.pro9
-rw-r--r--src/multimedia/audio/audio.pri15
-rw-r--r--src/multimedia/audio/qaudio_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudioutils.cpp)2
-rw-r--r--src/multimedia/audio/qaudio_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudioutils.h)37
-rw-r--r--src/multimedia/audio/qaudiodevicefactory.cpp16
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp)51
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudiodeviceinfo.h)25
-rw-r--r--src/multimedia/audio/qaudioinput.cpp2
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.cpp26
-rw-r--r--src/multimedia/audio/qaudioinput_mac_p.cpp1
-rw-r--r--src/multimedia/audio/qaudioinput_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudioinput.cpp)85
-rw-r--r--src/multimedia/audio/qaudioinput_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudioinput.h)31
-rw-r--r--src/multimedia/audio/qaudioinput_win32_p.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.cpp3
-rw-r--r--src/multimedia/audio/qaudiooutput_symbian_p.cpp (renamed from src/plugins/audio/symbian/symbianaudiooutput.cpp)89
-rw-r--r--src/multimedia/audio/qaudiooutput_symbian_p.h (renamed from src/plugins/audio/symbian/symbianaudiooutput.h)31
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp5
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.h2
-rw-r--r--src/multimedia/base/qpaintervideosurface.cpp14
-rw-r--r--src/multimedia/effects/qsoundeffect.cpp4
-rw-r--r--src/multimedia/effects/qsoundeffect_pulse_p.cpp87
-rw-r--r--src/multimedia/effects/qsoundeffect_pulse_p.h4
-rw-r--r--src/multimedia/effects/qsoundeffect_qmedia_p.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp21
-rw-r--r--src/network/access/qnetworkaccessmanager.h1
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h2
-rw-r--r--src/network/bearer/qbearerengine.cpp38
-rw-r--r--src/network/bearer/qbearerengine_p.h3
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp77
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp90
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h15
-rw-r--r--src/network/bearer/qnetworksession.cpp14
-rw-r--r--src/network/kernel/qhostinfo.cpp2
-rw-r--r--src/network/ssl/qsslkey.cpp4
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h11
-rw-r--r--src/opengl/gl2paintengineex/qglgradientcache.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp43
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h6
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker.cpp5
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker_p.h4
-rw-r--r--src/opengl/qgl.cpp71
-rw-r--r--src/opengl/qgl_egl.cpp158
-rw-r--r--src/opengl/qgl_egl_p.h2
-rw-r--r--src/opengl/qgl_p.h4
-rw-r--r--src/opengl/qgl_qws.cpp3
-rw-r--r--src/opengl/qgl_wince.cpp3
-rw-r--r--src/opengl/qgl_x11.cpp2
-rw-r--r--src/opengl/qgl_x11egl.cpp18
-rw-r--r--src/opengl/qglpixelbuffer_egl.cpp2
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp33
-rw-r--r--src/openvg/qpaintengine_vg.cpp13
-rw-r--r--src/openvg/qpaintengine_vg_p.h3
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp3
-rw-r--r--src/plugins/audio/audio.pro6
-rw-r--r--src/plugins/audio/symbian/main.cpp121
-rw-r--r--src/plugins/audio/symbian/symbian.pro31
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h5
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm163
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp14
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h3
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp23
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp13
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp98
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.h4
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp8
-rw-r--r--src/plugins/bearer/nla/qnlaengine.cpp56
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp56
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h9
-rw-r--r--src/plugins/codecs/cn/qgb18030codec.cpp59
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp29
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h1
-rw-r--r--src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp3
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp39
-rw-r--r--src/plugins/mediaservices/directshow/directshow.pro2
-rw-r--r--src/plugins/mediaservices/gstreamer/gstreamer.pro2
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp191
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h13
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp52
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h1
-rw-r--r--src/plugins/mediaservices/qt7/qt7.pro2
-rw-r--r--src/plugins/s60/3_2/3_2.pro2
-rw-r--r--src/plugins/s60/5_0/5_0.pro2
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp2
-rw-r--r--src/plugins/sqldrivers/sqlite/sqlite.pro2
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zipbin3155605 -> 3119273 bytes
-rw-r--r--src/qt3support/itemviews/q3listview.cpp9
-rw-r--r--src/qt3support/other/q3process_win.cpp2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def59
-rw-r--r--src/s60installs/bwins/QtGuiu.def2
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def61
-rw-r--r--src/s60installs/eabi/QtGuiu.def2
-rw-r--r--src/s60installs/qt.iby104
-rw-r--r--src/s60installs/s60installs.pro8
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp5
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h1
-rw-r--r--src/script/bridge/qscriptdeclarativeobject.cpp17
-rw-r--r--src/script/bridge/qscriptdeclarativeobject_p.h2
-rw-r--r--src/script/bridge/qscriptqobject.cpp122
-rw-r--r--src/script/bridge/qscriptqobject_p.h1
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp4
-rw-r--r--src/src.pro4
-rw-r--r--src/svg/qsvggenerator.cpp27
-rw-r--r--src/svg/qsvggraphics.cpp178
-rw-r--r--src/svg/qsvggraphics_p.h40
-rw-r--r--src/svg/qsvghandler.cpp4
-rw-r--r--src/svg/qsvgnode.cpp65
-rw-r--r--src/svg/qsvgnode_p.h14
-rw-r--r--src/svg/qsvgstructure.cpp13
-rw-r--r--src/svg/qsvgstructure_p.h3
-rw-r--r--src/svg/qsvgstyle.cpp46
-rw-r--r--src/svg/qsvgstyle_p.h28
-rw-r--r--src/svg/qsvgtinydocument.cpp7
-rw-r--r--src/svg/qsvgtinydocument_p.h5
-rw-r--r--src/testlib/qtestcase.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser.cpp48
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser_p.h22
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml4
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/simple.qml2
-rw-r--r--tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp32
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp98
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro5
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp35
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml56
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml1
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp102
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp92
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp57
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/data/particles.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp125
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview3.qml2
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/closestangle.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml42
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp79
-rw-r--r--tests/auto/declarative/visual/animation/parentAnimation/parentAnimation.qml2
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.pngbin626 -> 642 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.pngbin632 -> 647 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.pngbin622 -> 637 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.pngbin634 -> 642 bytes
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml366
-rw-r--r--tests/auto/declarative/visual/animation/reanchor/reanchor.qml2
-rw-r--r--tests/auto/mediaobject/media/test.sdp32
-rwxr-xr-xtests/auto/mediaobject/mediaobject.pro6
-rw-r--r--tests/auto/mediaobject/mediaobject.qrc1
-rw-r--r--tests/auto/mediaobject/tst_mediaobject.cpp75
-rw-r--r--tests/auto/multimedia.pro1
-rw-r--r--tests/auto/q3listview/tst_q3listview.cpp126
-rw-r--r--tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp97
-rw-r--r--tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp20
-rw-r--r--tests/auto/qchar/tst_qchar.cpp13
-rw-r--r--tests/auto/qgl/tst_qgl.cpp17
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp63
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp10
-rw-r--r--tests/auto/qsoundeffect/qsoundeffect.pro20
-rw-r--r--tests/auto/qsoundeffect/test.wavbin0 -> 38316 bytes
-rw-r--r--tests/auto/qsoundeffect/tst_qsoundeffect.cpp144
-rw-r--r--tests/auto/qsqldatabase/tst_databases.h26
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp301
-rw-r--r--tests/auto/qsqldriver/tst_qsqldriver.cpp19
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp517
-rw-r--r--tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp79
-rw-r--r--tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp221
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp117
-rw-r--r--tests/auto/qsqlthread/tst_qsqlthread.cpp39
-rw-r--r--tests/auto/qsslkey/rsa-with-passphrase.pem18
-rw-r--r--tests/auto/qsslkey/rsa-without-passphrase.pem15
-rw-r--r--tests/auto/qsslkey/tst_qsslkey.cpp72
-rw-r--r--tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg6
-rw-r--r--tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg10
-rw-r--r--tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp31
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp16
-rw-r--r--tests/auto/qtextcodec/test/test.pro1
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp266
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp58
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp12
-rw-r--r--tests/auto/qtransform/tst_qtransform.cpp5
-rw-r--r--tests/auto/qurl/tst_qurl.cpp9
-rw-r--r--tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp47
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp57
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P02/ibm02v01.xml2
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/ibm66v01.xml2
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/out/ibm66v01.xml2
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/089.xml2
-rw-r--r--tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/out/089.xml2
-rw-r--r--tests/auto/utf8/tst_utf8.cpp85
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-datatype.xsd6
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-import-a.xsd5
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-import-b.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-import-c.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-include-a.xsd5
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-include-b.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-include-c.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-redefine-a.xsd5
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-redefine-b.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/files/indirect-redefine-c.xsd4
-rw-r--r--tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp15
-rw-r--r--tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro2
-rwxr-xr-xtests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/benchmarks/corelib/io/qfile/qfile.pro2
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro2
-rwxr-xr-xtests/benchmarks/corelib/io/qiodevice/qiodevice.pro2
-rw-r--r--tests/benchmarks/corelib/io/qtemporaryfile/qtemporaryfile.pro2
-rw-r--r--tests/benchmarks/corelib/io/qurl/main.cpp244
-rw-r--r--tests/benchmarks/corelib/io/qurl/qurl.pro7
-rw-r--r--tests/benchmarks/corelib/kernel/events/events.pro2
-rw-r--r--tests/benchmarks/corelib/kernel/qmetaobject/qmetaobject.pro2
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/qobject.pro2
-rw-r--r--tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro11
-rw-r--r--tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp96
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/qvariant.pro2
-rw-r--r--tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro2
-rw-r--r--tests/benchmarks/corelib/tools/containers-associative/containers-associative.pro2
-rw-r--r--tests/benchmarks/corelib/tools/containers-sequential/containers-sequential.pro2
-rwxr-xr-xtests/benchmarks/corelib/tools/qbytearray/qbytearray.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qrect/qrect.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/qregexp.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/qstring.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro2
-rw-r--r--tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro2
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp14
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml1
-rw-r--r--tests/benchmarks/gui/animation/qanimation/qanimation.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro2
-rw-r--r--tests/benchmarks/gui/image/blendbench/blendbench.pro2
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro2
-rw-r--r--tests/benchmarks/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro2
-rw-r--r--tests/benchmarks/gui/itemviews/qtableview/qtableview.pro2
-rw-r--r--tests/benchmarks/gui/kernel/qapplication/qapplication.pro2
-rw-r--r--tests/benchmarks/gui/kernel/qwidget/qwidget.pro2
-rw-r--r--tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro2
-rw-r--r--tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro2
-rw-r--r--tests/benchmarks/gui/painting/painting.pro3
-rw-r--r--tests/benchmarks/gui/painting/qpainter/qpainter.pro2
-rw-r--r--tests/benchmarks/gui/painting/qregion/main.cpp50
-rw-r--r--tests/benchmarks/gui/painting/qregion/qregion.pro2
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h841
-rw-r--r--tests/benchmarks/gui/painting/qtbench/qtbench.pro6
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp254
-rw-r--r--tests/benchmarks/gui/painting/qtransform/qtransform.pro2
-rw-r--r--tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro2
-rw-r--r--tests/benchmarks/gui/text/qtext/qtext.pro2
-rw-r--r--tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro2
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/qnetworkreply.pro2
-rwxr-xr-xtests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro2
-rw-r--r--tests/benchmarks/opengl/opengl.pro2
-rw-r--r--tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp92
-rw-r--r--tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro18
-rw-r--r--tests/benchmarks/plugins/imageformats/jpeg/n900.jpegbin0 -> 19016 bytes
-rw-r--r--tests/benchmarks/script/qscriptclass/qscriptclass.pro2
-rw-r--r--tests/benchmarks/script/qscriptengine/qscriptengine.pro2
-rw-r--r--tests/benchmarks/script/qscriptvalue/qscriptvalue.pro2
-rw-r--r--tests/benchmarks/svg/qsvgrenderer/qsvgrenderer.pro2
-rw-r--r--tools/assistant/tools/assistant/assistant.pro16
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp8
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qtb.cpp6
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qtb.h6
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp6
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.h6
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp4
-rw-r--r--tools/assistant/tools/assistant/mainwindow.h2
-rw-r--r--tools/configure/configureapp.cpp1
-rw-r--r--tools/linguist/linguist/mainwindow.cpp2
-rw-r--r--tools/qdbus/qdbus/qdbus.cpp175
-rw-r--r--tools/qdoc3/generator.cpp1
-rw-r--r--tools/qdoc3/node.cpp13
-rw-r--r--tools/qdoc3/node.h1
-rw-r--r--tools/qml/content/Browser.qml10
-rw-r--r--tools/qml/qdeclarativefolderlistmodel.cpp2
-rw-r--r--tools/qml/qfxtester.cpp8
-rw-r--r--tools/qml/qml.pro2
-rw-r--r--tools/qml/qmlruntime.cpp7
-rw-r--r--translations/qt_da.ts23
-rw-r--r--translations/qt_de.ts23
-rw-r--r--translations/qt_es.ts23
-rw-r--r--translations/qt_fr.ts23
-rw-r--r--translations/qt_ja_JP.ts23
-rw-r--r--translations/qt_pl.ts23
-rw-r--r--translations/qt_pt.ts23
-rw-r--r--translations/qt_ru.ts23
-rw-r--r--translations/qt_sv.ts23
-rw-r--r--translations/qt_zh_CN.ts23
-rw-r--r--translations/qt_zh_TW.ts23
-rw-r--r--translations/translations.pro1
-rw-r--r--util/unicode/.gitattributes1
-rw-r--r--util/unicode/data/CompositionExclusions.txt197
-rw-r--r--util/unicode/main.cpp597
-rw-r--r--util/unicode/unicode.pro1
631 files changed, 14860 insertions, 7320 deletions
diff --git a/configure b/configure
index 16c1fcd..60bcc67 100755
--- a/configure
+++ b/configure
@@ -2976,7 +2976,7 @@ else
fi
QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
-TEST_COMPILER="$CC"
+TEST_COMPILER="$CXX"
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
if [ -z "$TEST_COMPILER" ]; then
echo "ERROR: Cannot set the compiler for the configuration tests"
@@ -5486,7 +5486,7 @@ if [ "$PLATFORM_MAC" = "yes" ]; then
fi
if [ "$CFG_COREWLAN" = "auto" ]; then
- if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/corewlan "CoreWlan" $L_FLAGS $I_FLAGS $l_FLAGS; then
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/corewlan "CoreWlan" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
CFG_COREWLAN=yes
else
CFG_COREWLAN=no
@@ -5962,19 +5962,6 @@ if [ "$CFG_NETWORKMANAGER" = "auto" ]; then
fi
fi
-if [ -f "$relpath/src/declarative/declarative.pro" ]; then
- if [ "$CFG_DECLARATIVE" = "auto" ]; then
- CFG_DECLARATIVE=yes
- fi
-else
- if [ "$CFG_DECLARATIVE" = "auto" ] || [ "$CFG_DECLARATIVE" = "no" ]; then
- CFG_DECLARATIVE=no
- else
- echo "Error: Unable to locate the qt-declarative package. Refer to the documentation on how to build the package."
- exit 1
- fi
-fi
-
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $l_FLAGS
@@ -6324,7 +6311,7 @@ else
QT_CONFIG="$QT_CONFIG freetype"
fi
-if [ "x$PLATFORM_MAC" = "xyes" ]; then
+if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM" != "win32-g++" ]; then
#On Mac we implicitly link against libz, so we
#never use the 3rdparty stuff.
[ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
@@ -6629,12 +6616,6 @@ else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
fi
-if [ "$CFG_DECLARATIVE" = "yes" ]; then
- QT_CONFIG="$QT_CONFIG declarative"
-else
- QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DECLARATIVE"
-fi
-
if [ "$CFG_WEBKIT" = "auto" ]; then
CFG_WEBKIT="$canBuildWebKit"
fi
@@ -6674,6 +6655,27 @@ else
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
fi
+
+if [ "$CFG_DECLARATIVE" = "yes" ]; then
+ if [ "$CFG_SCRIPT" = "no" ]; then
+ echo "Error: QtDeclarative was requested, but it can't be built due to QtScript being disabled."
+ exit 1
+ fi
+fi
+if [ "$CFG_DECLARATIVE" = "auto" ]; then
+ if [ "$CFG_SCRIPT" = "no" ]; then
+ CFG_DECLARATIVE=no
+ else
+ CFG_DECLARATIVE=yes
+ fi
+fi
+
+if [ "$CFG_DECLARATIVE" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG declarative"
+else
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DECLARATIVE"
+fi
+
if [ "$CFG_EXCEPTIONS" = "no" ]; then
case "$COMPILER" in
g++*)
diff --git a/configure.exe b/configure.exe
index 9974236..326fcdf 100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/demos/declarative/declarative.pro b/demos/declarative/declarative.pro
index 4d169e3..aa60db0 100644
--- a/demos/declarative/declarative.pro
+++ b/demos/declarative/declarative.pro
@@ -8,6 +8,7 @@ SUBDIRS = \
sources.files = \
calculator \
flickr \
+ photoviewer \
samegame \
snake \
twitter \
diff --git a/demos/declarative/flickr/common/qmldir b/demos/declarative/flickr/common/qmldir
index 0c94f60..adc2479 100644
--- a/demos/declarative/flickr/common/qmldir
+++ b/demos/declarative/flickr/common/qmldir
@@ -1,10 +1,10 @@
-ImageDetails 0.0 ImageDetails.qml
-LikeOMeter 0.0 LikeOMeter.qml
-Loading 0.0 Loading.qml
-MediaButton 0.0 MediaButton.qml
-MediaLineEdit 0.0 MediaLineEdit.qml
-Progress 0.0 Progress.qml
-RssModel 0.0 RssModel.qml
-ScrollBar 0.0 ScrollBar.qml
-Slider 0.0 Slider.qml
-Star 0.0 Star.qml
+ImageDetails ImageDetails.qml
+LikeOMeter LikeOMeter.qml
+Loading Loading.qml
+MediaButton MediaButton.qml
+MediaLineEdit MediaLineEdit.qml
+Progress Progress.qml
+RssModel RssModel.qml
+ScrollBar ScrollBar.qml
+Slider Slider.qml
+Star Star.qml
diff --git a/demos/declarative/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
index e337c46..172fcc0 100644
--- a/demos/declarative/minehunt/MinehuntCore/Explosion.qml
+++ b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item {
property bool explode : false
diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
index 89845ef..5e44d1b 100644
--- a/demos/declarative/minehunt/minehunt.cpp
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -292,9 +292,8 @@ class MinehuntExtensionPlugin : public QDeclarativeExtensionPlugin
public:
void registerTypes(const char *uri) {
- Q_UNUSED(uri);
- QML_REGISTER_TYPE(SameGameCore, 0, 1, Tile, Tile);
- QML_REGISTER_TYPE(SameGameCore, 0, 1, Game, MinehuntGame);
+ qmlRegisterType<Tile>(uri, 0, 1, "Tile");
+ qmlRegisterType<MinehuntGame>(uri, 0, 1, "Game");
}
void initializeEngine(QDeclarativeEngine *engine, const char *uri) {
@@ -304,7 +303,7 @@ class MinehuntExtensionPlugin : public QDeclarativeExtensionPlugin
MinehuntGame* game = new MinehuntGame();
- engine->rootContext()->addDefaultObject(game);
+ engine->rootContext()->setContextObject(game);
}
};
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
new file mode 100644
index 0000000..d71834e
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -0,0 +1,91 @@
+import Qt 4.6
+
+Component {
+ id: albumDelegate
+ Package {
+
+ Item {
+ Package.name: 'browser'
+ GridView {
+ id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21
+ x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false
+ onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain)
+ }
+ }
+
+ Item {
+ Package.name: 'fullscreen'
+ ListView {
+ id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal
+ width: mainWindow.width; height: mainWindow.height; interactive: false
+ onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
+ highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
+ }
+ }
+
+ Item {
+ Package.name: 'album'
+ id: albumWrapper
+ width: 210; height: 220
+
+ VisualDataModel {
+ id: visualModel; delegate: PhotoDelegate { }
+ model: RssModel { id: rssModel; tags: tag }
+ }
+
+ BusyIndicator {
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ on: rssModel.status != XmlListModel.Ready
+ }
+
+ PathView {
+ id: photosPathView; model: visualModel.parts.stack
+ anchors.centerIn: parent; anchors.verticalCenterOffset: -20
+ pathItemCount: 5
+ path: Path {
+ PathAttribute { name: 'z'; value: 9999.0 }
+ PathLine { x: 1; y: 1 }
+ PathAttribute { name: 'z'; value: 0.0 }
+ }
+ }
+
+ Tag {
+ anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom
+ label: tag; rotation: Math.random() * (2 * 6 + 1) - 6
+ }
+
+ MouseArea { anchors.fill: parent; onClicked: albumWrapper.state = 'inGrid' }
+
+ states: [
+ State {
+ name: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: true }
+ PropertyChanges { target: albumsShade; opacity: 1 }
+ PropertyChanges{ target: backTag; onClicked: albumWrapper.state = ''; y: 6 }
+ },
+ State {
+ name: 'fullscreen'; extend: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: false }
+ PropertyChanges { target: photosListView; interactive: true }
+ PropertyChanges { target: photosShade; opacity: 1 }
+ PropertyChanges{ target: backTag; y: -backTag.height - 8 }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: '*'; to: 'inGrid'
+ SequentialAnimation {
+ NumberAnimation { properties: 'opacity'; duration: 250 }
+ PauseAnimation { duration: 350 }
+ NumberAnimation { target: backTag; properties: "y"; duration: 200; easing.type: "OutQuad" }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: '*'
+ NumberAnimation { properties: "y,opacity"; easing.type: "OutQuad"; duration: 300 }
+ }
+ ]
+ }
+ }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml
new file mode 100644
index 0000000..919ac43
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/BusyIndicator.qml
@@ -0,0 +1,9 @@
+import Qt 4.6
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+ NumberAnimation on rotation { running: container.on; from: 0; to: 360; repeat: true; duration: 1200 }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
new file mode 100644
index 0000000..89fe3e8
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/PhotoDelegate.qml
@@ -0,0 +1,142 @@
+import Qt 4.6
+
+Package {
+ Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z }
+ Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 }
+ Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 }
+
+ Item {
+ width: 160; height: 153
+
+ Item {
+ id: photoWrapper
+
+ property double randomAngle: Math.random() * (2 * 6 + 1) - 6
+ property double randomAngle2: Math.random() * (2 * 6 + 1) - 6
+
+ x: 0; y: 0; width: 140; height: 133
+ z: stackItem.PathView.z; rotation: photoWrapper.randomAngle
+
+ BorderImage {
+ anchors {
+ fill: border.visible ? border : placeHolder
+ leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8
+ }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+ Rectangle {
+ id: placeHolder
+
+ property int w: getWidth(content)
+ property int h: getHeight(content)
+ property double s: calculateScale(w, h, photoWrapper.width)
+
+ color: '#878787'; anchors.centerIn: parent; smooth: true; border.color: 'white'; border.width: 3
+ width: w * s; height: h * s; visible: originalImage.status != Image.Ready
+ }
+ Rectangle {
+ id: border; color: 'white'; anchors.centerIn: parent; smooth: true
+ width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6
+ visible: !placeHolder.visible
+ }
+ BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
+ Image {
+ id: originalImage; smooth: true; source: "http://" + getImagePath(content)
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Image {
+ id: hqImage; smooth: true; source: ""; visible: false
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Binding {
+ target: mainWindow; property: "downloadProgress"; value: hqImage.progress
+ when: listItem.ListView.isCurrentItem
+ }
+ Binding {
+ target: mainWindow; property: "imageLoading"
+ value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem
+ }
+ MouseArea {
+ width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage
+ onClicked: {
+ if (albumWrapper.state == 'inGrid') {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'fullscreen'
+ } else {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'inGrid'
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: 'stacked'; when: albumWrapper.state == ''
+ ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 }
+ PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 }
+ },
+ State {
+ name: 'inGrid'; when: albumWrapper.state == 'inGrid'
+ ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 }
+ },
+ State {
+ name: 'fullscreen'; when: albumWrapper.state == 'fullscreen'
+ ParentChange {
+ target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0
+ width: mainWindow.width; height: mainWindow.height
+ }
+ PropertyChanges { target: border; opacity: 0 }
+ PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: 'stacked'; to: 'inGrid'
+ SequentialAnimation {
+ PauseAnimation { duration: 10 * index }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'stacked'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'fullscreen'
+ SequentialAnimation {
+ PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,opacity,rotation'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'fullscreen'; to: 'inGrid'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,rotation,opacity'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml b/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml
new file mode 100644
index 0000000..bd6b30f
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/ProgressBar.qml
@@ -0,0 +1,16 @@
+import Qt 4.6
+
+Item {
+ id: container
+
+ property real progress: 0
+
+ Behavior on opacity { NumberAnimation { duration: 600 } }
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.5 }
+
+ Rectangle {
+ id: fill; color: "white"; height: container.height
+ width: container.width * container.progress
+ }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml b/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml
new file mode 100644
index 0000000..ddbc02b
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/RssModel.qml
@@ -0,0 +1,13 @@
+import Qt 4.6
+
+XmlListModel {
+ property string tags : ""
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "content"; query: "content/string()" }
+ XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml b/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml
new file mode 100644
index 0000000..ee11d05
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/Tag.qml
@@ -0,0 +1,22 @@
+import Qt 4.6
+
+Item {
+ id: container
+
+ property alias label: labelText.text
+ signal clicked
+
+ width: labelText.width + 70 ; height: labelText.height + 18
+
+ BorderImage {
+ anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+ Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
+ Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true }
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: container.clicked()
+ }
+}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/images/box-shadow.png b/demos/declarative/photoviewer/PhotoViewerCore/images/box-shadow.png
new file mode 100644
index 0000000..431af85
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/images/box-shadow.png
Binary files differ
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png b/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png
new file mode 100644
index 0000000..664c2b1
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/images/busy.png
Binary files differ
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/images/cardboard.png b/demos/declarative/photoviewer/PhotoViewerCore/images/cardboard.png
new file mode 100644
index 0000000..1847ab5
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/images/cardboard.png
Binary files differ
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/qmldir b/demos/declarative/photoviewer/PhotoViewerCore/qmldir
new file mode 100644
index 0000000..4821faa
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/qmldir
@@ -0,0 +1,6 @@
+AlbumDelegate AlbumDelegate.qml
+PhotoDelegate PhotoDelegate.qml
+ProgressBar ProgressBar.qml
+RssModel RssModel.qml
+Tag Tag.qml
+BusyIndicator BusyIndicator.qml
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/script/script.js b/demos/declarative/photoviewer/PhotoViewerCore/script/script.js
new file mode 100644
index 0000000..ae24ea1
--- /dev/null
+++ b/demos/declarative/photoviewer/PhotoViewerCore/script/script.js
@@ -0,0 +1,25 @@
+function getWidth(string) {
+ return (string.match(/width=\"([0-9]+)\"/))[1]
+}
+
+function getHeight(string) {
+ return (string.match(/height=\"([0-9]+)\"/))[1]
+}
+
+function getImagePath(string) {
+ var pattern = /src=\"http:\/\/(\S+)\"/
+ return (string.match(pattern))[1]
+}
+
+function calculateScale(width, height, cellSize) {
+ var widthScale = (cellSize * 1.0) / width
+ var heightScale = (cellSize * 1.0) / height
+ var scale = 0
+
+ if (widthScale <= heightScale) {
+ scale = widthScale;
+ } else if (heightScale < widthScale) {
+ scale = heightScale;
+ }
+ return scale;
+}
diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml
new file mode 100644
index 0000000..5ce02f3
--- /dev/null
+++ b/demos/declarative/photoviewer/photoviewer.qml
@@ -0,0 +1,47 @@
+import Qt 4.6
+import PhotoViewerCore 1.0
+
+Rectangle {
+ id: mainWindow
+
+ property real downloadProgress: 0
+ property bool imageLoading: false
+
+ width: 800; height: 480; color: "#d5d6d8"
+
+ Script { source: "PhotoViewerCore/script/script.js" }
+
+ ListModel {
+ id: photosModel
+ ListElement { tag: "Flowers" }
+ ListElement { tag: "Savanna" }
+ ListElement { tag: "Central Park" }
+ }
+
+ VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} }
+
+ GridView {
+ width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220; model: albumVisualModel.parts.album
+ visible: albumsShade.opacity != 1.0
+ }
+
+ Rectangle {
+ id: albumsShade; color: mainWindow.color
+ width: parent.width; height: parent.height; opacity: 0.0
+ }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false }
+
+ Tag { id: backTag; label: "Back"; rotation: 3; x: parent.width - backTag.width - 6; y: -backTag.height - 8 }
+
+ Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false }
+
+ Item { id: foreground; anchors.fill: parent }
+
+ ProgressBar {
+ progress: mainWindow.downloadProgress; width: parent.width; height: 4
+ anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0
+ }
+}
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
index e48194a..b14531d 100644
--- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item { id:block
property bool dying: false
diff --git a/demos/declarative/samegame/SamegameCore/qmldir b/demos/declarative/samegame/SamegameCore/qmldir
index a8f8a98..e17b1f5 100644
--- a/demos/declarative/samegame/SamegameCore/qmldir
+++ b/demos/declarative/samegame/SamegameCore/qmldir
@@ -1,3 +1,3 @@
-BoomBlock 0.0 BoomBlock.qml
-Button 0.0 Button.qml
-Dialog 0.0 Dialog.qml
+BoomBlock BoomBlock.qml
+Button Button.qml
+Dialog Dialog.qml
diff --git a/demos/declarative/snake/content/Cookie.qml b/demos/declarative/snake/content/Cookie.qml
index 0ea95cb..b64987e 100644
--- a/demos/declarative/snake/content/Cookie.qml
+++ b/demos/declarative/snake/content/Cookie.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item {
id: root
diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml
index 31ac4b9..4171247 100644
--- a/demos/declarative/snake/content/Link.qml
+++ b/demos/declarative/snake/content/Link.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item { id:link
property bool dying: false
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index f9d02c7..317c7de 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -1,5 +1,5 @@
import Qt 4.6
-import "content"
+import "content" as Content
Rectangle {
id: screen;
@@ -27,7 +27,7 @@ Rectangle {
property var head;
- HighScoreModel {
+ Content.HighScoreModel {
id: highScores
game: "Snake"
}
@@ -46,7 +46,7 @@ Rectangle {
onTriggered: { moveSkull() }
}
Timer {
- id: startNewGameTimer;
+
interval: 700;
onTriggered: {startNewGame(); }
}
@@ -97,7 +97,7 @@ Rectangle {
height: numRowsAvailable * gridSize + 2*margin
- Skull {
+ Content.Skull {
id: skull
}
@@ -148,7 +148,7 @@ Rectangle {
height: 32; width: parent.width
anchors.bottom: screen.bottom
- Button {
+ Content.Button {
id: btnA; text: "New Game"; onClicked: {startNewGame();}
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
index 94c94f2..46dbc98 100644
--- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
+++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
@@ -18,7 +18,7 @@ Image {
anchors.top: header.top
anchors.topMargin: 4
- anchors.horizontalCenter: parent.horizontalCenter
+ x: parent.width > headerIcon.width+headerText.width+6 ? (parent.width-headerIcon.width-headerText.width-6)/2 : 0
spacing: 6
Image {
@@ -30,8 +30,6 @@ Image {
id: headerText
text: webView.title!='' || webView.progress == 1.0 ? webView.title : 'Loading...'
- elide: Text.ElideRight
- //width: parent.width - headerIcon.width-4
color: "white"
styleColor: "black"
diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
index 165ce89..e16ef66 100644
--- a/demos/embedded/anomaly/anomaly.pro
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -27,7 +27,7 @@ symbian {
TARGET.UID3 = 0xA000CF71
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -linsock -lconnmon
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/flightinfo/flightinfo.pro b/demos/embedded/flightinfo/flightinfo.pro
index 8e5535c..7391f88 100644
--- a/demos/embedded/flightinfo/flightinfo.pro
+++ b/demos/embedded/flightinfo/flightinfo.pro
@@ -9,7 +9,7 @@ symbian {
TARGET.UID3 = 0xA000CF74
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -lconnmon -linsock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
}
diff --git a/demos/embedded/lightmaps/lightmaps.pro b/demos/embedded/lightmaps/lightmaps.pro
index c9bfa0a..ef1a0a6 100644
--- a/demos/embedded/lightmaps/lightmaps.pro
+++ b/demos/embedded/lightmaps/lightmaps.pro
@@ -6,7 +6,7 @@ symbian {
TARGET.UID3 = 0xA000CF75
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -lconnmon -linsock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/demos/embedded/weatherinfo/weatherinfo.pro b/demos/embedded/weatherinfo/weatherinfo.pro
index 57f1684..f007bbb 100644
--- a/demos/embedded/weatherinfo/weatherinfo.pro
+++ b/demos/embedded/weatherinfo/weatherinfo.pro
@@ -8,7 +8,7 @@ symbian {
TARGET.UID3 = 0xA000CF77
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -lconnmon -linsock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = NetworkServices
}
diff --git a/dist/changes-4.5.4 b/dist/changes-4.5.4
index e60e507..ac91edb 100644
--- a/dist/changes-4.5.4
+++ b/dist/changes-4.5.4
@@ -9,12 +9,12 @@ The Qt version 4.5 series is binary compatible with the 4.4.x series.
Applications compiled for 4.4 will continue to run with 4.5.
Some of the changes listed in this file include issue tracking numbers
-corresponding to tasks in the Task Tracker:
+corresponding to tasks in the Qt Bug Tracker, the (now obsolete) Task
+Tracker, or the Merge Request queue of the public source repository.
- http://qt.nokia.com/developer/task-tracker
-
-Each of these identifiers can be entered in the task tracker to obtain more
-information about a particular change.
+Qt Bug Tracker: http://bugreports.qt.nokia.com
+Task Tracker: http://qt.nokia.com/developer/task-tracker
+Merge Request: http://qt.gitorious.org
****************************************************************************
* General *
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index 4b61bd9..ed63367 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -68,7 +68,7 @@ internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo br
Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}.
QML can be be used to incrementally extend an existing application or to build
-completely new applications. QML is fully \l {Extending QML}{extensible from C++}.
+completely new applications. QML is fully \l {Extending QML in C++}{extensible from C++}.
\section1 Getting Started:
\list
@@ -100,7 +100,7 @@ completely new applications. QML is fully \l {Extending QML}{extensible from C+
\list
\o \l {QML Elements}
\o \l {QML Global Object}
-\o \l {Extending QML}
+\o \l {Extending QML in C++}
\o \l {QML Internationalization}
\o \l {QtDeclarative Module}
\o \l {Debugging QML}
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 67aadcf..0d7fe3b 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -76,6 +76,7 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l ParallelAnimation
\o \l PauseAnimation
\o \l ParentAnimation
+\o \l AnchorAnimation
\o \l PropertyAction
\o \l ParentAction
\o \l ScriptAction
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 5aaa7bd..0ae4f7d 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -41,7 +41,7 @@
/*!
\page qml-extending.html
-\title Extending QML
+\title Extending QML in C++
The QML syntax declaratively describes how to construct an in memory object
tree. In Qt, QML is mainly used to describe a visual scene graph, but it is
@@ -67,21 +67,23 @@ that derive from QObject.
The QML engine has no intrinsic knowledge of any class types. Instead the
programmer must define the C++ types, and their corresponding QML name.
-Custom C++ types are made available to QML using these two macros:
+Custom C++ types are declared QML types using a macro and a template function:
\quotation
+
\code
#define QML_DECLARE_TYPE(T)
-#define QML_REGISTER_TYPE(URI,VMAJ,VMIN,QDeclarativeName,T)
+template<typename T>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
\endcode
-Register the C++ type \a T with the QML system, and make it available in QML
-under the name \a QDeclarativeName in library URI version VMAJ.VMIN.
-\a T and \a QDeclarativeName may be the same.
+Calling qmlRegisterType() registers the C++ type \a T with the QML system, and makes it available in QML
+under the name \a qmlName in library \a uri version \a versionMajor.versionMinor.
+The \a qmlName can be the same as the C++ type name.
Generally the QML_DECLARE_TYPE() macro should be included immediately following
-the type declaration (usually in its header file), and the QML_REGISTER_TYPE()
-macro called by the implementation.
+the type declaration (usually in its header file), and the template function qmlRegisterType()
+called by the implementation.
Type \a T must be a concrete type that inherits QObject and has a default
constructor.
@@ -147,19 +149,20 @@ property can be assigned.
QML also supports assigning Qt interfaces. To assign to a property whose type
is a Qt interface pointer, the interface must also be registered with QML. As
they cannot be instantiated directly, registering a Qt interface is different
-from registering a new QML type. The following macros are used instead:
+from registering a new QML type. The following macro and function are used instead:
\quotation
\code
- #define QML_DECLARE_INTERFACE(T)
- #define QML_REGISTER_INTERFACE(T)
+#define QML_DECLARE_INTERFACE(T)
+template<typename T>
+int qmlRegisterInterface(const char *typeName)
\endcode
-Register the C++ interface \a T with the QML system.
+Registers the C++ interface \a T with the QML system as \a typeName.
Generally the QML_DECLARE_INTERFACE() macro should be included immediately
following the interface declaration (usually in its header file), and the
-QML_REGISTER_INTERFACE() macro called by the implementation.
+qmlRegisterInterface() template function called by the implementation.
Following registration, QML can coerce objects that implement this interface
for assignment to appropriately typed properties.
@@ -174,7 +177,7 @@ The guest property declaration looks like this:
\snippet examples/declarative/extending/properties/birthdayparty.h 2
-\l {Extending QML - Object and List Property Types Example} shows the complete
+\l {Extending QML in C++ - Object and List Property Types Example} shows the complete
code used to create the \c BirthdayParty type.
\section1 Inheritance and Coercion
@@ -192,25 +195,26 @@ type used in the previous section, but the assignment is valid as both the Boy
and Girl objects inherit from Person.
To assign to a property, the property's type must have been registered with QML.
-Both the QML_REGISTER_TYPE() and QML_REGISTER_INTERFACE() macros already shown can
-be used to register a type with QML. Additionally, if a type that acts purely
+Both the qmlRegisterType() and qmlRegisterInterface() template functions already
+shown can be used to register a type with QML. Additionally, if a type that acts purely
as a base class that cannot be instantiated from QML needs to be
-registered these macros can be used:
+registered these macro and function can be used:
\quotation
\code
#define QML_DECLARE_TYPE(T)
- #define QML_REGISTER_NOCREATE_TYPE(T)
+ template<typename T>
+ int qmlRegisterType()
\endcode
-Register the C++ type \a T with the QML system. QML_REGISTER_NOCREATE_TYPE()
-differs from QML_REGISTER_TYPE() in that it does not define a mapping between the
+Registers the C++ type \a T with the QML system. The parameterless call to the template
+function qmlRegisterType() does not define a mapping between the
C++ class and a QML element name, so the type is not instantiable from QML, but
it is available for type coercion.
Generally the QML_DECLARE_TYPE() macro should be included immediately following
the type declaration (usually in its header file), and the
-QML_REGISTER_NOCREATE_TYPE() macro called from the implementation.
+qmlRegisterType() template function called from the implementation.
Type \a T must inherit QObject, but there are no restrictions on whether it is
concrete or the signature of its constructor.
@@ -220,7 +224,7 @@ QML will automatically coerce C++ types when assigning to either an object
property, or to a list property. Only if coercion fails does an assignment
error occur.
-\l {Extending QML - Inheritance and Coercion Example} shows the complete
+\l {Extending QML in C++ - Inheritance and Coercion Example} shows the complete
code used to create the \c Boy and \c Girl types.
\section1 Default Property
@@ -252,7 +256,7 @@ refer to a property declared in the class itself, or a property inherited from a
base class.
\endquotation
-\l {Extending QML - Default Property Example} shows the complete code used to
+\l {Extending QML in C++ - Default Property Example} shows the complete code used to
specify a default property.
\section1 Grouped Properties
@@ -277,7 +281,7 @@ property block - in this case the size, color, brand and price properties.
Grouped property blocks may declared and accessed be recusively.
-\l {Extending QML - Grouped Properties Example} shows the complete code used to
+\l {Extending QML in C++ - Grouped Properties Example} shows the complete code used to
implement the \c shoe property grouping.
\section1 Attached Properties
@@ -369,7 +373,7 @@ creating it if it does not already exist. If \a create is false, the attachment
object will only be returned if it has previously been created.
\endquotation
-\l {Extending QML - Attached Properties Example} shows the complete code used to
+\l {Extending QML in C++ - Attached Properties Example} shows the complete code used to
implement the rsvp attached property.
\section1 Memory Management and QVariant types
@@ -431,7 +435,7 @@ listed in \l {Adding Types}, as well registered object types are permitted as
signal parameter types. Using other types is not an error, but the parameter
value will not be accessible from script.
-\l {Extending QML - Signal Support Example} shows the complete code used to
+\l {Extending QML in C++ - Signal Support Example} shows the complete code used to
implement the onPartyStarted signal property.
\section1 Property Value Sources
@@ -478,7 +482,7 @@ to assign it normally, as though it were a regular QML type. Only if this
assignment fails does the engine call the setTarget() method. This allows
the type to also be used in contexts other than just as a value source.
-\l {Extending QML - Property Value Source Example} shows the complete code used
+\l {Extending QML in C++ - Property Value Source Example} shows the complete code used
implement the HappyBirthday property value source.
\section1 Property Binding
@@ -550,7 +554,7 @@ The CONSTANT attribute should only be used for properties whose value is set,
and finalized, only in the class constructor. All other properties that want
to be used in bindings should have a NOTIFY signal instead.
-\l {Extending QML - Binding Example} shows the BirthdayParty example updated to
+\l {Extending QML in C++ - Binding Example} shows the BirthdayParty example updated to
include NOTIFY signals for use in binding.
\section1 Extension Objects
@@ -623,7 +627,7 @@ public:
\title Extending types from QML
Many of the elements available for use in QML are implemented in
-\l {Extending QML}{C++}. These types are know as "core types". QML
+\l {Extending QML in C++}{C++}. These types are know as "core types". QML
allows programmers to build new, fully functional elements without using C++.
Existing core types can be extended, and new types defined entirely in the QML
language.
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index 4b1c7d3..9f6be12 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -182,18 +182,6 @@ This function returns a color 50% darker than \c baseColor. See QColor::darker()
\image declarative-rect_tint.png
Tint is most useful when a subtle change is intended to be conveyed due to some event; you can then use tinting to more effectively tune the visible color.
-\section3 Qt.closestAngle(number fromAngle, number toAngle)
-This function returns an equivalent angle to toAngle, such that the difference between fromAngle and toAngle is never more than 180 degrees. This is useful when animating angles using a NumberAnimation, which does not know about equivalent angles, when you always want to take the shortest path.
-
-For example, the following would rotate myItem counterclockwise from 350 degrees to 10 degrees, for a total of 340 degrees of rotation.
-\qml
-NumberAnimation { target: myItem; property: "rotation"; from: 350; to: 10 }
-\endqml
-
-while the following would rotate myItem clockwise from 350 degrees to 370 degrees (which is visually equivilant to 10 degrees), for a total of 20 degrees of rotation.
-\qml
-NumberAnimation { target: myItem; property: "rotation"; from: 350; to: Qt.closetAngle(350, 10) }
-\endqml
\section3 Qt.openUrlExternally(url target)
This function attempts to open the specified \c target url in an external application, based on the user's desktop preferences. It will return true if it succeeds, and false otherwise.
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index c0e028e..e80824d 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -191,6 +191,23 @@ will be positioned by the view.
\section2 QAbstractItemModel
QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNames() method.
+The default role names set by Qt are:
+
+\table
+\header
+\o Qt Role
+\o QML Role Name
+\row
+\o Qt::DisplayRole
+\o display
+\row
+\o Qt::DecorationRole
+\o decoration
+\endtable
+
+QAbstractItemModel presents a heirachy of tables. Views currently provided by QML
+can only display list data. In order to display child lists of a heirachical model
+use the VisualDataModel element with \e rootIndex set to a parent node.
\section2 QStringList
@@ -198,9 +215,6 @@ QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNam
QStringList provides the contents of the list via the \e modelData role:
\table
-\header
-\o
-\o
\row
\o
\code
@@ -208,7 +222,7 @@ QStringList provides the contents of the list via the \e modelData role:
QStringList dataList;
dataList.append("Fred");
dataList.append("Ginger");
-dataList.appenf("Skipper");
+dataList.append("Skipper");
QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(&dataList));
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 41d6338..b43d0ec 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -65,3 +65,51 @@ For more information on the Qt Declarative module, see the
\l{declarativeui.html}{Declarative UI} documentation.
*/
+
+
+/*!
+ \macro QML_DECLARE_TYPE(T)
+ \relates QDeclarativeEngine
+
+ yada yada yada
+
+*/
+
+
+/*!
+ \fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+ \relates QDeclarativeEngine
+
+ This template function registers the C++ type \a T with the QML system, and make it available in
+ QML under the name \a qmlName in the import library \a uri version \a versionMajor.versionMajor.
+
+ Returns the QML type id.
+
+ Example: Register the C++ class \c MinehuntGame as QML type \c Game version 0.1 in the import
+ library \c MinehuntCore:
+
+ \code
+ qmlRegisterType<MinehuntGame>("MinehuntCore", 0, 1, "Game");
+ \endcode
+
+*/
+
+/*!
+ \fn int qmlRegisterType()
+ \relates QDeclarativeEngine
+ \overload
+
+ This template function registers the C++ type \a T with the QML system. Instances of this type cannot
+ be created from the QML system.
+
+ Returns the QML type id.
+*/
+
+/*! \fn int qmlRegisterInterface(const char *typeName)
+ \relates QDeclarativeEngine
+
+ This template function registers the C++ type \a T as interface with the QML system, under the name
+ \a typeName.
+
+ Returns the QML type id.
+ */
diff --git a/doc/src/development/developing-on-mac.qdoc b/doc/src/development/developing-on-mac.qdoc
index 20eefb7..1eb829e 100644
--- a/doc/src/development/developing-on-mac.qdoc
+++ b/doc/src/development/developing-on-mac.qdoc
@@ -72,10 +72,10 @@
Carbon Qt can be developed on and deployed to 10.4, but there is no 64-bit
support.
- With Qt 4.7 we now reccommend using the Cocoa version of Qt for developement,
+ With Qt 4.7 we now recommend using the Cocoa version of Qt for development,
unless you want to target the 10.4 platform. Qt now uses Cocoa by default,
both for the binary package and when configuring from source. Download the
- Carbon binarypackages or configure with "-carbon" to use that version.
+ Carbon binary packages or configure with "-carbon" to use that version.
There are two versions of the Qt binary, one with x86 and x86_64
Cocoa and another with x86 and ppc Carbon. If you want a different setup
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index b17e255..8e1d970 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -2884,9 +2884,9 @@ For example:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 144
- This will add the specified statement to the end of the generated
- registration resource file. As an impact of this statement, the application
- will not be visible in application shell.
+ This will add the specified statement to the end of the \c APP_REGISTRATION_INFO
+ resource struct in the generated registration resource file.
+ As an impact of this statement, the application will not be visible in application shell.
It is also possible to add multiple rows in a single block. Each double
quoted string will be placed on a new row in the registration resource file.
@@ -2899,16 +2899,36 @@ For example:
platform application shell. In addition it will make the application to
be launched in background.
- For detailed list of possible RSS statements, please refer to the
- Symbian platform help.
+ For detailed list of possible \c APP_REGISTRATION_INFO statements, please refer to the
+ Symbian platform help.
\note You should not use \c RSS_RULES variable to set the following RSS statements:
-
- app_file
- localisable_resource_file
- localisable_resource_id
+ \c app_file, \c localisable_resource_file, and \c localisable_resource_id.
+
+ These statements are internally handled by qmake.
+
+ There is a number of special modifiers you can attach to \c RSS_RULES to specify where
+ in the application registration file the rule will be written:
+
+ \table
+ \header \o Modifier \o Location of the rule
+ \row \o <no modifier> \o Inside \c APP_REGISTRATION_INFO resource struct.
+ \row \o .header \o Before \c APP_REGISTRATION_INFO resource struct.
+ \row \o .footer \o After \c APP_REGISTRATION_INFO resource struct.
+ \row \o .service_list \o Inside a \c SERVICE_INFO item in the \c service_list
+ of \c APP_REGISTRATION_INFO
+ \row \o .file_ownership_list \o Inside a \c FILE_OWNERSHIP_INFO item in the
+ \c file_ownership_list of \c APP_REGISTRATION_INFO
+ \row \o .datatype_list \o Inside a \c DATATYPE item in the \c datatype_list of
+ \c APP_REGISTRATION_INFO
+ \endtable
+
+ For example:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 151
- These statements are internally handled by qmake.
+ This example will define service information for a fictional service that requires
+ an icon to be supplied via the \c opaque_data of the service information.
\target S60_VERSION
\section1 S60_VERSION
diff --git a/doc/src/examples/svgalib.qdoc b/doc/src/examples/svgalib.qdoc
index cf6512c..9142112 100644
--- a/doc/src/examples/svgalib.qdoc
+++ b/doc/src/examples/svgalib.qdoc
@@ -43,9 +43,6 @@
\example qws/svgalib
\title Accelerated Graphics Driver Example
- \warning This example was designed to work with Qt 4.4 and will not work
- with current versions of Qt. It will be removed from Qt 4.7.
-
The Accelerated Graphics Driver example shows how you can write
your own accelerated graphics driver and \l {add your graphics
driver to Qt for Embedded Linux}. In \l{Qt for Embedded Linux},
diff --git a/doc/src/images/quick_screens.png b/doc/src/images/quick_screens.png
new file mode 100644
index 0000000..76b25d9
--- /dev/null
+++ b/doc/src/images/quick_screens.png
Binary files differ
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index a84ad56..578ec37 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -116,7 +116,7 @@
\o aCC 3.57, gcc 3.4
\row \o HPUXi 11.23
\o aCC 6.10
- \row \o Solaris 10 UltraSparc
+ \row \o Solaris 10 (UltraSparc, x86)
\o Sun Studio 12
\row \o AIX 6
\o Power5 xlC 7
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index c670c51..ba9821a 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -473,6 +473,8 @@
\section1 Declarative UI development with Qt Quick
+ \image quick_screens.png
+
Qt 4.7 introduces Quick, the Qt UI Creation Kit. that enables the creation
of dynamic user interfaces, easier and more effective than possible
with existing UI technologies. This UI Creation Kit consist of three
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index e8c00d3..36676ae 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -996,3 +996,8 @@ symbian {
emulator_dll.condition = WINSCW
}
//! [150]
+
+//! [151]
+RSS_RULES.service_list += "uid = 0x12345678; datatype_list = \{\}; opaque_data = r_my_icon;"
+RSS_RULES.footer +="RESOURCE CAPTION_AND_ICON_INFO r_my_icon \{ icon_file =\"$$PWD/my_icon.svg\"; \}"
+//! [151]
diff --git a/examples/animation/animatedtiles/animatedtiles.pro b/examples/animation/animatedtiles/animatedtiles.pro
index 1840b17..d700642 100644
--- a/examples/animation/animatedtiles/animatedtiles.pro
+++ b/examples/animation/animatedtiles/animatedtiles.pro
@@ -6,3 +6,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/animatedtiles
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS animatedtiles.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/animatedtiles
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000D7D1
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/appchooser/appchooser.pro b/examples/animation/appchooser/appchooser.pro
index 847b60a..7d45da2 100644
--- a/examples/animation/appchooser/appchooser.pro
+++ b/examples/animation/appchooser/appchooser.pro
@@ -6,3 +6,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/appchooser
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS appchooser.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/appchooser
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F5
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/easing/easing.pro b/examples/animation/easing/easing.pro
index 8e8a35f..a8eda70 100644
--- a/examples/animation/easing/easing.pro
+++ b/examples/animation/easing/easing.pro
@@ -12,3 +12,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS easing.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/easing
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F6
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/moveblocks/moveblocks.pro b/examples/animation/moveblocks/moveblocks.pro
index b8e88b2..0a32ecf 100644
--- a/examples/animation/moveblocks/moveblocks.pro
+++ b/examples/animation/moveblocks/moveblocks.pro
@@ -5,3 +5,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/moveblocks
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS moveblocks.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/moveblocks
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F7
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/states/states.pro b/examples/animation/states/states.pro
index f4d1e0b..9d9a9c1 100644
--- a/examples/animation/states/states.pro
+++ b/examples/animation/states/states.pro
@@ -6,3 +6,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/states
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS states.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/states
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F8
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/animation/stickman/stickman.pro b/examples/animation/stickman/stickman.pro
index 487ff3a..37ff8d3 100644
--- a/examples/animation/stickman/stickman.pro
+++ b/examples/animation/stickman/stickman.pro
@@ -17,3 +17,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/animation/stickman
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS stickman.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/animation/stickman
INSTALLS += target sources
+
+symbian {
+ TARGET.UID3 = 0xA000E3F9
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animations/color-animation.qml
index 6740522..025134b 100644
--- a/examples/declarative/animations/color-animation.qml
+++ b/examples/declarative/animations/color-animation.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item {
id: window
diff --git a/examples/declarative/colorbrowser/colorbrowser.qml b/examples/declarative/colorbrowser/colorbrowser.qml
index 421ae07..d4c21e7 100644
--- a/examples/declarative/colorbrowser/colorbrowser.qml
+++ b/examples/declarative/colorbrowser/colorbrowser.qml
@@ -16,7 +16,7 @@ Rectangle {
GridView {
id: gridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height
cellWidth: 160; cellHeight: 160; interactive: false
- onCurrentIndexChanged: listView.positionViewAtIndex(currentIndex)
+ onCurrentIndexChanged: listView.positionViewAtIndex(currentIndex, ListView.Contain)
}
}
@@ -25,7 +25,7 @@ Rectangle {
ListView {
id: listView; model: visualModel.parts.list; orientation: Qt.Horizontal
width: mainWindow.width; height: mainWindow.height; interactive: false
- onCurrentIndexChanged: gridView.positionViewAtIndex(currentIndex)
+ onCurrentIndexChanged: gridView.positionViewAtIndex(currentIndex, GridView.Contain)
highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
}
}
diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml
index 6af3e81..7de4d38 100644
--- a/examples/declarative/dynamic/dynamic.qml
+++ b/examples/declarative/dynamic/dynamic.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
import "qml"
Item {
diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/extending/adding/main.cpp
index 76e0736..b9e5aa3 100644
--- a/examples/declarative/extending/adding/main.cpp
+++ b/examples/declarative/extending/adding/main.cpp
@@ -48,7 +48,7 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, Person, Person);
+ qmlRegisterType<Person>("People", 1,0, "Person");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/extending/attached/main.cpp
index 684d8d3..fd2d525 100644
--- a/examples/declarative/extending/attached/main.cpp
+++ b/examples/declarative/extending/attached/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/binding/main.cpp b/examples/declarative/extending/binding/main.cpp
index 873f8c9..ce6c50d 100644
--- a/examples/declarative/extending/binding/main.cpp
+++ b/examples/declarative/extending/binding/main.cpp
@@ -49,14 +49,13 @@
int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
-
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, HappyBirthday, HappyBirthday);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthday>("People", 1,0, "HappyBirthday");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/coercion/main.cpp b/examples/declarative/extending/coercion/main.cpp
index 1e2209f..312aff9 100644
--- a/examples/declarative/extending/coercion/main.cpp
+++ b/examples/declarative/extending/coercion/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
// ![0]
- QML_REGISTER_NOCREATE_TYPE(Person);
+ qmlRegisterType<Person>();
// ![0]
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/default/main.cpp b/examples/declarative/extending/default/main.cpp
index 7d7f8a1..06282ad 100644
--- a/examples/declarative/extending/default/main.cpp
+++ b/examples/declarative/extending/default/main.cpp
@@ -49,10 +49,10 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/extended/main.cpp b/examples/declarative/extending/extended/main.cpp
index 5cbeea3..ca7242d 100644
--- a/examples/declarative/extending/extended/main.cpp
+++ b/examples/declarative/extending/extended/main.cpp
@@ -49,7 +49,7 @@ int main(int argc, char ** argv)
{
QApplication app(argc, argv);
- QML_REGISTER_EXTENDED_TYPE(People, 1,0, QLineEdit, QLineEdit, LineEditExtension);
+ qmlRegisterExtendedType<QLineEdit, LineEditExtension>("People", 1,0, "QLineEdit");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/grouped/main.cpp b/examples/declarative/extending/grouped/main.cpp
index 15a0bb5..b383a8b 100644
--- a/examples/declarative/extending/grouped/main.cpp
+++ b/examples/declarative/extending/grouped/main.cpp
@@ -49,11 +49,11 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/extending/properties/main.cpp
index ce69ad2..350f8bd 100644
--- a/examples/declarative/extending/properties/main.cpp
+++ b/examples/declarative/extending/properties/main.cpp
@@ -49,8 +49,8 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, Person, Person);
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<Person>("People", 1,0, "Person");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/signal/main.cpp b/examples/declarative/extending/signal/main.cpp
index afc1a66..1b23a46 100644
--- a/examples/declarative/extending/signal/main.cpp
+++ b/examples/declarative/extending/signal/main.cpp
@@ -49,12 +49,12 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/extending/valuesource/main.cpp b/examples/declarative/extending/valuesource/main.cpp
index 873f8c9..2574917 100644
--- a/examples/declarative/extending/valuesource/main.cpp
+++ b/examples/declarative/extending/valuesource/main.cpp
@@ -50,13 +50,13 @@ int main(int argc, char ** argv)
{
QCoreApplication app(argc, argv);
- QML_REGISTER_NOCREATE_TYPE(BirthdayPartyAttached);
- QML_REGISTER_TYPE(People, 1,0, BirthdayParty, BirthdayParty);
- QML_REGISTER_TYPE(People, 1,0, HappyBirthday, HappyBirthday);
- QML_REGISTER_NOCREATE_TYPE(ShoeDescription);
- QML_REGISTER_NOCREATE_TYPE(Person);
- QML_REGISTER_TYPE(People, 1,0, Boy, Boy);
- QML_REGISTER_TYPE(People, 1,0, Girl, Girl);
+ qmlRegisterType<BirthdayPartyAttached>();
+ qmlRegisterType<BirthdayParty>("People", 1,0, "BirthdayParty");
+ qmlRegisterType<HappyBirthday>("People", 1,0, "HappyBirthday");
+ qmlRegisterType<ShoeDescription>();
+ qmlRegisterType<Person>();
+ qmlRegisterType<Boy>("People", 1,0, "Boy");
+ qmlRegisterType<Girl>("People", 1,0, "Girl");
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine, ":example.qml");
diff --git a/examples/declarative/imageprovider/imageprovider.cpp b/examples/declarative/imageprovider/imageprovider.cpp
index 253dbf5..011a63b 100644
--- a/examples/declarative/imageprovider/imageprovider.cpp
+++ b/examples/declarative/imageprovider/imageprovider.cpp
@@ -104,4 +104,5 @@ public:
#include "imageprovider.moc"
Q_EXPORT_PLUGIN(ImageProviderExtensionPlugin);
+//![0]
diff --git a/examples/declarative/imageprovider/imageprovider.qml b/examples/declarative/imageprovider/imageprovider.qml
index f899b1e..a1f2794 100644
--- a/examples/declarative/imageprovider/imageprovider.qml
+++ b/examples/declarative/imageprovider/imageprovider.qml
@@ -1,5 +1,5 @@
import Qt 4.6
-import "ImageProviderCore"
+import ImageProviderCore 1.0
//![0]
ListView {
width: 100
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
index 9ef455a..a6ef62c 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item { id:block
property int type: 0
diff --git a/examples/examples.pro b/examples/examples.pro
index 8941eae..ec5cc5f9 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -36,6 +36,8 @@ symbian: SUBDIRS = \
mainwindows \
sql \
uitools \
+ animation \
+ gestures \
xml
contains(QT_CONFIG, multimedia) {
diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro
index 8c947e4..5365558 100644
--- a/examples/gestures/imagegestures/imagegestures.pro
+++ b/examples/gestures/imagegestures/imagegestures.pro
@@ -14,3 +14,8 @@ sources.files = $$SOURCES \
sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
INSTALLS += target \
sources
+
+symbian {
+ TARGET.UID3 = 0xA000D7D0
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index c9dc39a..2b65f2f 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -12,7 +12,7 @@ INSTALLS += target sources
symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index 4dbc2e8..acb285b 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -13,7 +13,7 @@ symbian {
TARGET.UID3 = 0xA000CF71
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
TARGET.CAPABILITY = "All -TCB"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 16c11e3..7438641 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -21,7 +21,8 @@ INSTALLS += target sources
symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -lconnmon -lcharconv -linsock
+ LIBS += -lesock -lcommdb -linsock # For IAP selection
+ LIBS += -lcharconv
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
diff --git a/examples/qws/svgalib/README b/examples/qws/svgalib/README
index 0b2831f..227c066 100644
--- a/examples/qws/svgalib/README
+++ b/examples/qws/svgalib/README
@@ -1,5 +1,9 @@
-This is the SVGA screen driver plugin example from Qt 4.4. The code does
-not compile with Qt 4.5, because the internal graphics engine has changed.
+This is the SVGA screen driver plugin example for QWS.
-This is unsupported code, provided for convenience in case there is
-interest in porting it to Qt 4.5.
+You may need to set the SVGALIB_DEFAULT_MODE environment
+variable. These values have been confirmed to work on one specific
+machine using svgalib 1.4.3: 18, 24, 34, 35, 36
+
+There is a bug in the example causing missing updates in 8-bit mode
+(e.g. modes 10 and 12). Fixing this bug is left as an exercise for the
+reader.
diff --git a/examples/qws/svgalib/svgalibpaintdevice.cpp b/examples/qws/svgalib/svgalibpaintdevice.cpp
index 090311f..86613d2 100644
--- a/examples/qws/svgalib/svgalibpaintdevice.cpp
+++ b/examples/qws/svgalib/svgalibpaintdevice.cpp
@@ -48,7 +48,7 @@
SvgalibPaintDevice::SvgalibPaintDevice(QWidget *w)
: QCustomRasterPaintDevice(w)
{
- pengine = new SvgalibPaintEngine;
+ pengine = new SvgalibPaintEngine(this);
}
SvgalibPaintDevice::~SvgalibPaintDevice()
diff --git a/examples/qws/svgalib/svgalibpaintengine.cpp b/examples/qws/svgalib/svgalibpaintengine.cpp
index 8713863..59740da 100644
--- a/examples/qws/svgalib/svgalibpaintengine.cpp
+++ b/examples/qws/svgalib/svgalibpaintengine.cpp
@@ -45,7 +45,8 @@
#include <vga.h>
#include <vgagl.h>
-SvgalibPaintEngine::SvgalibPaintEngine()
+SvgalibPaintEngine::SvgalibPaintEngine(QPaintDevice *device)
+ : QRasterPaintEngine(device)
{
}
@@ -61,7 +62,7 @@ bool SvgalibPaintEngine::begin(QPaintDevice *dev)
simplePen = true;
brush = Qt::NoBrush;
simpleBrush = true;
- matrix = QMatrix();
+ matrix = QTransform();
simpleMatrix = true;
setClip(QRect(0, 0, device->width(), device->height()));
opaque = true;
@@ -81,54 +82,52 @@ bool SvgalibPaintEngine::end()
//! [1]
//! [2]
-void SvgalibPaintEngine::updateState(const QPaintEngineState &state)
+void SvgalibPaintEngine::updateState()
{
- QPaintEngine::DirtyFlags flags = state.state();
+ QRasterPaintEngineState *s = state();
- if (flags & DirtyTransform) {
- matrix = state.matrix();
+ if (s->dirty & DirtyTransform) {
+ matrix = s->matrix;
simpleMatrix = (matrix.m12() == 0 && matrix.m21() == 0);
}
- if (flags & DirtyPen) {
- pen = state.pen();
+ if (s->dirty & DirtyPen) {
+ pen = s->pen;
simplePen = (pen.width() == 0 || pen.widthF() <= 1)
&& (pen.style() == Qt::NoPen || pen.style() == Qt::SolidLine)
&& (pen.color().alpha() == 255);
}
- if (flags & DirtyBrush) {
- brush = state.brush();
+ if (s->dirty & DirtyBrush) {
+ brush = s->brush;
simpleBrush = (brush.style() == Qt::SolidPattern
|| brush.style() == Qt::NoBrush)
&& (brush.color().alpha() == 255);
}
- if (flags & DirtyClipRegion)
- setClip(state.clipRegion());
+ if (s->dirty & DirtyClipRegion)
+ setClip(s->clipRegion);
- if (flags & DirtyClipEnabled) {
- clipEnabled = state.isClipEnabled();
+ if (s->dirty & DirtyClipEnabled) {
+ clipEnabled = s->isClipEnabled();
updateClip();
}
- if (flags & DirtyClipPath) {
+ if (s->dirty & DirtyClipPath) {
setClip(QRegion());
simpleClip = false;
}
- if (flags & DirtyCompositionMode) {
- const QPainter::CompositionMode m = state.compositionMode();
+ if (s->dirty & DirtyCompositionMode) {
+ const QPainter::CompositionMode m = s->composition_mode;
sourceOver = (m == QPainter::CompositionMode_SourceOver);
}
- if (flags & DirtyOpacity)
- opaque = (state.opacity() == 256);
+ if (s->dirty & DirtyOpacity)
+ opaque = (s->opacity == 256);
- if (flags & DirtyHints)
- aliased = !(state.renderHints() & QPainter::Antialiasing);
-
- QRasterPaintEngine::updateState(state);
+ if (s->dirty & DirtyHints)
+ aliased = !(s->flags.antialiased);
}
//! [2]
diff --git a/examples/qws/svgalib/svgalibpaintengine.h b/examples/qws/svgalib/svgalibpaintengine.h
index f43d201..27b77ee 100644
--- a/examples/qws/svgalib/svgalibpaintengine.h
+++ b/examples/qws/svgalib/svgalibpaintengine.h
@@ -48,12 +48,12 @@
class SvgalibPaintEngine : public QRasterPaintEngine
{
public:
- SvgalibPaintEngine();
+ SvgalibPaintEngine(QPaintDevice *device);
~SvgalibPaintEngine();
bool begin(QPaintDevice *device);
bool end();
- void updateState(const QPaintEngineState &state);
+ void updateState();
void drawRects(const QRect *rects, int rectCount);
private:
@@ -64,7 +64,7 @@ private:
bool simplePen;
QBrush brush;
bool simpleBrush;
- QMatrix matrix;
+ QTransform matrix;
bool simpleMatrix;
QRegion clip;
bool clipEnabled;
diff --git a/examples/sql/masterdetail/masterdetail.pro b/examples/sql/masterdetail/masterdetail.pro
index 89e7e73..41a0274 100644
--- a/examples/sql/masterdetail/masterdetail.pro
+++ b/examples/sql/masterdetail/masterdetail.pro
@@ -15,4 +15,7 @@ sources.files = $$SOURCES *.h $$RESOURCES $$FORMS masterdetail.pro *.xml images
sources.path = $$[QT_INSTALL_EXAMPLES]/sql/masterdetail
INSTALLS += target sources
-symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian {
+ TARGET.UID3 = 0xA000D7CF
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
diff --git a/examples/sql/sql.pro b/examples/sql/sql.pro
index 644e2c7..331a210 100644
--- a/examples/sql/sql.pro
+++ b/examples/sql/sql.pro
@@ -5,10 +5,12 @@ SUBDIRS = drilldown
relationaltablemodel \
sqlwidgetmapper
+!wince*: SUBDIRS += masterdetail
+
!wince*:!symbian: SUBDIRS += \
querymodel \
- tablemodel \
- masterdetail
+ tablemodel
+
# install
sources.files = connection.h sql.pro README
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 9c5bcf4..b42ab6a 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -133,14 +133,17 @@ MMP_RULES += PAGED BYTEPAIRCOMPRESSTARGET
MMP_RULES += $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6
-# Legacy support requires some hardcoded stdapis paths.
INCLUDEPATH = \
$$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \
$$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \
$${EPOCROOT}epoc32/include \
$$OS_LAYER_LIBC_SYSTEMINCLUDE \
$$INCLUDEPATH
-
+
+# Ensure '.' directory is the first in include path.
+# RVCT seems to do this automatically, but WINSCW compiler does not, so add it here.
+MMP_RULES += "USERINCLUDE ."
+
# Supports S60 3.0, 3.1, 3.2 and 5.0 by default
default_deployment.pkg_prerules = \
"; Default HW/platform dependencies" \
diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf
index b790463..ebef8b2 100644
--- a/mkspecs/features/symbian/application_icon.prf
+++ b/mkspecs/features/symbian/application_icon.prf
@@ -3,7 +3,7 @@ load(data_caging_paths)
# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW
# requires the registration resource file to exist always
contains( CONFIG, no_icon ) {
- symbian:RSS_RULES ="hidden = KAppIsHidden;"
+ symbian:RSS_RULES += "hidden = KAppIsHidden;"
CONFIG -= no_icon
} else {
# There is no point in compiling the MIF icon if no_icon CONFIGS is set
diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf
index c723d8c..a55e842 100644
--- a/mkspecs/features/symbian/platform_paths.prf
+++ b/mkspecs/features/symbian/platform_paths.prf
@@ -230,33 +230,6 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility)
- # ---------------------------------------
- # Definitions to export IBY files to different folders where they will be taken
- # to ROM image
- # ---------------------------------------
-
- defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/app/$$1)
- }
- defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/mw/$$1)
- }
- defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/os/$$1)
- }
- defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/os/$$1)
- }
- defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/$$1)
- }
-
- # You need to define the following in pro-file, if you are using the stllib:
- # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
- # DEFINES *= $$STLLIB_USAGE_DEFINES
- STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
- STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
-
} else { # Old pre-SF structure
# ---------------------------------------
@@ -450,34 +423,49 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) {
OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) \
/epoc32/include/stdapis/utility
- # ---------------------------------------
- # Definitions to export IBY files to different folders where they will be taken
- # to ROM image
- # ---------------------------------------
-
- defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/app/$$1)
- }
- defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/mw/$$1)
- }
- defineReplace(CORE_OSEXT_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/osext/$$1)
- }
- defineReplace(CORE_OS_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/core/osext/$$1)
- }
- defineReplace(CORE_ADAPT_LAYER_IBY_EXPORT_PATH) {
- return(/epoc32/rom/include/$$1)
- }
-
- # You need to define the following in pro-file, if you are using the stllib:
- # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
- # DEFINES *= $$STLLIB_USAGE_DEFINES
- STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
- STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
-
}
+
+ # Definitions common to both structures
+
+ # ---------------------------------------
+ # Definitions to export IBY files to different folders where they will be taken
+ # to ROM image
+ # ---------------------------------------
+
+ defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/app/$$1)
+ }
+ defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/core/mw/$$1)
+ }
+
+ defineReplace(LANGUAGE_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/language/app/$$1)
+ }
+ defineReplace(LANGUAGE_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/language/mw/$$1)
+ }
+
+ defineReplace(CUSTOMER_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/customer/app/$$1)
+ }
+ defineReplace(CUSTOMER_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/customer/mw/$$1)
+ }
+
+ defineReplace(CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/customervariant/app/$$1)
+ }
+ defineReplace(CUSTOMER_VARIANT_MW_LAYER_IBY_EXPORT_PATH) {
+ return(/epoc32/rom/include/customervariant/mw/$$1)
+ }
+
+ # You need to define the following in pro-file, if you are using the stllib:
+ # QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS
+ # DEFINES *= $$STLLIB_USAGE_DEFINES
+ STLLIB_USAGE_CW_FLAGS = "-wchar_t on"
+ STLLIB_USAGE_DEFINES = _WCHAR_T_DECLARED
+
}
diff --git a/src/imports/webkit/webkitqmlplugin_export.h b/mkspecs/symbian-abld/qplatformdefs.h
index 974fd24..4cd0d73 100644
--- a/src/imports/webkit/webkitqmlplugin_export.h
+++ b/mkspecs/symbian-abld/qplatformdefs.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,15 +39,5 @@
**
****************************************************************************/
-#ifndef WEBKITQMLPLUGIN_EXPORT_H
-#define WEBKITQMLPLUGIN_EXPORT_H
+#include "../common/symbian/qplatformdefs.h"
-#include <QtCore/QtGlobal>
-
-#if defined WEBKITQMLPLUGIN_EXPORTS
-# define WEBKITQMLPLUGIN_EXPORT Q_DECL_EXPORT
-#else
-# define WEBKITQMLPLUGIN_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // WEBKITQMLPLUGIN_EXPORT_H
diff --git a/src/plugins/audio/symbian/symbianaudio.h b/mkspecs/symbian-sbsv2/qplatformdefs.h
index 3fc0419..4cd0d73 100644
--- a/src/plugins/audio/symbian/symbianaudio.h
+++ b/mkspecs/symbian-sbsv2/qplatformdefs.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtMultimedia module of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -39,38 +39,5 @@
**
****************************************************************************/
-#ifndef SYMBIANAUDIO_H
-#define SYMBIANAUDIO_H
+#include "../common/symbian/qplatformdefs.h"
-#include <QtCore/qnamespace.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace SymbianAudio {
-
-/**
- * Default values used by audio input and output classes, when underlying
- * DevSound instance has not yet been created.
- */
-
-const int DefaultBufferSize = 4096; // bytes
-const int DefaultNotifyInterval = 1000; // ms
-
-/**
- * Enumeration used to track state of internal DevSound instances.
- * Values are translated to the corresponding QAudio::State values by
- * SymbianAudio::Utils::stateNativeToQt.
- */
-enum State {
- ClosedState
- , InitializingState
- , ActiveState
- , IdleState
- , SuspendedState
-};
-
-} // namespace SymbianAudio
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index b15baf4..b84f0f1 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -70,6 +70,12 @@
#define RSS_RULES_BASE "RSS_RULES."
#define RSS_TAG_NBROFICONS "number_of_icons"
#define RSS_TAG_ICONFILE "icon_file"
+#define RSS_TAG_HEADER "header"
+#define RSS_TAG_SERVICE_LIST "service_list"
+#define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list"
+#define RSS_TAG_DATATYPE_LIST "datatype_list"
+#define RSS_TAG_FOOTER "footer"
+#define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag
#define MMP_TARGET "TARGET"
#define MMP_TARGETTYPE "TARGETTYPE"
@@ -192,7 +198,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
QString numberOfIcons;
QString iconFile;
- QStringList userRssRules;
+ QMap<QString, QStringList> userRssRules;
readRssRules(numberOfIcons, iconFile, userRssRules);
// Get the application translations and convert to symbian OS lang code, i.e. decical number
@@ -1418,7 +1424,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy
}
}
-void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems)
+void SymbianMakefileGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems)
{
QString filename(fixedTarget);
filename.append("_reg.rss");
@@ -1435,6 +1441,8 @@ void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems)
t << endl;
t << "#include <" << fixedTarget << ".rsg>" << endl;
t << "#include <appinfo.rh>" << endl;
+ foreach(QString item, userItems[RSS_TAG_HEADER])
+ t << item << endl;
t << endl;
t << "UID2 KUidAppRegistrationResourceFile" << endl;
t << "UID3 " << uid3 << endl << endl;
@@ -1442,16 +1450,51 @@ void SymbianMakefileGenerator::writeRegRssFile(QStringList &userItems)
t << "\t{" << endl;
t << "\tapp_file=\"" << fixedTarget << "\";" << endl;
t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl;
+
+ writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST],
+ QLatin1String(RSS_TAG_SERVICE_LIST),
+ QLatin1String("SERVICE_INFO"));
+ writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST],
+ QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST),
+ QLatin1String("FILE_OWNERSHIP_INFO"));
+ writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST],
+ QLatin1String(RSS_TAG_DATATYPE_LIST),
+ QLatin1String("DATATYPE"));
t << endl;
- foreach(QString item, userItems)
- t << "\t" << item << endl;
+ foreach(QString item, userItems[RSS_TAG_DEFAULT])
+ t << "\t" << item.replace("\n","\n\t") << endl;
t << "\t}" << endl;
+
+ foreach(QString item, userItems[RSS_TAG_FOOTER])
+ t << item << endl;
} else {
PRINT_FILE_CREATE_ERROR(filename)
}
}
+void SymbianMakefileGenerator::writeRegRssList(QTextStream &t,
+ QStringList &userList,
+ const QString &listTag,
+ const QString &listItem)
+{
+ int itemCount = userList.count();
+ if (itemCount) {
+ t << "\t" << listTag << " ="<< endl;
+ t << "\t\t{" << endl;
+ foreach(QString item, userList) {
+ t << "\t\t" << listItem << endl;
+ t << "\t\t\t{" << endl;
+ t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl;
+ t << "\t\t\t}";
+ if (--itemCount)
+ t << ",";
+ t << endl;
+ }
+ t << "\t\t}; "<< endl;
+ }
+}
+
void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile)
{
QString filename(fixedTarget);
@@ -1530,7 +1573,9 @@ void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes)
}
}
-void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules)
+void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons,
+ QString &iconFile, QMap<QString,
+ QStringList> &userRssRules)
{
for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {
if (it.key().startsWith(RSS_RULES_BASE)) {
@@ -1542,14 +1587,16 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico
QStringList newValues;
QStringList values = it.value();
foreach(QString item, values) {
- // If there is no stringlist defined for a rule, use rule name directly
+ // If there is no stringlist defined for a rule, use rule value directly
// This is convenience for defining single line statements
if (project->values(item).isEmpty()) {
newValues << item;
} else {
+ QStringList itemList;
foreach(QString itemRow, project->values(item)) {
- newValues << itemRow;
+ itemList << itemRow;
}
+ newValues << itemList.join("\n");
}
}
// Verify thet there is exactly one value in RSS_TAG_NBROFICONS
@@ -1570,6 +1617,14 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico
RSS_RULES_BASE, RSS_TAG_ICONFILE);
continue;
}
+ } else if (newKey == RSS_TAG_HEADER
+ || newKey == RSS_TAG_SERVICE_LIST
+ || newKey == RSS_TAG_FILE_OWNERSHIP_LIST
+ || newKey == RSS_TAG_DATATYPE_LIST
+ || newKey == RSS_TAG_FOOTER
+ || newKey == RSS_TAG_DEFAULT) {
+ userRssRules[newKey] = newValues;
+ continue;
} else {
fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",
RSS_RULES_BASE, newKey.toLatin1().constData());
@@ -1578,15 +1633,17 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico
}
}
+ QStringList newValues;
foreach(QString item, project->values(RSS_RULES)) {
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line mmp statements
+ // If there is no stringlist defined for a rule, use rule value directly
+ // This is convenience for defining single line statements
if (project->values(item).isEmpty()) {
- userRssRules << item;
+ newValues << item;
} else {
- userRssRules << project->values(item);
+ newValues << project->values(item);
}
}
+ userRssRules[RSS_TAG_DEFAULT] << newValues;
// Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist
// or neither of them exist
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index fa55ae7..0847ee8 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -107,7 +107,10 @@ protected:
QString &checkString);
void writeHeader(QTextStream &t);
- void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList);
+ void writeBldInfContent(QTextStream& t,
+ bool addDeploymentExtension,
+ const QString &iconFile,
+ DeploymentList &depList);
static bool removeDuplicatedStrings(QStringList& stringList);
@@ -127,10 +130,15 @@ protected:
void writeCustomDefFile();
- void writeRegRssFile(QStringList &useritems);
+ void writeRegRssFile(QMap<QString, QStringList> &useritems);
+ void writeRegRssList(QTextStream &t, QStringList &userList,
+ const QString &listTag,
+ const QString &listItem);
void writeRssFile(QString &numberOfIcons, QString &iconfile);
void writeLocFile(QStringList &symbianLangCodes);
- void readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules);
+ void readRssRules(QString &numberOfIcons,
+ QString &iconFile,
+ QMap<QString, QStringList> &userRssRules);
QStringList symbianLangCodesFromTsFiles();
void fillQt2S60LangMapTable();
diff --git a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp
index f7d42cf..9c7993c 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_soft.cpp
+++ b/src/3rdparty/phonon/ds9/videorenderer_soft.cpp
@@ -45,7 +45,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#endif
#ifndef QT_NO_OPENGL
-#include <gl/gl.h>
+#include <GL/gl.h>
#ifndef GL_FRAGMENT_PROGRAM_ARB
#define GL_FRAGMENT_PROGRAM_ARB 0x8804
#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp
index 2d17bd2..c556afc 100644
--- a/src/3rdparty/phonon/mmf/utils.cpp
+++ b/src/3rdparty/phonon/mmf/utils.cpp
@@ -52,22 +52,24 @@ void MMF::Utils::panic(PanicCode code)
User::Panic(PanicCategory, code);
}
-
-static const TInt KMimePrefixLength = 6; // either "audio/" or "video/"
_LIT(KMimePrefixAudio, "audio/");
_LIT(KMimePrefixVideo, "video/");
+_LIT(KMimeSDP, "application/sdp");
+
+enum ConstantStringLengths {
+ KMimePrefixLength = 6, // either "audio/" or "video/",
+ KMimeSDPLength = 15 // "application/sdp"
+};
MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType)
{
- MediaType result = MediaTypeUnknown;
-
if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixAudio) == 0) {
- result = MediaTypeAudio;
- } else if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixVideo) == 0) {
- result = MediaTypeVideo;
- }
-
- return result;
+ return MediaTypeAudio;
+ } else if (mimeType.Left(KMimePrefixLength).Compare(KMimePrefixVideo) == 0 ||
+ mimeType.Left(KMimeSDPLength).Compare(KMimeSDP) == 0) {
+ return MediaTypeVideo;
+ } else
+ return MediaTypeUnknown;
}
QString MMF::Utils::symbianErrorToString(int errorCode)
diff --git a/src/3rdparty/phonon/waveout/mediaobject.cpp b/src/3rdparty/phonon/waveout/mediaobject.cpp
index 08af4ee..fdd81a7 100644
--- a/src/3rdparty/phonon/waveout/mediaobject.cpp
+++ b/src/3rdparty/phonon/waveout/mediaobject.cpp
@@ -70,7 +70,7 @@ namespace Phonon
}
- void CALLBACK MediaObject::WaveOutCallBack(HWAVEOUT m_hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
+ void QT_WIN_CALLBACK MediaObject::WaveOutCallBack(HWAVEOUT m_hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
{
Q_UNUSED(m_hWaveOut);
Q_UNUSED(dwInstance);
diff --git a/src/3rdparty/phonon/waveout/mediaobject.h b/src/3rdparty/phonon/waveout/mediaobject.h
index dd6b24b..bb1410a 100644
--- a/src/3rdparty/phonon/waveout/mediaobject.h
+++ b/src/3rdparty/phonon/waveout/mediaobject.h
@@ -112,7 +112,7 @@ namespace Phonon
void deleteValidWaveOutDevice();
void playBuffer(WAVEHDR *waveHeader);
- static void CALLBACK WaveOutCallBack(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
+ static void QT_WIN_CALLBACK WaveOutCallBack(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
struct {
WAVEHDR *waveHeader;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 6a2e75f..a2d5f37 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- f3110d2f94c825477afac054ed448e45d47f5670
+ 266a6c4f1938dd9edf4a8125faf91c62495e3ce2
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 61c2227..a3f70d3 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Avoid double-buffering with Qt image decoders
+
+ Pass QIODevice::Unbuffered when opening the QBuffer that
+ wraps the image data, to hint to Qt that no extra buffering
+ is needed.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::setData):
+
2010-01-14 Diego Gonzalez <diego.gonzalez@openbossa.org>
Reviewed by Kenneth Christiansen.
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index b6823dd..9bcb3e9 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -79,7 +79,7 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
QByteArray imageData = QByteArray::fromRawData(m_data->data(), m_data->size());
m_buffer = new QBuffer;
m_buffer->setData(imageData);
- m_buffer->open(QBuffer::ReadOnly);
+ m_buffer->open(QBuffer::ReadOnly | QIODevice::Unbuffered);
m_reader = new QImageReader(m_buffer, m_format);
}
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index ce71490..ca16b39 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -160,7 +160,7 @@ public:
void createMenu(QMenuBar *menuBar);
void removeMenu();
- static LRESULT CALLBACK ActiveXProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ static LRESULT QT_WIN_CALLBACK ActiveXProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
// Object registration with OLE
void registerActiveObject(IUnknown *object);
@@ -764,7 +764,7 @@ private:
};
// callback for DLL server to hook into non-Qt eventloop
-LRESULT CALLBACK axs_FilterProc(int nCode, WPARAM wParam, LPARAM lParam)
+LRESULT QT_WIN_CALLBACK axs_FilterProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (qApp && !invokeCount)
qApp->sendPostedEvents();
@@ -1350,7 +1350,7 @@ class HackWidget : public QWidget
The semantics of \a wParam and \a lParam depend on the value of \a uMsg.
*/
-LRESULT CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_CREATE) {
CREATESTRUCT *cs = (CREATESTRUCT*)lParam;
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index 17f4d91..c572e08 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -31,7 +31,7 @@ unix {
DEFINES += GNU_LIBICONV
!mac:LIBS_PRIVATE *= -liconv
- } else {
+ } else:!symbian {
# no iconv, so we put all plugins in the library
HEADERS += \
../plugins/codecs/cn/qgb18030codec.h \
@@ -52,3 +52,4 @@ unix {
../plugins/codecs/jp/qfontjpcodec.cpp
}
}
+symbian:LIBS += -lcharconv
diff --git a/src/corelib/codecs/qsimplecodec.cpp b/src/corelib/codecs/qsimplecodec.cpp
index 4cc7912..a6f5c9e 100644
--- a/src/corelib/codecs/qsimplecodec.cpp
+++ b/src/corelib/codecs/qsimplecodec.cpp
@@ -54,6 +54,7 @@ static const struct {
int mib;
quint16 values[128];
} unicodevalues[QSimpleTextCodec::numSimpleCodecs] = {
+#ifndef Q_OS_SYMBIAN
// from RFC 1489, ftp://ftp.isi.edu/in-notes/rfc1489.txt
{ "KOI8-R", { "csKOI8R", 0 }, 2084,
{ 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
@@ -288,6 +289,7 @@ static const struct {
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF} },
+#endif
{ "ISO-8859-16", { "iso-ir-226", "latin10", 0 }, 112,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
@@ -309,7 +311,7 @@ static const struct {
// next bits generated again from tables on the Unicode 3.0 CD.
// $ for a in CP* ; do (awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a) | sort | sed -e 's/#UNDEF.*$/0xFFFD/' | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done
-
+#ifndef Q_OS_SYMBIAN
{ "IBM850", { "CP850", "csPC850Multilingual", 0 }, 2009,
{ 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
@@ -344,6 +346,7 @@ static const struct {
0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
+#endif //Q_OS_SYMBIAN
{ "IBM866", { "CP866", "csIBM866", 0 }, 2086,
{ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
@@ -362,6 +365,7 @@ static const struct {
0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E,
0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0} },
+#ifndef Q_OS_SYMBIAN
{ "windows-1250", { "CP1250", 0 }, 2250,
{ 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021,
0xFFFD, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
@@ -516,6 +520,7 @@ static const struct {
0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF} },
+#endif
{ "Apple Roman", { "macintosh", "MacRoman", 0 }, -168,
{ 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1,
0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
@@ -534,8 +539,6 @@ static const struct {
0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC,
0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7} },
-
-
// This one is based on the charmap file
// /usr/share/i18n/charmaps/SAMI-WS2.gz, which is manually adapted
// to this format by Boerre Gaup <boerre@subdimension.com>
@@ -557,7 +560,7 @@ static const struct {
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} },
-
+#ifndef Q_OS_SYMBIAN
// this one is generated from the charmap file located in /usr/share/i18n/charmaps
// on most Linux distributions. The thai character set tis620 is byte by byte equivalent
// to iso8859-11, so we name it 8859-11 here, but recognise the name tis620 too.
@@ -581,6 +584,7 @@ static const struct {
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD } },
+#endif
/*
Name: hp-roman8 [HP-PCL5,RFC1345,KXS2]
MIBenum: 2004
diff --git a/src/corelib/codecs/qsimplecodec_p.h b/src/corelib/codecs/qsimplecodec_p.h
index b53eb95..57503b2 100644
--- a/src/corelib/codecs/qsimplecodec_p.h
+++ b/src/corelib/codecs/qsimplecodec_p.h
@@ -64,7 +64,11 @@ template <typename T> class QAtomicPointer;
class QSimpleTextCodec: public QTextCodec
{
public:
+#ifdef Q_OS_SYMBIAN
+ enum { numSimpleCodecs = 5 };
+#else
enum { numSimpleCodecs = 30 };
+#endif
explicit QSimpleTextCodec(int);
~QSimpleTextCodec();
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index ca5e658..4034218 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -64,6 +64,7 @@
#ifndef QT_NO_CODECS
# include "qtsciicodec_p.h"
# include "qisciicodec_p.h"
+#ifndef Q_OS_SYMBIAN
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no iconv(3) support, must build all codecs into the library
# include "../../plugins/codecs/cn/qgb18030codec.h"
@@ -77,6 +78,7 @@
# include "qfontlaocodec_p.h"
# include "../../plugins/codecs/jp/qfontjpcodec.h"
# endif
+#endif // QT_NO_SYMBIAN
#endif // QT_NO_CODECS
#include "qlocale.h"
#include "qmutex.h"
@@ -93,6 +95,11 @@
# define QT_NO_SETLOCALE
#endif
+#ifdef Q_OS_SYMBIAN
+#include "qtextcodec_symbian.cpp"
+#endif
+
+
// enabling this is not exception safe!
// #define Q_DEBUG_TEXTCODEC
@@ -537,6 +544,12 @@ static QTextCodec *checkForCodec(const QByteArray &name) {
*/
static void setupLocaleMapper()
{
+#ifdef Q_OS_SYMBIAN
+ localeMapper = QSymbianTextCodec::localeMapper;
+ if (localeMapper)
+ return;
+#endif
+
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
localeMapper = QTextCodec::codecForName("System");
#else
@@ -680,6 +693,17 @@ static void setup()
(void) createQTextCodecCleanup();
#ifndef QT_NO_CODECS
+ (void)new QTsciiCodec;
+ for (int i = 0; i < 9; ++i)
+ (void)new QIsciiCodec(i);
+
+ for (int i = 0; i < QSimpleTextCodec::numSimpleCodecs; ++i)
+ (void)new QSimpleTextCodec(i);
+
+#ifdef Q_OS_SYMBIAN
+ localeMapper = QSymbianTextCodec::init();
+#endif
+
# if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED)
// no font codecs when bootstrapping
(void)new QFontLaoCodec;
@@ -696,12 +720,8 @@ static void setup()
# endif // QT_NO_ICONV && !QT_BOOTSTRAPPED
# endif // Q_WS_X11
- (void)new QTsciiCodec;
-
- for (int i = 0; i < 9; ++i)
- (void)new QIsciiCodec(i);
-
+#ifndef Q_OS_SYMBIAN
# if defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// no asian codecs when bootstrapping, sorry
(void)new QGb18030Codec;
@@ -715,6 +735,7 @@ static void setup()
(void)new QBig5Codec;
(void)new QBig5hkscsCodec;
# endif // QT_NO_ICONV && !QT_BOOTSTRAPPED
+#endif //Q_OS_SYMBIAN
#endif // QT_NO_CODECS
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
@@ -727,17 +748,18 @@ static void setup()
(void)new QUtf32Codec;
(void)new QUtf32BECodec;
(void)new QUtf32LECodec;
+#ifndef Q_OS_SYMBIAN
(void)new QLatin15Codec;
+#endif
(void)new QLatin1Codec;
(void)new QUtf8Codec;
- for (int i = 0; i < QSimpleTextCodec::numSimpleCodecs; ++i)
- (void)new QSimpleTextCodec(i);
-
+#ifndef Q_OS_SYMBIAN
#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
// QIconvCodec depends on the UTF-16 codec, so it needs to be created last
(void) new QIconvCodec();
#endif
+#endif
if (!localeMapper)
setupLocaleMapper();
@@ -1124,6 +1146,9 @@ QList<int> QTextCodec::availableMibs()
*/
void QTextCodec::setCodecForLocale(QTextCodec *c)
{
+#ifndef QT_NO_THREAD
+ QMutexLocker locker(textCodecsMutex());
+#endif
localeMapper = c;
if (!localeMapper)
setupLocaleMapper();
diff --git a/src/corelib/codecs/qtextcodec_symbian.cpp b/src/corelib/codecs/qtextcodec_symbian.cpp
new file mode 100644
index 0000000..e4db9d7
--- /dev/null
+++ b/src/corelib/codecs/qtextcodec_symbian.cpp
@@ -0,0 +1,678 @@
+/****************************************************************************
+**
+** 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 QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtextcodec_p.h"
+
+#include <private/qcore_symbian_p.h>
+#include <QThreadStorage>
+#include <QScopedPointer>
+
+#include <charconv.h>
+
+struct QSymbianCodecInitData {
+ uint charsetId;
+ int mib;
+ const char *aliases;
+};
+
+/* This table contains the known Symbian codecs aliases. It is ordered by charsetId.
+ It is required as symbian does not provide have aliases.
+ */
+static const QSymbianCodecInitData codecsData[] = {
+ { /*268439485*/ KCharacterSetIdentifierShiftJis, 17, "Shift_JIS\0MS_Kanji\0csShiftJIS\0MS_KANJI\0SJIS\0" },
+ { /*268439486*/ KCharacterSetIdentifierGb2312, 57, "GB2312\0csGB2312\0CN-GB\0EUC-CN\0" },
+ { /*268439487*/ KCharacterSetIdentifierBig5, 2026, "Big5\0csBig5\0Big5-ETen\0CP950\0BIG-FIVE\0CN-BIG5\0" },
+ { /*268440246*/ KCharacterSetIdentifierCodePage1252, 2252, "windows-1252\0Code Page 1252\0CP1252\0MS-ANSI\0" },
+// { /*268450576*/ KCharacterSetIdentifierIso88591, 4, "ISO-8859-1\0ISO_8859-1:1987\0iso-ir-100\0ISO_8859-1\0latin1\0l1\0IBM819\0CP819\0csISOLatin1\0ISO-IR-100\0ISO8859-1\0L1\0LATIN1\0CSISOLATIN1\0" },
+ { /*268451531*/ KCharacterSetIdentifierGbk, 113, "GBK\0MS936\0windows-936\0CP936\0" },
+ { /*268451866*/ KCharacterSetIdentifierGb12345, 0, "GB12345\0" },
+ { /*268455110*/ KCharacterSetIdentifierAscii, 3, "US-ASCII\0ANSI_X3.4-1968\0iso-ir-6\0ANSI_X3.4-1986\0ISO_646.irv:1991\0ASCII\0ISO646-US\0us\0IBM367\0cp367\0csASCII\0ISO-IR-6\0ISO_646.IRV:1991\0"},
+ { /*268456062*/ KCharacterSetIdentifierIso88592, 5, "ISO-8859-2\0ISO_8859-2:1987\0iso-ir-101\0latin2\0l2\0csISOLatin2\0" },
+ { /*268456063*/ KCharacterSetIdentifierIso88594, 7, "ISO-8859-4\0ISO_8859-4:1988\0iso-ir-110\0latin4\0l4\0csISOLatin4\0" },
+ { /*268456064*/ KCharacterSetIdentifierIso88595, 8, "ISO-8859-5\0ISO_8859-5:1988\0iso-ir-144\0cyrillic\0csISOLatinCyrillic\0" },
+ { /*268456065*/ KCharacterSetIdentifierIso88597, 10, "ISO-8859-7\0ISO_8859-7:1987\0iso-ir-126\0ELOT_928\0ECMA-118\0greek\0greek8\0csISOLatinGreek\0" },
+ { /*268456066*/ KCharacterSetIdentifierIso88599, 12, "ISO-8859-9\0ISO_8859-9:1989\0iso-ir-148\0latin5\0l5\0csISOLatin5\0" },
+ { /*268456875*/ KCharacterSetIdentifierSms7Bit, 0, "SMS 7-bit\0" },
+ { /*268458028*/ KCharacterSetIdentifierUtf7, 103, "UTF-7\0UNICODE-1-1-UTF-7\0CSUNICODE11UTF7\0" },
+// { /*268458029*/ KCharacterSetIdentifierUtf8, 106, "UTF-8\0" },
+ { /*268458030*/ KCharacterSetIdentifierImapUtf7, 0, "IMAP UTF-7\0" },
+ { /*268458031*/ KCharacterSetIdentifierJavaConformantUtf8, 0, "JAVA UTF-8\0" },
+ { /*268458454*/ 268458454, 2250, "Windows-1250\0CP1250\0MS-EE\0" },
+ { /*268458455*/ 268458455, 2251, "Windows-1251\0CP1251\0MS-CYRL\0" },
+ { /*268458456*/ 268458456, 2253, "Windows-1253\0CP1253\0MS-GREEK\0" },
+ { /*268458457*/ 268458457, 2254, "Windows-1254\0CP1254\0MS-TURK\0" },
+ { /*268458458*/ 268458458, 2257, "Windows-1257\0CP1257\0WINBALTRIM\0" },
+ { /*268460133*/ KCharacterSetIdentifierHz, 2085, "HZ-GB-2312\0HZ\0" },
+ { /*268460134*/ KCharacterSetIdentifierJis, 16, "JIS_Encoding\0JIS\0" },
+ { /*268460135*/ KCharacterSetIdentifierEucJpPacked, 18, "EUC-JP\0Extended_UNIX_Code_Packed_Format_for_Japanese\0csEUCPkdFmtJapanese\0EUCJP_PACKED\0" },
+ { /*268461728*/ KCharacterSetIdentifierIso2022Jp, 39, "ISO-2022-JP\0csISO2022JP\0JIS7\0" },
+ { /*268461731*/ KCharacterSetIdentifierIso2022Jp1, 0, "ISO2022JP1\0" },
+ { /*268470824*/ KCharacterSetIdentifierIso88593, 6, "ISO-8859-3\0ISO_8859-3:1988\0iso-ir-109\0latin3\0l3\0csISOLatin3\0" },
+ { /*268470825*/ KCharacterSetIdentifierIso88596, 9, "ISO-8859-6\0ISO_8859-6:1987\0iso-ir-127\0ECMA-114\0ASMO-708\0arabic\0ISO88596\0csISOLatinArabic\0ARABIC\0" },
+ { /*268470826*/ KCharacterSetIdentifierIso88598, 11, "ISO-8859-8\0ISO_8859-8:1988\0iso-ir-138\0hebrew\0csISOLatinHebrew\0" },
+ { /*268470827*/ KCharacterSetIdentifierIso885910, 13, "ISO-8859-10\0iso-ir-157\0l6\0ISO_8859-10:1992\0csISOLatin6\0latin6\0" },
+ { /*268470828*/ KCharacterSetIdentifierIso885913, 109, "ISO-8859-13\0ISO885913\0ISO-IR-179\0ISO8859-13\0L7\0LATIN7\0CSISOLATIN7\0" },
+ { /*268470829*/ KCharacterSetIdentifierIso885914, 110, "ISO-8859-14\0iso-ir-199\0ISO_8859-14:1998\0latin8\0iso-celtic\0l8\0" },
+ { /*268470830*/ KCharacterSetIdentifierIso885915, 111, "ISO-8859-15\0latin-9\0ISO-IR-203\0" },
+// { /*270483374*/ KCharacterSetIdentifierUnicodeLittle, 1014, "UTF-16LE\0Little-Endian UNICODE\0" },
+// { /*270483538*/ KCharacterSetIdentifierUnicodeBig, 1013, "UTF-16BE\0Big-Endian UNICODE\0" },
+ { /*270501191*/ 270501191, 2255, "Windows-1255\0CP1255\0MS-HEBR\0" },
+ { /*270501192*/ 270501192, 2256, "Windows-1256\0CP1256\0MS-ARAB\0" },
+ { /*270501193*/ 270501193, 2259, "TIS-620\0ISO-IR-166\0TIS620-0\0TIS620.2529-1\0TIS620.2533-0\0TIS620.2533-1\0" },
+ { /*270501194*/ 270501194, 0, "windows-874\0CP874\0IBM874\0" },
+ { /*270501325*/ 270501325, 0, "SmsStrict\0" },
+ { /*270501521*/ 270501521, 0, "ShiftJisDirectmap\0" },
+ { /*270501542*/ 270501542, 0, "EucJpDirectmap\0" },
+ /* 270501691 (duplicate) Windows-1252 | windows-1252 |Windows-1252 |Code Page 1252 |CP1252 |MS-ANSI |WINDOWS-1252 |2252 */
+ { /*270501729*/ 270501729, 2088, "KOI8-U\0" },
+ { /*270501752*/ 270501752, 2084, "KOI8-R\0csKOI8R\0" },
+ { /*270529682*/ 270529682, 1000, "ISO-10646-UCS-2\0UCS-2\0CSUNICODE\0" },
+ { /*270562232*/ 270562232, 2258, "Windows-1258\0CP1258\0WINDOWS-1258\0" },
+ { /*270586888*/ 270586888, 0, "J5\0" },
+ { /*271011982*/ 271011982, 0, "ISCII\0" },
+ { /*271066541*/ 271066541, 2009, "CP850\0IBM850\0""850\0csPC850Multilingual\0" },
+ { /*271082493*/ 271082493, 0, "EXTENDED_SMS_7BIT\0" },
+ { /*271082494*/ 271082494, 0, "gsm7_turkish_single\0" },
+ { /*271082495*/ 271082495, 0, "turkish_locking_gsm7ext\0" },
+ { /*271082496*/ 271082496, 0, "turkish_locking_single\0" },
+ { /*536929574*/ 536929574, 38, "EUC-KR\0" },
+ { /*536936703*/ 536936703, 0, "CP949\0" },
+ { /*536936705*/ 536936705, 37, "ISO-2022-KR\0" },
+ { /*536941517*/ 536941517, 36, "KS_C_5601-1987\0" }
+ };
+
+
+class QSymbianTextCodec : public QTextCodec
+{
+public:
+ QString convertToUnicode(const char*, int, ConverterState*) const;
+ QByteArray convertFromUnicode(const QChar*, int, ConverterState*) const;
+ QList<QByteArray> aliases() const;
+ QByteArray name() const;
+ int mibEnum() const;
+
+ explicit QSymbianTextCodec(uint charsetId, int staticIndex = -1) : m_charsetId(charsetId), m_staticIndex(staticIndex) { }
+
+ static QSymbianTextCodec *init();
+ static QSymbianTextCodec *localeMapper;
+private:
+ static CCnvCharacterSetConverter *converter();
+ static uint getLanguageDependentCharacterSet();
+ uint m_charsetId;
+ int m_staticIndex;
+};
+
+QSymbianTextCodec *QSymbianTextCodec::localeMapper = 0;
+
+class QSymbianTextCodecWithName : public QSymbianTextCodec
+{
+public:
+ QSymbianTextCodecWithName(uint charsetId, const QByteArray &name)
+ : QSymbianTextCodec(charsetId) , m_name(name) { }
+ QByteArray name() const { return m_name; }
+ QList<QByteArray> aliases() const { return QList<QByteArray>(); }
+private:
+ QByteArray m_name;
+};
+
+Q_GLOBAL_STATIC(QThreadStorage<CCnvCharacterSetConverter *>,gs_converterStore);
+
+CCnvCharacterSetConverter *QSymbianTextCodec::converter()
+{
+ CCnvCharacterSetConverter *&conv = gs_converterStore()->localData();
+ if (!conv)
+ QT_TRAP_THROWING(conv = CCnvCharacterSetConverter::NewL())
+ return conv;
+}
+
+
+QByteArray QSymbianTextCodec::name() const
+{
+ if (m_staticIndex >= 0)
+ return QByteArray(codecsData[m_staticIndex].aliases);
+ QScopedPointer<HBufC8> buf;
+ QT_TRAP_THROWING(buf.reset(converter()->ConvertCharacterSetIdentifierToStandardNameL(m_charsetId, qt_s60GetRFs())))
+ if (buf)
+ return QByteArray(reinterpret_cast<const char *>(buf->Ptr()), buf->Length());
+ return QByteArray();
+}
+
+int QSymbianTextCodec::mibEnum() const
+{
+ if (m_staticIndex >= 0)
+ return codecsData[m_staticIndex].mib;
+ int mib;
+ QT_TRAP_THROWING(mib = converter()->ConvertCharacterSetIdentifierToMibEnumL(m_charsetId, qt_s60GetRFs()))
+ return mib;
+}
+
+QList<QByteArray> QSymbianTextCodec::aliases() const
+{
+ QList<QByteArray> result;
+ if (m_staticIndex >= 0) {
+ const char *aliases = codecsData[m_staticIndex].aliases;
+ aliases += strlen(aliases) + 1;
+ while (*aliases) {
+ int len = strlen(aliases);
+ result += QByteArray(aliases, len);
+ aliases += len + 1;
+ }
+ }
+ return result;
+}
+
+
+QString QSymbianTextCodec::convertToUnicode(const char *str, int len, ConverterState *state) const
+{
+ uint charsetId = m_charsetId;
+
+ // no support for utf7 with state
+ if (state && (charsetId == KCharacterSetIdentifierUtf7 ||
+ charsetId == KCharacterSetIdentifierImapUtf7)) {
+ return QString();
+ }
+ CCnvCharacterSetConverter *converter = QSymbianTextCodec::converter();
+ if (!str) {
+ return QString();
+ }
+
+ //Search the character set array containing all of the character sets for which conversion is available
+ CCnvCharacterSetConverter::TAvailability av;
+ QT_TRAP_THROWING(av = converter->PrepareToConvertToOrFromL(charsetId, qt_s60GetRFs()))
+ if (av == CCnvCharacterSetConverter::ENotAvailable) {
+ return QString();
+ }
+
+ char *str2;
+ int len2;
+ QByteArray helperBA;
+ if (state && (state->remainingChars > 0)) {
+ // we should prepare the input string ourselves
+ // the real size
+ len2 = len + state->remainingChars;
+ helperBA.resize(len2);
+ str2 = helperBA.data();
+ if (state->remainingChars > 3) { // doesn't happen usually
+ memcpy(str2, state->d, state->remainingChars);
+ qFree(state->d);
+ state->d = 0;
+ } else {
+ char charTbl[3];
+ charTbl[0] = state->state_data[0];
+ charTbl[1] = state->state_data[1];
+ charTbl[2] = state->state_data[2];
+ memcpy(str2, charTbl, state->remainingChars);
+ }
+ memcpy(str2+state->remainingChars, str, len);
+ }
+ else {
+ len2 = len;
+ str2 = const_cast<char*>(str);
+ }
+
+ QString UnicodeText(len2, Qt::Uninitialized);
+ TPtrC8 remainderOfForeignText;
+ remainderOfForeignText.Set(reinterpret_cast<const unsigned char *>(str2), len2);
+
+ int numberOfUnconvertibleCharacters = 0;
+ int indexOfFirstUnconvertibleCharacter;
+
+ // Use null character as replacement, if it is asked
+ bool convertToNull = (state && (state->flags & QTextCodec::ConvertInvalidToNull));
+ if (convertToNull) {
+ _LIT8(KReplacement, "\x00");
+ QT_TRAP_THROWING(converter->SetReplacementForUnconvertibleUnicodeCharactersL(KReplacement))
+ }
+ // use state->invalidChars for keeping symbian state
+ int sState = CCnvCharacterSetConverter::KStateDefault;
+ if (state && (state->invalidChars != CCnvCharacterSetConverter::KStateDefault)) {
+ sState = state->invalidChars;
+ }
+ //Convert text encoded in a non-Unicode character set into the Unicode character set (UCS-2).
+ int remainingChars = -1;
+ int initial_size=0;
+ while (1) {
+ TPtr16 UnicodePtr(reinterpret_cast<unsigned short *>(UnicodeText.data()+initial_size), UnicodeText.size());
+ QT_TRAP_THROWING(remainingChars = converter->ConvertToUnicode(UnicodePtr,
+ remainderOfForeignText,
+ sState,
+ numberOfUnconvertibleCharacters,
+ indexOfFirstUnconvertibleCharacter))
+
+ initial_size += UnicodePtr.Length();
+ // replace 0xFFFD with 0x0000 and only if state set to convert to it
+ if (numberOfUnconvertibleCharacters>0 && convertToNull) {
+ int len2 = UnicodePtr.Length();
+ for (int i = indexOfFirstUnconvertibleCharacter; i < len2; i++) {
+ UnicodePtr[i] = 0x0000;
+ }
+ }
+ // success
+ if (remainingChars==KErrNone) {
+ break;
+ }
+ // if ConvertToUnicode could not consume the foreign text at all
+ // UTF-8: EErrorIllFormedInput = KErrCorrupt
+ // UCS-2: KErrNotFound
+ if (remainingChars == CCnvCharacterSetConverter::EErrorIllFormedInput ||
+ remainingChars == KErrNotFound) {
+ remainingChars = remainderOfForeignText.Size();
+ break;
+ }
+ else {
+ if (remainingChars < 0) {
+ return QString();
+ }
+ }
+ //
+ UnicodeText.resize(UnicodeText.size() + remainingChars*2);
+ remainderOfForeignText.Set(reinterpret_cast<const unsigned char *>(str2+len2-remainingChars), remainingChars);
+ }
+ // save symbian state
+ if (state) {
+ state->invalidChars = sState;
+ }
+
+ if (remainingChars > 0) {
+ if (!state) {
+ // No way to signal, if there is still remaining chars, for ex. UTF-8 still can have
+ // some characters hanging around.
+ return QString();
+ }
+ const unsigned char *charPtr = remainderOfForeignText.Right(remainingChars).Ptr();
+ if (remainingChars > 3) { // doesn't happen usually
+ state->d = (void*)qMalloc(remainingChars);
+ if (!state->d)
+ return QString();
+ // copy characters there
+ memcpy(state->d, charPtr, remainingChars);
+ }
+ else {
+ // fallthru is correct
+ switch (remainingChars) {
+ case 3:
+ state->state_data[2] = charPtr[2];
+ case 2:
+ state->state_data[1] = charPtr[1];
+ case 1:
+ state->state_data[0] = charPtr[0];
+ }
+ }
+ state->remainingChars = remainingChars;
+ }
+ else {
+ if (state) {
+ // If we continued from an earlier iteration
+ state->remainingChars = 0;
+ }
+ }
+ // check if any ORIGINAL headers should be left
+ if (initial_size > 0) {
+ if (!state || (state && !(state->flags & QTextCodec::IgnoreHeader))) {
+ // always skip headers on following state loops
+ if (state) {
+ state->flags |= QTextCodec::IgnoreHeader;
+ }
+ const TUint16 *ptr = reinterpret_cast<const TUint16 *>(UnicodeText.data());
+ if (ptr[0] == QChar::ByteOrderMark || ptr[0] == QChar::ByteOrderSwapped) {
+ return UnicodeText.mid(1, initial_size - 1);
+ }
+ }
+ }
+ if (initial_size >= 0) {
+ UnicodeText.resize(initial_size);
+ return UnicodeText;
+ }
+ else {
+ return QString();
+ }
+}
+
+
+QByteArray QSymbianTextCodec::convertFromUnicode(const QChar *str, int len, ConverterState *state) const
+{
+ uint charsetId = m_charsetId;
+ CCnvCharacterSetConverter *converter = QSymbianTextCodec::converter();
+ if (!str)
+ return QByteArray();
+
+ if (len == 0)
+ return QByteArray();
+
+ // no support for utf7 with state
+ if (state && (charsetId == KCharacterSetIdentifierUtf7 ||
+ charsetId == KCharacterSetIdentifierImapUtf7))
+ return QByteArray();
+
+ //Get reference file session from backend
+ RFs &fileSession = qt_s60GetRFs();
+
+ //Search the character set array containing all of the character sets for which conversion is available
+ CCnvCharacterSetConverter::TAvailability av = CCnvCharacterSetConverter::ENotAvailable;
+ QT_TRAP_THROWING(av = converter->PrepareToConvertToOrFromL(charsetId, fileSession))
+ if (av == CCnvCharacterSetConverter::ENotAvailable)
+ return QByteArray();
+
+ // Use null character as replacement, if it is asked
+ if (state && (state->flags & QTextCodec::ConvertInvalidToNull)) {
+ _LIT8(KReplacement, "\x00");
+ QT_TRAP_THROWING(converter->SetReplacementForUnconvertibleUnicodeCharactersL(KReplacement))
+ }
+ else {
+ _LIT8(KReplacement, "?");
+ QT_TRAP_THROWING(converter->SetReplacementForUnconvertibleUnicodeCharactersL(KReplacement))
+ }
+ QByteArray outputBuffer;
+
+ // add header if no state (one run), or if no ignoreheader (from first state)
+ int bomofs = 0;
+ if (!state || (state && !(state->flags & QTextCodec::IgnoreHeader))) {
+
+ QChar bom(QChar::ByteOrderMark);
+
+ if (state)
+ state->flags |= QTextCodec::IgnoreHeader; // bom handling only on first state
+
+ switch (charsetId) {
+ case KCharacterSetIdentifierUcs2:
+ outputBuffer.append(bom.row());
+ outputBuffer.append(bom.cell());
+ bomofs = 2;
+ break;
+
+ case KCharacterSetIdentifierUtf8: // we don't add bom for UTF-8
+ case KCharacterSetIdentifierJavaConformantUtf8:
+ /*outputBuffer.append("\xef\xbb\xbf");
+ bomofs = 3;
+ */
+ break;
+
+ case KCharacterSetIdentifierUnicodeLittle:
+ outputBuffer.append(bom.cell());
+ outputBuffer.append(bom.row());
+ bomofs = 2;
+ break;
+
+ case KCharacterSetIdentifierUnicodeBig:
+ outputBuffer.append(bom.row());
+ outputBuffer.append(bom.cell());
+ bomofs = 2;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // len is 16bit chars, reserve 3 8bit chars for each input char
+ // jsz - it could be differentiated, to allocate less
+ outputBuffer.resize(len * 3 + bomofs);
+
+ // loop for too short output buffer
+ int unconverted;
+ int numberOfUnconvertibleCharacters = len;
+ int indexOfFirstUnconvertibleCharacter;
+ int convertedSize;
+ int lastUnconverted = 0;
+ int initial_size=0;
+ int remainderToConvert = len;
+ while (1) {
+ TPtr8 outputPtr(reinterpret_cast<unsigned char *>(outputBuffer.data() + bomofs + initial_size), outputBuffer.size() - bomofs);
+
+ TPtrC16 UnicodeText(reinterpret_cast<const unsigned short *>(str+len-remainderToConvert), remainderToConvert);
+
+ //Convert text encoded in the Unicode character set (UCS-2) into other character sets
+ unconverted = -1;
+ QT_TRAP_THROWING( unconverted = converter->ConvertFromUnicode(outputPtr,
+ UnicodeText,
+ numberOfUnconvertibleCharacters,
+ indexOfFirstUnconvertibleCharacter))
+ initial_size += outputPtr.Length();
+ if (unconverted < 0) {
+ return QByteArray();
+ }
+
+
+ if (unconverted == 0 ) {
+ convertedSize = initial_size;
+ break;
+ }
+
+ // check what means unconverted > 0
+ if (indexOfFirstUnconvertibleCharacter<0) {
+ // 8859-6 and 8859-8 break with certain input (string of \xc0 - \xd9 converted to unicode and back)
+ if (unconverted == lastUnconverted) {
+ return QByteArray();
+ }
+ lastUnconverted = unconverted;
+ }
+ else {
+ // were some character not possible to convert
+
+ }
+ remainderToConvert = unconverted; // len - indexOfFirstUnconvertibleCharacter;
+ // resize output buffer, use =op for the null check
+ outputBuffer.resize(outputBuffer.size() + remainderToConvert * 3 + bomofs);
+ };
+
+ // shorten output
+ outputBuffer.resize(convertedSize + bomofs);
+
+ if (state) {
+ state->invalidChars = numberOfUnconvertibleCharacters;
+
+ // check if any Symbian CONVERTED headers should be removed
+ if (state->flags & QTextCodec::IgnoreHeader && state->state_data[0] == 0) {
+
+ state->state_data[0] = 0xff; // bom handling only on first state
+
+ if (charsetId == KCharacterSetIdentifierUcs2 && outputBuffer.size() > 1) {
+
+ QChar bom(QChar::ByteOrderMark);
+ if (outputBuffer.at(0) == bom.row() && outputBuffer.at(1) == bom.cell()) {
+ outputBuffer.remove(0, 2);
+ } else if (outputBuffer.at(0) == bom.cell() && outputBuffer.at(1) == bom.row()) {
+ outputBuffer.remove(0, 2);
+ }
+
+ } else if ((charsetId == KCharacterSetIdentifierUtf8 ||
+ charsetId == KCharacterSetIdentifierJavaConformantUtf8) &&
+ outputBuffer.size() > 2) {
+ if (outputBuffer.at(0) == 0xef && outputBuffer.at(1) == 0xbb && outputBuffer.at(2) == 0xbf) {
+ outputBuffer.remove(0, 3);
+ }
+
+ } else if (charsetId == KCharacterSetIdentifierUnicodeLittle &&
+ outputBuffer.size() > 1) {
+
+ QChar bom(QChar::ByteOrderMark);
+ if (outputBuffer.at(0) == bom.row() && outputBuffer.at(1) == bom.cell()) {
+ outputBuffer.remove(0, 2);
+ }
+
+ } else if (charsetId == KCharacterSetIdentifierUnicodeBig &&
+ outputBuffer.size() > 1) {
+
+ QChar bom(QChar::ByteOrderSwapped);
+ if (outputBuffer.at(0) == bom.row() && outputBuffer.at(1) == bom.cell()) {
+ outputBuffer.remove(0, 2);
+ }
+ }
+
+ }
+ }
+
+ return outputBuffer;
+}
+
+
+uint QSymbianTextCodec::getLanguageDependentCharacterSet()
+{
+ TLanguage lang = User::Language();
+
+ uint langIndex = 0;
+
+ switch (lang) {
+ case 14: //ELangTurkish
+ langIndex = KCharacterSetIdentifierIso88599; break;
+ case 16: //ELangRussian
+ langIndex = KCharacterSetIdentifierIso88595; break;
+ case 17: //ELangHungarian
+ langIndex = KCharacterSetIdentifierIso88592; break;
+ case 25: //ELangCzec
+ case 26: //ELangSlovak
+ case 27: //ELangPolish
+ case 28: //ELangSlovenian
+ langIndex = KCharacterSetIdentifierIso88592; break;
+ case 29: //ELangTaiwanChinese
+ case 30: //ELangHongKongChinese
+ langIndex = KCharacterSetIdentifierBig5; break;
+ case 31: //ELangPrcChinese
+ langIndex = KCharacterSetIdentifierGbk; break;
+ case 32: //ELangJapanese
+ langIndex = KCharacterSetIdentifierShiftJis; break;
+ case 33: //ELangThai
+ langIndex = 270501193 /*KCharacterSetIdentifierTis620*/; break;
+ case 37: //ELangArabic
+ langIndex = KCharacterSetIdentifierIso88596; break;
+ case 40: //ELangBelarussian
+ case 42: //ELangBulgarian
+ langIndex = KCharacterSetIdentifierIso88595; break;
+ case 45: //ELangCroatian
+ langIndex = KCharacterSetIdentifierIso88592; break;
+ case 49: //ELangEstonian
+ langIndex = KCharacterSetIdentifierIso88594; break;
+ case 54: //ELangGreek
+ case 55: //ELangCyprusGreek
+ langIndex = KCharacterSetIdentifierIso88597; break;
+ case 57: //ELangHebrew
+ langIndex = KCharacterSetIdentifierIso88598; break;
+ case 58: //ELangHindi
+ langIndex = 271011982/*KCharacterSetIdentifierIscii*/; break;
+ case 67: //ELangLatvian
+ case 68: //ELangLithuanian
+ langIndex = KCharacterSetIdentifierIso88594; break;
+ case 69: //ELangMacedonian
+ langIndex = KCharacterSetIdentifierIso88595; break;
+ case 78: //ELangRomanian
+ langIndex = KCharacterSetIdentifierIso88592; break;
+ case 79: //ELangSerbian
+ langIndex = KCharacterSetIdentifierIso88592; break;
+ case 91: //ELangCyprusTurkish
+ langIndex = KCharacterSetIdentifierIso88599; break;
+ case 93: //ELangUkrainian
+ langIndex = KCharacterSetIdentifierIso88595; break;
+ case 94: //ELangUrdu
+ langIndex = KCharacterSetIdentifierIso88596; break;
+ case 157: //ELangEnglish_Taiwan
+ case 158: //ELangEnglish_HongKong
+ langIndex = KCharacterSetIdentifierBig5; break;
+ case 159: //ELangEnglish_Prc
+ langIndex = KCharacterSetIdentifierGbk; break;
+ case 160:
+ langIndex = KCharacterSetIdentifierShiftJis; break;
+ case 161: //ELangEnglish_Thailand
+ langIndex = 270501193/*KCharacterSetIdentifierTis620*/; break;
+ }
+
+ if (langIndex > 0) {
+ return langIndex;
+ }
+ return KCharacterSetIdentifierCodePage1252;
+}
+
+/* Create the codecs that have aliases and return the locale mapper*/
+QSymbianTextCodec *QSymbianTextCodec::init()
+{
+ const uint localeMapperId = getLanguageDependentCharacterSet();
+ QScopedPointer<CArrayFix<CCnvCharacterSetConverter::SCharacterSet> > array;
+ QT_TRAP_THROWING(array.reset(CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableL(qt_s60GetRFs())))
+ CCnvCharacterSetConverter *converter = QSymbianTextCodec::converter();
+ int count = array->Count();
+ for (int i = 0; i < count; i++) {
+ int charsetId = array->At(i).Identifier();
+
+ // skip builtin Qt codecs
+ if (charsetId == KCharacterSetIdentifierUtf8 || charsetId == KCharacterSetIdentifierUnicodeLittle
+ || charsetId == KCharacterSetIdentifierUnicodeLittle || charsetId == KCharacterSetIdentifierUnicodeBig
+ || charsetId == KCharacterSetIdentifierIso88591
+ || charsetId == 270501691 /* skip Windows-1252 duplicate*/) {
+ continue;
+ }
+
+ int begin = 0;
+ int n = sizeof(codecsData) / sizeof(codecsData[0]);
+ int half;
+
+ while (n > 0) {
+ half = n >> 1;
+ int middle = begin + half;
+ if (codecsData[middle].charsetId < charsetId) {
+ begin = middle + 1;
+ n -= half + 1;
+ } else {
+ n = half;
+ }
+ }
+ if (codecsData[begin].charsetId == charsetId) {
+ QSymbianTextCodec *c = new QSymbianTextCodec(charsetId, begin);
+ if (charsetId == localeMapperId)
+ localeMapper = c;
+ } else {
+ QScopedPointer<HBufC8> buf;
+ QT_TRAP_THROWING(buf.reset(converter->ConvertCharacterSetIdentifierToStandardNameL(charsetId, qt_s60GetRFs())))
+ QByteArray name;
+ if (buf && buf->Length()) {
+ name = QByteArray(reinterpret_cast<const char *>(buf->Ptr()), buf->Length());
+ } else {
+ TPtrC charSetName = array->At(i).NameIsFileName() ? TParsePtrC(array->At(i).Name()).Name() : array->At(i).Name();
+ int len = charSetName.Length();
+ QString str;
+ str.setUnicode(reinterpret_cast<const QChar*>(charSetName.Ptr()), len);
+ name = str.toLatin1();
+ }
+ if (!name.isEmpty())
+ new QSymbianTextCodecWithName(charsetId, name);
+ }
+
+ }
+ return localeMapper;
+}
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 7655c51..f747bf7 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -48,6 +48,19 @@ QT_BEGIN_NAMESPACE
enum { Endian = 0, Data = 1 };
+static inline bool isUnicodeNonCharacter(uint ucs4)
+{
+ // Unicode has a couple of "non-characters" that one can use internally,
+ // but are not allowed to be used for text interchange.
+ //
+ // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF,
+ // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and
+ // U+FDEF (inclusive)
+
+ return (ucs4 & 0xfffe) == 0xfffe
+ || (ucs4 - 0xfdd0U) < 16;
+}
+
QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::ConverterState *state)
{
uchar replacement = '?';
@@ -106,16 +119,17 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve
if (u < 0x0800) {
*cursor++ = 0xc0 | ((uchar) (u >> 6));
} else {
+ // is it one of the Unicode non-characters?
+ if (isUnicodeNonCharacter(u)) {
+ *cursor++ = replacement;
+ ++ch;
+ ++invalid;
+ continue;
+ }
+
if (u > 0xffff) {
- // see QString::fromUtf8() and QString::utf8() for explanations
- if (u > 0x10fe00 && u < 0x10ff00) {
- *cursor++ = (u - 0x10fe00);
- ++ch;
- continue;
- } else {
- *cursor++ = 0xf0 | ((uchar) (u >> 18));
- *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f);
- }
+ *cursor++ = 0xf0 | ((uchar) (u >> 18));
+ *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f);
} else {
*cursor++ = 0xe0 | (((uchar) (u >> 12)) & 0x3f);
}
@@ -179,15 +193,16 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte
--need;
if (!need) {
// utf-8 bom composes into 0xfeff code point
+ bool nonCharacter;
if (!headerdone && uc == 0xfeff) {
// dont do anything, just skip the BOM
- } else if (uc > 0xffff && uc < 0x110000) {
+ } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) {
// surrogate pair
Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length());
*qch++ = QChar::highSurrogate(uc);
*qch++ = QChar::lowSurrogate(uc);
- } else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
- // error: overlong sequence, UTF16 surrogate or BOM
+ } else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || nonCharacter || uc >= 0x110000) {
+ // error: overlong sequence, UTF16 surrogate or non-character
*qch++ = replacement;
++invalid;
} else {
diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/corelib/concurrent/qfuturewatcher.cpp
index 3b808b8..d4573c6 100644
--- a/src/corelib/concurrent/qfuturewatcher.cpp
+++ b/src/corelib/concurrent/qfuturewatcher.cpp
@@ -505,7 +505,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
finished signal will be emitted.
To avoid a race condition, it is important to call this function
- \i after doing the connections.
+ \e after doing the connections.
*/
/*! \fn QFuture<T> QFutureWatcher::future() const
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 4d48b60..6437fb7 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1064,6 +1064,16 @@ redefine to built-in booleans to make autotests work properly */
# define QT_FASTCALL
#endif
+//defines the type for the WNDPROC on windows
+//the alignment needs to be forced for sse2 to not crash with mingw
+#if defined(Q_WS_WIN)
+# if defined(Q_CC_MINGW)
+# define QT_WIN_CALLBACK CALLBACK __attribute__ ((force_align_arg_pointer))
+# else
+# define QT_WIN_CALLBACK CALLBACK
+# endif
+#endif
+
typedef int QNoImplicitBoolCast;
#if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_MIPS) && (defined(Q_WS_QWS) || defined(Q_OS_WINCE))) || defined(QT_ARCH_SH) || defined(QT_ARCH_SH4A)
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index f7aea36..89a0c0b 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1059,6 +1059,9 @@ public:
Key_Suspend = 0x0100010c,
Key_ContrastAdjust = 0x0100010d,
+ Key_LaunchG = 0x0100010e,
+ Key_LaunchH = 0x0100010f,
+
Key_MediaLast = 0x0100ffff,
// Keypad navigation keys
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 74144b0..f8f3c49 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1639,6 +1639,8 @@
\value Key_LaunchD On X11 this key is mapped to XF86XK_LaunchB key for legacy reasons.
\value Key_LaunchE On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons.
\value Key_LaunchF On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons.
+ \value Key_LaunchG On X11 this key is mapped to XF86XK_LaunchE key for legacy reasons.
+ \value Key_LaunchH On X11 this key is mapped to XF86XK_LaunchF key for legacy reasons.
\value Key_MonBrightnessUp
\value Key_MonBrightnessDown
\value Key_KeyboardLightOnOff
@@ -2988,7 +2990,7 @@
\value IgnoredGesturesPropagateToParent Since Qt 4.7, this flag allows you
to fine-tune gesture event propagation. By setting the flag when
- \l{QGraphicsObject::grabGesture}{grabbing} a gesture all ignored partial
+ \l{QGraphicsObject::grabGesture()}{grabbing} a gesture all ignored partial
gestures will propagate to their parent items.
\sa QWidget::grabGesture(), QGraphicsObject::grabGesture()
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index efbc290..d3276bd 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -171,6 +171,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
stop();
+ wait();
QMutexLocker locker(&mutex);
QStringList failedToAdd;
// if we have a running FSStreamEvent, we have to kill it, we'll re-add the stream soon.
@@ -268,6 +269,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
stop();
+ wait();
QMutexLocker locker(&mutex);
// short circuit for smarties that call remove before add and we have nothing.
if (pathsToWatch == 0)
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 662100a..c93f0c3 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -282,8 +282,7 @@ QIODevicePrivate::~QIODevicePrivate()
Certain flags, such as \c Unbuffered and \c Truncate, are
meaningless when used with some subclasses. Some of these
restrictions are implied by the type of device that is represented
- by a subclass; for example, access to a QBuffer is always
- unbuffered. In other cases, the restriction may be due to the
+ by a subclass. In other cases, the restriction may be due to the
implementation, or may be imposed by the underlying platform; for
example, QTcpSocket does not support \c Unbuffered mode, and
limitations in the native API prevent QFile from supporting \c
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index f3fc28e..cb25a58 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -525,7 +525,7 @@ qint64 QProcessPrivate::readFromStderr(char *data, qint64 maxlen)
}
-static BOOL CALLBACK qt_terminateApp(HWND hwnd, LPARAM procId)
+static BOOL QT_WIN_CALLBACK qt_terminateApp(HWND hwnd, LPARAM procId)
{
DWORD currentProcId = 0;
GetWindowThreadProcessId(hwnd, &currentProcId);
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 6d33c8b..8e76e9e 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -1411,8 +1411,12 @@ QString QResourceFileEngine::fileName(FileName file) const
} else if(file == PathName || file == AbsolutePathName) {
const QString path = (file == AbsolutePathName) ? d->resource.absoluteFilePath() : d->resource.fileName();
const int slash = path.lastIndexOf(QLatin1Char('/'));
- if (slash != -1)
- return path.left(slash);
+ if (slash == -1)
+ return QLatin1String(":");
+ else if (slash <= 1)
+ return QLatin1String(":/");
+ return path.left(slash);
+
} else if(file == CanonicalName || file == CanonicalPathName) {
const QString absoluteFilePath = d->resource.absoluteFilePath();
if(file == CanonicalPathName) {
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 9e79894..b1c403f 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -70,7 +70,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
have reached the end of the data stream, with stdin. The reason for this is
that as long as stdin doesn't give any input to the QTextStream, \c atEnd()
will return true even if the stdin is open and waiting for more characters.
-
+
Besides using QTextStream's constructors, you can also set the
device or string QTextStream operates on by calling setDevice() or
setString(). You can seek to a position by calling seek(), and
@@ -1196,6 +1196,7 @@ bool QTextStream::seek(qint64 pos)
resetCodecConverterStateHelper(&d->writeConverterState);
delete d->readConverterSavedState;
d->readConverterSavedState = 0;
+ d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
#endif
return true;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 626bd3f..a60f206 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3479,8 +3479,12 @@ QString QUrlPrivate::authority(QUrl::FormattingOptions options) const
void QUrlPrivate::setAuthority(const QString &auth)
{
- if (auth.isEmpty())
+ if (auth.isEmpty()) {
+ setUserInfo(QString());
+ host.clear();
+ port = -1;
return;
+ }
// find the port section of the authority by searching from the
// end towards the beginning for numbers until a ':' is reached.
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 4755540..2633a7c 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -308,7 +308,7 @@ typedef MMRESULT(WINAPI *ptimeKillEvent)(UINT);
static ptimeSetEvent qtimeSetEvent = 0;
static ptimeKillEvent qtimeKillEvent = 0;
-LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
+LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
static void resolveTimerAPI()
{
@@ -420,7 +420,7 @@ Q_CORE_EXPORT bool winGetMessage(MSG* msg, HWND hWnd, UINT wMsgFilterMin,
}
// This function is called by a workerthread
-void WINAPI CALLBACK qt_fast_timer_proc(uint timerId, uint /*reserved*/, DWORD_PTR user, DWORD_PTR /*reserved*/, DWORD_PTR /*reserved*/)
+void WINAPI QT_WIN_CALLBACK qt_fast_timer_proc(uint timerId, uint /*reserved*/, DWORD_PTR user, DWORD_PTR /*reserved*/, DWORD_PTR /*reserved*/)
{
if (!timerId) // sanity check
return;
@@ -429,7 +429,7 @@ void WINAPI CALLBACK qt_fast_timer_proc(uint timerId, uint /*reserved*/, DWORD_P
QCoreApplication::postEvent(t->dispatcher, new QTimerEvent(t->timerId));
}
-LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
+LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
{
if (message == WM_NCCREATE)
return true;
@@ -506,7 +506,7 @@ LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
return DefWindowProc(hwnd, message, wp, lp);
}
-LRESULT CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
+LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
if (wp == PM_REMOVE) {
QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index ed94c49..788cc44 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -62,7 +62,7 @@ class QWinEventNotifier;
class QEventDispatcherWin32Private;
// forward declaration
-LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
+LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
class Q_CORE_EXPORT QEventDispatcherWin32 : public QAbstractEventDispatcher
{
@@ -101,8 +101,8 @@ public:
bool event(QEvent *e);
private:
- friend LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
- friend LRESULT CALLBACK qt_GetMessageHook(int, WPARAM, LPARAM);
+ friend LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);
+ friend LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int, WPARAM, LPARAM);
};
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8f2d025..30af6fa 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -590,6 +590,8 @@ bool QMetaType::isRegistered(int type)
int QMetaType::type(const char *typeName)
{
int length = qstrlen(typeName);
+ if (!length)
+ return 0;
int type = qMetaTypeStaticType(typeName, length);
if (!type) {
QReadLocker locker(customTypesLock());
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 389e6e7..68f34ca 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2033,6 +2033,8 @@ void QObjectPrivate::setParent_helper(QObject *o)
}
}
}
+ if (!wasDeleted && declarativeData)
+ declarativeData->parentChanged(q, o);
}
/*!
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index cc5bf97..20e3da1 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -90,6 +90,7 @@ class Q_CORE_EXPORT QDeclarativeData
public:
virtual ~QDeclarativeData();
virtual void destroyed(QObject *) = 0;
+ virtual void parentChanged(QObject *, QObject *) = 0;
};
class Q_CORE_EXPORT QObjectPrivate : public QObjectData
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index e17c995..7650f6a 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -339,8 +339,20 @@ QT_END_INCLUDE_NAMESPACE
void QTimer::singleShot(int msec, QObject *receiver, const char *member)
{
- if (receiver && member)
+ if (receiver && member) {
+ if (msec == 0) {
+ // special code shortpath for 0-timers
+ const char* bracketPosition = strchr(member, '(');
+ if (!bracketPosition || !(member[0] >= '0' && member[0] <= '3')) {
+ qWarning("QTimer::singleShot: Invalid slot specification");
+ return;
+ }
+ QByteArray methodName(member+1, bracketPosition - 1 - member); // extract method name
+ QMetaObject::invokeMethod(receiver, methodName.constData(), Qt::QueuedConnection);
+ return;
+ }
(void) new QSingleShotTimer(msec, receiver, member);
+ }
}
/*!
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 07c9e53..f5d7c0d 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1511,6 +1511,7 @@ QVariant::QVariant(const char *val)
*/
/*!
+ \since 4.7
\fn QVariant::QVariant(const QEasingCurve &val)
Constructs a new variant with an easing curve value, \a val.
@@ -2204,6 +2205,7 @@ QDateTime QVariant::toDateTime() const
}
/*!
+ \since 4.7
\fn QEasingCurve QVariant::toEasingCurve() const
Returns the variant as a QEasingCurve if the variant has type() \l
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 08cb863..2bc5347 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -42,10 +42,10 @@
// Don't define it while compiling this module, or USERS of Qt will
// not be able to link.
#ifdef QT_NO_CAST_FROM_ASCII
-#undef QT_NO_CAST_FROM_ASCII
+# undef QT_NO_CAST_FROM_ASCII
#endif
#ifdef QT_NO_CAST_TO_ASCII
-#undef QT_NO_CAST_TO_ASCII
+# undef QT_NO_CAST_TO_ASCII
#endif
#include "qchar.h"
#include "qdatastream.h"
@@ -57,17 +57,16 @@
QT_BEGIN_NAMESPACE
-#define LAST_UNICODE_CHAR 0x10ffff
-
#ifndef QT_NO_CODEC_FOR_C_STRINGS
-#ifdef QT_NO_TEXTCODEC
-#define QT_NO_CODEC_FOR_C_STRINGS
-#endif
+# ifdef QT_NO_TEXTCODEC
+# define QT_NO_CODEC_FOR_C_STRINGS
+# endif
#endif
#define FLAG(x) (1 << (x))
-/*! \class QLatin1Char
+/*!
+ \class QLatin1Char
\brief The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
\ingroup string-processing
@@ -550,7 +549,7 @@ bool QChar::isSpace() const
/*!
Returns true if the character is a mark (Mark_* categories);
otherwise returns false.
-
+
See QChar::Category for more information regarding marks.
*/
bool QChar::isMark() const
@@ -647,45 +646,44 @@ bool QChar::isSymbol() const
}
/*!
- \fn bool QChar::isHighSurrogate() const
+ \fn bool QChar::isHighSurrogate() const
- Returns true if the QChar is the high part of a utf16 surrogate
- (ie. if its code point is between 0xd800 and 0xdbff).
+ Returns true if the QChar is the high part of a utf16 surrogate
+ (ie. if its code point is between 0xd800 and 0xdbff).
*/
/*!
- \fn bool QChar::isLowSurrogate() const
+ \fn bool QChar::isLowSurrogate() const
- Returns true if the QChar is the low part of a utf16 surrogate
- (ie. if its code point is between 0xdc00 and 0xdfff).
+ Returns true if the QChar is the low part of a utf16 surrogate
+ (ie. if its code point is between 0xdc00 and 0xdfff).
*/
/*!
- \fn static uint QChar::surrogateToUcs4(ushort high, ushort low)
+ \fn static uint QChar::surrogateToUcs4(ushort high, ushort low)
- Converts a UTF16 surrogate pair with the given \a high and \a low values
- to its UCS-4 code point.
+ Converts a UTF16 surrogate pair with the given \a high and \a low values
+ to its UCS-4 code point.
*/
/*!
- \fn static uint QChar::surrogateToUcs4(QChar high, QChar low)
+ \fn static uint QChar::surrogateToUcs4(QChar high, QChar low)
- Converts a utf16 surrogate pair (\a high, \a low) to its ucs4 code
- point.
+ Converts a utf16 surrogate pair (\a high, \a low) to its ucs4 code point.
*/
/*!
- \fn static ushort QChar::highSurrogate(uint ucs4)
+ \fn static ushort QChar::highSurrogate(uint ucs4)
- Returns the high surrogate value of a ucs4 code point.
- The returned result is undefined if \a ucs4 is smaller than 0x10000.
+ Returns the high surrogate value of a ucs4 code point.
+ The returned result is undefined if \a ucs4 is smaller than 0x10000.
*/
/*!
- \fn static ushort QChar::lowSurrogate(uint ucs4)
+ \fn static ushort QChar::lowSurrogate(uint ucs4)
- Returns the low surrogate value of a ucs4 code point.
- The returned result is undefined if \a ucs4 is smaller than 0x10000.
+ Returns the low surrogate value of a ucs4 code point.
+ The returned result is undefined if \a ucs4 is smaller than 0x10000.
*/
/*!
@@ -714,7 +712,7 @@ int QChar::digitValue(ushort ucs2)
*/
int QChar::digitValue(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return 0;
return qGetProp(ucs4)->digitValue;
}
@@ -727,22 +725,22 @@ QChar::Category QChar::category() const
return (QChar::Category) qGetProp(ucs)->category;
}
-/*!
+/*!
\overload
\since 4.3
Returns the category of the UCS-4-encoded character specified by \a ucs4.
- */
+*/
QChar::Category QChar::category(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return QChar::NoCategory;
return (QChar::Category) qGetProp(ucs4)->category;
}
-/*!
+/*!
\overload
Returns the category of the UCS-2-encoded character specified by \a ucs2.
- */
+*/
QChar::Category QChar::category(ushort ucs2)
{
return (QChar::Category) qGetProp(ucs2)->category;
@@ -757,21 +755,21 @@ QChar::Direction QChar::direction() const
return (QChar::Direction) qGetProp(ucs)->direction;
}
-/*!
-\overload
-Returns the direction of the UCS-4-encoded character specified by \a ucs4.
- */
+/*!
+ \overload
+ Returns the direction of the UCS-4-encoded character specified by \a ucs4.
+*/
QChar::Direction QChar::direction(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return QChar::DirL;
return (QChar::Direction) qGetProp(ucs4)->direction;
}
-/*!
-\overload
-Returns the direction of the UCS-2-encoded character specified by \a ucs2.
- */
+/*!
+ \overload
+ Returns the direction of the UCS-2-encoded character specified by \a ucs2.
+*/
QChar::Direction QChar::direction(ushort ucs2)
{
return (QChar::Direction) qGetProp(ucs2)->direction;
@@ -786,25 +784,25 @@ QChar::Joining QChar::joining() const
return (QChar::Joining) qGetProp(ucs)->joining;
}
-/*!
-\overload
-Returns information about the joining properties of the UCS-4-encoded
-character specified by \a ucs4 (needed for certain languages such as
-Arabic).
- */
+/*!
+ \overload
+ Returns information about the joining properties of the UCS-4-encoded
+ character specified by \a ucs4 (needed for certain languages such as
+ Arabic).
+*/
QChar::Joining QChar::joining(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return QChar::OtherJoining;
return (QChar::Joining) qGetProp(ucs4)->joining;
}
-/*!
-\overload
-Returns information about the joining properties of the UCS-2-encoded
-character specified by \a ucs2 (needed for certain languages such as
-Arabic).
- */
+/*!
+ \overload
+ Returns information about the joining properties of the UCS-2-encoded
+ character specified by \a ucs2 (needed for certain languages such as
+ Arabic).
+*/
QChar::Joining QChar::joining(ushort ucs2)
{
return (QChar::Joining) qGetProp(ucs2)->joining;
@@ -863,26 +861,27 @@ QChar QChar::mirroredChar() const
return ucs + qGetProp(ucs)->mirrorDiff;
}
-/*! \overload
-Returns the mirrored character if the UCS-4-encoded character specified
-by \a ucs4 is a mirrored character; otherwise returns the character itself.
+/*!
+ \overload
+ Returns the mirrored character if the UCS-4-encoded character specified
+ by \a ucs4 is a mirrored character; otherwise returns the character itself.
-\sa hasMirrored()
- */
+ \sa hasMirrored()
+*/
uint QChar::mirroredChar(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return ucs4;
return ucs4 + qGetProp(ucs4)->mirrorDiff;
}
-/*!
-\overload
-Returns the mirrored character if the UCS-2-encoded character specified
-by \a ucs2 is a mirrored character; otherwise returns the character itself.
+/*!
+ \overload
+ Returns the mirrored character if the UCS-2-encoded character specified
+ by \a ucs2 is a mirrored character; otherwise returns the character itself.
-\sa hasMirrored()
- */
+ \sa hasMirrored()
+*/
ushort QChar::mirroredChar(ushort ucs2)
{
return ucs2 + qGetProp(ucs2)->mirrorDiff;
@@ -906,7 +905,7 @@ static const unsigned short * QT_FASTCALL decompositionHelper
(uint ucs4, int *length, int *tag, unsigned short *buffer)
{
*length = 0;
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return 0;
if (ucs4 >= Hangul_SBase && ucs4 < Hangul_SBase + Hangul_SCount) {
int SIndex = ucs4 - Hangul_SBase;
@@ -936,11 +935,11 @@ QString QChar::decomposition() const
return decomposition(ucs);
}
-/*!
-\overload
-Decomposes the UCS-4-encoded character specified by \a ucs4 into its
-constituent parts. Returns an empty string if no decomposition exists.
- */
+/*!
+ \overload
+ Decomposes the UCS-4-encoded character specified by \a ucs4 into its
+ constituent parts. Returns an empty string if no decomposition exists.
+*/
QString QChar::decomposition(uint ucs4)
{
unsigned short buffer[3];
@@ -959,14 +958,14 @@ QChar::Decomposition QChar::decompositionTag() const
return decompositionTag(ucs);
}
-/*!
-\overload
-Returns the tag defining the composition of the UCS-4-encoded character
-specified by \a ucs4. Returns QChar::Single if no decomposition exists.
- */
+/*!
+ \overload
+ Returns the tag defining the composition of the UCS-4-encoded character
+ specified by \a ucs4. Returns QChar::Single if no decomposition exists.
+*/
QChar::Decomposition QChar::decompositionTag(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return QChar::NoDecomposition;
const unsigned short index = GET_DECOMPOSITION_INDEX(ucs4);
if (index == 0xffff)
@@ -987,27 +986,28 @@ unsigned char QChar::combiningClass() const
return (unsigned char) qGetProp(ucs)->combiningClass;
}
-/*! \overload
-Returns the combining class for the UCS-4-encoded character specified by
-\a ucs4, as defined in the Unicode standard.
- */
+/*!
+ \overload
+ Returns the combining class for the UCS-4-encoded character specified by
+ \a ucs4, as defined in the Unicode standard.
+*/
unsigned char QChar::combiningClass(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return 0;
return (unsigned char) qGetProp(ucs4)->combiningClass;
}
-/*! \overload
-Returns the combining class for the UCS-2-encoded character specified by
-\a ucs2, as defined in the Unicode standard.
- */
+/*!
+ \overload
+ Returns the combining class for the UCS-2-encoded character specified by
+ \a ucs2, as defined in the Unicode standard.
+*/
unsigned char QChar::combiningClass(ushort ucs2)
{
return (unsigned char) qGetProp(ucs2)->combiningClass;
}
-
/*!
Returns the Unicode version that introduced this character.
*/
@@ -1016,21 +1016,23 @@ QChar::UnicodeVersion QChar::unicodeVersion() const
return (QChar::UnicodeVersion) qGetProp(ucs)->unicodeVersion;
}
-/*! \overload
-Returns the Unicode version that introduced the character specified in
-its UCS-4-encoded form as \a ucs4.
- */
+/*!
+ \overload
+ Returns the Unicode version that introduced the character specified in
+ its UCS-4-encoded form as \a ucs4.
+*/
QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return QChar::Unicode_Unassigned;
return (QChar::UnicodeVersion) qGetProp(ucs4)->unicodeVersion;
}
-/*! \overload
-Returns the Unicode version that introduced the character specified in
-its UCS-2-encoded form as \a ucs2.
- */
+/*!
+ \overload
+ Returns the Unicode version that introduced the character specified in
+ its UCS-2-encoded form as \a ucs2.
+*/
QChar::UnicodeVersion QChar::unicodeVersion(ushort ucs2)
{
return (QChar::UnicodeVersion) qGetProp(ucs2)->unicodeVersion;
@@ -1049,14 +1051,15 @@ QChar QChar::toLower() const
return ucs;
}
-/*! \overload
-Returns the lowercase equivalent of the UCS-4-encoded character specified
-by \a ucs4 if the character is uppercase or titlecase; otherwise returns
-the character itself.
- */
+/*!
+ \overload
+ Returns the lowercase equivalent of the UCS-4-encoded character specified
+ by \a ucs4 if the character is uppercase or titlecase; otherwise returns
+ the character itself.
+*/
uint QChar::toLower(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return ucs4;
const QUnicodeTables::Properties *p = qGetProp(ucs4);
if (!p->lowerCaseSpecial)
@@ -1064,11 +1067,12 @@ uint QChar::toLower(uint ucs4)
return ucs4;
}
-/*! \overload
-Returns the lowercase equivalent of the UCS-2-encoded character specified
-by \a ucs2 if the character is uppercase or titlecase; otherwise returns
-the character itself.
- */
+/*!
+ \overload
+ Returns the lowercase equivalent of the UCS-2-encoded character specified
+ by \a ucs2 if the character is uppercase or titlecase; otherwise returns
+ the character itself.
+*/
ushort QChar::toLower(ushort ucs2)
{
const QUnicodeTables::Properties *p = qGetProp(ucs2);
@@ -1089,14 +1093,15 @@ QChar QChar::toUpper() const
return ucs;
}
-/*! \overload
-Returns the uppercase equivalent of the UCS-4-encoded character specified
-by \a ucs4 if the character is lowercase or titlecase; otherwise returns
-the character itself.
- */
+/*!
+ \overload
+ Returns the uppercase equivalent of the UCS-4-encoded character specified
+ by \a ucs4 if the character is lowercase or titlecase; otherwise returns
+ the character itself.
+*/
uint QChar::toUpper(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return ucs4;
const QUnicodeTables::Properties *p = qGetProp(ucs4);
if (!p->upperCaseSpecial)
@@ -1104,11 +1109,12 @@ uint QChar::toUpper(uint ucs4)
return ucs4;
}
-/*! \overload
-Returns the uppercase equivalent of the UCS-2-encoded character specified
-by \a ucs2 if the character is lowercase or titlecase; otherwise returns
-the character itself.
- */
+/*!
+ \overload
+ Returns the uppercase equivalent of the UCS-2-encoded character specified
+ by \a ucs2 if the character is lowercase or titlecase; otherwise returns
+ the character itself.
+*/
ushort QChar::toUpper(ushort ucs2)
{
const QUnicodeTables::Properties *p = qGetProp(ucs2);
@@ -1137,7 +1143,7 @@ QChar QChar::toTitleCase() const
*/
uint QChar::toTitleCase(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return ucs4;
const QUnicodeTables::Properties *p = qGetProp(ucs4);
if (!p->titleCaseSpecial)
@@ -1198,7 +1204,7 @@ QChar QChar::toCaseFolded() const
*/
uint QChar::toCaseFolded(uint ucs4)
{
- if (ucs4 > LAST_UNICODE_CHAR)
+ if (ucs4 > UNICODE_LAST_CODEPOINT)
return ucs4;
return ucs4 + qGetProp(ucs4)->caseFoldDiff;
}
@@ -1292,28 +1298,25 @@ QChar QChar::fromAscii(char c)
#ifndef QT_NO_DATASTREAM
/*!
- \relates QChar
-
- Writes the char \a chr to the stream \a out.
+ \relates QChar
- \sa {Format of the QDataStream operators}
- */
+ Writes the char \a chr to the stream \a out.
+ \sa {Format of the QDataStream operators}
+*/
QDataStream &operator<<(QDataStream &out, const QChar &chr)
{
out << quint16(chr.unicode());
return out;
}
-
/*!
- \relates QChar
-
- Reads a char from the stream \a in into char \a chr.
+ \relates QChar
- \sa {Format of the QDataStream operators}
- */
+ Reads a char from the stream \a in into char \a chr.
+ \sa {Format of the QDataStream operators}
+*/
QDataStream &operator>>(QDataStream &in, QChar &chr)
{
quint16 u;
@@ -1602,11 +1605,9 @@ int QT_FASTCALL QUnicodeTables::script(unsigned int uc)
return script;
}
-
Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass(uint ucs4)
{
return (QUnicodeTables::LineBreakClass) qGetProp(ucs4)->line_break_class;
}
-
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index d4b2c27..9c65d5d 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -877,8 +877,8 @@ QDataStream &operator<<(QDataStream &stream, const QEasingCurve &easing)
\fn QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
\relates QQuaternion
- Reads an easing curve from the given \a stream into the given \a quaternion
- and returns a reference to the stream.
+ Reads an easing curve from the given \a stream into the given \a
+ easing curve and returns a reference to the stream.
\sa {Format of the QDataStream Operators}
*/
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index eff87e8..b54315c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -335,7 +335,7 @@ const QString::Null QString::null = { };
\macro QT_NO_CAST_TO_ASCII
\relates QString
- disables automatic conversion from QString to ASCII 8-bit strings (char *)
+ disables automatic conversion from QString to 8-bit strings (char *)
\sa QT_NO_CAST_FROM_ASCII, QT_NO_CAST_FROM_BYTEARRAY
*/
@@ -391,10 +391,10 @@ const QString::Null QString::null = { };
with code values above 65535 are stored using surrogate pairs,
i.e., two consecutive \l{QChar}s.)
- \l{Unicode} is an international standard that supports most of
- the writing systems in use today. It is a superset of ASCII and
- Latin-1 (ISO 8859-1), and all the ASCII/Latin-1 characters are
- available at the same code positions.
+ \l{Unicode} is an international standard that supports most of the
+ writing systems in use today. It is a superset of US-ASCII (ANSI
+ X3.4-1986) and Latin-1 (ISO 8859-1), and all the US-ASCII/Latin-1
+ characters are available at the same code positions.
Behind the scenes, QString uses \l{implicit sharing}
(copy-on-write) to reduce memory usage and to avoid the needless
@@ -562,11 +562,13 @@ const QString::Null QString::null = { };
toLatin1(), toUtf8(), and toLocal8Bit().
\list
- \o toAscii() returns an ASCII encoded 8-bit string.
+ \o toAscii() returns an 8-bit string encoded using the codec
+ specified by QTextCodec::codecForCStrings (by default, that is
+ Latin 1).
\o toLatin1() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.
\o toUtf8() returns a UTF-8 encoded 8-bit string. UTF-8 is a
- superset of ASCII that supports the entire Unicode character
- set through multibyte sequences.
+ superset of US-ASCII (ANSI X3.4-1986) that supports the entire
+ Unicode character set through multibyte sequences.
\o toLocal8Bit() returns an 8-bit string using the system's local
encoding.
\endlist
@@ -578,7 +580,7 @@ const QString::Null QString::null = { };
As mentioned above, QString provides a lot of functions and
operators that make it easy to interoperate with \c{const char *}
strings. But this functionality is a double-edged sword: It makes
- QString more convenient to use if all strings are ASCII or
+ QString more convenient to use if all strings are US-ASCII or
Latin-1, but there is always the risk that an implicit conversion
from or to \c{const char *} is done using the wrong 8-bit
encoding. To minimize these risks, you can turn off these implicit
@@ -586,9 +588,9 @@ const QString::Null QString::null = { };
\list
\o \c QT_NO_CAST_FROM_ASCII disables automatic conversions from
- ASCII to Unicode.
+ C string literals and pointers to Unicode.
\o \c QT_NO_CAST_TO_ASCII disables automatic conversion from QString
- to ASCII.
+ to C strings.
\endlist
One way to define these preprocessor symbols globally for your
@@ -837,7 +839,7 @@ int QString::grow(int size)
/*! \fn QString::QString(const char *str)
- Constructs a string initialized with the ASCII string \a str. The
+ Constructs a string initialized with the 8-bit string \a str. The
given const char pointer is converted to Unicode using the
fromAscii() function.
@@ -1337,8 +1339,9 @@ QString &QString::operator=(const QString &other)
\overload operator=()
- Assigns \a ba to this string. The byte array is converted to
- Unicode using the fromAscii() function.
+ Assigns \a ba to this string. The byte array is converted to Unicode
+ using the fromAscii() function. This function stops conversion at the
+ first NUL character found, or the end of the \a ba byte array.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -2131,7 +2134,8 @@ bool QString::operator==(const QLatin1String &other) const
\overload operator==()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. This function stops conversion at the
+ first NUL character found, or the end of the byte array.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -2192,7 +2196,8 @@ bool QString::operator<(const QLatin1String &other) const
\overload operator<()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. If any NUL characters ('\0') are embedded
+ in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -2234,7 +2239,8 @@ bool QString::operator<(const QLatin1String &other) const
\overload operator<=()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. If any NUL characters ('\0') are embedded
+ in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -2292,7 +2298,8 @@ bool QString::operator>(const QLatin1String &other) const
\overload operator>()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. If any NUL characters ('\0') are embedded
+ in the byte array, they will be included in the transformation.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -2334,7 +2341,8 @@ bool QString::operator>(const QLatin1String &other) const
\overload operator>=()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. If any NUL characters ('\0') are embedded in
+ the byte array, they will be included in the transformation.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
@@ -2349,10 +2357,10 @@ bool QString::operator>(const QLatin1String &other) const
The \a other const char pointer is converted to a QString using
the fromAscii() function.
- You can disable this operator by defining \c
- QT_NO_CAST_FROM_ASCII when you compile your applications. This
- can be useful if you want to ensure that all user-visible strings
- go through QObject::tr(), for example.
+ You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
+ when you compile your applications. This can be useful if you want
+ to ensure that all user-visible strings go through QObject::tr(),
+ for example.
*/
/*! \fn bool QString::operator!=(const QString &other) const
@@ -2376,7 +2384,8 @@ bool QString::operator>(const QLatin1String &other) const
\overload operator!=()
The \a other byte array is converted to a QString using the
- fromAscii() function.
+ fromAscii() function. If any NUL characters ('\0') are embedded
+ in the byte array, they will be included in the transformation.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
when you compile your applications. This can be useful if you want
@@ -3563,8 +3572,10 @@ static QByteArray toLatin1_helper(const QChar *data, int length)
/*!
Returns a Latin-1 representation of the string as a QByteArray.
- The returned byte array is undefined if the string contains
- non-Latin1 characters.
+
+ The returned byte array is undefined if the string contains non-Latin1
+ characters. Those characters may be suppressed or replaced with a
+ question mark.
\sa fromLatin1(), toAscii(), toUtf8(), toLocal8Bit(), QTextCodec
*/
@@ -3578,12 +3589,15 @@ QByteArray QString::toLatin1() const
// isn't necessary in the header. See task 177402.
/*!
- Returns an 8-bit ASCII representation of the string as a QByteArray.
+ Returns an 8-bit representation of the string as a QByteArray.
If a codec has been set using QTextCodec::setCodecForCStrings(),
it is used to convert Unicode to 8-bit char; otherwise this
function does the same as toLatin1().
+ Note that, despite the name, this function does not necessarily return an US-ASCII
+ (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
+
\sa fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
*/
QByteArray QString::toAscii() const
@@ -3611,8 +3625,13 @@ static QByteArray toLocal8Bit_helper(const QChar *data, int length)
QByteArray. The returned byte array is undefined if the string
contains characters not supported by the local 8-bit encoding.
- QTextCodec::codecForLocale() is used to perform the conversion
- from Unicode.
+ QTextCodec::codecForLocale() is used to perform the conversion from
+ Unicode. If the locale encoding could not be determined, this function
+ does the same as toLatin1().
+
+ If this string contains any characters that cannot be encoded in the
+ locale, the returned byte array is undefined. Those characters may be
+ suppressed or replaced by another.
\sa fromLocal8Bit(), toAscii(), toLatin1(), toUtf8(), QTextCodec
*/
@@ -3628,54 +3647,34 @@ QByteArray QString::toLocal8Bit() const
/*!
Returns a UTF-8 representation of the string as a QByteArray.
+ UTF-8 is a Unicode codec and can represent all characters in a Unicode
+ string like QString.
+
+ However, in the Unicode range, there are certain codepoints that are not
+ considered characters. The Unicode standard reserves the last two
+ codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
+ U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF,
+ inclusive, as non-characters. If any of those appear in the string, they
+ may be discarded and will not appear in the UTF-8 representation, or they
+ may be replaced by one or more replacement characters.
+
\sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec
*/
QByteArray QString::toUtf8() const
{
- QByteArray ba;
- if (d->size) {
- int l = d->size;
- int rlen = l*3+1;
- ba.resize(rlen);
- uchar *cursor = (uchar*)ba.data();
- const ushort *ch =d->data;
- for (int i=0; i < l; i++) {
- uint u = *ch;
- if (u < 0x80) {
- *cursor++ = (uchar)u;
- } else {
- if (u < 0x0800) {
- *cursor++ = 0xc0 | ((uchar) (u >> 6));
- } else {
- if (QChar(u).isHighSurrogate() && i < l-1) {
- ushort low = ch[1];
- if (QChar(low).isLowSurrogate()) {
- ++ch;
- ++i;
- u = QChar::surrogateToUcs4(u,low);
- }
- }
- if (u > 0xffff) {
- *cursor++ = 0xf0 | ((uchar) (u >> 18));
- *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f);
- } else {
- *cursor++ = 0xe0 | ((uchar) (u >> 12));
- }
- *cursor++ = 0x80 | (((uchar) (u >> 6)) & 0x3f);
- }
- *cursor++ = 0x80 | ((uchar) (u&0x3f));
- }
- ++ch;
- }
- ba.resize(cursor - (uchar*)ba.constData());
- }
- return ba;
+ if (isNull())
+ return QByteArray();
+
+ return QUtf8::convertFromUnicode(constData(), length(), 0);
}
/*!
\since 4.2
- Returns a UCS-4 representation of the string as a QVector<uint>.
+ Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
+
+ UCS-4 is a Unicode codec and is lossless. All characters from this string
+ can be encoded in UCS-4.
\sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
*/
@@ -3952,14 +3951,16 @@ QString QString::fromLocal8Bit(const char *str, int size)
/*!
Returns a QString initialized with the first \a size characters
- of the 8-bit ASCII string \a str.
+ of the 8-bit string \a str.
If \a size is -1 (default), it is taken to be qstrlen(\a
str).
- If a codec has been set using QTextCodec::setCodecForCStrings(),
- it is used to convert \a str to Unicode; otherwise this function
- does the same as fromLatin1().
+ Note that, despite the name, this function actually uses the codec
+ defined by QTextCodec::setCodecForCStrings() to convert \a str to
+ Unicode. Depending on the codec, it may not accept valid US-ASCII (ANSI
+ X3.4-1986) input. If no codec has been set, this function does the same
+ as fromLatin1().
\sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
*/
@@ -3975,6 +3976,18 @@ QString QString::fromAscii(const char *str, int size)
If \a size is -1 (default), it is taken to be qstrlen(\a
str).
+ UTF-8 is a Unicode codec and can represent all characters in a Unicode
+ string like QString. However, invalid sequences are possible with UTF-8
+ and, if any such are found, they will be replaced with one or more
+ "replacement characters", or suppressed. These include non-Unicode
+ sequences, non-characters, overlong sequences or surrogate codepoints
+ encoded into UTF-8.
+
+ Non-characters are codepoints that the Unicode standard reserves and must
+ not be used in text interchange. They are the last two codepoints in each
+ Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well
+ as 16 codepoints in the range U+FDD0..U+FDDF, inclusive.
+
\sa toUtf8(), fromAscii(), fromLatin1(), fromLocal8Bit()
*/
QString QString::fromUtf8(const char *str, int size)
@@ -4399,8 +4412,10 @@ QString& QString::fill(QChar ch, int size)
\overload operator+=()
- Appends the byte array \a ba to this string. The byte array is
- converted to Unicode using the fromAscii() function.
+ Appends the byte array \a ba to this string. The byte array is converted
+ to Unicode using the fromAscii() function. If any NUL characters ('\0')
+ are embedded in the \a ba byte array, they will be included in the
+ transformation.
You can disable this function by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications. This
@@ -6176,7 +6191,7 @@ QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
*/
QString QString::normalized(QString::NormalizationForm mode) const
{
- return normalized(mode, CURRENT_VERSION);
+ return normalized(mode, UNICODE_DATA_VERSION);
}
/*!
@@ -6258,7 +6273,7 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::
return;
QString &s = *data;
- if (version != CURRENT_VERSION) {
+ if (version != UNICODE_DATA_VERSION) {
for (int i = 0; i < NumNormalizationCorrections; ++i) {
const NormalizationCorrection &n = uc_normalization_corrections[i];
if (n.version > version) {
@@ -7085,9 +7100,9 @@ void QString::updateProperties() const
This operator is mostly useful to pass a QString to a function
that accepts a std::string object.
- If the QString contains non-ASCII Unicode characters, using this
- operator can lead to loss of information, since the implementation
- calls toAscii().
+ If the QString contains Unicode characters that the
+ QTextCodec::codecForCStrings() codec cannot handle, using this operator
+ can lead to loss of information.
This operator is only available if Qt is configured with STL
compatibility enabled.
@@ -7138,7 +7153,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
}
/*! \class QLatin1String
- \brief The QLatin1String class provides a thin wrapper around an ASCII/Latin-1 encoded string literal.
+ \brief The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
\ingroup string-processing
\reentrant
@@ -7225,7 +7240,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
\since 4.3
\overload
- The \a other const char pointer is converted to a QLatin1String using
+ The \a other const char pointer is converted to a QString using
the QString::fromAscii() function.
You can disable this operator by defining \c
@@ -7250,7 +7265,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
\since 4.3
\overload operator!=()
- The \a other const char pointer is converted to a QLatin1String using
+ The \a other const char pointer is converted to a QString using
the QString::fromAscii() function.
You can disable this operator by defining \c
@@ -7276,7 +7291,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
\since 4.3
\overload
- The \a other const char pointer is converted to a QLatin1String using
+ The \a other const char pointer is converted to a QString using
the QString::fromAscii() function.
You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII
@@ -7302,7 +7317,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
\since 4.3
\overload
- The \a other const char pointer is converted to a QLatin1String using
+ The \a other const char pointer is converted to a QString using
the QString::fromAscii() function.
You can disable this operator by defining \c
@@ -7328,7 +7343,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
\since 4.3
\overload
- The \a other const char pointer is converted to a QLatin1String using
+ The \a other const char pointer is converted to a QString using
the QString::fromAscii() function.
You can disable this operator by defining \c
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 97afdf5..9df31e5 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -44,7 +44,7 @@
QT_BEGIN_NAMESPACE
static const unsigned short uc_property_trie[] = {
- // 0x11000
+ // 0 - 0x11000
6256, 6288, 6320, 6352, 6384, 6416, 6448, 6480,
6512, 6544, 6576, 6608, 6640, 6672, 6704, 6736,
@@ -1777,42 +1777,42 @@ static const unsigned short uc_property_trie[] = {
42, 42, 560, 561, 562, 160, 563, 564,
565, 565, 565, 565, 566, 42, 42, 42,
- 492, 492, 567, 568, 160, 160, 569, 570,
- 493, 493, 571, 571, 160, 42, 42, 42,
-
- 492, 492, 572, 573, 574, 182, 575, 576,
- 493, 493, 577, 577, 578, 42, 42, 42,
- 160, 160, 579, 580, 581, 160, 582, 583,
- 584, 584, 585, 585, 586, 42, 42, 160,
-
- 587, 587, 587, 587, 587, 587, 587, 588,
- 587, 587, 587, 589, 590, 591, 592, 593,
- 594, 595, 594, 594, 596, 597, 14, 14,
- 598, 599, 600, 601, 598, 602, 600, 601,
-
- 14, 14, 14, 14, 603, 603, 603, 604,
- 605, 606, 607, 608, 609, 610, 611, 612,
- 13, 13, 13, 13, 13, 613, 613, 613,
- 14, 598, 602, 14, 614, 614, 14, 43,
-
- 43, 14, 14, 14, 615, 16, 17, 616,
- 617, 617, 432, 432, 432, 432, 618, 618,
- 618, 618, 185, 619, 620, 621, 622, 618,
- 622, 622, 622, 622, 621, 622, 622, 623,
-
- 624, 625, 625, 625, 160, 160, 160, 160,
- 160, 160, 626, 626, 626, 626, 626, 626,
- 627, 628, 160, 160, 629, 630, 631, 632,
- 633, 634, 635, 635, 36, 16, 17, 50,
-
- 627, 60, 55, 56, 629, 630, 631, 632,
- 633, 634, 635, 635, 36, 16, 17, 160,
+ 492, 492, 567, 166, 160, 160, 568, 569,
+ 493, 493, 570, 570, 160, 42, 42, 42,
+
+ 492, 492, 571, 169, 572, 182, 573, 574,
+ 493, 493, 575, 575, 576, 42, 42, 42,
+ 160, 160, 577, 578, 579, 160, 580, 581,
+ 582, 582, 583, 583, 584, 42, 42, 160,
+
+ 585, 585, 585, 585, 585, 585, 585, 586,
+ 585, 585, 585, 587, 588, 589, 590, 591,
+ 592, 593, 592, 592, 594, 595, 14, 14,
+ 596, 597, 598, 599, 596, 600, 598, 599,
+
+ 14, 14, 14, 14, 601, 601, 601, 602,
+ 603, 604, 605, 606, 607, 608, 609, 610,
+ 13, 13, 13, 13, 13, 611, 611, 611,
+ 14, 596, 600, 14, 612, 612, 14, 43,
+
+ 43, 14, 14, 14, 613, 16, 17, 614,
+ 615, 615, 432, 432, 432, 432, 616, 616,
+ 616, 616, 185, 617, 618, 619, 620, 616,
+ 620, 620, 620, 620, 619, 620, 620, 621,
+
+ 622, 623, 623, 623, 160, 160, 160, 160,
+ 160, 160, 624, 624, 624, 624, 624, 624,
+ 625, 626, 160, 160, 627, 628, 629, 630,
+ 631, 632, 633, 633, 36, 16, 17, 50,
+
+ 625, 60, 55, 56, 627, 628, 629, 630,
+ 631, 632, 633, 633, 36, 16, 17, 160,
484, 484, 484, 484, 484, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
12, 12, 12, 12, 12, 12, 12, 48,
- 12, 12, 12, 636, 637, 429, 429, 429,
- 638, 638, 639, 639, 639, 639, 160, 160,
+ 12, 12, 12, 634, 635, 429, 429, 429,
+ 636, 636, 637, 637, 637, 637, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -1820,32 +1820,32 @@ static const unsigned short uc_property_trie[] = {
139, 139, 144, 144, 139, 139, 139, 139,
144, 144, 144, 139, 139, 273, 273, 273,
- 273, 139, 195, 195, 640, 641, 641, 159,
- 642, 159, 641, 643, 299, 299, 299, 299,
+ 273, 139, 195, 195, 638, 639, 639, 159,
+ 640, 159, 639, 641, 299, 299, 299, 299,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 49, 49, 175, 644, 49, 49, 49, 175,
- 49, 644, 50, 175, 175, 175, 50, 50,
- 175, 175, 175, 50, 49, 175, 645, 49,
+ 49, 49, 175, 642, 49, 49, 49, 175,
+ 49, 642, 50, 175, 175, 175, 50, 50,
+ 175, 175, 175, 50, 49, 175, 643, 49,
49, 175, 175, 175, 175, 175, 49, 49,
- 49, 49, 49, 49, 175, 49, 646, 49,
- 175, 49, 647, 648, 175, 175, 649, 50,
- 175, 175, 650, 175, 50, 90, 90, 90,
- 90, 131, 651, 239, 103, 628, 652, 652,
+ 49, 49, 49, 49, 175, 49, 644, 49,
+ 175, 49, 645, 646, 175, 175, 647, 50,
+ 175, 175, 648, 175, 50, 90, 90, 90,
+ 90, 131, 649, 239, 103, 626, 650, 650,
- 185, 185, 185, 185, 185, 652, 628, 628,
- 628, 628, 653, 185, 418, 301, 654, 160,
+ 185, 185, 185, 185, 185, 650, 626, 626,
+ 626, 626, 651, 185, 418, 301, 652, 160,
160, 160, 160, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62,
- 655, 655, 655, 655, 655, 655, 655, 655,
- 655, 655, 655, 655, 655, 655, 655, 655,
- 656, 656, 656, 656, 656, 656, 656, 656,
- 656, 656, 656, 656, 656, 656, 656, 656,
+ 653, 653, 653, 653, 653, 653, 653, 653,
+ 653, 653, 653, 653, 653, 653, 653, 653,
+ 654, 654, 654, 654, 654, 654, 654, 654,
+ 654, 654, 654, 654, 654, 654, 654, 654,
- 657, 657, 657, 99, 109, 160, 160, 160,
+ 655, 655, 655, 99, 109, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
36, 36, 36, 36, 36, 49, 49, 49,
49, 49, 36, 36, 49, 49, 49, 49,
@@ -1861,52 +1861,52 @@ static const unsigned short uc_property_trie[] = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 651, 651, 651, 651, 651,
- 651, 651, 651, 651, 185, 185, 185, 185,
+ 49, 49, 49, 649, 649, 649, 649, 649,
+ 649, 649, 649, 649, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
36, 36, 36, 36, 36, 36, 36, 36,
- 658, 658, 658, 659, 659, 659, 36, 36,
- 36, 36, 18, 54, 36, 660, 36, 36,
+ 656, 656, 656, 657, 657, 657, 36, 36,
+ 36, 36, 18, 54, 36, 658, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 661, 662, 36, 36,
+ 36, 36, 36, 36, 659, 660, 36, 36,
- 36, 36, 36, 663, 36, 36, 36, 36,
+ 36, 36, 36, 661, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 661, 662, 661, 662, 36, 36,
+ 36, 36, 659, 660, 659, 660, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 661, 662, 661, 662,
- 661, 662, 661, 662, 36, 36, 661, 662,
- 661, 662, 661, 662, 661, 662, 661, 662,
- 661, 662, 661, 662, 661, 662, 661, 662,
+ 36, 36, 36, 36, 659, 660, 659, 660,
+ 659, 660, 659, 660, 36, 36, 659, 660,
+ 659, 660, 659, 660, 659, 660, 659, 660,
+ 659, 660, 659, 660, 659, 660, 659, 660,
- 661, 662, 661, 662, 661, 662, 661, 662,
- 661, 662, 661, 662, 36, 36, 36, 661,
- 662, 661, 662, 36, 36, 36, 36, 36,
- 664, 36, 36, 36, 36, 36, 36, 36,
+ 659, 660, 659, 660, 659, 660, 659, 660,
+ 659, 660, 659, 660, 36, 36, 36, 659,
+ 660, 659, 660, 36, 36, 36, 36, 36,
+ 662, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 661, 662, 36, 36, 665, 36,
- 666, 667, 36, 667, 36, 36, 36, 36,
- 661, 662, 661, 662, 661, 662, 661, 662,
+ 36, 36, 659, 660, 36, 36, 663, 36,
+ 664, 665, 36, 665, 36, 36, 36, 36,
+ 659, 660, 659, 660, 659, 660, 659, 660,
36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36,
- 36, 661, 662, 661, 662, 668, 36, 36,
- 661, 662, 36, 36, 36, 36, 661, 662,
- 661, 662, 661, 662, 661, 662, 661, 662,
+ 36, 659, 660, 659, 660, 666, 36, 36,
+ 659, 660, 36, 36, 36, 36, 659, 660,
+ 659, 660, 659, 660, 659, 660, 659, 660,
- 661, 662, 661, 662, 661, 662, 661, 662,
- 661, 662, 661, 662, 661, 662, 36, 36,
- 661, 662, 669, 669, 669, 185, 670, 670,
- 185, 185, 671, 671, 671, 672, 672, 185,
+ 659, 660, 659, 660, 659, 660, 659, 660,
+ 659, 660, 659, 660, 659, 660, 36, 36,
+ 659, 660, 667, 667, 667, 185, 668, 668,
+ 185, 185, 669, 669, 669, 670, 670, 185,
- 49, 651, 49, 49, 49, 49, 49, 49,
- 661, 662, 661, 662, 49, 49, 49, 49,
+ 49, 649, 49, 49, 49, 49, 49, 49,
+ 659, 660, 659, 660, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
@@ -1923,24 +1923,24 @@ static const unsigned short uc_property_trie[] = {
194, 194, 194, 194, 194, 194, 194, 194,
194, 194, 194, 194, 194, 194, 194, 194,
194, 194, 194, 194, 194, 194, 194, 194,
- 194, 194, 194, 651, 185, 651, 651, 651,
+ 194, 194, 194, 649, 185, 649, 649, 649,
- 651, 651, 651, 651, 651, 651, 651, 651,
- 651, 651, 651, 651, 651, 651, 651, 651,
- 651, 651, 651, 651, 651, 381, 651, 651,
- 651, 651, 651, 185, 185, 185, 185, 185,
+ 649, 649, 649, 649, 649, 649, 649, 649,
+ 649, 649, 649, 649, 649, 649, 649, 649,
+ 649, 649, 649, 649, 649, 381, 649, 649,
+ 649, 649, 649, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 185, 185, 185, 185, 653, 653, 653, 653,
- 653, 653, 653, 653, 653, 653, 653, 653,
+ 185, 185, 185, 185, 651, 651, 651, 651,
+ 651, 651, 651, 651, 651, 651, 651, 651,
- 653, 653, 653, 653, 653, 653, 653, 653,
- 653, 653, 653, 653, 653, 653, 653, 239,
+ 651, 651, 651, 651, 651, 651, 651, 651,
+ 651, 651, 651, 651, 651, 651, 651, 239,
239, 418, 418, 418, 418, 418, 418, 418,
- 418, 418, 418, 418, 673, 673, 673, 673,
+ 418, 418, 418, 418, 671, 671, 671, 671,
- 673, 673, 301, 301, 301, 301, 301, 301,
+ 671, 671, 301, 301, 301, 301, 301, 301,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -1950,7 +1950,7 @@ static const unsigned short uc_property_trie[] = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 651, 651, 160,
+ 49, 49, 49, 49, 49, 649, 649, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -1960,35 +1960,35 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 674, 675, 676, 677, 678, 679, 680, 681,
- 682, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 674, 675, 676, 677,
- 678, 679, 680, 681, 682, 62, 62, 62,
+ 672, 673, 674, 675, 676, 677, 678, 679,
+ 680, 62, 62, 62, 62, 62, 62, 62,
+ 62, 62, 62, 62, 672, 673, 674, 675,
+ 676, 677, 678, 679, 680, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62,
- 60, 55, 56, 629, 630, 631, 632, 633,
- 634, 683, 683, 683, 683, 683, 683, 683,
- 683, 683, 683, 683, 194, 194, 194, 194,
+ 60, 55, 56, 627, 628, 629, 630, 631,
+ 632, 681, 681, 681, 681, 681, 681, 681,
+ 681, 681, 681, 681, 194, 194, 194, 194,
194, 194, 194, 194, 194, 194, 194, 194,
194, 194, 194, 194, 194, 194, 194, 194,
- 194, 194, 194, 194, 194, 194, 684, 684,
- 684, 684, 684, 684, 684, 684, 684, 684,
+ 194, 194, 194, 194, 194, 194, 682, 682,
+ 682, 682, 682, 682, 682, 682, 682, 682,
- 684, 684, 684, 684, 684, 684, 684, 684,
- 684, 684, 684, 684, 684, 684, 684, 684,
- 685, 685, 685, 685, 685, 685, 685, 685,
- 685, 685, 685, 685, 685, 685, 685, 685,
+ 682, 682, 682, 682, 682, 682, 682, 682,
+ 682, 682, 682, 682, 682, 682, 682, 682,
+ 683, 683, 683, 683, 683, 683, 683, 683,
+ 683, 683, 683, 683, 683, 683, 683, 683,
- 685, 685, 685, 685, 685, 685, 685, 685,
- 685, 685, 686, 687, 687, 687, 687, 687,
- 687, 687, 687, 687, 687, 688, 689, 690,
- 691, 692, 693, 694, 695, 696, 687, 697,
+ 683, 683, 683, 683, 683, 683, 683, 683,
+ 683, 683, 684, 685, 685, 685, 685, 685,
+ 685, 685, 685, 685, 685, 686, 687, 688,
+ 689, 690, 691, 692, 693, 694, 685, 695,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 653, 653,
- 653, 653, 653, 653, 653, 653, 653, 653,
+ 49, 49, 49, 49, 49, 49, 651, 651,
+ 651, 651, 651, 651, 651, 651, 651, 651,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
@@ -2002,21 +2002,21 @@ static const unsigned short uc_property_trie[] = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
- 651, 651, 651, 651, 651, 651, 651, 651,
+ 649, 649, 649, 649, 649, 649, 649, 649,
185, 185, 185, 185, 185, 185, 185, 185,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 239, 239, 653, 653,
- 418, 651, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 239, 239, 651, 651,
+ 418, 649, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 36,
- 651, 651, 653, 653, 653, 653, 653, 653,
- 653, 653, 653, 653, 653, 653, 418, 418,
+ 649, 649, 651, 651, 651, 651, 651, 651,
+ 651, 651, 651, 651, 651, 651, 418, 418,
- 653, 653, 653, 653, 653, 653, 653, 653,
- 653, 653, 239, 239, 239, 239, 239, 239,
+ 651, 651, 651, 651, 651, 651, 651, 651,
+ 651, 651, 239, 239, 239, 239, 239, 239,
239, 239, 418, 418, 418, 418, 418, 418,
418, 418, 418, 418, 418, 160, 160, 160,
@@ -2038,16 +2038,16 @@ static const unsigned short uc_property_trie[] = {
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 160, 49, 160, 49,
49, 49, 49, 160, 160, 160, 49, 160,
- 49, 49, 49, 698, 698, 698, 698, 160,
+ 49, 49, 49, 696, 696, 696, 696, 160,
- 160, 49, 699, 699, 49, 49, 49, 49,
- 700, 701, 700, 701, 700, 701, 700, 701,
- 700, 701, 700, 701, 700, 701, 674, 675,
- 676, 677, 678, 679, 680, 681, 682, 62,
+ 160, 49, 697, 697, 49, 49, 49, 49,
+ 698, 699, 698, 699, 698, 699, 698, 699,
+ 698, 699, 698, 699, 698, 699, 672, 673,
+ 674, 675, 676, 677, 678, 679, 680, 62,
- 674, 675, 676, 677, 678, 679, 680, 681,
- 682, 62, 674, 675, 676, 677, 678, 679,
- 680, 681, 682, 62, 49, 160, 160, 160,
+ 672, 673, 674, 675, 676, 677, 678, 679,
+ 680, 62, 672, 673, 674, 675, 676, 677,
+ 678, 679, 680, 62, 49, 160, 160, 160,
49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49,
@@ -2055,13 +2055,13 @@ static const unsigned short uc_property_trie[] = {
160, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 160,
- 702, 702, 702, 703, 704, 705, 706, 673,
- 673, 673, 673, 160, 160, 160, 160, 160,
- 185, 185, 185, 185, 185, 707, 708, 185,
- 185, 185, 185, 185, 185, 707, 708, 185,
+ 700, 700, 700, 701, 702, 703, 704, 671,
+ 671, 671, 671, 160, 160, 160, 160, 160,
+ 185, 185, 185, 185, 185, 705, 706, 185,
+ 185, 185, 185, 185, 185, 705, 706, 185,
- 185, 185, 707, 708, 707, 708, 700, 701,
- 700, 701, 700, 701, 160, 160, 160, 160,
+ 185, 185, 705, 706, 705, 706, 698, 699,
+ 698, 699, 698, 699, 160, 160, 160, 160,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
@@ -2075,55 +2075,55 @@ static const unsigned short uc_property_trie[] = {
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 185, 185, 185, 700, 701, 700, 701, 700,
- 701, 700, 701, 700, 701, 709, 710, 711,
- 712, 700, 701, 700, 701, 700, 701, 700,
- 701, 185, 185, 185, 185, 185, 185, 185,
+ 185, 185, 185, 698, 699, 698, 699, 698,
+ 699, 698, 699, 698, 699, 707, 708, 709,
+ 710, 698, 699, 698, 699, 698, 699, 698,
+ 699, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 713, 185, 185, 185, 185, 185, 185, 185,
+ 711, 185, 185, 185, 185, 185, 185, 185,
- 707, 708, 185, 185, 707, 708, 185, 185,
- 185, 185, 185, 185, 185, 185, 185, 707,
- 708, 707, 708, 185, 707, 708, 185, 185,
- 700, 701, 700, 701, 185, 185, 185, 185,
+ 705, 706, 185, 185, 705, 706, 185, 185,
+ 185, 185, 185, 185, 185, 185, 185, 705,
+ 706, 705, 706, 185, 705, 706, 185, 185,
+ 698, 699, 698, 699, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 185, 185, 185, 185, 185, 714, 185, 185,
- 707, 708, 185, 185, 700, 701, 185, 185,
+ 185, 185, 185, 185, 185, 712, 185, 185,
+ 705, 706, 185, 185, 698, 699, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 185, 185, 185, 707, 708, 707, 708, 185,
- 185, 185, 185, 185, 707, 708, 185, 185,
- 185, 185, 185, 185, 707, 708, 185, 185,
+ 185, 185, 185, 705, 706, 705, 706, 185,
+ 185, 185, 185, 185, 705, 706, 185, 185,
+ 185, 185, 185, 185, 705, 706, 185, 185,
- 185, 185, 185, 185, 707, 708, 185, 185,
+ 185, 185, 185, 185, 705, 706, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
185, 185, 185, 185, 185, 185, 185, 185,
- 185, 707, 708, 185, 185, 707, 708, 707,
+ 185, 705, 706, 185, 185, 705, 706, 705,
- 708, 707, 708, 707, 708, 185, 185, 185,
- 185, 185, 185, 707, 708, 185, 185, 185,
- 185, 707, 708, 707, 708, 707, 708, 707,
- 708, 707, 708, 707, 708, 185, 185, 185,
+ 706, 705, 706, 705, 706, 185, 185, 185,
+ 185, 185, 185, 705, 706, 185, 185, 185,
+ 185, 705, 706, 705, 706, 705, 706, 705,
+ 706, 705, 706, 705, 706, 185, 185, 185,
- 185, 707, 708, 185, 185, 185, 707, 708,
- 707, 708, 707, 708, 707, 708, 185, 707,
- 708, 185, 185, 707, 708, 185, 185, 185,
- 185, 185, 185, 707, 708, 707, 708, 707,
+ 185, 705, 706, 185, 185, 185, 705, 706,
+ 705, 706, 705, 706, 705, 706, 185, 705,
+ 706, 185, 185, 705, 706, 185, 185, 185,
+ 185, 185, 185, 705, 706, 705, 706, 705,
- 708, 707, 708, 707, 708, 707, 708, 185,
- 185, 185, 185, 185, 185, 707, 708, 707,
- 708, 707, 708, 707, 708, 707, 708, 185,
- 185, 185, 185, 185, 185, 185, 715, 185,
+ 706, 705, 706, 705, 706, 705, 706, 185,
+ 185, 185, 185, 185, 185, 705, 706, 705,
+ 706, 705, 706, 705, 706, 705, 706, 185,
+ 185, 185, 185, 185, 185, 185, 713, 185,
- 185, 185, 185, 716, 717, 716, 185, 185,
- 185, 185, 185, 185, 707, 708, 185, 185,
- 185, 185, 185, 185, 185, 185, 185, 707,
- 708, 707, 708, 185, 185, 185, 185, 185,
+ 185, 185, 185, 714, 715, 714, 185, 185,
+ 185, 185, 185, 185, 705, 706, 185, 185,
+ 185, 185, 185, 185, 185, 185, 185, 705,
+ 706, 705, 706, 185, 185, 185, 185, 185,
239, 239, 239, 239, 239, 239, 239, 239,
239, 239, 239, 239, 239, 239, 418, 418,
@@ -2135,24 +2135,24 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 718, 718, 718, 718, 718, 718, 718, 718,
- 718, 718, 718, 718, 718, 718, 718, 718,
- 718, 718, 718, 718, 718, 718, 718, 718,
- 718, 718, 718, 718, 718, 718, 718, 718,
+ 716, 716, 716, 716, 716, 716, 716, 716,
+ 716, 716, 716, 716, 716, 716, 716, 716,
+ 716, 716, 716, 716, 716, 716, 716, 716,
+ 716, 716, 716, 716, 716, 716, 716, 716,
- 718, 718, 718, 718, 718, 718, 718, 718,
- 718, 718, 718, 718, 718, 718, 718, 160,
- 719, 719, 719, 719, 719, 719, 719, 719,
- 719, 719, 719, 719, 719, 719, 719, 719,
+ 716, 716, 716, 716, 716, 716, 716, 716,
+ 716, 716, 716, 716, 716, 716, 716, 160,
+ 717, 717, 717, 717, 717, 717, 717, 717,
+ 717, 717, 717, 717, 717, 717, 717, 717,
- 719, 719, 719, 719, 719, 719, 719, 719,
- 719, 719, 719, 719, 719, 719, 719, 719,
- 719, 719, 719, 719, 719, 719, 719, 719,
- 719, 719, 719, 719, 719, 719, 719, 160,
+ 717, 717, 717, 717, 717, 717, 717, 717,
+ 717, 717, 717, 717, 717, 717, 717, 717,
+ 717, 717, 717, 717, 717, 717, 717, 717,
+ 717, 717, 717, 717, 717, 717, 717, 160,
- 113, 109, 720, 721, 722, 723, 724, 113,
+ 113, 109, 718, 719, 720, 721, 722, 113,
109, 113, 109, 113, 109, 160, 160, 160,
- 160, 160, 160, 160, 725, 113, 109, 725,
+ 160, 160, 160, 160, 723, 113, 109, 723,
160, 160, 160, 160, 160, 160, 160, 160,
105, 106, 105, 106, 105, 106, 105, 106,
@@ -2163,14 +2163,14 @@ static const unsigned short uc_property_trie[] = {
105, 106, 105, 106, 103, 418, 418, 418,
418, 418, 418, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 160, 622, 622, 622, 622, 726, 622, 622,
+ 160, 620, 620, 620, 620, 724, 620, 620,
- 727, 727, 727, 727, 727, 727, 727, 727,
- 727, 727, 727, 727, 727, 727, 727, 727,
- 727, 727, 727, 727, 727, 727, 727, 727,
- 727, 727, 727, 727, 727, 727, 727, 727,
+ 725, 725, 725, 725, 725, 725, 725, 725,
+ 725, 725, 725, 725, 725, 725, 725, 725,
+ 725, 725, 725, 725, 725, 725, 725, 725,
+ 725, 725, 725, 725, 725, 725, 725, 725,
- 727, 727, 727, 727, 727, 727, 160, 160,
+ 725, 725, 725, 725, 725, 725, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
323, 323, 323, 323, 323, 323, 323, 323,
323, 323, 323, 323, 323, 323, 323, 323,
@@ -2195,227 +2195,227 @@ static const unsigned short uc_property_trie[] = {
323, 323, 323, 323, 323, 323, 323, 160,
323, 323, 323, 323, 323, 323, 323, 160,
- 728, 728, 729, 730, 729, 730, 728, 728,
- 728, 729, 730, 728, 729, 730, 622, 622,
- 622, 622, 622, 622, 622, 622, 621, 731,
- 160, 160, 160, 160, 729, 730, 160, 160,
+ 726, 726, 727, 728, 727, 728, 726, 726,
+ 726, 727, 728, 726, 727, 728, 620, 620,
+ 620, 620, 620, 620, 620, 620, 619, 729,
+ 160, 160, 160, 160, 727, 728, 160, 160,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 160, 732, 732, 732, 732, 732,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 160, 730, 730, 730, 730, 730,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 160, 160, 160, 160,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 160, 160,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 160, 160, 160, 160,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 160, 160, 160, 160,
- 733, 734, 735, 736, 737, 738, 739, 740,
+ 731, 732, 733, 734, 735, 736, 737, 738,
16, 17, 16, 17, 16, 17, 16, 17,
- 16, 17, 737, 737, 16, 17, 16, 17,
- 16, 17, 16, 17, 741, 16, 17, 742,
-
- 737, 740, 740, 740, 740, 740, 740, 740,
- 740, 740, 743, 744, 140, 745, 746, 746,
- 747, 748, 748, 748, 748, 748, 737, 737,
- 749, 749, 749, 750, 751, 752, 732, 737,
-
- 160, 753, 739, 753, 739, 753, 739, 753,
- 739, 753, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
-
- 739, 739, 739, 753, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
-
- 739, 739, 739, 753, 739, 753, 739, 753,
- 739, 739, 739, 739, 739, 739, 753, 739,
- 739, 739, 739, 739, 739, 754, 754, 160,
- 160, 755, 755, 756, 756, 757, 757, 758,
-
- 759, 760, 761, 760, 761, 760, 761, 760,
- 761, 760, 761, 761, 761, 761, 761, 761,
- 761, 761, 761, 761, 761, 761, 761, 761,
- 761, 761, 761, 761, 761, 761, 761, 761,
-
- 761, 761, 761, 760, 761, 761, 761, 761,
- 761, 761, 761, 761, 761, 761, 761, 761,
- 761, 761, 761, 761, 761, 761, 761, 761,
- 761, 761, 761, 761, 761, 761, 761, 761,
-
- 761, 761, 761, 760, 761, 760, 761, 760,
- 761, 761, 761, 761, 761, 761, 760, 761,
- 761, 761, 761, 761, 761, 760, 760, 761,
- 761, 761, 761, 762, 763, 763, 763, 764,
-
- 160, 160, 160, 160, 160, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
-
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 160, 160, 160,
- 160, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
-
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 765,
+ 16, 17, 735, 735, 16, 17, 16, 17,
+ 16, 17, 16, 17, 739, 16, 17, 740,
+
+ 735, 738, 738, 738, 738, 738, 738, 738,
+ 738, 738, 741, 742, 140, 743, 744, 744,
+ 745, 746, 746, 746, 746, 746, 735, 735,
+ 747, 747, 747, 748, 749, 750, 730, 735,
+
+ 160, 751, 737, 751, 737, 751, 737, 751,
+ 737, 751, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+
+ 737, 737, 737, 751, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+
+ 737, 737, 737, 751, 737, 751, 737, 751,
+ 737, 737, 737, 737, 737, 737, 751, 737,
+ 737, 737, 737, 737, 737, 752, 752, 160,
+ 160, 753, 753, 754, 754, 755, 755, 756,
+
+ 757, 758, 759, 758, 759, 758, 759, 758,
+ 759, 758, 759, 759, 759, 759, 759, 759,
+ 759, 759, 759, 759, 759, 759, 759, 759,
+ 759, 759, 759, 759, 759, 759, 759, 759,
+
+ 759, 759, 759, 758, 759, 759, 759, 759,
+ 759, 759, 759, 759, 759, 759, 759, 759,
+ 759, 759, 759, 759, 759, 759, 759, 759,
+ 759, 759, 759, 759, 759, 759, 759, 759,
+
+ 759, 759, 759, 758, 759, 758, 759, 758,
+ 759, 759, 759, 759, 759, 759, 758, 759,
+ 759, 759, 759, 759, 759, 758, 758, 759,
+ 759, 759, 759, 760, 761, 761, 761, 762,
+
+ 160, 160, 160, 160, 160, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 160, 160, 160,
+ 160, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 763,
+
+ 763, 763, 763, 763, 763, 763, 763, 763,
+ 763, 763, 763, 763, 763, 763, 763, 160,
+ 764, 764, 765, 765, 765, 765, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
- 765, 765, 765, 765, 765, 765, 765, 765,
- 765, 765, 765, 765, 765, 765, 765, 160,
- 766, 766, 767, 767, 767, 767, 766, 766,
766, 766, 766, 766, 766, 766, 766, 766,
-
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
160, 160, 160, 160, 160, 160, 160, 160,
- 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769,
+ 767, 767, 767, 767, 767, 767, 767, 767,
+ 767, 767, 767, 767, 767, 767, 767, 767,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 770, 770, 770, 770, 770, 770, 770, 770,
- 770, 770, 770, 770, 770, 770, 770, 770,
+ 768, 768, 768, 768, 768, 768, 768, 768,
+ 768, 768, 768, 768, 768, 768, 768, 768,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 771, 771, 160,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 769, 769, 160,
- 767, 767, 767, 767, 767, 767, 767, 767,
- 767, 767, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
+ 765, 765, 765, 765, 765, 765, 765, 765,
+ 765, 765, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
- 766, 766, 766, 766, 160, 160, 160, 160,
+ 764, 764, 764, 764, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 771, 772, 772, 772, 772, 772, 772, 772,
- 772, 772, 772, 772, 772, 772, 772, 772,
+ 769, 770, 770, 770, 770, 770, 770, 770,
+ 770, 770, 770, 770, 770, 770, 770, 770,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 771, 771, 769, 766,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 769, 769, 767, 764,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 772, 772, 772, 772, 772, 772, 772,
- 772, 772, 772, 772, 772, 772, 772, 772,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 770, 770, 770, 770, 770, 770, 770,
+ 770, 770, 770, 770, 770, 770, 770, 770,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 771, 771, 771, 771,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 769, 769, 769, 769,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 160,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 160,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 771,
- 771, 771, 771, 766, 766, 766, 766, 766,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 769,
+ 769, 769, 769, 764, 764, 764, 764, 764,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 771, 771,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 769, 769,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 766,
- 766, 766, 766, 766, 766, 766, 766, 771,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 764,
+ 764, 764, 764, 764, 764, 764, 764, 769,
- 773, 773, 773, 773, 773, 773, 773, 773,
- 773, 773, 773, 773, 773, 773, 773, 773,
- 773, 773, 773, 773, 773, 773, 773, 773,
- 773, 773, 773, 773, 773, 773, 773, 773,
+ 771, 771, 771, 771, 771, 771, 771, 771,
+ 771, 771, 771, 771, 771, 771, 771, 771,
+ 771, 771, 771, 771, 771, 771, 771, 771,
+ 771, 771, 771, 771, 771, 771, 771, 771,
- 773, 773, 773, 773, 773, 773, 773, 773,
- 773, 773, 773, 773, 773, 773, 773, 773,
- 773, 773, 773, 773, 773, 773, 160, 160,
+ 771, 771, 771, 771, 771, 771, 771, 771,
+ 771, 771, 771, 771, 771, 771, 771, 771,
+ 771, 771, 771, 771, 771, 771, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 739, 739,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 737, 737,
- 739, 739, 739, 739, 739, 739, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 160, 160, 160, 160,
+ 737, 737, 737, 737, 737, 737, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 160, 160, 160, 160,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 775, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 773, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766,
- 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 160, 160, 160,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
+ 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 160, 160, 160,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
- 732, 732, 776, 776, 732, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
- 732, 732, 732, 732, 776, 732, 732, 732,
- 732, 732, 732, 732, 732, 732, 732, 732,
+ 730, 730, 774, 774, 730, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
+ 730, 730, 730, 730, 774, 730, 730, 730,
+ 730, 730, 730, 730, 730, 730, 730, 730,
- 732, 776, 732, 732, 732, 776, 732, 160,
+ 730, 774, 730, 730, 730, 774, 730, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 777, 777, 777, 777, 777, 777, 777, 777,
- 777, 777, 777, 777, 777, 777, 777, 777,
- 777, 777, 777, 777, 777, 777, 777, 778,
- 778, 778, 778, 160, 160, 160, 160, 160,
+ 775, 775, 775, 775, 775, 775, 775, 775,
+ 775, 775, 775, 775, 775, 775, 775, 775,
+ 775, 775, 775, 775, 775, 775, 775, 776,
+ 776, 776, 776, 160, 160, 160, 160, 160,
- 779, 779, 160, 160, 160, 160, 160, 160,
+ 777, 777, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 323, 323, 780, 323, 323, 323, 781, 323,
- 323, 323, 323, 782, 323, 323, 323, 323,
+ 323, 323, 778, 323, 323, 323, 779, 323,
+ 323, 323, 323, 780, 323, 323, 323, 323,
323, 323, 323, 323, 323, 323, 323, 323,
323, 323, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 464, 464, 782, 782, 464,
+ 323, 323, 323, 464, 464, 780, 780, 464,
418, 418, 418, 418, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -2427,91 +2427,91 @@ static const unsigned short uc_property_trie[] = {
322, 322, 322, 322, 322, 322, 322, 322,
322, 322, 322, 322, 322, 322, 322, 322,
- 322, 322, 322, 322, 783, 783, 304, 304,
+ 322, 322, 322, 322, 781, 781, 304, 304,
160, 160, 160, 160, 160, 160, 160, 160,
- 784, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 784, 785, 785, 785,
+ 782, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 782, 783, 783, 783,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 784, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 782, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 784, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 782, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 784, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 782, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 784, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 782, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 784, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 782, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 784, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
- 785, 785, 785, 785, 785, 785, 785, 785,
+ 783, 783, 783, 783, 782, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
+ 783, 783, 783, 783, 783, 783, 783, 783,
- 785, 785, 785, 785, 160, 160, 160, 160,
+ 783, 783, 783, 783, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
+ 784, 784, 784, 784, 784, 784, 784, 784,
+ 784, 784, 784, 784, 784, 784, 784, 784,
+ 784, 784, 784, 784, 784, 784, 784, 784,
+ 784, 784, 784, 784, 784, 784, 784, 784,
+
+ 785, 785, 785, 785, 785, 785, 785, 785,
+ 785, 785, 785, 785, 785, 785, 785, 785,
+ 785, 785, 785, 785, 785, 785, 785, 785,
+ 785, 785, 785, 785, 785, 785, 785, 785,
+
+ 737, 737, 737, 737, 737, 737, 737, 737,
+ 737, 737, 737, 737, 737, 737, 160, 160,
+ 786, 786, 786, 786, 786, 786, 786, 786,
+ 786, 786, 786, 786, 786, 786, 786, 786,
+
786, 786, 786, 786, 786, 786, 786, 786,
786, 786, 786, 786, 786, 786, 786, 786,
786, 786, 786, 786, 786, 786, 786, 786,
786, 786, 786, 786, 786, 786, 786, 786,
- 787, 787, 787, 787, 787, 787, 787, 787,
- 787, 787, 787, 787, 787, 787, 787, 787,
- 787, 787, 787, 787, 787, 787, 787, 787,
- 787, 787, 787, 787, 787, 787, 787, 787,
-
- 739, 739, 739, 739, 739, 739, 739, 739,
- 739, 739, 739, 739, 739, 739, 160, 160,
- 788, 788, 788, 788, 788, 788, 788, 788,
- 788, 788, 788, 788, 788, 788, 788, 788,
-
- 788, 788, 788, 788, 788, 788, 788, 788,
- 788, 788, 788, 788, 788, 788, 788, 788,
- 788, 788, 788, 788, 788, 788, 788, 788,
- 788, 788, 788, 788, 788, 788, 788, 788,
-
- 788, 788, 788, 788, 788, 788, 788, 788,
- 788, 788, 788, 160, 160, 160, 160, 160,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
+ 786, 786, 786, 786, 786, 786, 786, 786,
+ 786, 786, 786, 160, 160, 160, 160, 160,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 774, 774, 774, 774, 774, 774,
- 774, 774, 160, 160, 160, 160, 160, 160,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 772, 772, 772, 772, 772, 772,
+ 772, 772, 160, 160, 160, 160, 160, 160,
- 789, 790, 791, 792, 793, 794, 795, 160,
+ 787, 788, 789, 790, 791, 792, 792, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 796, 797, 798, 799, 800,
- 160, 160, 160, 160, 160, 801, 802, 231,
+ 160, 160, 160, 793, 794, 795, 796, 797,
+ 160, 160, 160, 160, 160, 798, 799, 231,
231, 231, 231, 231, 231, 231, 231, 231,
- 231, 635, 231, 231, 231, 231, 231, 231,
+ 231, 633, 231, 231, 231, 231, 231, 231,
231, 231, 231, 231, 231, 231, 231, 205,
231, 231, 231, 231, 231, 205, 231, 205,
@@ -2538,7 +2538,7 @@ static const unsigned short uc_property_trie[] = {
243, 243, 243, 243, 243, 243, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
- 243, 243, 243, 243, 243, 243, 600, 742,
+ 243, 243, 243, 243, 243, 243, 598, 740,
235, 235, 235, 235, 235, 235, 235, 235,
235, 235, 235, 235, 235, 235, 235, 235,
@@ -2552,63 +2552,63 @@ static const unsigned short uc_property_trie[] = {
243, 243, 243, 243, 243, 243, 243, 243,
235, 235, 235, 235, 235, 235, 235, 235,
- 803, 803, 803, 803, 803, 803, 803, 803,
- 803, 803, 803, 803, 803, 803, 803, 803,
+ 800, 800, 800, 800, 800, 800, 800, 800,
+ 800, 800, 800, 800, 800, 800, 800, 800,
- 803, 803, 803, 803, 803, 803, 803, 803,
- 803, 803, 803, 803, 803, 803, 803, 803,
+ 800, 800, 800, 800, 800, 800, 800, 800,
+ 800, 800, 800, 800, 800, 800, 800, 800,
243, 243, 243, 243, 243, 243, 243, 243,
- 243, 243, 243, 243, 804, 239, 235, 235,
+ 243, 243, 243, 243, 801, 239, 235, 235,
423, 423, 423, 423, 423, 423, 423, 423,
423, 423, 423, 423, 423, 423, 423, 423,
- 805, 806, 806, 805, 805, 807, 807, 808,
- 809, 810, 160, 160, 160, 160, 160, 160,
+ 802, 803, 803, 802, 802, 804, 804, 805,
+ 806, 807, 160, 160, 160, 160, 160, 160,
139, 139, 139, 139, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 736, 747, 747, 811, 811, 600, 742, 600,
- 742, 600, 742, 600, 742, 600, 742, 600,
+ 734, 745, 745, 808, 808, 598, 740, 598,
+ 740, 598, 740, 598, 740, 598, 740, 598,
- 742, 600, 742, 600, 742, 752, 752, 812,
- 813, 736, 736, 736, 736, 811, 811, 811,
- 814, 736, 815, 160, 762, 816, 9, 9,
- 747, 16, 17, 16, 17, 16, 17, 817,
+ 740, 598, 740, 598, 740, 750, 750, 809,
+ 810, 734, 734, 734, 734, 808, 808, 808,
+ 811, 734, 812, 160, 760, 813, 9, 9,
+ 745, 16, 17, 16, 17, 16, 17, 814,
- 736, 736, 818, 819, 820, 821, 822, 160,
- 736, 12, 13, 736, 160, 160, 160, 160,
+ 734, 734, 815, 816, 817, 818, 819, 160,
+ 734, 12, 13, 734, 160, 160, 160, 160,
243, 243, 243, 286, 243, 235, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
243, 243, 243, 243, 243, 243, 243, 243,
- 243, 243, 243, 243, 243, 235, 235, 823,
-
- 160, 9, 736, 817, 12, 13, 736, 736,
- 16, 17, 736, 818, 814, 819, 815, 824,
- 825, 826, 827, 828, 829, 830, 831, 832,
- 833, 834, 816, 762, 835, 822, 836, 9,
+ 243, 243, 243, 243, 243, 235, 235, 820,
+
+ 160, 9, 734, 814, 12, 13, 734, 734,
+ 16, 17, 734, 815, 811, 816, 812, 821,
+ 822, 823, 824, 825, 826, 827, 828, 829,
+ 830, 831, 813, 760, 832, 819, 833, 9,
+
+ 734, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 834, 834, 834, 834, 834,
+ 834, 834, 834, 39, 734, 41, 835, 808,
+
+ 835, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 836, 836, 836, 836, 836,
+ 836, 836, 836, 39, 819, 41, 819, 698,
+
+ 699, 733, 16, 17, 732, 760, 837, 758,
+ 758, 758, 758, 758, 758, 758, 758, 758,
+ 761, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837,
- 736, 837, 837, 837, 837, 837, 837, 837,
837, 837, 837, 837, 837, 837, 837, 837,
837, 837, 837, 837, 837, 837, 837, 837,
- 837, 837, 837, 39, 736, 41, 838, 811,
-
- 838, 839, 839, 839, 839, 839, 839, 839,
- 839, 839, 839, 839, 839, 839, 839, 839,
- 839, 839, 839, 839, 839, 839, 839, 839,
- 839, 839, 839, 39, 822, 41, 822, 700,
-
- 701, 735, 16, 17, 734, 762, 840, 760,
- 760, 760, 760, 760, 760, 760, 760, 760,
- 763, 840, 840, 840, 840, 840, 840, 840,
- 840, 840, 840, 840, 840, 840, 840, 840,
-
- 840, 840, 840, 840, 840, 840, 840, 840,
- 840, 840, 840, 840, 840, 840, 840, 840,
- 840, 840, 840, 840, 840, 840, 840, 840,
- 840, 840, 840, 840, 840, 840, 763, 763,
+ 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 761, 761,
90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90,
@@ -2620,10 +2620,10 @@ static const unsigned short uc_property_trie[] = {
160, 160, 90, 90, 90, 90, 90, 90,
160, 160, 90, 90, 90, 160, 160, 160,
- 48, 12, 822, 838, 737, 12, 12, 160,
+ 48, 12, 819, 835, 735, 12, 12, 160,
49, 36, 36, 36, 36, 49, 49, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 160, 841, 841, 841, 842, 49, 843, 843,
+ 160, 838, 838, 838, 839, 49, 840, 840,
308, 308, 308, 308, 308, 308, 308, 308,
308, 308, 308, 308, 160, 308, 308, 308,
@@ -2650,68 +2650,68 @@ static const unsigned short uc_property_trie[] = {
308, 308, 308, 308, 308, 308, 308, 308,
308, 308, 308, 160, 160, 160, 160, 160,
- 844, 845, 846, 160, 160, 160, 160, 847,
- 847, 847, 847, 847, 847, 847, 847, 847,
- 847, 847, 847, 847, 847, 847, 847, 847,
- 847, 847, 847, 847, 847, 847, 847, 847,
+ 841, 842, 843, 160, 160, 160, 160, 844,
+ 844, 844, 844, 844, 844, 844, 844, 844,
+ 844, 844, 844, 844, 844, 844, 844, 844,
+ 844, 844, 844, 844, 844, 844, 844, 844,
- 847, 847, 847, 847, 847, 847, 847, 847,
- 847, 847, 847, 847, 847, 847, 847, 847,
- 847, 847, 847, 847, 160, 160, 160, 848,
- 848, 848, 848, 848, 848, 848, 848, 848,
+ 844, 844, 844, 844, 844, 844, 844, 844,
+ 844, 844, 844, 844, 844, 844, 844, 844,
+ 844, 844, 844, 844, 160, 160, 160, 845,
+ 845, 845, 845, 845, 845, 845, 845, 845,
- 849, 849, 849, 849, 849, 849, 849, 849,
- 849, 849, 849, 849, 849, 849, 849, 849,
- 849, 849, 849, 849, 849, 849, 849, 849,
- 849, 849, 849, 849, 849, 849, 849, 849,
+ 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 846, 846, 846,
- 849, 849, 849, 849, 849, 849, 849, 849,
- 849, 849, 849, 849, 849, 849, 849, 849,
- 849, 849, 849, 849, 849, 726, 726, 726,
- 726, 418, 418, 418, 418, 418, 418, 418,
+ 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 846, 846, 846,
+ 846, 846, 846, 846, 846, 724, 724, 724,
+ 724, 418, 418, 418, 418, 418, 418, 418,
418, 418, 418, 418, 418, 418, 418, 418,
- 418, 418, 726, 160, 160, 160, 160, 160,
+ 418, 418, 724, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 160,
+ 847, 847, 847, 847, 847, 847, 847, 847,
+ 847, 847, 847, 847, 847, 847, 847, 847,
+ 847, 847, 847, 847, 847, 847, 847, 847,
+ 847, 847, 847, 847, 847, 847, 847, 160,
- 851, 851, 851, 851, 160, 160, 160, 160,
+ 848, 848, 848, 848, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 850, 850, 850, 850, 850, 850, 850, 850,
- 850, 850, 850, 850, 850, 850, 850, 850,
+ 847, 847, 847, 847, 847, 847, 847, 847,
+ 847, 847, 847, 847, 847, 847, 847, 847,
- 850, 852, 850, 850, 850, 850, 850, 850,
- 850, 850, 852, 160, 160, 160, 160, 160,
+ 847, 849, 847, 847, 847, 847, 847, 847,
+ 847, 847, 849, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
308, 308, 308, 308, 308, 308, 308, 308,
308, 308, 308, 308, 308, 308, 308, 308,
308, 308, 308, 308, 308, 308, 308, 308,
- 308, 308, 308, 308, 308, 308, 160, 844,
+ 308, 308, 308, 308, 308, 308, 160, 841,
323, 323, 323, 323, 160, 160, 160, 160,
323, 323, 323, 323, 323, 323, 323, 323,
- 465, 853, 853, 853, 853, 853, 160, 160,
+ 465, 850, 850, 850, 850, 850, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 854, 854, 854, 854, 854, 854, 854, 854,
- 854, 854, 854, 854, 854, 854, 854, 854,
- 854, 854, 854, 854, 854, 854, 854, 854,
- 854, 854, 854, 854, 854, 854, 854, 854,
+ 851, 851, 851, 851, 851, 851, 851, 851,
+ 851, 851, 851, 851, 851, 851, 851, 851,
+ 851, 851, 851, 851, 851, 851, 851, 851,
+ 851, 851, 851, 851, 851, 851, 851, 851,
- 854, 854, 854, 854, 854, 854, 855, 855,
- 856, 856, 856, 856, 856, 856, 856, 856,
- 856, 856, 856, 856, 856, 856, 856, 856,
- 856, 856, 856, 856, 856, 856, 856, 856,
+ 851, 851, 851, 851, 851, 851, 852, 852,
+ 853, 853, 853, 853, 853, 853, 853, 853,
+ 853, 853, 853, 853, 853, 853, 853, 853,
+ 853, 853, 853, 853, 853, 853, 853, 853,
- 856, 856, 856, 856, 856, 856, 856, 856,
- 856, 856, 856, 856, 856, 856, 857, 857,
+ 853, 853, 853, 853, 853, 853, 853, 853,
+ 853, 853, 853, 853, 853, 853, 854, 854,
308, 308, 308, 308, 308, 308, 308, 308,
308, 308, 308, 308, 308, 308, 308, 308,
@@ -2725,35 +2725,35 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 858, 858, 858, 858, 858, 858, 205, 205,
- 858, 205, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
+ 855, 855, 855, 855, 855, 855, 205, 205,
+ 855, 205, 855, 855, 855, 855, 855, 855,
+ 855, 855, 855, 855, 855, 855, 855, 855,
+ 855, 855, 855, 855, 855, 855, 855, 855,
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 858, 858,
- 858, 858, 858, 858, 858, 858, 205, 858,
- 858, 205, 205, 205, 858, 205, 205, 858,
+ 855, 855, 855, 855, 855, 855, 855, 855,
+ 855, 855, 855, 855, 855, 855, 855, 855,
+ 855, 855, 855, 855, 855, 855, 205, 855,
+ 855, 205, 205, 205, 855, 205, 205, 855,
- 859, 859, 859, 859, 859, 859, 859, 859,
- 859, 859, 859, 859, 859, 859, 859, 859,
- 859, 859, 859, 859, 859, 859, 860, 860,
- 860, 860, 205, 205, 205, 205, 205, 861,
+ 856, 856, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 856, 857, 857,
+ 857, 857, 205, 205, 205, 205, 205, 858,
- 862, 782, 782, 782, 205, 782, 782, 205,
- 205, 205, 205, 205, 782, 152, 782, 153,
- 862, 862, 862, 862, 205, 862, 862, 862,
- 205, 862, 862, 862, 862, 862, 862, 862,
+ 859, 780, 780, 780, 205, 780, 780, 205,
+ 205, 205, 205, 205, 780, 152, 780, 153,
+ 859, 859, 859, 859, 205, 859, 859, 859,
+ 205, 859, 859, 859, 859, 859, 859, 859,
- 862, 862, 862, 862, 862, 862, 862, 862,
- 862, 862, 862, 862, 862, 862, 862, 862,
- 862, 862, 862, 862, 205, 205, 205, 205,
- 153, 643, 152, 205, 205, 205, 205, 781,
+ 859, 859, 859, 859, 859, 859, 859, 859,
+ 859, 859, 859, 859, 859, 859, 859, 859,
+ 859, 859, 859, 859, 205, 205, 205, 205,
+ 153, 641, 152, 205, 205, 205, 205, 779,
- 863, 864, 865, 866, 867, 867, 867, 867,
+ 860, 861, 862, 863, 864, 864, 864, 864,
205, 205, 205, 205, 205, 205, 205, 205,
- 868, 868, 868, 868, 868, 868, 868, 868,
- 869, 205, 205, 205, 205, 205, 205, 205,
+ 865, 865, 865, 865, 865, 865, 865, 865,
+ 866, 205, 205, 205, 205, 205, 205, 205,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -2854,19 +2854,19 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 870, 870, 870, 870, 870,
- 870, 870, 870, 160, 160, 160, 160, 160,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
481, 481, 481, 481, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -2887,67 +2887,67 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 160, 160,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 160,
- 160, 160, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 872, 873, 874,
- 874, 874, 871, 871, 871, 875, 872, 872,
- 872, 872, 872, 876, 876, 876, 876, 876,
- 876, 876, 876, 877, 877, 877, 877, 877,
- 877, 877, 877, 871, 871, 878, 878, 878,
- 878, 878, 877, 877, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 878, 878, 878, 878, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 871, 871,
- 871, 871, 871, 871, 871, 871, 160, 160,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 160,
+ 160, 160, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 869, 870, 871,
+ 871, 871, 868, 868, 868, 872, 869, 869,
+ 869, 869, 869, 873, 873, 873, 873, 873,
+ 873, 873, 873, 874, 874, 874, 874, 874,
+ 874, 874, 874, 868, 868, 875, 875, 875,
+ 875, 875, 874, 874, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 875, 875, 875, 875, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 868, 868, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -2998,169 +2998,169 @@ static const unsigned short uc_property_trie[] = {
239, 239, 239, 239, 239, 239, 239, 239,
239, 239, 239, 239, 239, 239, 239, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 879, 879, 879, 879, 879, 879, 879, 879,
- 879, 879, 879, 879, 879, 879, 879, 879,
- 879, 879, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
-
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 881, 881,
- 881, 881, 881, 881, 881, 160, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 880, 160, 880, 880,
- 160, 160, 880, 160, 160, 880, 880, 160,
- 160, 880, 880, 880, 880, 160, 880, 880,
- 880, 880, 880, 880, 880, 880, 881, 881,
- 881, 881, 160, 881, 160, 881, 881, 881,
- 881, 102, 881, 881, 160, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
-
- 881, 881, 881, 881, 880, 880, 160, 880,
- 880, 880, 880, 160, 160, 880, 880, 880,
- 880, 880, 880, 880, 880, 160, 880, 880,
- 880, 880, 880, 880, 880, 160, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 160, 880, 880, 880, 880, 160,
- 880, 880, 880, 880, 880, 160, 880, 160,
- 160, 160, 880, 880, 880, 880, 880, 880,
- 880, 160, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
+ 876, 876, 876, 876, 876, 876, 876, 876,
+ 876, 876, 876, 876, 876, 876, 876, 876,
+ 876, 876, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 878, 878,
+ 878, 878, 878, 878, 878, 160, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 877, 160, 877, 877,
+ 160, 160, 877, 160, 160, 877, 877, 160,
+ 160, 877, 877, 877, 877, 160, 877, 877,
+ 877, 877, 877, 877, 877, 877, 878, 878,
+ 878, 878, 160, 878, 160, 878, 878, 878,
+ 878, 102, 878, 878, 160, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+
+ 878, 878, 878, 878, 877, 877, 160, 877,
+ 877, 877, 877, 160, 160, 877, 877, 877,
+ 877, 877, 877, 877, 877, 160, 877, 877,
+ 877, 877, 877, 877, 877, 160, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 160, 877, 877, 877, 877, 160,
+ 877, 877, 877, 877, 877, 160, 877, 160,
+ 160, 160, 877, 877, 877, 877, 877, 877,
+ 877, 160, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 103, 103, 160, 160,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 882, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 882, 881, 881, 881, 881,
- 881, 881, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 882, 881, 881, 881, 881,
-
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 882, 881, 881,
- 881, 881, 881, 881, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 882, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 882,
- 881, 881, 881, 881, 881, 881, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 882,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 882, 881, 881, 881, 881, 881, 881,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 880, 880, 880, 880, 880, 880, 880,
- 880, 882, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 881, 881, 881, 881, 881,
- 881, 881, 881, 882, 881, 881, 881, 881,
- 881, 881, 883, 725, 160, 160, 884, 885,
- 886, 887, 888, 889, 890, 891, 892, 893,
- 884, 885, 886, 887, 888, 889, 890, 891,
- 892, 893, 884, 885, 886, 887, 888, 889,
- 890, 891, 892, 893, 884, 885, 886, 887,
- 888, 889, 890, 891, 892, 893, 884, 885,
- 886, 887, 888, 889, 890, 891, 892, 893,
-
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 160,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 103, 103, 160, 160,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 879, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 879, 878, 878, 878, 878,
+ 878, 878, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 879, 878, 878, 878, 878,
+
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 879, 878, 878,
+ 878, 878, 878, 878, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 879, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 879,
+ 878, 878, 878, 878, 878, 878, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 879,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 879, 878, 878, 878, 878, 878, 878,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 877, 877, 877, 877, 877, 877, 877,
+ 877, 879, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 878, 878, 878, 878, 878,
+ 878, 878, 878, 879, 878, 878, 878, 878,
+ 878, 878, 880, 723, 160, 160, 881, 882,
+ 883, 884, 885, 886, 887, 888, 889, 890,
+ 881, 882, 883, 884, 885, 886, 887, 888,
+ 889, 890, 881, 882, 883, 884, 885, 886,
+ 887, 888, 889, 890, 881, 882, 883, 884,
+ 885, 886, 887, 888, 889, 890, 881, 882,
+ 883, 884, 885, 886, 887, 888, 889, 890,
+
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -3182,78 +3182,78 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 894, 894,
+ 160, 160, 160, 160, 160, 160, 891, 891,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 160,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 895, 895,
- 895, 895, 895, 895, 895, 895, 160, 160,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 892, 892,
+ 892, 892, 892, 892, 892, 892, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -3283,22 +3283,22 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 160, 876, 160, 160, 160, 160, 160, 160,
+ 160, 873, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
+ 873, 873, 873, 873, 873, 873, 873, 873,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
@@ -3349,71 +3349,71 @@ static const unsigned short uc_property_trie[] = {
160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
-
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 896, 896,
- 896, 896, 896, 896, 896, 896, 894, 894,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 893, 893,
+ 893, 893, 893, 893, 893, 893, 891, 891,
};
#define GET_PROP_INDEX(ucs4) \
@@ -3424,904 +3424,901 @@ static const unsigned short uc_property_trie[] = {
#define GET_PROP_INDEX_UCS2(ucs2) \
(uc_property_trie[uc_property_trie[ucs2>>5] + (ucs2 & 0x1f)])
-static const QUnicodeTables::Properties uc_properties [] = {
- { 10, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0},
- { 10, 15, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3},
- { 10, 30, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1},
- { 10, 31, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3},
- { 10, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3},
- { 10, 29, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
- { 10, 19, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0},
- { 10, 19, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0},
- { 7, 28, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 26, 5, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 26, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 8, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10},
- { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 27, 8, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 21, 14, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8},
- { 26, 6, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 10, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0},
- { 26, 7, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 32, 0, 0, 32, 0, 3, 5},
- { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 10},
- { 26, 8, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 10},
- { 29, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 20, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -32, -32, 0, 0, 3, 4},
- { 27, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 10, 11, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1},
- { 7, 3, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 28, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 10},
- { 11, 15, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 30, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 8, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 29, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 743, 743, 775, 0, 3, 4},
- { 26, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0},
- { 6, 11, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 10},
- { 6, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 3, 0, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 121, 121, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -232, -232, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 91, 88, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -121, 0, 0, -121, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -300, -300, -268, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 195, 195, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 210, 0, 0, 210, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 206, 0, 0, 206, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 205, 0, 0, 205, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 79, 0, 0, 79, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 202, 0, 0, 202, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 203, 0, 0, 203, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 207, 0, 0, 207, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 97, 97, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 211, 0, 0, 211, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 209, 0, 0, 209, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 163, 163, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 213, 0, 0, 213, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 214, 0, 0, 214, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 218, 0, 0, 218, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 217, 0, 0, 217, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 219, 0, 0, 219, 0, 3, 5},
- { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 56, 56, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -79, -79, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 113, 110, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -97, 0, 0, -97, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10795, 0, 0, 10795, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -163, 0, 0, -163, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10792, 0, 0, 10792, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -195, 0, 0, -195, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 69, 0, 0, 69, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 71, 0, 0, 71, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -210, -210, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -206, -206, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -205, -205, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -202, -202, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -203, -203, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -207, -207, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -209, -209, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -211, -211, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10743, 10743, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -213, -213, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -214, -214, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10727, 10727, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -218, -218, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -69, -69, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -217, -217, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -71, -71, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -219, -219, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 18, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 18, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 29, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 29, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 230, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 232, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 216, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 202, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 240, 0, -1, 1, 0, 0, 0, 0, 0, 0, 84, 84, 116, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 232, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 233, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 234, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 233, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 234, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 3, 17, 233, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 0, 11, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 38, 0, 0, 38, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 37, 0, 0, 37, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 64, 0, 0, 64, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 63, 0, 0, 63, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 98, 94, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -38, -38, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -37, -37, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 106, 102, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -31, -31, 1, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -64, -64, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -63, -63, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -62, -62, -30, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -57, -57, -25, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -47, -47, -15, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -54, -54, -22, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -86, -86, -54, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, -48, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -96, -96, -64, 0, 3, 4},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4},
- { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 3, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 15, 0, 0, 15, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -15, -15, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5},
- { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 55, 52, 0, 0, 3, 4},
- { 26, 7, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 9},
- { 21, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 11, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 220, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 222, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 228, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 10, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 11, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 12, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 13, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 14, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 15, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 16, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 17, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 18, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 19, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 19, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 20, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 21, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 22, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 15, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 23, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 24, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 25, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 5, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 18, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 19, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0},
- { 11, 11, 13, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 0, 11, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 9, 13, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 7, 13, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 30, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 13, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 19, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 2, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 18, 11, 13, 0, 3, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 27, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 28, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 29, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 30, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 31, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 32, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 33, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 34, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 4, 10, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 5, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 5, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 10, 5, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 11, 13, 0, 1, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 35, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 19, 11, 13, 0, 1, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 2, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 11, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 3, 19, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 18, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 2, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 11, 13, 0, 1, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 26, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 11, 11, 18, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 1, 19, 17, 36, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 19, 11, 13, 0, 1, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 2, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 19, 11, 13, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 4, 10, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 7, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 1, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 19, 11, 1, 0, 1, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 230, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 18, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 7, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 26, 5, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 18, 11, 1, 0, 3, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 7, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 9, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 15, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 4, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 19, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 2, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 6, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 28, 8, 4, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 10, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 1, 19, 17, 84, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 91, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 7, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 9, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 26, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 1, 26, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 26, 17, 103, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 26, 17, 9, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 18, 26, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 1, 26, 17, 107, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 15, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 26, 17, 118, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 26, 17, 122, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 19, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 16, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 16, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 3, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 5, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 6, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 216, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 22, 0, 10, 0, 0, -1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 2, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 2, 19, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 129, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 130, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 132, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 9, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 30, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 16, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 2, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 1, 26, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 26, 17, 7, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 26, 17, 9, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 4, 10, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 7264, 0, 0, 7264, 0, 3, 5},
- { 19, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 18, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 23, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 6},
- { 19, 24, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 6},
- { 19, 25, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 6},
- { 30, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 6, 11, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 7, 15, 9, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 22, 0, 10, 0, 0, -1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 4, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 5, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 9, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 15, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 11, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 26, 4, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 28, 8, 4, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 26, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 6, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 21, 16, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 7, 3, 9, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 1, 19, 17, 228, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 17, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 222, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 5, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 4, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 19, 26, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 19, 26, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 2, 26, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 4, 10, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 26, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 2, 19, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 26, 15, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 2, 19, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 7, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 9, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 10, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 7, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 26, 15, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 15, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 18, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 3814, 3814, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 119, 116, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 125, 122, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 131, 128, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 137, 134, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 143, 140, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, -59, -59, -58, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8, 0, 0, -8, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 149, 146, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 156, 152, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 164, 160, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 172, 168, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 74, 74, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 112, 112, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 126, 126, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 244, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 247, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 250, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 253, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 256, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 259, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 262, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 265, 8, 0, 0, 3, 4},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 244, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 247, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 250, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 253, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 256, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 259, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 262, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 268, 0, -8, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 271, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 274, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 277, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 280, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 283, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 286, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 289, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 292, 8, 0, 0, 3, 4},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 271, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 274, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 277, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 280, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 283, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 286, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 289, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 295, 0, -8, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 298, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 301, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 304, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 307, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 310, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 313, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 316, 8, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 319, 8, 0, 0, 3, 4},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 298, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 301, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 304, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 307, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 310, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 313, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 316, 0, -8, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 322, 0, -8, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 346, 343, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 325, 9, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 352, 349, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 179, 176, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 383, 379, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -74, 0, 0, -74, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 328, 0, -9, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -7205, -7205, -7173, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 358, 355, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 331, 9, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 364, 361, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 185, 182, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 391, 387, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -86, 0, 0, -86, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 334, 0, -9, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 192, 188, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 94, 94, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 199, 196, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 206, 202, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -100, 0, 0, -100, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 214, 210, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 102, 102, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 221, 218, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 227, 224, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 234, 230, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -112, 0, 0, -112, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 370, 367, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 337, 9, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 376, 373, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 241, 238, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 399, 395, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -126, 0, 0, -126, 0, 3, 5},
- { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 340, 0, -9, 0, 3, 5},
- { 7, 15, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 7, 3, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 11, 18, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 11, 19, 18, 0, 3, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 11, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 21, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 21, 3, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 21, 17, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 21, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 4, 10},
- { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 26, 13, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0},
- { 8, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1},
- { 9, 31, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1},
- { 11, 19, 11, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 14, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 16, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 12, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 15, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 7, 3, 6, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 26, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 27, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 26, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 4, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 20, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0},
- { 26, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 7, 15, 9, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 11, 20, 18, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 11, 18, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 11, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 6, 11, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 6, 11, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 8, 4, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 8, 4, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 8, 4, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 8, 4, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 3, 19, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 1, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 220, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 1, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 30, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 8, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7517, 0, 0, -7517, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8383, 0, 0, -8383, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8262, 0, 0, -8262, 0, 3, 5},
- { 30, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 28, 0, 0, 28, 0, 3, 5},
- { 30, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5},
- { 30, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -28, -28, 0, 0, 3, 4},
- { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 16, 0, 0, 16, 0, 3, 5},
- { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -16, -16, 0, 0, 3, 4},
- { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2016, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1824, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2104, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2108, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2106, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -138, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 2, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 26, 0, 0, 26, 0, 3, 5},
- { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -26, -26, 0, 0, 3, 4},
- { 6, 11, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 7, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 10, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 30, 5, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0},
- { 22, 0, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0},
- { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 10},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1824, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2016, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2104, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2106, 0, 0, 0, 0, 0, 0, 0},
- { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2108, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10743, 0, 0, -10743, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -3814, 0, 0, -3814, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10727, 0, 0, -10727, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10795, -10795, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10792, -10792, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 6, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -7264, -7264, 0, 0, 3, 4},
- { 26, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 24, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10},
- { 25, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10},
- { 21, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 12, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 7, 12, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3},
- { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 5, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 21, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 1, 19, 17, 218, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 228, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 222, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 224, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 21, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 5, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 18, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 26, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 1, 19, 17, 8, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 29, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0},
- { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 21, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0},
- { 19, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 26, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 12, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 30, 12, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 19, 12, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 18, 4, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 29, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 18, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 29, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 2, 19, 17, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 9, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 26, 16, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 21, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 3, 6},
- { 19, 22, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 3, 6},
- { 12, 27, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 13, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 12, 9, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 18, 15, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 24, 21, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 31, 27, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 39, 35, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 46, 43, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 49, 43, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 61, 58, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 67, 64, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 73, 70, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 79, 76, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 85, 82, 0, 0, 3, 4},
- { 19, 11, 1, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 1, 19, 17, 26, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 0, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 28, 9, 13, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 7, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0},
- { 26, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 5, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 22, 0, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 26, 13, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 20, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0},
- { 22, 0, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 23, 1, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10},
- { 26, 1, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 1, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9},
- { 26, 4, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 12, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 21, 12, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 11, 20, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 26, 12, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 4, 12, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0},
- { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0},
- { 15, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 32, 0, 0, 32, 0, 3, 5},
- { 29, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 16, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -32, -32, 0, 0, 3, 4},
- { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6},
- { 11, 19, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 30, 11, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 15, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 30, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 5, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 6, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 5, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 5, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 40, 0, 0, 40, 0, 3, 5},
- { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 40, 0, 0, 40, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -40, -40, 0, 0, 3, 4},
- { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -40, -40, 0, 0, 3, 4},
- { 19, 11, 1, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 19, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 6, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 6, 11, 1, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 1, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 1, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 1, 0, 0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 6, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 15, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 26, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 5, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6},
- { 30, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 2, 19, 0, 216, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 216, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 1, 19, 17, 1, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 2, 19, 0, 226, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 11, 19, 18, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2},
- { 1, 19, 17, 220, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 1, 19, 17, 230, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0},
- { 6, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5},
- { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4},
- { 27, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5},
- { 4, 10, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 4, 10, 2, 0, 0, 9, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7},
- { 0, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 19, 12, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6},
- { 13, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+static const QUnicodeTables::Properties uc_properties[] = {
+ { 10, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 },
+ { 10, 15, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 },
+ { 10, 30, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1 },
+ { 10, 31, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 },
+ { 10, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 },
+ { 10, 29, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 },
+ { 10, 19, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 },
+ { 10, 19, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 },
+ { 7, 28, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 26, 5, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 26, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 8, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10 },
+ { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 27, 8, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 21, 14, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8 },
+ { 26, 6, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 10, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 },
+ { 26, 7, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 32, 0, 0, 32, 0, 3, 5 },
+ { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 10 },
+ { 26, 8, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 10 },
+ { 29, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 20, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -32, -32, 0, 0, 3, 4 },
+ { 27, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 10, 11, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1 },
+ { 7, 3, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 28, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 10 },
+ { 11, 15, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 30, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 8, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 29, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 743, 743, 775, 0, 3, 4 },
+ { 26, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 },
+ { 6, 11, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 10 },
+ { 6, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 3, 0, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 121, 121, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -232, -232, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 85, 85, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -121, 0, 0, -121, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -300, -300, -268, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 195, 195, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 210, 0, 0, 210, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 206, 0, 0, 206, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 205, 0, 0, 205, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 79, 0, 0, 79, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 202, 0, 0, 202, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 203, 0, 0, 203, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 207, 0, 0, 207, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 97, 97, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 211, 0, 0, 211, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 209, 0, 0, 209, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 163, 163, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 213, 0, 0, 213, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 214, 0, 0, 214, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 218, 0, 0, 218, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 217, 0, 0, 217, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 219, 0, 0, 219, 0, 3, 5 },
+ { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 56, 56, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -79, -79, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 96, 96, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -97, 0, 0, -97, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10795, 0, 0, 10795, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -163, 0, 0, -163, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10792, 0, 0, 10792, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -195, 0, 0, -195, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 69, 0, 0, 69, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 71, 0, 0, 71, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -210, -210, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -206, -206, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -205, -205, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -202, -202, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -203, -203, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -207, -207, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -209, -209, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -211, -211, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10743, 10743, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -213, -213, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -214, -214, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10727, 10727, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -218, -218, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -69, -69, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -217, -217, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -71, -71, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -219, -219, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 18, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 18, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 29, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 29, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 230, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 232, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 216, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 202, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 240, 0, -1, 1, 0, 0, 0, 0, 0, 0, 84, 84, 116, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 232, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 233, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 234, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 233, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 234, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 3, 17, 233, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 14, 11, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 38, 0, 0, 38, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 37, 0, 0, 37, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 64, 0, 0, 64, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 63, 0, 0, 63, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 88, 88, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -38, -38, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -37, -37, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 92, 92, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -31, -31, 1, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -64, -64, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -63, -63, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -62, -62, -30, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -57, -57, -25, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -47, -47, -15, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -54, -54, -22, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -86, -86, -54, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, -48, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -96, -96, -64, 0, 3, 4 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 },
+ { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 3, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 15, 0, 0, 15, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -15, -15, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 },
+ { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 52, 49, 0, 0, 3, 4 },
+ { 26, 7, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 9 },
+ { 21, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 14, 11, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 220, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 222, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 228, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 10, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 11, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 12, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 13, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 14, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 15, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 16, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 17, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 18, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 19, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 19, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 20, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 21, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 22, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 15, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 23, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 24, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 25, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 5, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 18, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 19, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 26, 11, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 },
+ { 11, 11, 13, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 14, 11, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 9, 13, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 7, 13, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 30, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 13, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 19, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 2, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 18, 11, 13, 0, 3, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 27, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 28, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 29, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 30, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 31, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 32, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 33, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 34, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 4, 10, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 5, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 5, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 10, 5, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 11, 13, 0, 1, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 35, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 19, 11, 13, 0, 1, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 2, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 11, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 3, 19, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 18, 11, 13, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 2, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 11, 13, 0, 1, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 26, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 11, 11, 18, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 1, 19, 17, 36, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 19, 11, 13, 0, 1, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 2, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 13, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 19, 11, 13, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 4, 10, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 7, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 1, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 19, 11, 1, 0, 1, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 230, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 18, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 7, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 26, 5, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 18, 11, 1, 0, 3, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 7, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 9, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 15, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 4, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 19, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 2, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 6, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 28, 8, 4, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 10, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 1, 19, 17, 84, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 91, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 7, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 9, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 26, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 1, 26, 17, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 26, 17, 103, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 26, 17, 9, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 18, 26, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 1, 26, 17, 107, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 15, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 26, 17, 118, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 26, 17, 122, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 19, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 16, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 16, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 3, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 5, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 10, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 6, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 216, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 22, 0, 10, 0, 0, -1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 2, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 2, 19, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 129, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 130, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 132, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 15, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 9, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 30, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 16, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 2, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 1, 26, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 26, 17, 7, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 26, 17, 9, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 4, 10, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 7264, 0, 0, 7264, 0, 3, 5 },
+ { 19, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 18, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 23, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 6 },
+ { 19, 24, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 6 },
+ { 19, 25, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 6 },
+ { 30, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 6, 11, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 7, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, 9, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 7, 15, 9, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 22, 0, 10, 0, 0, -1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 4, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 5, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 9, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 15, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 11, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 26, 4, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 26, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 28, 8, 4, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 26, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 6, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 21, 16, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 7, 3, 9, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 1, 19, 17, 228, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 17, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 222, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 5, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 4, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 19, 26, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 19, 26, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 2, 26, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 4, 10, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 26, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 2, 19, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 26, 15, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 2, 19, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 7, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 9, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 10, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 7, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 26, 15, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 15, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 18, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 3814, 3814, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 99, 99, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 102, 102, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 105, 105, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 108, 108, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 111, 111, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, -59, -59, -58, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8, 0, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 114, 114, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 117, 117, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 121, 121, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 125, 125, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 74, 74, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 112, 112, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 126, 126, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 163, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 166, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 169, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 172, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 175, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 178, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 181, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 184, 8, 0, 0, 3, 4 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 163, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 166, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 169, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 172, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 175, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 178, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 181, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 184, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 187, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 190, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 193, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 196, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 199, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 202, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 205, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 208, 8, 0, 0, 3, 4 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 187, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 190, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 193, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 196, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 199, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 202, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 205, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 208, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 211, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 214, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 217, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 220, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 223, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 226, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 229, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 232, 8, 0, 0, 3, 4 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 211, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 214, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 217, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 220, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 223, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 226, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 229, 0, -8, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 232, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 247, 244, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 235, 9, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 253, 250, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 129, 129, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 284, 280, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -74, 0, 0, -74, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 235, 0, -9, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -7205, -7205, -7173, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 259, 256, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 238, 9, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 265, 262, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 132, 132, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 292, 288, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -86, 0, 0, -86, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 238, 0, -9, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 135, 135, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 139, 139, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 142, 142, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -100, 0, 0, -100, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 146, 146, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 150, 150, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 153, 153, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 156, 156, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -112, 0, 0, -112, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 271, 268, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 241, 9, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 277, 274, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 160, 160, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 300, 296, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -126, 0, 0, -126, 0, 3, 5 },
+ { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 241, 0, -9, 0, 3, 5 },
+ { 7, 15, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 7, 3, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 11, 18, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 11, 19, 18, 0, 3, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 11, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 21, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 21, 3, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 21, 17, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 21, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 4, 10 },
+ { 22, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 26, 13, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 },
+ { 8, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1 },
+ { 9, 31, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1 },
+ { 11, 19, 11, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 14, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 16, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 12, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 15, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 7, 3, 6, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 26, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 27, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 26, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 4, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 20, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0 },
+ { 26, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 7, 15, 9, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 11, 20, 18, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 11, 18, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 11, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 6, 11, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 6, 11, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 8, 4, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 8, 4, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 8, 4, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 8, 4, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 3, 19, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 1, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 220, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 1, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 30, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 8, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7517, 0, 0, -7517, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8383, 0, 0, -8383, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8262, 0, 0, -8262, 0, 3, 5 },
+ { 30, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 28, 0, 0, 28, 0, 3, 5 },
+ { 30, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 },
+ { 30, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -28, -28, 0, 0, 3, 4 },
+ { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 16, 0, 0, 16, 0, 3, 5 },
+ { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -16, -16, 0, 0, 3, 4 },
+ { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2016, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1824, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2104, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2108, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2106, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -138, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 2, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 26, 0, 0, 26, 0, 3, 5 },
+ { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -26, -26, 0, 0, 3, 4 },
+ { 6, 11, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 7, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 10, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 30, 5, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 },
+ { 22, 0, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 },
+ { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 10 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1824, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2016, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2104, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2106, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2108, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10743, 0, 0, -10743, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -3814, 0, 0, -3814, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10727, 0, 0, -10727, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10795, -10795, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10792, -10792, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 6, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -7264, -7264, 0, 0, 3, 4 },
+ { 26, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 24, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 },
+ { 25, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 },
+ { 21, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 12, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 7, 12, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
+ { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 5, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 21, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 23, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 1, 19, 17, 218, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 228, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 222, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 224, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 21, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 5, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 18, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 26, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 1, 19, 17, 8, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 29, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 },
+ { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 21, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0 },
+ { 19, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 26, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 19, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 12, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 4, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 30, 12, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 12, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 19, 12, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 18, 4, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 12, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 29, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 18, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 29, 11, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 2, 19, 17, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 9, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 26, 16, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 21, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 3, 6 },
+ { 19, 22, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 3, 6 },
+ { 12, 27, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 13, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 12, 9, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 18, 15, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 24, 21, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 31, 27, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 39, 35, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 46, 43, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 58, 55, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 64, 61, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 70, 67, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 76, 73, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 82, 79, 0, 0, 3, 4 },
+ { 19, 11, 1, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 1, 19, 17, 26, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 14, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 28, 9, 13, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 7, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 },
+ { 26, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 5, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 22, 0, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 26, 13, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 20, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0 },
+ { 22, 0, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 23, 1, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 },
+ { 26, 1, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 1, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
+ { 26, 4, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 12, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 21, 12, 3, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 11, 20, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 26, 12, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 4, 12, 2, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 },
+ { 27, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 32, 0, 0, 32, 0, 3, 5 },
+ { 29, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 16, 12, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -32, -32, 0, 0, 3, 4 },
+ { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6 },
+ { 11, 19, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 30, 11, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 15, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 30, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 5, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 6, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 5, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 5, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 40, 0, 0, 40, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 40, 0, 0, 40, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -40, -40, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -40, -40, 0, 0, 3, 4 },
+ { 19, 11, 1, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 19, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 6, 11, 1, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 10, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 6, 11, 1, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 1, 0, 0, 2, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 1, 0, 0, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 1, 0, 0, 4, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 6, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 15, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 26, 11, 1, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 5, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
+ { 30, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 2, 19, 0, 216, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 216, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 1, 19, 17, 1, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 2, 19, 0, 226, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 11, 19, 18, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
+ { 1, 19, 17, 220, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 1, 19, 17, 230, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
+ { 6, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
+ { 27, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 },
+ { 4, 10, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 4, 10, 2, 0, 0, 9, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 },
+ { 14, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 19, 12, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
+ { 13, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
};
static inline const QUnicodeTables::Properties *qGetProp(uint ucs4)
@@ -4348,35 +4345,103 @@ Q_CORE_EXPORT const QUnicodeTables::Properties * QT_FASTCALL QUnicodeTables::pro
return uc_properties + index;
}
-#define CURRENT_VERSION QChar::Unicode_5_0
-
-static const ushort specialCaseMap [] = {
- 0x53, 0x73, 0x0, 0x53, 0x53, 0x0, 0x69, 0x307, 0x0, 0x46, 0x66, 0x0, 0x46, 0x46, 0x0, 0x46,
- 0x69, 0x0, 0x46, 0x49, 0x0, 0x46, 0x6c, 0x0, 0x46, 0x4c, 0x0, 0x46, 0x66, 0x69, 0x0, 0x46,
- 0x46, 0x49, 0x0, 0x46, 0x66, 0x6c, 0x0, 0x46, 0x46, 0x4c, 0x0, 0x53, 0x74, 0x0, 0x53, 0x54,
- 0x0, 0x53, 0x54, 0x0, 0x535, 0x582, 0x0, 0x535, 0x552, 0x0, 0x544, 0x576, 0x0, 0x544, 0x546, 0x0,
- 0x544, 0x565, 0x0, 0x544, 0x535, 0x0, 0x544, 0x56b, 0x0, 0x544, 0x53b, 0x0, 0x54e, 0x576, 0x0, 0x54e,
- 0x546, 0x0, 0x544, 0x56d, 0x0, 0x544, 0x53d, 0x0, 0x2bc, 0x4e, 0x0, 0x2bc, 0x4e, 0x0, 0x399, 0x308,
- 0x301, 0x0, 0x399, 0x308, 0x301, 0x0, 0x3a5, 0x308, 0x301, 0x0, 0x3a5, 0x308, 0x301, 0x0, 0x4a, 0x30c,
- 0x0, 0x4a, 0x30c, 0x0, 0x48, 0x331, 0x0, 0x48, 0x331, 0x0, 0x54, 0x308, 0x0, 0x54, 0x308, 0x0,
- 0x57, 0x30a, 0x0, 0x57, 0x30a, 0x0, 0x59, 0x30a, 0x0, 0x59, 0x30a, 0x0, 0x41, 0x2be, 0x0, 0x41,
- 0x2be, 0x0, 0x3a5, 0x313, 0x0, 0x3a5, 0x313, 0x0, 0x3a5, 0x313, 0x300, 0x0, 0x3a5, 0x313, 0x300, 0x0,
- 0x3a5, 0x313, 0x301, 0x0, 0x3a5, 0x313, 0x301, 0x0, 0x3a5, 0x313, 0x342, 0x0, 0x3a5, 0x313, 0x342, 0x0,
- 0x391, 0x342, 0x0, 0x391, 0x342, 0x0, 0x397, 0x342, 0x0, 0x397, 0x342, 0x0, 0x399, 0x308, 0x300, 0x0,
- 0x399, 0x308, 0x300, 0x0, 0x399, 0x342, 0x0, 0x399, 0x342, 0x0, 0x399, 0x308, 0x342, 0x0, 0x399, 0x308,
- 0x342, 0x0, 0x3a5, 0x308, 0x300, 0x0, 0x3a5, 0x308, 0x300, 0x0, 0x3a1, 0x313, 0x0, 0x3a1, 0x313, 0x0,
- 0x3a5, 0x342, 0x0, 0x3a5, 0x342, 0x0, 0x3a5, 0x308, 0x342, 0x0, 0x3a5, 0x308, 0x342, 0x0, 0x3a9, 0x342,
- 0x0, 0x3a9, 0x342, 0x0, 0x1f08, 0x399, 0x0, 0x1f09, 0x399, 0x0, 0x1f0a, 0x399, 0x0, 0x1f0b, 0x399, 0x0,
- 0x1f0c, 0x399, 0x0, 0x1f0d, 0x399, 0x0, 0x1f0e, 0x399, 0x0, 0x1f0f, 0x399, 0x0, 0x1f0f, 0x399, 0x0, 0x1f28,
- 0x399, 0x0, 0x1f29, 0x399, 0x0, 0x1f2a, 0x399, 0x0, 0x1f2b, 0x399, 0x0, 0x1f2c, 0x399, 0x0, 0x1f2d, 0x399,
- 0x0, 0x1f2e, 0x399, 0x0, 0x1f2f, 0x399, 0x0, 0x1f2f, 0x399, 0x0, 0x1f68, 0x399, 0x0, 0x1f69, 0x399, 0x0,
- 0x1f6a, 0x399, 0x0, 0x1f6b, 0x399, 0x0, 0x1f6c, 0x399, 0x0, 0x1f6d, 0x399, 0x0, 0x1f6e, 0x399, 0x0, 0x1f6f,
- 0x399, 0x0, 0x1f6f, 0x399, 0x0, 0x391, 0x399, 0x0, 0x391, 0x399, 0x0, 0x397, 0x399, 0x0, 0x397, 0x399,
- 0x0, 0x3a9, 0x399, 0x0, 0x3a9, 0x399, 0x0, 0x1fba, 0x345, 0x0, 0x1fba, 0x399, 0x0, 0x386, 0x345, 0x0,
- 0x386, 0x399, 0x0, 0x1fca, 0x345, 0x0, 0x1fca, 0x399, 0x0, 0x389, 0x345, 0x0, 0x389, 0x399, 0x0, 0x1ffa,
- 0x345, 0x0, 0x1ffa, 0x399, 0x0, 0x38f, 0x345, 0x0, 0x38f, 0x399, 0x0, 0x391, 0x342, 0x345, 0x0, 0x391,
- 0x342, 0x399, 0x0, 0x397, 0x342, 0x345, 0x0, 0x397, 0x342, 0x399, 0x0, 0x3a9, 0x342, 0x345, 0x0, 0x3a9,
- 0x342, 0x399, 0x0
+static const ushort specialCaseMap[] = {
+ 0x53, 0x73, 0x0,
+ 0x53, 0x53, 0x0,
+ 0x69, 0x307, 0x0,
+ 0x46, 0x66, 0x0,
+ 0x46, 0x46, 0x0,
+ 0x46, 0x69, 0x0,
+ 0x46, 0x49, 0x0,
+ 0x46, 0x6c, 0x0,
+ 0x46, 0x4c, 0x0,
+ 0x46, 0x66, 0x69, 0x0,
+ 0x46, 0x46, 0x49, 0x0,
+ 0x46, 0x66, 0x6c, 0x0,
+ 0x46, 0x46, 0x4c, 0x0,
+ 0x53, 0x74, 0x0,
+ 0x53, 0x54, 0x0,
+ 0x535, 0x582, 0x0,
+ 0x535, 0x552, 0x0,
+ 0x544, 0x576, 0x0,
+ 0x544, 0x546, 0x0,
+ 0x544, 0x565, 0x0,
+ 0x544, 0x535, 0x0,
+ 0x544, 0x56b, 0x0,
+ 0x544, 0x53b, 0x0,
+ 0x54e, 0x576, 0x0,
+ 0x54e, 0x546, 0x0,
+ 0x544, 0x56d, 0x0,
+ 0x544, 0x53d, 0x0,
+ 0x2bc, 0x4e, 0x0,
+ 0x399, 0x308, 0x301, 0x0,
+ 0x3a5, 0x308, 0x301, 0x0,
+ 0x4a, 0x30c, 0x0,
+ 0x48, 0x331, 0x0,
+ 0x54, 0x308, 0x0,
+ 0x57, 0x30a, 0x0,
+ 0x59, 0x30a, 0x0,
+ 0x41, 0x2be, 0x0,
+ 0x3a5, 0x313, 0x0,
+ 0x3a5, 0x313, 0x300, 0x0,
+ 0x3a5, 0x313, 0x301, 0x0,
+ 0x3a5, 0x313, 0x342, 0x0,
+ 0x391, 0x342, 0x0,
+ 0x397, 0x342, 0x0,
+ 0x399, 0x308, 0x300, 0x0,
+ 0x399, 0x342, 0x0,
+ 0x399, 0x308, 0x342, 0x0,
+ 0x3a5, 0x308, 0x300, 0x0,
+ 0x3a1, 0x313, 0x0,
+ 0x3a5, 0x342, 0x0,
+ 0x3a5, 0x308, 0x342, 0x0,
+ 0x3a9, 0x342, 0x0,
+ 0x1f08, 0x399, 0x0,
+ 0x1f09, 0x399, 0x0,
+ 0x1f0a, 0x399, 0x0,
+ 0x1f0b, 0x399, 0x0,
+ 0x1f0c, 0x399, 0x0,
+ 0x1f0d, 0x399, 0x0,
+ 0x1f0e, 0x399, 0x0,
+ 0x1f0f, 0x399, 0x0,
+ 0x1f28, 0x399, 0x0,
+ 0x1f29, 0x399, 0x0,
+ 0x1f2a, 0x399, 0x0,
+ 0x1f2b, 0x399, 0x0,
+ 0x1f2c, 0x399, 0x0,
+ 0x1f2d, 0x399, 0x0,
+ 0x1f2e, 0x399, 0x0,
+ 0x1f2f, 0x399, 0x0,
+ 0x1f68, 0x399, 0x0,
+ 0x1f69, 0x399, 0x0,
+ 0x1f6a, 0x399, 0x0,
+ 0x1f6b, 0x399, 0x0,
+ 0x1f6c, 0x399, 0x0,
+ 0x1f6d, 0x399, 0x0,
+ 0x1f6e, 0x399, 0x0,
+ 0x1f6f, 0x399, 0x0,
+ 0x391, 0x399, 0x0,
+ 0x397, 0x399, 0x0,
+ 0x3a9, 0x399, 0x0,
+ 0x1fba, 0x345, 0x0,
+ 0x1fba, 0x399, 0x0,
+ 0x386, 0x345, 0x0,
+ 0x386, 0x399, 0x0,
+ 0x1fca, 0x345, 0x0,
+ 0x1fca, 0x399, 0x0,
+ 0x389, 0x345, 0x0,
+ 0x389, 0x399, 0x0,
+ 0x1ffa, 0x345, 0x0,
+ 0x1ffa, 0x399, 0x0,
+ 0x38f, 0x345, 0x0,
+ 0x38f, 0x399, 0x0,
+ 0x391, 0x342, 0x345, 0x0,
+ 0x391, 0x342, 0x399, 0x0,
+ 0x397, 0x342, 0x345, 0x0,
+ 0x397, 0x342, 0x399, 0x0,
+ 0x3a9, 0x342, 0x345, 0x0,
+ 0x3a9, 0x342, 0x399, 0x0
+
};
#define SPECIAL_CASE_MAX_LEN 3
@@ -7700,7 +7765,7 @@ static const unsigned short uc_ligature_trie[] = {
#define GET_LIGATURE_INDEX(u2) (u2 < 0x3100 ? uc_ligature_trie[uc_ligature_trie[u2>>5] + (u2 & 0x1f)] : 0xffff);
-static const unsigned short uc_ligature_map [] = {
+static const unsigned short uc_ligature_map[] = {
0x54, 0x41, 0xc0, 0x45, 0xc8, 0x49, 0xcc, 0x4e,
0x1f8, 0x4f, 0xd2, 0x55, 0xd9, 0x57, 0x1e80, 0x59,
@@ -9401,5 +9466,4 @@ static const unsigned char uc_scripts[] = {
} // namespace QUnicodeTables
-
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h
index 9b0b7cf..5c7cc08 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/tools/qunicodetables_p.h
@@ -59,33 +59,37 @@
QT_BEGIN_NAMESPACE
+#define UNICODE_DATA_VERSION QChar::Unicode_5_0
+
+#define UNICODE_LAST_CODEPOINT 0x10ffff
+
namespace QUnicodeTables {
+
struct Properties {
- ushort category : 8;
- ushort line_break_class : 8;
- ushort direction : 8;
- ushort combiningClass :8;
- ushort joining : 2;
+ ushort category : 8; /* 5 needed */
+ ushort line_break_class : 8; /* 6 needed */
+ ushort direction : 8; /* 5 needed */
+ ushort combiningClass : 8;
+ ushort joining : 2;
signed short digitValue : 6; /* 5 needed */
- ushort unicodeVersion : 4;
+ ushort unicodeVersion : 4;
ushort lowerCaseSpecial : 1;
ushort upperCaseSpecial : 1;
ushort titleCaseSpecial : 1;
- ushort caseFoldSpecial : 1; /* currently unused */
- signed short mirrorDiff : 16;
+ ushort caseFoldSpecial : 1; /* currently unused */
+ signed short mirrorDiff : 16;
signed short lowerCaseDiff : 16;
signed short upperCaseDiff : 16;
signed short titleCaseDiff : 16;
- signed short caseFoldDiff : 16;
- ushort graphemeBreak : 8;
- ushort wordBreak : 8;
- ushort sentenceBreak : 8;
+ signed short caseFoldDiff : 16;
+ ushort graphemeBreak : 8; /* 4 needed */
+ ushort wordBreak : 8; /* 4 needed */
+ ushort sentenceBreak : 8; /* 4 needed */
};
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);
// See http://www.unicode.org/reports/tr24/tr24-5.html
-
enum Script {
Common,
Greek,
@@ -172,19 +176,8 @@ namespace QUnicodeTables {
};
- Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);
- inline int lineBreakClass(const QChar &ch) {
- return QUnicodeTables::lineBreakClass(ch.unicode());
- }
-
- Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4);
- inline int script(const QChar &ch) {
- return script(ch.unicode());
- }
-
-
enum GraphemeBreak {
- GraphemeBreakOther,
+ GraphemeBreakOther,
GraphemeBreakCR,
GraphemeBreakLF,
GraphemeBreakControl,
@@ -224,8 +217,16 @@ namespace QUnicodeTables {
};
-}
+ Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);
+ inline int lineBreakClass(const QChar &ch)
+ { return lineBreakClass(ch.unicode()); }
+
+ Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4);
+ inline int script(const QChar &ch)
+ { return script(ch.unicode()); }
+
+} // namespace QUnicodeTables
QT_END_NAMESPACE
-#endif
+#endif // QUNICODETABLES_P_H
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 1069b816..aecb66e 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -222,7 +222,6 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
}
} else {
qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T));
- s = asize;
}
} else {
ptr = oldPtr;
@@ -233,7 +232,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
if (QTypeInfo<T>::isComplex) {
while (osize > asize)
(oldPtr+(--osize))->~T();
- if( oldPtr == ptr )
+ if (!QTypeInfo<T>::isStatic)
s = osize;
}
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 591fb3d..6d0f16f 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,4 +1,32 @@
=============================================================================
+The changes below are pre Qt 4.7.0 beta
+
+PathView: offset property now uses range 0-1.0 rather than 0-100
+ListView, GridView::positionViewAtIndex() gained a 'mode' parameter
+Removed Qt.playSound (replaced by SoundEffect element)
+Removed Qt.closestAngle (use RotationAnimation instead)
+Removed NumberFormatter
+Removed DateTimeFormatter (use Qt.formatDateTime() instead)
+Using WebView now requires "import org.webkit 1.0"
+Using Particles now requires "import Qt.labs.particles 1.0"
+AnchorAnimation must now be used to animate anchor changes (and not NumberAnimation)
+
+C++ API
+-------
+QDeclarativeContext::addDefaultObject() has been replaced with
+QDeclarativeContext::setContextObject()
+
+Behavior and Animation syntax
+-----------------------------
+Previously animations and behaviors could be "assigned" to properties like this:
+ Item { x: Behavior {}; y: NumberAnimation {} }
+To make it more obvious that these are not regular value assignments a new "on"
+syntax has been introduced:
+ Item { Behavior on x {}; NumberAnimation on y {} }
+Only the syntax has changed, the behavior is identical.
+
+
+=============================================================================
The changes below are pre Qt 4.7.0 alpha
Flickable: renamed viewportWidth -> contentWidth
@@ -6,16 +34,12 @@ Flickable: renamed viewportHeight -> contentHeight
Flickable: renamed viewportX -> contentX
Flickable: renamed viewportY -> contentY
Removed Flickable.reportedVelocitySmoothing
-Removed Qt.playSound (replaced by SoundEffect element)
-Removed NumberFormatter
-Removed DateTimeFormatter (use Qt.formatDateTime() instead)
Renamed MouseRegion -> MouseArea
Connection: syntax and rename:
Connection { sender: a; signal: foo(); script: xxx }
Connection { sender: a; signal: bar(); script: yyy }
becomes:
Connections { target: a; onFoo: xxx; onBar: yyy }
-Using WebView now requires "import org.webkit 1.0"
QmlView
-------
@@ -47,7 +71,7 @@ C++ API
QML_DEFINE_... definition macros, previously global macros, are replaced by
QML_REGISTER_... registration macros, which must be called explicitly. C++ API users
should also consider using the QmlExtensionPlugin (previously named QmlModulePlugin)
-as a cleaner mechanism for publishing libraries of QML types, or the upcoming
+as a cleaner mechanism for publishing libraries of QML types, or the upcoming
application plugin features of the qmlviewer / qmlruntime / qml.
PropertyAnimation
@@ -56,16 +80,6 @@ matchProperties and matchTargets have been renamed back to properties and target
The semantics are explained in the PropertyAnimation::properties documentation
and the animation overview documentation.
-Behavior and Animation syntax
------------------------------
-
-Previously animations and behaviors could be "assigned" to properties like this:
- Item { x: Behavior {}; y: NumberAnimation {} }
-To make it more obvious that these are not regular value assignments a new "on"
-syntax has been introduced:
- Item { Behavior on x {}; NumberAnimation on y {} }
-Only the syntax has changed, the behavior is identical.
-
=============================================================================
The changes below are pre-4.6.0 release.
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri
index 3ff92b1..d30651b 100644
--- a/src/declarative/graphicsitems/graphicsitems.pri
+++ b/src/declarative/graphicsitems/graphicsitems.pri
@@ -48,7 +48,6 @@ HEADERS += \
$$PWD/qdeclarativevisualitemmodel_p.h \
$$PWD/qdeclarativelistview_p.h \
$$PWD/qdeclarativegraphicsobjectcontainer_p.h \
- $$PWD/qdeclarativeparticles_p.h \
$$PWD/qdeclarativelayoutitem_p.h \
$$PWD/qdeclarativeitemchangelistener_p.h \
$$PWD/qdeclarativeeffects.cpp
@@ -82,5 +81,4 @@ SOURCES += \
$$PWD/qdeclarativevisualitemmodel.cpp \
$$PWD/qdeclarativelistview.cpp \
$$PWD/qdeclarativegraphicsobjectcontainer.cpp \
- $$PWD/qdeclarativeparticles.cpp \
- $$PWD/qdeclarativelayoutitem.cpp \
+ $$PWD/qdeclarativelayoutitem.cpp
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index 274d778..dc1f09d 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -168,8 +168,7 @@ void QDeclarativeAnchorsPrivate::fillChanged()
} else if (fill->parentItem() == item->parentItem()) { //siblings
setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin));
}
- setItemWidth(fill->width()-leftMargin-rightMargin);
- setItemHeight(fill->height()-topMargin-bottomMargin);
+ setItemSize(QSizeF(fill->width()-leftMargin-rightMargin, fill->height()-topMargin-bottomMargin));
--updatingFill;
} else {
@@ -314,6 +313,13 @@ void QDeclarativeAnchorsPrivate::setItemPos(const QPointF &v)
updatingMe = false;
}
+void QDeclarativeAnchorsPrivate::setItemSize(const QSizeF &v)
+{
+ updatingMe = true;
+ item->setSize(v);
+ updatingMe = false;
+}
+
void QDeclarativeAnchorsPrivate::updateMe()
{
if (updatingMe) {
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
index d9d7ffa..5840868 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -59,12 +59,9 @@
QT_BEGIN_NAMESPACE
-class QDeclarativeAnchorLine
+struct QDeclarativeAnchorLine
{
-public:
- QDeclarativeAnchorLine() : item(0), anchorLine(Invalid)
- {
- }
+ QDeclarativeAnchorLine() : item(0), anchorLine(Invalid) {}
enum AnchorLine {
Invalid = 0x0,
@@ -81,27 +78,22 @@ public:
QDeclarativeItem *item;
AnchorLine anchorLine;
-
- bool operator==(const QDeclarativeAnchorLine& other) const
- {
- return item == other.item && anchorLine == other.anchorLine;
- }
};
+inline bool operator==(const QDeclarativeAnchorLine& a, const QDeclarativeAnchorLine& b)
+{
+ return a.item == b.item && a.anchorLine == b.anchorLine;
+}
+
class QDeclarativeAnchorsPrivate : public QObjectPrivate, public QDeclarativeItemChangeListener
{
Q_DECLARE_PUBLIC(QDeclarativeAnchors)
public:
QDeclarativeAnchorsPrivate(QDeclarativeItem *i)
- : updatingMe(false), updatingHorizontalAnchor(0),
+ : componentComplete(true), updatingMe(false), updatingHorizontalAnchor(0),
updatingVerticalAnchor(0), updatingFill(0), updatingCenterIn(0), item(i), usedAnchors(0), fill(0),
centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0),
- margins(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0),
- componentComplete(true)
- {
- }
-
- void init()
+ margins(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0)
{
}
@@ -111,17 +103,19 @@ public:
void remDepend(QDeclarativeItem *);
bool isItemComplete() const;
- bool updatingMe;
- int updatingHorizontalAnchor;
- int updatingVerticalAnchor;
- int updatingFill;
- int updatingCenterIn;
+ bool componentComplete:1;
+ bool updatingMe:1;
+ uint updatingHorizontalAnchor:2;
+ uint updatingVerticalAnchor:2;
+ uint updatingFill:2;
+ uint updatingCenterIn:2;
void setItemHeight(qreal);
void setItemWidth(qreal);
void setItemX(qreal);
void setItemY(qreal);
void setItemPos(const QPointF &);
+ void setItemSize(const QSizeF &);
void updateOnComplete();
void updateMe();
@@ -163,8 +157,6 @@ public:
qreal vCenterOffset;
qreal hCenterOffset;
qreal baselineOffset;
-
- bool componentComplete;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index 20b1de3..2c2e034 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -247,9 +247,25 @@ void QDeclarativeAnimatedImage::setSource(const QUrl &url)
emit statusChanged(d->status);
}
+#define ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION 16
+
void QDeclarativeAnimatedImage::movieRequestFinished()
{
Q_D(QDeclarativeAnimatedImage);
+
+ d->redirectCount++;
+ if (d->redirectCount < ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->reply->url().resolved(redirect.toUrl());
+ d->reply->deleteLater();
+ d->reply = 0;
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount=0;
+
d->_movie = new QMovie(d->reply);
if (!d->_movie->isValid()){
qWarning() << "Error Reading Animated Image File " << d->url;
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h
index 39bb3e5..273c1d6 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h
@@ -66,7 +66,7 @@ class QDeclarativeAnimatedImagePrivate : public QDeclarativeImagePrivate
public:
QDeclarativeAnimatedImagePrivate()
- : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0)
+ : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0), redirectCount(0)
{
}
@@ -75,6 +75,7 @@ public:
int preset_currentframe;
QMovie *_movie;
QNetworkReply *reply;
+ int redirectCount;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index de16668..a7534b8 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -191,7 +191,7 @@ void QDeclarativeBorderImage::load()
update();
} else {
d->status = Loading;
- if (d->url.path().endsWith(QLatin1String(".sci"))) {
+ if (d->url.path().endsWith(QLatin1String("sci"))) {
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
QString lf = toLocalFileOrQrc(d->url);
if (!lf.isEmpty()) {
@@ -400,9 +400,23 @@ void QDeclarativeBorderImage::requestFinished()
update();
}
+#define BORDERIMAGE_MAX_REDIRECT 16
+
void QDeclarativeBorderImage::sciRequestFinished()
{
Q_D(QDeclarativeBorderImage);
+
+ d->redirectCount++;
+ if (d->redirectCount < BORDERIMAGE_MAX_REDIRECT) {
+ QVariant redirect = d->sciReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->sciReply->url().resolved(redirect.toUrl());
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount=0;
+
if (d->sciReply->error() != QNetworkReply::NoError) {
d->status = Error;
d->sciReply->deleteLater();
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h
index b9cf73a..82b9ebf 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h
@@ -68,7 +68,8 @@ public:
: border(0), sciReply(0),
sciPendingPixmapCache(false),
horizontalTileMode(QDeclarativeBorderImage::Stretch),
- verticalTileMode(QDeclarativeBorderImage::Stretch)
+ verticalTileMode(QDeclarativeBorderImage::Stretch),
+ redirectCount(0)
{
}
@@ -90,6 +91,7 @@ public:
bool sciPendingPixmapCache;
QDeclarativeBorderImage::TileMode horizontalTileMode;
QDeclarativeBorderImage::TileMode verticalTileMode;
+ int redirectCount;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 67068a0..9ccb3b6 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -264,6 +264,7 @@ void QDeclarativeFlickablePrivate::fixupY()
void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
{
+ Q_Q(QDeclarativeFlickable);
if (data.move.value() > minExtent || maxExtent > minExtent) {
timeline.reset(data.move);
if (data.move.value() != minExtent) {
@@ -273,6 +274,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutQuint), 3*fixupDuration/4);
} else {
data.move.setValue(minExtent);
+ q->viewportMoved();
}
}
//emit flickingChanged();
@@ -284,6 +286,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutQuint), 3*fixupDuration/4);
} else {
data.move.setValue(maxExtent);
+ q->viewportMoved();
}
//emit flickingChanged();
} else {
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
index 0323a59..20524b6 100644
--- a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
@@ -41,6 +41,8 @@
#include "qdeclarativefocuspanel_p.h"
+#include "qdeclarativeitem_p.h"
+
#include <QtGui/qgraphicsscene.h>
#include <QEvent>
@@ -65,7 +67,8 @@ QT_BEGIN_NAMESPACE
QDeclarativeFocusPanel::QDeclarativeFocusPanel(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
{
- setFlag(ItemIsPanel);
+ Q_D(QDeclarativeItem);
+ d->flags |= QGraphicsItem::ItemIsPanel;
}
QDeclarativeFocusPanel::~QDeclarativeFocusPanel()
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
index 1ad8b6e..d9ca0b0 100644
--- a/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel_p.h
@@ -66,6 +66,7 @@ protected:
private:
Q_DISABLE_COPY(QDeclarativeFocusPanel)
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
index 384a47b..484df13 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
@@ -41,6 +41,8 @@
#include "qdeclarativefocusscope_p.h"
+#include "qdeclarativeitem_p.h"
+
QT_BEGIN_NAMESPACE
/*!
@@ -62,7 +64,8 @@ QT_BEGIN_NAMESPACE
QDeclarativeFocusScope::QDeclarativeFocusScope(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
{
- setFlag(QGraphicsItem::ItemIsFocusScope);
+ Q_D(QDeclarativeItem);
+ d->flags |= QGraphicsItem::ItemIsFocusScope;
}
QDeclarativeFocusScope::~QDeclarativeFocusScope()
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope_p.h b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
index cd480b4..c65a07c 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope_p.h
@@ -54,6 +54,7 @@ QT_MODULE(Declarative)
class Q_DECLARATIVE_EXPORT QDeclarativeFocusScope : public QDeclarativeItem
{
Q_OBJECT
+ Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
public:
QDeclarativeFocusScope(QDeclarativeItem *parent=0);
virtual ~QDeclarativeFocusScope();
diff --git a/src/declarative/graphicsitems/qdeclarativegraphicsobjectcontainer.cpp b/src/declarative/graphicsitems/qdeclarativegraphicsobjectcontainer.cpp
index 1977817..eb5b6ce 100644
--- a/src/declarative/graphicsitems/qdeclarativegraphicsobjectcontainer.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegraphicsobjectcontainer.cpp
@@ -65,12 +65,12 @@ public:
if (graphicsObject && graphicsObject->isWidget()) {
if (!on) {
graphicsObject->removeEventFilter(q);
- QObject::disconnect(q, SIGNAL(widthChanged()), q, SLOT(_q_updateSize()));
- QObject::disconnect(q, SIGNAL(heightChanged()), q, SLOT(_q_updateSize()));
+ QObject::disconnect(q, SIGNAL(widthChanged(qreal)), q, SLOT(_q_updateSize()));
+ QObject::disconnect(q, SIGNAL(heightChanged(qreal)), q, SLOT(_q_updateSize()));
} else {
graphicsObject->installEventFilter(q);
- QObject::connect(q, SIGNAL(widthChanged()), q, SLOT(_q_updateSize()));
- QObject::connect(q, SIGNAL(heightChanged()), q, SLOT(_q_updateSize()));
+ QObject::connect(q, SIGNAL(widthChanged(qreal)), q, SLOT(_q_updateSize()));
+ QObject::connect(q, SIGNAL(heightChanged(qreal)), q, SLOT(_q_updateSize()));
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 76ad9b7..b1391f9 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -50,6 +50,8 @@
#include <qlistmodelinterface_p.h>
#include <QKeyEvent>
+#include <math.h>
+
QT_BEGIN_NAMESPACE
@@ -95,14 +97,15 @@ class QDeclarativeGridViewPrivate : public QDeclarativeFlickablePrivate
public:
QDeclarativeGridViewPrivate()
: currentItem(0), flow(QDeclarativeGridView::LeftToRight)
- , visiblePos(0), visibleIndex(0) , currentIndex(-1)
+ , visibleIndex(0) , currentIndex(-1)
, cellWidth(100), cellHeight(100), columns(1), requestedIndex(-1)
+ , highlightRangeStart(0), highlightRangeEnd(0), highlightRange(QDeclarativeGridView::NoHighlightRange)
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
- , bufferMode(NoBuffer)
+ , bufferMode(NoBuffer), snapMode(QDeclarativeGridView::NoSnap)
, ownModel(false), wrap(false), autoHighlight(true)
, fixCurrentVisibility(false), lazyRelease(false), layoutScheduled(false)
- , deferredRelease(false) {}
+ , deferredRelease(false), haveHighlightRange(false) {}
void init();
void clear();
@@ -119,6 +122,7 @@ public:
void createHighlight();
void updateHighlight();
void updateCurrent(int modelIndex);
+ void fixupPosition();
FxGridItem *visibleItem(int modelIndex) const {
if (modelIndex >= visibleIndex && modelIndex < visibleIndex + visibleItems.count()) {
@@ -236,7 +240,33 @@ public:
return -1; // Not in visibleList
}
- void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
+ qreal snapPosAt(qreal pos) {
+ qreal snapPos = 0;
+ if (!visibleItems.isEmpty()) {
+ pos += rowSize()/2;
+ snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
+ snapPos = pos - fmodf(pos - snapPos, qreal(rowSize()));
+ }
+ return snapPos;
+ }
+
+ int snapIndex() {
+ int index = currentIndex;
+ for (int i = 0; i < visibleItems.count(); ++i) {
+ FxGridItem *item = visibleItems[i];
+ if (item->index == -1)
+ continue;
+ qreal itemTop = item->rowPos();
+ if (itemTop >= highlight->rowPos()-rowSize()/2 && itemTop < highlight->rowPos()+rowSize()/2) {
+ index = item->index;
+ if (item->colPos() >= highlight->colPos()-colSize()/2 && item->colPos() < highlight->colPos()+colSize()/2)
+ return item->index;
+ }
+ }
+ return index;
+ }
+
+ virtual void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) {
Q_Q(const QDeclarativeGridView);
QDeclarativeFlickablePrivate::itemGeometryChanged(item, newGeometry, oldGeometry);
if (item == q) {
@@ -249,6 +279,11 @@ public:
}
}
}
+
+ virtual void fixup(AxisData &data, qreal minExtent, qreal maxExtent);
+ virtual void flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity);
+
// for debugging only
void checkVisible() const {
int skip = 0;
@@ -270,13 +305,15 @@ public:
QHash<QDeclarativeItem*,int> unrequestedItems;
FxGridItem *currentItem;
QDeclarativeGridView::Flow flow;
- int visiblePos;
int visibleIndex;
int currentIndex;
int cellWidth;
int cellHeight;
int columns;
int requestedIndex;
+ qreal highlightRangeStart;
+ qreal highlightRangeEnd;
+ QDeclarativeGridView::HighlightRangeMode highlightRange;
QDeclarativeComponent *highlightComponent;
FxGridItem *highlight;
FxGridItem *trackedItem;
@@ -287,6 +324,7 @@ public:
QDeclarativeEaseFollow *highlightYAnimator;
enum BufferMode { NoBuffer = 0x00, BufferBefore = 0x01, BufferAfter = 0x02 };
BufferMode bufferMode;
+ QDeclarativeGridView::SnapMode snapMode;
bool ownModel : 1;
bool wrap : 1;
@@ -295,6 +333,7 @@ public:
bool lazyRelease : 1;
bool layoutScheduled : 1;
bool deferredRelease : 1;
+ bool haveHighlightRange : 1;
};
void QDeclarativeGridViewPrivate::init()
@@ -310,7 +349,6 @@ void QDeclarativeGridViewPrivate::clear()
for (int i = 0; i < visibleItems.count(); ++i)
releaseItem(visibleItems.at(i));
visibleItems.clear();
- visiblePos = 0;
visibleIndex = 0;
releaseItem(currentItem);
currentItem = 0;
@@ -496,7 +534,7 @@ void QDeclarativeGridViewPrivate::scheduleLayout()
Q_Q(QDeclarativeGridView);
if (!layoutScheduled) {
layoutScheduled = true;
- QMetaObject::invokeMethod(q, "layout", Qt::QueuedConnection);
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
}
}
@@ -683,6 +721,128 @@ void QDeclarativeGridViewPrivate::updateCurrent(int modelIndex)
releaseItem(oldCurrentItem);
}
+void QDeclarativeGridViewPrivate::fixupPosition()
+{
+ moveReason = Other;
+ if (flow == QDeclarativeGridView::LeftToRight)
+ fixupY();
+ else
+ fixupX();
+}
+
+void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
+{
+ Q_Q(QDeclarativeGridView);
+
+ if ((&data == &vData && !q->yflick())
+ || (&data == &hData && !q->xflick())
+ || data.move.timeLine())
+ return;
+
+ int oldDuration = fixupDuration;
+ fixupDuration = moveReason == Mouse ? fixupDuration : 0;
+
+ if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
+ if (currentItem && currentItem->rowPos() - position() != highlightRangeStart) {
+ qreal pos = currentItem->rowPos() - highlightRangeStart;
+ timeline.reset(data.move);
+ if (fixupDuration) {
+ timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ } else {
+ data.move.setValue(-pos);
+ q->viewportMoved();
+ }
+ vTime = timeline.time();
+ }
+ } else if (snapMode != QDeclarativeGridView::NoSnap) {
+ qreal pos = -snapPosAt(-(data.move.value() - highlightRangeStart)) + highlightRangeStart;
+ pos = qMin(qMax(pos, maxExtent), minExtent);
+ qreal dist = qAbs(data.move.value() - pos);
+ if (dist > 0) {
+ timeline.reset(data.move);
+ if (fixupDuration) {
+ timeline.move(data.move, pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ } else {
+ data.move.setValue(pos);
+ q->viewportMoved();
+ }
+ vTime = timeline.time();
+ }
+ } else {
+ QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
+ }
+ fixupDuration = oldDuration;
+}
+
+void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QDeclarativeTimeLineCallback::Callback fixupCallback, qreal velocity)
+{
+ Q_Q(QDeclarativeGridView);
+
+ moveReason = Mouse;
+ if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange) && snapMode == QDeclarativeGridView::NoSnap) {
+ QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
+ return;
+ }
+ qreal maxDistance = -1;
+ // -ve velocity means list is moving up
+ if (velocity > 0) {
+ if (snapMode == QDeclarativeGridView::SnapOneRow) {
+ if (FxGridItem *item = firstVisibleItem())
+ maxDistance = qAbs(item->rowPos() + data.move.value());
+ } else if (data.move.value() < minExtent) {
+ maxDistance = qAbs(minExtent - data.move.value());
+ }
+ if (snapMode != QDeclarativeGridView::SnapToRow && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ data.flickTarget = minExtent;
+ } else {
+ if (snapMode == QDeclarativeGridView::SnapOneRow) {
+ qreal pos = snapPosAt(-data.move.value()) + rowSize();
+ maxDistance = qAbs(pos + data.move.value());
+ } else if (data.move.value() > maxExtent) {
+ maxDistance = qAbs(maxExtent - data.move.value());
+ }
+ if (snapMode != QDeclarativeGridView::SnapToRow && highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ data.flickTarget = maxExtent;
+ }
+ if (maxDistance > 0 && (snapMode != QDeclarativeGridView::NoSnap || highlightRange == QDeclarativeGridView::StrictlyEnforceRange)) {
+ // This mode requires the grid to stop exactly on a row boundary.
+ qreal v = velocity;
+ if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
+ if (v < 0)
+ v = -maxVelocity;
+ else
+ v = maxVelocity;
+ }
+ qreal accel = deceleration;
+ qreal v2 = v * v;
+ qreal maxAccel = v2 / (2.0f * maxDistance);
+ qreal overshootDist = 0.0;
+ if (maxAccel < accel) {
+ // + rowSize()/4 to encourage moving at least one item in the flick direction
+ qreal dist = v2 / (accel * 2.0) + rowSize()/4;
+ if (v > 0)
+ dist = -dist;
+ data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
+ dist = -data.flickTarget + data.move.value();
+ accel = v2 / (2.0f * qAbs(dist));
+ } else {
+ data.flickTarget = velocity > 0 ? minExtent : maxExtent;
+ overshootDist = overShoot ? overShootDistance(v, vSize) : 0;
+ }
+ timeline.reset(data.move);
+ timeline.accel(data.move, v, accel, maxDistance + overshootDist);
+ timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
+ flicked = true;
+ emit q->flickingChanged();
+ emit q->flickStarted();
+ } else {
+ timeline.reset(data.move);
+ fixup(data, minExtent, maxExtent);
+ }
+}
+
+
//----------------------------------------------------------------------------
/*!
@@ -1031,6 +1191,87 @@ void QDeclarativeGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
}
/*!
+ \qmlproperty real GridView::preferredHighlightBegin
+ \qmlproperty real GridView::preferredHighlightEnd
+ \qmlproperty enumeration GridView::highlightRangeMode
+
+ These properties set the preferred range of the highlight (current item)
+ within the view.
+
+ Note that this is the correct way to influence where the
+ current item ends up when the view scrolls. For example, if you want the
+ currently selected item to be in the middle of the list, then set the
+ highlight range to be where the middle item would go. Then, when the view scrolls,
+ the currently selected item will be the item at that spot. This also applies to
+ when the currently selected item changes - it will scroll to within the preferred
+ highlight range. Furthermore, the behaviour of the current item index will occur
+ whether or not a highlight exists.
+
+ If highlightRangeMode is set to \e ApplyRange the view will
+ attempt to maintain the highlight within the range, however
+ the highlight can move outside of the range at the ends of the list
+ or due to a mouse interaction.
+
+ If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never
+ move outside of the range. This means that the current item will change
+ if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+
+ The default value is \e NoHighlightRange.
+
+ Note that a valid range requires preferredHighlightEnd to be greater
+ than or equal to preferredHighlightBegin.
+*/
+qreal QDeclarativeGridView::preferredHighlightBegin() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRangeStart;
+}
+
+void QDeclarativeGridView::setPreferredHighlightBegin(qreal start)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->highlightRangeStart == start)
+ return;
+ d->highlightRangeStart = start;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightBeginChanged();
+}
+
+qreal QDeclarativeGridView::preferredHighlightEnd() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRangeEnd;
+}
+
+void QDeclarativeGridView::setPreferredHighlightEnd(qreal end)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->highlightRangeEnd == end)
+ return;
+ d->highlightRangeEnd = end;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit preferredHighlightEndChanged();
+}
+
+QDeclarativeGridView::HighlightRangeMode QDeclarativeGridView::highlightRangeMode() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->highlightRange;
+}
+
+void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->highlightRange == mode)
+ return;
+ d->highlightRange = mode;
+ d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd;
+ emit highlightRangeModeChanged();
+}
+
+
+/*!
\qmlproperty enumeration GridView::flow
This property holds the flow of the grid.
@@ -1153,6 +1394,47 @@ void QDeclarativeGridView::setCellHeight(int cellHeight)
d->layout();
}
}
+/*!
+ \qmlproperty enumeration GridView::snapMode
+
+ This property determines where the view will settle following a drag or flick.
+ The allowed values are:
+
+ \list
+ \o NoSnap (default) - the view will stop anywhere within the visible area.
+ \o SnapToRow - the view will settle with a row (or column for TopToBottom flow)
+ aligned with the start of the view.
+ \o SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow)
+ away from the first visible row at the time the mouse button is released.
+ This mode is particularly useful for moving one page at a time.
+ \endlist
+
+*/
+QDeclarativeGridView::SnapMode QDeclarativeGridView::snapMode() const
+{
+ Q_D(const QDeclarativeGridView);
+ return d->snapMode;
+}
+
+void QDeclarativeGridView::setSnapMode(SnapMode mode)
+{
+ Q_D(QDeclarativeGridView);
+ if (d->snapMode != mode) {
+ d->snapMode = mode;
+ emit snapModeChanged();
+ }
+}
+
+bool QDeclarativeGridView::event(QEvent *event)
+{
+ Q_D(QDeclarativeGridView);
+ if (event->type() == QEvent::User) {
+ d->layout();
+ return true;
+ }
+
+ return QDeclarativeFlickable::event(event);
+}
void QDeclarativeGridView::viewportMoved()
{
@@ -1175,6 +1457,32 @@ void QDeclarativeGridView::viewportMoved()
}
}
refill();
+ if (isFlicking() || d->moving)
+ d->moveReason = QDeclarativeGridViewPrivate::Mouse;
+ if (d->moveReason != QDeclarativeGridViewPrivate::SetIndex) {
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
+ // reposition highlight
+ qreal pos = d->highlight->rowPos();
+ qreal viewPos = qRound(d->position());
+ if (pos > viewPos + d->highlightRangeEnd - 1 - d->rowSize())
+ pos = viewPos + d->highlightRangeEnd - 1 - d->rowSize();
+ if (pos < viewPos + d->highlightRangeStart)
+ pos = viewPos + d->highlightRangeStart;
+ d->highlight->setPosition(d->highlight->colPos(), pos);
+
+ // update current index
+ int idx = d->snapIndex();
+ if (idx >= 0 && idx != d->currentIndex) {
+ d->updateCurrent(idx);
+ if (d->currentItem && d->currentItem->colPos() != d->highlight->colPos() && d->autoHighlight) {
+ if (d->flow == LeftToRight)
+ d->highlightXAnimator->setSourceValue(d->currentItem->item->x());
+ else
+ d->highlightYAnimator->setSourceValue(d->currentItem->item->y());
+ }
+ }
+ }
+ }
}
qreal QDeclarativeGridView::minYExtent() const
@@ -1182,7 +1490,10 @@ qreal QDeclarativeGridView::minYExtent() const
Q_D(const QDeclarativeGridView);
if (d->flow == QDeclarativeGridView::TopToBottom)
return QDeclarativeFlickable::minYExtent();
- return -d->startPosition();
+ qreal extent = -d->startPosition();
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
+ extent += d->highlightRangeStart;
+ return extent;
}
qreal QDeclarativeGridView::maxYExtent() const
@@ -1190,7 +1501,11 @@ qreal QDeclarativeGridView::maxYExtent() const
Q_D(const QDeclarativeGridView);
if (d->flow == QDeclarativeGridView::TopToBottom)
return QDeclarativeFlickable::maxYExtent();
- qreal extent = -(d->endPosition() - height());
+ qreal extent;
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
+ extent = -(d->rowPosAt(count()-1) - d->highlightRangeEnd);
+ else
+ extent = -(d->endPosition() - height());
const qreal minY = minYExtent();
if (extent > minY)
extent = minY;
@@ -1202,7 +1517,10 @@ qreal QDeclarativeGridView::minXExtent() const
Q_D(const QDeclarativeGridView);
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::minXExtent();
- return -d->startPosition();
+ qreal extent = -d->startPosition();
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
+ extent += d->highlightRangeStart;
+ return extent;
}
qreal QDeclarativeGridView::maxXExtent() const
@@ -1210,7 +1528,11 @@ qreal QDeclarativeGridView::maxXExtent() const
Q_D(const QDeclarativeGridView);
if (d->flow == QDeclarativeGridView::LeftToRight)
return QDeclarativeFlickable::maxXExtent();
- qreal extent = -(d->endPosition() - width());
+ qreal extent;
+ if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
+ extent = -(d->rowPosAt(count()-1) - d->highlightRangeEnd);
+ else
+ extent = -(d->endPosition() - height());
const qreal minX = minXExtent();
if (extent > minX)
extent = minX;
@@ -1344,46 +1666,84 @@ void QDeclarativeGridView::moveCurrentIndexRight()
}
/*!
- \qmlmethod GridView::positionViewAtIndex(int index)
+ \qmlmethod GridView::positionViewAtIndex(int index, PositionMode mode)
+
+ Positions the view such that the \a index is at the position specified by
+ \a mode:
+
+ \list
+ \o Beginning - position item at the top (or left for TopToBottom flow) of the view.
+ \o Center- position item in the center of the view.
+ \o End - position item at bottom (or right for horizontal orientation) of the view.
+ \o Visible - if any part of the item is visible then take no action, otherwise
+ bring the item into view.
+ \o Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for TopToBottom flow) of the view.
+ \endlist
- Positions the view such that the \a index is at the top (or left for horizontal orientation) of the view.
If positioning the view at the index would cause empty space to be displayed at
- the end of the view, the view will be positioned at the end.
+ the beginning or end of the view, the view will be positioned at the boundary.
It is not recommended to use contentX or contentY to position the view
at a particular index. This is unreliable since removing items from the start
- of the list does not cause all other items to be repositioned.
+ of the view does not cause all other items to be repositioned.
The correct way to bring an item into view is with positionViewAtIndex.
*/
-void QDeclarativeGridView::positionViewAtIndex(int index)
+void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
{
Q_D(QDeclarativeGridView);
if (!d->isValid() || index < 0 || index >= d->model->count())
return;
+ if (mode < Beginning || mode > Contain)
+ return;
- qreal maxExtent = d->flow == QDeclarativeGridView::LeftToRight ? -maxYExtent() : -maxXExtent();
+ qreal pos = d->position();
FxGridItem *item = d->visibleItem(index);
- if (item) {
- // Already created - just move to top of view
- int pos = qMin(item->rowPos(), maxExtent);
- d->setPosition(pos);
- } else {
- int pos = d->rowPosAt(index);
+ if (!item) {
+ int itemPos = d->rowPosAt(index);
// save the currently visible items in case any of them end up visible again
QList<FxGridItem*> oldVisible = d->visibleItems;
d->visibleItems.clear();
d->visibleIndex = index - index % d->columns;
- d->setPosition(pos);
- // setPosition() will cause refill. Adjust if we have moved beyond range
- if (d->position() > maxExtent)
- d->setPosition(maxExtent);
+ d->setPosition(itemPos);
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
d->releaseItem(oldVisible.at(i));
+ item = d->visibleItem(index);
}
+ if (item) {
+ qreal itemPos = item->rowPos();
+ switch (mode) {
+ case Beginning:
+ pos = itemPos;
+ break;
+ case Center:
+ pos = itemPos - (d->size() - d->rowSize())/2;
+ break;
+ case End:
+ pos = itemPos - d->size() + d->rowSize();
+ break;
+ case Visible:
+ if (itemPos > pos + d->size())
+ pos = itemPos - d->size() + d->rowSize();
+ else if (item->endRowPos() < pos)
+ pos = itemPos;
+ break;
+ case Contain:
+ if (item->endRowPos() > pos + d->size())
+ pos = itemPos - d->size() + d->rowSize();
+ if (itemPos < pos)
+ pos = itemPos;
+ }
+ qreal maxExtent = d->flow == QDeclarativeGridView::LeftToRight ? -maxYExtent() : -maxXExtent();
+ pos = qMin(pos, maxExtent);
+ qreal minExtent = d->flow == QDeclarativeGridView::LeftToRight ? -minYExtent() : -minXExtent();
+ pos = qMax(pos, minExtent);
+ d->setPosition(pos);
+ }
+ d->fixupPosition();
}
-
void QDeclarativeGridView::componentComplete()
{
Q_D(QDeclarativeGridView);
@@ -1394,6 +1754,7 @@ void QDeclarativeGridView::componentComplete()
d->updateCurrent(0);
else
d->updateCurrent(d->currentIndex);
+ d->fixupPosition();
}
void QDeclarativeGridView::trackedPositionChanged()
@@ -1402,22 +1763,50 @@ void QDeclarativeGridView::trackedPositionChanged()
if (!d->trackedItem || !d->currentItem)
return;
if (!isFlicking() && !d->moving && d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
+ const qreal trackedPos = d->trackedItem->rowPos();
const qreal viewPos = d->position();
- if (d->trackedItem->rowPos() < viewPos && d->currentItem->rowPos() < viewPos) {
- d->setPosition(d->currentItem->rowPos() < d->trackedItem->rowPos() ? d->trackedItem->rowPos() : d->currentItem->rowPos());
- } else if (d->trackedItem->endRowPos() > viewPos + d->size()
- && d->currentItem->endRowPos() > viewPos + d->size()) {
- qreal pos;
- if (d->trackedItem->endRowPos() < d->currentItem->endRowPos()) {
- pos = d->trackedItem->endRowPos() - d->size();
- if (d->rowSize() > d->size())
- pos = d->trackedItem->rowPos();
+ if (d->haveHighlightRange) {
+ if (d->highlightRange == StrictlyEnforceRange) {
+ qreal pos = viewPos;
+ if (trackedPos > pos + d->highlightRangeEnd - d->rowSize())
+ pos = trackedPos - d->highlightRangeEnd + d->rowSize();
+ if (trackedPos < pos + d->highlightRangeStart)
+ pos = trackedPos - d->highlightRangeStart;
+ d->setPosition(pos);
} else {
- pos = d->currentItem->endRowPos() - d->size();
- if (d->rowSize() > d->size())
- pos = d->currentItem->rowPos();
+ qreal pos = viewPos;
+ if (trackedPos < d->startPosition() + d->highlightRangeStart) {
+ pos = d->startPosition();
+ } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + d->highlightRangeEnd) {
+ pos = d->endPosition() - d->size();
+ if (pos < d->startPosition())
+ pos = d->startPosition();
+ } else {
+ if (trackedPos < viewPos + d->highlightRangeStart) {
+ pos = trackedPos - d->highlightRangeStart;
+ } else if (trackedPos > viewPos + d->highlightRangeEnd - d->rowSize()) {
+ pos = trackedPos - d->highlightRangeEnd + d->rowSize();
+ }
+ }
+ d->setPosition(pos);
+ }
+ } else {
+ if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
+ d->setPosition(d->currentItem->rowPos() < trackedPos ? trackedPos : d->currentItem->rowPos());
+ } else if (d->trackedItem->endRowPos() > viewPos + d->size()
+ && d->currentItem->endRowPos() > viewPos + d->size()) {
+ qreal pos;
+ if (d->trackedItem->endRowPos() < d->currentItem->endRowPos()) {
+ pos = d->trackedItem->endRowPos() - d->size();
+ if (d->rowSize() > d->size())
+ pos = trackedPos;
+ } else {
+ pos = d->currentItem->endRowPos() - d->size();
+ if (d->rowSize() > d->size())
+ pos = d->currentItem->rowPos();
+ }
+ d->setPosition(pos);
}
- d->setPosition(pos);
}
}
}
@@ -1426,7 +1815,7 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
{
Q_D(QDeclarativeGridView);
if (!d->visibleItems.count() || d->model->count() <= 1) {
- refill();
+ d->scheduleLayout();
d->updateCurrent(qMax(0, qMin(d->currentIndex, d->model->count()-1)));
emit countChanged();
return;
@@ -1455,8 +1844,9 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
d->currentIndex += count;
if (d->currentItem)
d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
}
- d->layout();
+ d->scheduleLayout();
emit countChanged();
return;
}
@@ -1486,9 +1876,21 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
}
}
+ // Update the indexes of the following visible items.
+ for (int i = 0; i < d->visibleItems.count(); ++i) {
+ FxGridItem *listItem = d->visibleItems.at(i);
+ if (listItem->index != -1 && listItem->index >= modelIndex)
+ listItem->index += count;
+ }
+
+ bool addedVisible = false;
QList<FxGridItem*> added;
int i = 0;
while (i < insertCount && rowPos <= to + d->rowSize()*(d->columns - (colPos/d->colSize()))/qreal(d->columns)) {
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
FxGridItem *item = d->createItem(modelIndex + i);
d->visibleItems.insert(index, item);
item->setPosition(colPos, rowPos);
@@ -1509,6 +1911,15 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
}
}
+ // update visibleIndex
+ d->visibleIndex = 0;
+ for (QList<FxGridItem*>::Iterator it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
+ if ((*it)->index != -1) {
+ d->visibleIndex = (*it)->index;
+ break;
+ }
+ }
+
if (d->currentIndex >= modelIndex) {
// adjust current item index
d->currentIndex += count;
@@ -1516,18 +1927,13 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
d->currentItem->index = d->currentIndex;
d->currentItem->setPosition(d->colPosAt(d->currentIndex), d->rowPosAt(d->currentIndex));
}
- }
- // Update the indexes of the following visible items.
- for (; index < d->visibleItems.count(); ++index) {
- FxGridItem *listItem = d->visibleItems.at(index);
- if (listItem->index != -1)
- listItem->index += count;
+ emit currentIndexChanged();
}
// everything is in order now - emit add() signal
for (int j = 0; j < added.count(); ++j)
added.at(j)->attached->emitAdd();
- d->layout();
+
emit countChanged();
}
@@ -1543,8 +1949,10 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
FxGridItem *item = *it;
if (item->index == -1 || item->index < modelIndex) {
// already removed, or before removed items
- if (item->index < modelIndex)
+ if (item->index < modelIndex && !removedVisible) {
+ d->scheduleLayout();
removedVisible = true;
+ }
++it;
} else if (item->index >= modelIndex + count) {
// after removed items
@@ -1552,7 +1960,10 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
++it;
} else {
// removed item
- removedVisible = true;
+ if (!removedVisible) {
+ d->scheduleLayout();
+ removedVisible = true;
+ }
item->attached->emitRemove();
if (item->attached->delayRemove()) {
item->index = -1;
@@ -1570,6 +1981,7 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
d->currentIndex -= count;
if (d->currentItem)
d->currentItem->index -= count;
+ emit currentIndexChanged();
} else if (currentRemoved) {
// current item has been removed.
d->releaseItem(d->currentItem);
@@ -1579,6 +1991,7 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
}
// update visibleIndex
+ d->visibleIndex = 0;
for (it = d->visibleItems.begin(); it != d->visibleItems.end(); ++it) {
if ((*it)->index != -1) {
d->visibleIndex = (*it)->index;
@@ -1586,27 +1999,16 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
}
}
- if (removedVisible) {
- if (d->visibleItems.isEmpty()) {
- d->visibleIndex = 0;
- d->setPosition(0);
- refill();
- } else {
- // Correct the positioning of the items
- d->scheduleLayout();
- }
+ if (removedVisible && d->visibleItems.isEmpty()) {
+ d->timeline.clear();
+ d->setPosition(0);
+ if (d->model->count() == 0)
+ update();
}
emit countChanged();
}
-void QDeclarativeGridView::layout()
-{
- Q_D(QDeclarativeGridView);
- if (d->layoutScheduled)
- d->layout();
-}
-
void QDeclarativeGridView::destroyRemoved()
{
Q_D(QDeclarativeGridView);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index 7255d3d..f14ec14 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -67,11 +67,20 @@ class Q_DECLARATIVE_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
Q_PROPERTY(QDeclarativeItem *highlightItem READ highlightItem NOTIFY highlightItemChanged)
Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem)
+ Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin NOTIFY preferredHighlightBeginChanged)
+ Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd NOTIFY preferredHighlightEndChanged)
+ Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode NOTIFY highlightRangeModeChanged)
+
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged)
Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged)
Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged)
+
+ Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged)
+
+ Q_ENUMS(HighlightRangeMode)
+ Q_ENUMS(SnapMode)
Q_CLASSINFO("DefaultProperty", "data")
public:
@@ -97,6 +106,16 @@ public:
bool highlightFollowsCurrentItem() const;
void setHighlightFollowsCurrentItem(bool);
+ enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange };
+ HighlightRangeMode highlightRangeMode() const;
+ void setHighlightRangeMode(HighlightRangeMode mode);
+
+ qreal preferredHighlightBegin() const;
+ void setPreferredHighlightBegin(qreal);
+
+ qreal preferredHighlightEnd() const;
+ void setPreferredHighlightEnd(qreal);
+
Q_ENUMS(Flow)
enum Flow { LeftToRight, TopToBottom };
Flow flow() const;
@@ -114,6 +133,13 @@ public:
int cellHeight() const;
void setCellHeight(int);
+ enum SnapMode { NoSnap, SnapToRow, SnapOneRow };
+ SnapMode snapMode() const;
+ void setSnapMode(SnapMode mode);
+
+ enum PositionMode { Beginning, Center, End, Visible, Contain };
+ Q_ENUMS(PositionMode)
+
static QDeclarativeGridViewAttached *qmlAttachedProperties(QObject *);
public Q_SLOTS:
@@ -121,7 +147,7 @@ public Q_SLOTS:
void moveCurrentIndexDown();
void moveCurrentIndexLeft();
void moveCurrentIndexRight();
- void positionViewAtIndex(int index);
+ void positionViewAtIndex(int index, int mode);
Q_SIGNALS:
void countChanged();
@@ -130,13 +156,18 @@ Q_SIGNALS:
void cellHeightChanged();
void highlightChanged();
void highlightItemChanged();
+ void preferredHighlightBeginChanged();
+ void preferredHighlightEndChanged();
+ void highlightRangeModeChanged();
void modelChanged();
void delegateChanged();
void flowChanged();
void keyNavigationWrapsChanged();
void cacheBufferChanged();
+ void snapModeChanged();
protected:
+ virtual bool event(QEvent *event);
virtual void viewportMoved();
virtual qreal minYExtent() const;
virtual qreal maxYExtent() const;
@@ -154,7 +185,6 @@ private Q_SLOTS:
void destroyRemoved();
void createdItem(int index, QDeclarativeItem *item);
void destroyingItem(QDeclarativeItem *item);
- void layout();
private:
void refill();
@@ -165,7 +195,7 @@ class QDeclarativeGridViewAttached : public QObject
Q_OBJECT
public:
QDeclarativeGridViewAttached(QObject *parent)
- : QObject(parent), m_isCurrent(false), m_delayRemove(false) {}
+ : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
~QDeclarativeGridViewAttached() {}
Q_PROPERTY(QDeclarativeGridView *view READ view CONSTANT)
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index a20d6bc..425976f 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -386,7 +386,7 @@ void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi
void QDeclarativeImage::pixmapChange()
{
updatePaintedGeometry();
- QDeclarativeImageBase::pixmapChange();
+ emit pixmapChanged();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
index 7394774..da6cbd5 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -79,6 +79,7 @@ public:
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
Q_SIGNALS:
+ void pixmapChanged();
void fillModeChanged();
void paintedGeometryChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 0e9638d..e65c9d1 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -144,19 +144,19 @@ void QDeclarativeImageBase::load()
static int thisRequestProgress = -1;
static int thisRequestFinished = -1;
if (replyDownloadProgress == -1) {
- replyDownloadProgress =
+ replyDownloadProgress =
QDeclarativePixmapReply::staticMetaObject.indexOfSignal("downloadProgress(qint64,qint64)");
- replyFinished =
+ replyFinished =
QDeclarativePixmapReply::staticMetaObject.indexOfSignal("finished()");
- thisRequestProgress =
+ thisRequestProgress =
QDeclarativeImageBase::staticMetaObject.indexOfSlot("requestProgress(qint64,qint64)");
thisRequestFinished =
QDeclarativeImageBase::staticMetaObject.indexOfSlot("requestFinished()");
}
- QMetaObject::connect(reply, replyFinished, this,
+ QMetaObject::connect(reply, replyFinished, this,
thisRequestFinished, Qt::DirectConnection);
- QMetaObject::connect(reply, replyDownloadProgress, this,
+ QMetaObject::connect(reply, replyDownloadProgress, this,
thisRequestProgress, Qt::DirectConnection);
} else {
//### should be unified with requestFinished
@@ -219,7 +219,6 @@ void QDeclarativeImageBase::componentComplete()
void QDeclarativeImageBase::pixmapChange()
{
- emit pixmapChanged();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
index cfebdca..b215193 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p.h
@@ -75,7 +75,6 @@ Q_SIGNALS:
void sourceChanged(const QUrl &);
void statusChanged(Status);
void progressChanged(qreal progress);
- void pixmapChanged();
void asynchronousChanged();
protected:
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 59dd43d..4ba80ad 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -273,7 +273,7 @@ void QDeclarativeContents::calcHeight()
m_height = qMax(bottom - top, qreal(0.0));
if (m_height != oldheight || m_y != oldy)
- emit rectChanged();
+ emit rectChanged(rectF());
}
//TODO: optimization: only check sender(), if there is one
@@ -301,7 +301,7 @@ void QDeclarativeContents::calcWidth()
m_width = qMax(right - left, qreal(0.0));
if (m_width != oldwidth || m_x != oldx)
- emit rectChanged();
+ emit rectChanged(rectF());
}
void QDeclarativeContents::setItem(QDeclarativeItem *item)
@@ -313,11 +313,11 @@ void QDeclarativeContents::setItem(QDeclarativeItem *item)
QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
continue;
- connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight()));
+ connect(child, SIGNAL(heightChanged(qreal)), this, SLOT(calcHeight()));
connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight()));
- connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth()));
+ connect(child, SIGNAL(widthChanged(qreal)), this, SLOT(calcWidth()));
connect(child, SIGNAL(xChanged()), this, SLOT(calcWidth()));
- connect(this, SIGNAL(rectChanged()), m_item, SIGNAL(childrenRectChanged()));
+ connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF)));
}
calcHeight();
@@ -1293,6 +1293,16 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
\internal
*/
+/*!
+ \fn void QDeclarativeItem::smoothChanged()
+ \internal
+*/
+
+/*!
+ \fn void QDeclarativeItem::clipChanged()
+ \internal
+*/
+
/*! \fn void QDeclarativeItem::transformOriginChanged(TransformOrigin)
\internal
*/
@@ -1652,7 +1662,7 @@ void QDeclarativeItem::setClip(bool c)
if (clip() == c)
return;
setFlag(ItemClipsChildrenToShape, c);
- emit clipChanged();
+ emit clipChanged(c);
}
/*!
@@ -1792,11 +1802,11 @@ void QDeclarativeItem::geometryChanged(const QRectF &newGeometry,
if (newGeometry.x() != oldGeometry.x())
emit xChanged();
if (newGeometry.width() != oldGeometry.width())
- emit widthChanged();
+ emit widthChanged(newGeometry.width());
if (newGeometry.y() != oldGeometry.y())
emit yChanged();
if (newGeometry.height() != oldGeometry.height())
- emit heightChanged();
+ emit heightChanged(newGeometry.height());
for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
@@ -2058,7 +2068,6 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
return;
d->_baselineOffset = offset;
- emit baselineOffsetChanged();
for(int ii = 0; ii < d->changeListeners.count(); ++ii) {
const QDeclarativeItemPrivate::ChangeListener &change = d->changeListeners.at(ii);
@@ -2068,6 +2077,7 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
anchor->updateVerticalAnchors();
}
}
+ emit baselineOffsetChanged(offset);
}
/*!
@@ -2214,7 +2224,7 @@ void QDeclarativeItem::setKeepMouseGrab(bool keep)
}
/*!
- \qmlmethod object Item::mapFromItem(Item item, int x, int y)
+ \qmlmethod object Item::mapFromItem(Item item, real x, real y)
Maps the point (\a x, \a y), which is in \a item's coordinate system, to
this item's coordinate system, and returns an object with \c x and \c y
@@ -2223,7 +2233,7 @@ void QDeclarativeItem::setKeepMouseGrab(bool keep)
If \a item is a \c null value, this maps the point from the coordinate
system of the root QML view.
*/
-QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, int x, int y) const
+QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, qreal x, qreal y) const
{
QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
QDeclarativeItem *itemObj = qobject_cast<QDeclarativeItem*>(item.toQObject());
@@ -2234,13 +2244,13 @@ QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, int x, int
// If QGraphicsItem::mapFromItem() is called with 0, behaves the same as mapFromScene()
QPointF p = qobject_cast<QGraphicsItem*>(this)->mapFromItem(itemObj, x, y);
- sv.setProperty("x", p.x());
- sv.setProperty("y", p.y());
+ sv.setProperty(QLatin1String("x"), p.x());
+ sv.setProperty(QLatin1String("y"), p.y());
return sv;
}
/*!
- \qmlmethod object Item::mapToItem(Item item, int x, int y)
+ \qmlmethod object Item::mapToItem(Item item, real x, real y)
Maps the point (\a x, \a y), which is in this item's coordinate system, to
\a item's coordinate system, and returns an object with \c x and \c y
@@ -2249,7 +2259,7 @@ QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, int x, int
If \a item is a \c null value, this maps \a x and \a y to the coordinate
system of the root QML view.
*/
-QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, int x, int y) const
+QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qreal y) const
{
QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject();
QDeclarativeItem *itemObj = qobject_cast<QDeclarativeItem*>(item.toQObject());
@@ -2260,23 +2270,15 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, int x, int y)
// If QGraphicsItem::mapToItem() is called with 0, behaves the same as mapToScene()
QPointF p = qobject_cast<QGraphicsItem*>(this)->mapToItem(itemObj, x, y);
- sv.setProperty("x", p.x());
- sv.setProperty("y", p.y());
+ sv.setProperty(QLatin1String("x"), p.x());
+ sv.setProperty(QLatin1String("y"), p.y());
return sv;
}
-/*!
- \internal
-
- This function emits the \e focusChanged signal.
-
- Subclasses overriding this function should call up
- to their base class.
-*/
-void QDeclarativeItem::focusChanged(bool flag)
+void QDeclarativeItemPrivate::focusChanged(bool flag)
{
- Q_UNUSED(flag);
- emit focusChanged();
+ Q_Q(QDeclarativeItem);
+ emit q->focusChanged(flag);
}
/*! \internal */
@@ -2569,14 +2571,16 @@ QPointF QDeclarativeItemPrivate::computeTransformOrigin() const
/*! \internal */
bool QDeclarativeItem::sceneEvent(QEvent *event)
{
+ Q_D(QDeclarativeItem);
if (event->type() == QEvent::KeyPress) {
QKeyEvent *k = static_cast<QKeyEvent *>(event);
-
if ((k->key() == Qt::Key_Tab || k->key() == Qt::Key_Backtab) &&
!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) {
keyPressEvent(static_cast<QKeyEvent *>(event));
if (!event->isAccepted())
return QGraphicsItem::sceneEvent(event);
+ else
+ return true;
} else {
return QGraphicsItem::sceneEvent(event);
}
@@ -2585,7 +2589,7 @@ bool QDeclarativeItem::sceneEvent(QEvent *event)
if (event->type() == QEvent::FocusIn ||
event->type() == QEvent::FocusOut) {
- focusChanged(hasFocus());
+ d->focusChanged(hasFocus());
}
return rv;
}
@@ -2598,7 +2602,7 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
Q_D(const QDeclarativeItem);
switch (change) {
case ItemParentHasChanged:
- emit parentChanged();
+ emit parentChanged(parentItem());
break;
case ItemChildAddedChange:
case ItemChildRemovedChange:
@@ -2711,7 +2715,7 @@ void QDeclarativeItem::setSmooth(bool smooth)
if (d->smooth == smooth)
return;
d->smooth = smooth;
- emit smoothChanged();
+ emit smoothChanged(smooth);
update();
}
@@ -2855,6 +2859,27 @@ bool QDeclarativeItem::heightValid() const
return d->heightValid;
}
+/*! \internal */
+void QDeclarativeItem::setSize(const QSizeF &size)
+{
+ Q_D(QDeclarativeItem);
+ d->heightValid = true;
+ d->widthValid = true;
+
+ if (d->height == size.height() && d->width == size.width())
+ return;
+
+ qreal oldHeight = d->height;
+ qreal oldWidth = d->width;
+
+ prepareGeometryChange();
+ d->height = size.height();
+ d->width = size.width();
+
+ geometryChanged(QRectF(x(), y(), width(), height()),
+ QRectF(x(), y(), oldWidth, oldHeight));
+}
+
/*!
\qmlproperty bool Item::wantsFocus
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index f6fedc7..9b85ba3 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -42,8 +42,8 @@
#ifndef QDECLARATIVEITEM_H
#define QDECLARATIVEITEM_H
-#include <qdeclarative.h>
-#include <qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtCore/QObject>
#include <QtCore/QList>
@@ -143,6 +143,8 @@ public:
void resetHeight();
qreal implicitHeight() const;
+ void setSize(const QSizeF &size);
+
TransformOrigin transformOrigin() const;
void setTransformOrigin(TransformOrigin);
@@ -159,8 +161,8 @@ public:
bool keepMouseGrab() const;
void setKeepMouseGrab(bool);
- Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, int x, int y) const;
- Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, int x, int y) const;
+ Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const;
+ Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
QDeclarativeAnchorLine left() const;
QDeclarativeAnchorLine right() const;
@@ -171,18 +173,18 @@ public:
QDeclarativeAnchorLine baseline() const;
Q_SIGNALS:
- void widthChanged();
- void heightChanged();
+ void widthChanged(qreal);
+ void heightChanged(qreal);
void childrenChanged();
- void childrenRectChanged();
- void baselineOffsetChanged();
+ void childrenRectChanged(const QRectF &);
+ void baselineOffsetChanged(qreal);
void stateChanged(const QString &);
- void focusChanged();
- void wantsFocusChanged();
- void parentChanged();
+ void focusChanged(bool);
+ void wantsFocusChanged(bool);
+ void parentChanged(QDeclarativeItem *);
void transformOriginChanged(TransformOrigin);
- void smoothChanged();
- void clipChanged();
+ void smoothChanged(bool);
+ void clipChanged(bool);
protected:
bool isComponentComplete() const;
@@ -197,7 +199,6 @@ protected:
virtual void classBegin();
virtual void componentComplete();
- virtual void focusChanged(bool);
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
virtual void inputMethodEvent(QInputMethodEvent *);
@@ -209,8 +210,6 @@ protected:
QDeclarativeItem(QDeclarativeItemPrivate &dd, QDeclarativeItem *parent = 0);
private:
- friend class QDeclarativeStatePrivate;
- friend class QDeclarativeAnchors;
Q_DISABLE_COPY(QDeclarativeItem)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
};
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index e424970..55df063 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -91,7 +91,7 @@ public Q_SLOTS:
void calcWidth();
Q_SIGNALS:
- void rectChanged();
+ void rectChanged(QRectF);
private:
QDeclarativeItem *m_item;
@@ -101,7 +101,7 @@ private:
qreal m_height;
};
-class QDeclarativeItemPrivate : public QGraphicsItemPrivate
+class Q_DECLARATIVE_EXPORT QDeclarativeItemPrivate : public QGraphicsItemPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeItem)
@@ -240,7 +240,7 @@ public:
// Reimplemented from QGraphicsItemPrivate
virtual void subFocusItemChange()
{
- emit q_func()->wantsFocusChanged();
+ emit q_func()->wantsFocusChanged(subFocusItem != 0);
}
// Reimplemented from QGraphicsItemPrivate
@@ -255,9 +255,11 @@ public:
}
}
+ virtual void focusChanged(bool);
+
static int consistentTime;
static QTime currentTime();
- static void Q_DECLARATIVE_EXPORT setConsistentTime(int t);
+ static void setConsistentTime(int t);
static void start(QTime &);
static int elapsed(QTime &);
static int restart(QTime &);
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 25660f8..2ac55a4 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -65,7 +65,6 @@
#include "qdeclarativelistview_p.h"
#include "qdeclarativeloader_p.h"
#include "qdeclarativemousearea_p.h"
-#include "qdeclarativeparticles_p.h"
#include "qdeclarativepath_p.h"
#include "qdeclarativepathview_p.h"
#include "qdeclarativerectangle_p.h"
@@ -82,76 +81,71 @@
void QDeclarativeItemModule::defineModule()
{
- QML_REGISTER_TYPE(Qt,4,6,AnimatedImage,QDeclarativeAnimatedImage);
- QML_REGISTER_TYPE(Qt,4,6,Blur,QGraphicsBlurEffect);
- QML_REGISTER_TYPE(Qt,4,6,BorderImage,QDeclarativeBorderImage);
- QML_REGISTER_TYPE(Qt,4,6,Colorize,QGraphicsColorizeEffect);
- QML_REGISTER_TYPE(Qt,4,6,Column,QDeclarativeColumn);
- QML_REGISTER_TYPE(Qt,4,6,Drag,QDeclarativeDrag);
- QML_REGISTER_TYPE(Qt,4,6,DropShadow,QGraphicsDropShadowEffect);
- QML_REGISTER_TYPE(Qt,4,6,Flickable,QDeclarativeFlickable);
- QML_REGISTER_TYPE(Qt,4,6,Flipable,QDeclarativeFlipable);
- QML_REGISTER_TYPE(Qt,4,6,Flow,QDeclarativeFlow);
- QML_REGISTER_TYPE(Qt,4,6,FocusPanel,QDeclarativeFocusPanel);
- QML_REGISTER_TYPE(Qt,4,6,FocusScope,QDeclarativeFocusScope);
- QML_REGISTER_TYPE(Qt,4,6,Gradient,QDeclarativeGradient);
- QML_REGISTER_TYPE(Qt,4,6,GradientStop,QDeclarativeGradientStop);
- QML_REGISTER_TYPE(Qt,4,6,GraphicsObjectContainer,QDeclarativeGraphicsObjectContainer);
- QML_REGISTER_TYPE(Qt,4,6,Grid,QDeclarativeGrid);
- QML_REGISTER_TYPE(Qt,4,6,GridView,QDeclarativeGridView);
- QML_REGISTER_TYPE(Qt,4,6,Image,QDeclarativeImage);
- QML_REGISTER_TYPE(Qt,4,6,Item,QDeclarativeItem);
- QML_REGISTER_TYPE(Qt,4,6,KeyNavigation,QDeclarativeKeyNavigationAttached);
- QML_REGISTER_TYPE(Qt,4,6,Keys,QDeclarativeKeysAttached);
- QML_REGISTER_TYPE(Qt,4,6,LayoutItem,QDeclarativeLayoutItem);
- QML_REGISTER_TYPE(Qt,4,6,ListView,QDeclarativeListView);
- QML_REGISTER_TYPE(Qt,4,6,Loader,QDeclarativeLoader);
- QML_REGISTER_TYPE(Qt,4,6,MouseArea,QDeclarativeMouseArea);
- QML_REGISTER_TYPE(Qt,4,6,Opacity,QGraphicsOpacityEffect);
- QML_REGISTER_TYPE(Qt,4,6,ParticleMotion,QDeclarativeParticleMotion);
- QML_REGISTER_TYPE(Qt,4,6,ParticleMotionGravity,QDeclarativeParticleMotionGravity);
- QML_REGISTER_TYPE(Qt,4,6,ParticleMotionLinear,QDeclarativeParticleMotionLinear);
- QML_REGISTER_TYPE(Qt,4,6,ParticleMotionWander,QDeclarativeParticleMotionWander);
- QML_REGISTER_TYPE(Qt,4,6,Particles,QDeclarativeParticles);
- QML_REGISTER_TYPE(Qt,4,6,Path,QDeclarativePath);
- QML_REGISTER_TYPE(Qt,4,6,PathAttribute,QDeclarativePathAttribute);
- QML_REGISTER_TYPE(Qt,4,6,PathCubic,QDeclarativePathCubic);
- QML_REGISTER_TYPE(Qt,4,6,PathLine,QDeclarativePathLine);
- QML_REGISTER_TYPE(Qt,4,6,PathPercent,QDeclarativePathPercent);
- QML_REGISTER_TYPE(Qt,4,6,PathQuad,QDeclarativePathQuad);
- QML_REGISTER_TYPE(Qt,4,6,PathView,QDeclarativePathView);
- QML_REGISTER_TYPE(Qt,4,6,Pen,QDeclarativePen);
- QML_REGISTER_TYPE(Qt,4,6,QIntValidator,QIntValidator);
+ qmlRegisterType<QDeclarativeAnimatedImage>("Qt",4,6,"AnimatedImage");
+ qmlRegisterType<QGraphicsBlurEffect>("Qt",4,6,"Blur");
+ qmlRegisterType<QDeclarativeBorderImage>("Qt",4,6,"BorderImage");
+ qmlRegisterType<QGraphicsColorizeEffect>("Qt",4,6,"Colorize");
+ qmlRegisterType<QDeclarativeColumn>("Qt",4,6,"Column");
+ qmlRegisterType<QDeclarativeDrag>("Qt",4,6,"Drag");
+ qmlRegisterType<QGraphicsDropShadowEffect>("Qt",4,6,"DropShadow");
+ qmlRegisterType<QDeclarativeFlickable>("Qt",4,6,"Flickable");
+ qmlRegisterType<QDeclarativeFlipable>("Qt",4,6,"Flipable");
+ qmlRegisterType<QDeclarativeFlow>("Qt",4,6,"Flow");
+ qmlRegisterType<QDeclarativeFocusPanel>("Qt",4,6,"FocusPanel");
+ qmlRegisterType<QDeclarativeFocusScope>("Qt",4,6,"FocusScope");
+ qmlRegisterType<QDeclarativeGradient>("Qt",4,6,"Gradient");
+ qmlRegisterType<QDeclarativeGradientStop>("Qt",4,6,"GradientStop");
+ qmlRegisterType<QDeclarativeGraphicsObjectContainer>("Qt",4,6,"GraphicsObjectContainer");
+ qmlRegisterType<QDeclarativeGrid>("Qt",4,6,"Grid");
+ qmlRegisterType<QDeclarativeGridView>("Qt",4,6,"GridView");
+ qmlRegisterType<QDeclarativeImage>("Qt",4,6,"Image");
+ qmlRegisterType<QDeclarativeItem>("Qt",4,6,"Item");
+ qmlRegisterType<QDeclarativeKeyNavigationAttached>("Qt",4,6,"KeyNavigation");
+ qmlRegisterType<QDeclarativeKeysAttached>("Qt",4,6,"Keys");
+ qmlRegisterType<QDeclarativeLayoutItem>("Qt",4,6,"LayoutItem");
+ qmlRegisterType<QDeclarativeListView>("Qt",4,6,"ListView");
+ qmlRegisterType<QDeclarativeLoader>("Qt",4,6,"Loader");
+ qmlRegisterType<QDeclarativeMouseArea>("Qt",4,6,"MouseArea");
+ qmlRegisterType<QGraphicsOpacityEffect>("Qt",4,6,"Opacity");
+ qmlRegisterType<QDeclarativePath>("Qt",4,6,"Path");
+ qmlRegisterType<QDeclarativePathAttribute>("Qt",4,6,"PathAttribute");
+ qmlRegisterType<QDeclarativePathCubic>("Qt",4,6,"PathCubic");
+ qmlRegisterType<QDeclarativePathLine>("Qt",4,6,"PathLine");
+ qmlRegisterType<QDeclarativePathPercent>("Qt",4,6,"PathPercent");
+ qmlRegisterType<QDeclarativePathQuad>("Qt",4,6,"PathQuad");
+ qmlRegisterType<QDeclarativePathView>("Qt",4,6,"PathView");
+ qmlRegisterType<QDeclarativePen>("Qt",4,6,"Pen");
+ qmlRegisterType<QIntValidator>("Qt",4,6,"QIntValidator");
#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
- QML_REGISTER_TYPE(Qt,4,7,QDoubleValidator,QDoubleValidator);
- QML_REGISTER_TYPE(Qt,4,7,QRegExpValidator,QRegExpValidator);
+ qmlRegisterType<QDoubleValidator>("Qt",4,7,"QDoubleValidator");
+ qmlRegisterType<QRegExpValidator>("Qt",4,7,"QRegExpValidator");
#endif
- QML_REGISTER_TYPE(Qt,4,6,Rectangle,QDeclarativeRectangle);
- QML_REGISTER_TYPE(Qt,4,6,Repeater,QDeclarativeRepeater);
- QML_REGISTER_TYPE(Qt,4,6,Rotation,QGraphicsRotation);
- QML_REGISTER_TYPE(Qt,4,6,Row,QDeclarativeRow);
- QML_REGISTER_TYPE(Qt,4,6,Scale,QGraphicsScale);
- QML_REGISTER_TYPE(Qt,4,6,Text,QDeclarativeText);
- QML_REGISTER_TYPE(Qt,4,6,TextEdit,QDeclarativeTextEdit);
- QML_REGISTER_TYPE(Qt,4,6,TextInput,QDeclarativeTextInput);
- QML_REGISTER_TYPE(Qt,4,6,ViewSection,QDeclarativeViewSection);
- QML_REGISTER_TYPE(Qt,4,6,VisibleArea,QDeclarativeFlickableVisibleArea);
- QML_REGISTER_TYPE(Qt,4,6,VisualDataModel,QDeclarativeVisualDataModel);
- QML_REGISTER_TYPE(Qt,4,6,VisualItemModel,QDeclarativeVisualItemModel);
+ qmlRegisterType<QDeclarativeRectangle>("Qt",4,6,"Rectangle");
+ qmlRegisterType<QDeclarativeRepeater>("Qt",4,6,"Repeater");
+ qmlRegisterType<QGraphicsRotation>("Qt",4,6,"Rotation");
+ qmlRegisterType<QDeclarativeRow>("Qt",4,6,"Row");
+ qmlRegisterType<QGraphicsScale>("Qt",4,6,"Scale");
+ qmlRegisterType<QDeclarativeText>("Qt",4,6,"Text");
+ qmlRegisterType<QDeclarativeTextEdit>("Qt",4,6,"TextEdit");
+ qmlRegisterType<QDeclarativeTextInput>("Qt",4,6,"TextInput");
+ qmlRegisterType<QDeclarativeViewSection>("Qt",4,6,"ViewSection");
+ qmlRegisterType<QDeclarativeFlickableVisibleArea>("Qt",4,6,"VisibleArea");
+ qmlRegisterType<QDeclarativeVisualDataModel>("Qt",4,6,"VisualDataModel");
+ qmlRegisterType<QDeclarativeVisualItemModel>("Qt",4,6,"VisualItemModel");
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeAnchors);
- QML_REGISTER_NOCREATE_TYPE(QGraphicsEffect);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeKeyEvent);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeMouseEvent);
- QML_REGISTER_NOCREATE_TYPE(QGraphicsObject);
- QML_REGISTER_NOCREATE_TYPE(QGraphicsTransform);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativePathElement);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeCurve);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeScaleGrid);
- QML_REGISTER_NOCREATE_TYPE(QValidator);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeVisualModel);
- QML_REGISTER_NOCREATE_TYPE(QAction);
+ qmlRegisterType<QDeclarativeAnchors>();
+ qmlRegisterType<QGraphicsEffect>();
+ qmlRegisterType<QDeclarativeKeyEvent>();
+ qmlRegisterType<QDeclarativeMouseEvent>();
+ qmlRegisterType<QGraphicsObject>();
+ qmlRegisterType<QGraphicsTransform>();
+ qmlRegisterType<QDeclarativePathElement>();
+ qmlRegisterType<QDeclarativeCurve>();
+ qmlRegisterType<QDeclarativeScaleGrid>();
+ qmlRegisterType<QValidator>();
+ qmlRegisterType<QDeclarativeVisualModel>();
+ qmlRegisterType<QAction>();
#ifdef QT_WEBKIT_LIB
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeWebSettings);
+ qmlRegisterType<QDeclarativeWebSettings>();
#endif
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index d54bb70..e5013a9 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -158,7 +158,7 @@ public:
, bufferMode(NoBuffer)
, ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false)
, correctFlick(true), inFlickCorrection(false), lazyRelease(false)
- , deferredRelease(false), minExtentDirty(true), maxExtentDirty(true)
+ , deferredRelease(false), layoutScheduled(false), minExtentDirty(true), maxExtentDirty(true)
{}
void init();
@@ -414,6 +414,7 @@ public:
}
void refill(qreal from, qreal to, bool doBuffer = false);
+ void scheduleLayout();
void layout();
void updateUnrequestedIndexes();
void updateUnrequestedPositions();
@@ -480,6 +481,7 @@ public:
bool inFlickCorrection : 1;
bool lazyRelease : 1;
bool deferredRelease : 1;
+ bool layoutScheduled : 1;
mutable bool minExtentDirty : 1;
mutable bool maxExtentDirty : 1;
};
@@ -557,7 +559,7 @@ void QDeclarativeListViewPrivate::releaseItem(FxListItem *item)
return;
if (trackedItem == item) {
const char *notifier1 = orient == QDeclarativeListView::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged());
- const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged());
+ const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged(qreal)) : SIGNAL(widthChanged(qreal));
QObject::disconnect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged()));
QObject::disconnect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged()));
trackedItem = 0;
@@ -680,9 +682,19 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
lazyRelease = false;
}
+void QDeclarativeListViewPrivate::scheduleLayout()
+{
+ Q_Q(QDeclarativeListView);
+ if (!layoutScheduled) {
+ layoutScheduled = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::User), Qt::HighEventPriority);
+ }
+}
+
void QDeclarativeListViewPrivate::layout()
{
Q_Q(QDeclarativeListView);
+ layoutScheduled = false;
updateSections();
if (!visibleItems.isEmpty()) {
int oldEnd = visibleItems.last()->endPosition();
@@ -748,7 +760,7 @@ void QDeclarativeListViewPrivate::updateTrackedItem()
FxListItem *oldTracked = trackedItem;
const char *notifier1 = orient == QDeclarativeListView::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged());
- const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged());
+ const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged(qreal)) : SIGNAL(widthChanged(qreal));
if (trackedItem && item != trackedItem) {
QObject::disconnect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged()));
@@ -1082,10 +1094,12 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
if (currentItem && currentItem->position() - position() != highlightRangeStart) {
qreal pos = currentItem->position() - highlightRangeStart;
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupDuration) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ } else {
data.move.setValue(-pos);
+ q->viewportMoved();
+ }
vTime = timeline.time();
}
} else if (snapMode != QDeclarativeListView::NoSnap) {
@@ -1094,10 +1108,12 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
- if (fixupDuration)
+ if (fixupDuration) {
timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
+ } else {
data.move.setValue(-pos);
+ q->viewportMoved();
+ }
vTime = timeline.time();
}
}
@@ -1124,7 +1140,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (FxListItem *item = firstVisibleItem())
maxDistance = qAbs(item->position() + data.move.value());
} else if (data.move.value() < minExtent) {
- maxDistance = qAbs(minExtent - data.move.value() + (overShoot?overShootDistance(velocity, vSize):0));
+ maxDistance = qAbs(minExtent - data.move.value());
}
if (snapMode != QDeclarativeListView::SnapToItem && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
data.flickTarget = minExtent;
@@ -1133,7 +1149,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (FxListItem *item = nextVisibleItem())
maxDistance = qAbs(item->position() + data.move.value());
} else if (data.move.value() > maxExtent) {
- maxDistance = qAbs(maxExtent - data.move.value()) + (overShoot?overShootDistance(velocity, vSize):0);
+ maxDistance = qAbs(maxExtent - data.move.value());
}
if (snapMode != QDeclarativeListView::SnapToItem && highlightRange != QDeclarativeListView::StrictlyEnforceRange)
data.flickTarget = maxExtent;
@@ -1156,7 +1172,8 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
qreal v2 = v * v;
qreal maxAccel = v2 / (2.0f * maxDistance);
if (maxAccel < accel) {
- qreal dist = v2 / (accel * 2.0);
+ // + averageSize/4 to encourage moving at least one item in the flick direction
+ qreal dist = v2 / (accel * 2.0) + averageSize/4;
if (v > 0)
dist = -dist;
data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart;
@@ -1944,6 +1961,17 @@ void QDeclarativeListView::setHeader(QDeclarativeComponent *header)
}
}
+bool QDeclarativeListView::event(QEvent *event)
+{
+ Q_D(QDeclarativeListView);
+ if (event->type() == QEvent::User) {
+ d->layout();
+ return true;
+ }
+
+ return QDeclarativeFlickable::event(event);
+}
+
void QDeclarativeListView::viewportMoved()
{
Q_D(QDeclarativeListView);
@@ -1956,10 +1984,11 @@ void QDeclarativeListView::viewportMoved()
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
// reposition highlight
qreal pos = d->highlight->position();
- if (pos > d->position() + d->highlightRangeEnd - 1 - d->highlight->size())
- pos = d->position() + d->highlightRangeEnd - 1 - d->highlight->size();
- if (pos < d->position() + d->highlightRangeStart)
- pos = d->position() + d->highlightRangeStart;
+ qreal viewPos = qRound(d->position());
+ if (pos > viewPos + d->highlightRangeEnd - 1 - d->highlight->size())
+ pos = viewPos + d->highlightRangeEnd - 1 - d->highlight->size();
+ if (pos < viewPos + d->highlightRangeStart)
+ pos = viewPos + d->highlightRangeStart;
d->highlight->setPosition(pos);
// update current index
@@ -2032,7 +2061,7 @@ qreal QDeclarativeListView::maxYExtent() const
return height();
if (d->maxExtentDirty) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
- d->maxExtent = -(d->positionAt(count()-1) - d->highlightRangeEnd);
+ d->maxExtent = -(d->endPosition() - d->highlightRangeEnd);
else
d->maxExtent = -(d->endPosition() - height() + 1);
if (d->footer)
@@ -2069,7 +2098,7 @@ qreal QDeclarativeListView::maxXExtent() const
return width();
if (d->maxExtentDirty) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange)
- d->maxExtent = -(d->positionAt(count()-1) - d->highlightRangeEnd);
+ d->maxExtent = -(d->endPosition() - d->highlightRangeEnd);
else
d->maxExtent = -(d->endPosition() - width() + 1);
if (d->footer)
@@ -2151,11 +2180,23 @@ void QDeclarativeListView::decrementCurrentIndex()
}
/*!
- \qmlmethod ListView::positionViewAtIndex(int index)
+ \qmlmethod ListView::positionViewAtIndex(int index, PositionMode mode)
+
+ Positions the view such that the \a index is at the position specified by
+ \a mode:
+
+ \list
+ \o Beginning - position item at the top (or left for horizontal orientation) of the view.
+ \o Center- position item in the center of the view.
+ \o End - position item at bottom (or right for horizontal orientation) of the view.
+ \o Visible - if any part of the item is visible then take no action, otherwise
+ bring the item into view.
+ \o Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for horizontal orientation) of the view.
+ \endlist
- Positions the view such that the \a index is at the top (or left for horizontal orientation) of the view.
If positioning the view at the index would cause empty space to be displayed at
- the end of the view, the view will be positioned at the end.
+ the beginning or end of the view, the view will be positioned at the boundary.
It is not recommended to use contentX or contentY to position the view
at a particular index. This is unreliable since removing items from the start
@@ -2163,32 +2204,58 @@ void QDeclarativeListView::decrementCurrentIndex()
the actual start of the view can vary based on the size of the delegates.
The correct way to bring an item into view is with positionViewAtIndex.
*/
-void QDeclarativeListView::positionViewAtIndex(int index)
+void QDeclarativeListView::positionViewAtIndex(int index, int mode)
{
Q_D(QDeclarativeListView);
if (!d->isValid() || index < 0 || index >= d->model->count())
return;
+ if (mode < Beginning || mode > Contain)
+ return;
- qreal maxExtent = d->orient == QDeclarativeListView::Vertical ? -maxYExtent() : -maxXExtent();
+ qreal pos = d->position();
FxListItem *item = d->visibleItem(index);
- if (item) {
- // Already created - just move to top of view
- int pos = qMin(item->position(), maxExtent);
- d->setPosition(pos);
- } else {
- int pos = d->positionAt(index);
+ if (!item) {
+ int itemPos = d->positionAt(index);
// save the currently visible items in case any of them end up visible again
QList<FxListItem*> oldVisible = d->visibleItems;
d->visibleItems.clear();
- d->visiblePos = pos;
+ d->visiblePos = itemPos;
d->visibleIndex = index;
- d->setPosition(pos);
- // setPosition() will cause refill. Adjust if we have moved beyond range.
- if (d->position() > maxExtent)
- d->setPosition(maxExtent);
+ d->setPosition(itemPos);
// now release the reference to all the old visible items.
for (int i = 0; i < oldVisible.count(); ++i)
d->releaseItem(oldVisible.at(i));
+ item = d->visibleItem(index);
+ }
+ if (item) {
+ const qreal itemPos = item->position();
+ switch (mode) {
+ case Beginning:
+ pos = itemPos;
+ break;
+ case Center:
+ pos = itemPos - (d->size() - item->size())/2;
+ break;
+ case End:
+ pos = itemPos - d->size() + item->size();
+ break;
+ case Visible:
+ if (itemPos > pos + d->size())
+ pos = itemPos - d->size() + item->size();
+ else if (item->endPosition() < pos)
+ pos = itemPos;
+ break;
+ case Contain:
+ if (item->endPosition() > pos + d->size())
+ pos = itemPos - d->size() + item->size();
+ if (itemPos < pos)
+ pos = itemPos;
+ }
+ qreal maxExtent = d->orient == QDeclarativeListView::Vertical ? -maxYExtent() : -maxXExtent();
+ pos = qMin(pos, maxExtent);
+ qreal minExtent = d->orient == QDeclarativeListView::Vertical ? -minYExtent() : -minXExtent();
+ pos = qMax(pos, minExtent);
+ d->setPosition(pos);
}
d->fixupPosition();
}
@@ -2273,7 +2340,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
d->updateUnrequestedIndexes();
d->moveReason = QDeclarativeListViewPrivate::Other;
if (!d->visibleItems.count() || d->model->count() <= 1) {
- d->layout();
+ d->scheduleLayout();
d->updateCurrent(qMax(0, qMin(d->currentIndex, d->model->count()-1)));
emit countChanged();
return;
@@ -2303,8 +2370,9 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
d->currentIndex += count;
if (d->currentItem)
d->currentItem->index = d->currentIndex;
+ emit currentIndexChanged();
}
- d->layout();
+ d->scheduleLayout();
emit countChanged();
return;
}
@@ -2327,7 +2395,10 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
int i = 0;
int from = d->position() - d->buffer;
for (i = count-1; i >= 0 && pos > from; --i) {
- addedVisible = true;
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
FxListItem *item = d->createItem(modelIndex + i);
d->visibleItems.insert(insertionIdx, item);
pos -= item->size() + d->spacing;
@@ -2354,7 +2425,10 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
int i = 0;
int to = d->buffer+d->position()+d->size()-1;
for (i = 0; i < count && pos <= to; ++i) {
- addedVisible = true;
+ if (!addedVisible) {
+ d->scheduleLayout();
+ addedVisible = true;
+ }
FxListItem *item = d->createItem(modelIndex + i);
d->visibleItems.insert(index, item);
item->setPosition(pos);
@@ -2377,6 +2451,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
d->currentItem->index = d->currentIndex;
d->currentItem->setPosition(d->currentItem->position() + diff);
}
+ emit currentIndexChanged();
}
// Update the indexes of the following visible items.
for (; index < d->visibleItems.count(); ++index) {
@@ -2390,8 +2465,6 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
for (int j = 0; j < added.count(); ++j)
added.at(j)->attached->emitAdd();
- if (addedVisible)
- d->layout();
emit countChanged();
}
@@ -2417,7 +2490,10 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
++it;
} else {
// removed item
- removedVisible = true;
+ if (!removedVisible) {
+ d->scheduleLayout();
+ removedVisible = true;
+ }
item->attached->emitRemove();
if (item->attached->delayRemove()) {
item->index = -1;
@@ -2442,6 +2518,7 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
d->currentIndex -= count;
if (d->currentItem)
d->currentItem->index -= count;
+ emit currentIndexChanged();
} else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) {
// current item has been removed.
d->currentItem->attached->setIsCurrentItem(false);
@@ -2459,20 +2536,13 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count)
}
}
- if (removedVisible) {
- if (d->visibleItems.isEmpty()) {
- d->visibleIndex = 0;
- d->visiblePos = d->header ? d->header->size() : 0;
- d->timeline.clear();
- d->setPosition(0);
- if (d->model->count() == 0)
- update();
- else
- refill();
- } else {
- // Correct the positioning of the items
- d->layout();
- }
+ if (removedVisible && d->visibleItems.isEmpty()) {
+ d->visibleIndex = 0;
+ d->visiblePos = d->header ? d->header->size() : 0;
+ d->timeline.clear();
+ d->setPosition(0);
+ if (d->model->count() == 0)
+ update();
}
emit countChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index d66ac2b..0c2677c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -191,10 +191,13 @@ public:
static QDeclarativeListViewAttached *qmlAttachedProperties(QObject *);
+ enum PositionMode { Beginning, Center, End, Visible, Contain };
+ Q_ENUMS(PositionMode)
+
public Q_SLOTS:
void incrementCurrentIndex();
void decrementCurrentIndex();
- void positionViewAtIndex(int index);
+ void positionViewAtIndex(int index, int mode);
Q_SIGNALS:
void countChanged();
@@ -219,6 +222,7 @@ Q_SIGNALS:
void footerChanged();
protected:
+ virtual bool event(QEvent *event);
virtual void viewportMoved();
virtual qreal minYExtent() const;
virtual qreal maxYExtent() const;
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index b0499d7..6dbcd16 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -155,6 +155,8 @@ void QDeclarativeLoaderPrivate::initResize()
QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent)
{
+ Q_D(QDeclarativeItem);
+ d->flags |= QGraphicsItem::ItemIsFocusScope;
}
/*!
@@ -273,7 +275,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
if (component) {
QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q));
- ctxt->addDefaultObject(q);
+ ctxt->setContextObject(q);
if (!component->errors().isEmpty()) {
qWarning() << component->errors();
@@ -346,12 +348,13 @@ QDeclarativeLoader::Status QDeclarativeLoader::status() const
}
/*!
- \qmlproperty real Loader::progress
+\qmlproperty real Loader::progress
- This property holds the progress of QML data loading, from 0.0 (nothing loaded)
- to 1.0 (finished).
+This property holds the progress of loading QML data from the network, from
+0.0 (nothing loaded) to 1.0 (finished). Most QML files are quite small, so
+this value will rapidly change from 0 to 1.
- \sa status
+\sa status
*/
qreal QDeclarativeLoader::progress() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index ec7aa62..13195af 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -383,7 +383,6 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
d->dragged = false;
setHovered(true);
- d->start = event->pos();
d->startScene = event->scenePos();
// we should only start timer if pressAndHold is connected to.
if (d->isConnected("pressAndHold(QDeclarativeMouseEvent*)"))
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index d4871f2..88206cd 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -101,7 +101,6 @@ public:
bool dragY : 1;
bool dragged : 1;
QDeclarativeDrag *drag;
- QPointF start;
QPointF startScene;
qreal startX;
qreal startY;
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index ab6007a..28a93d2 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -211,8 +211,8 @@ QDeclarativePaintedItem::~QDeclarativePaintedItem()
*/
void QDeclarativePaintedItem::init()
{
- connect(this,SIGNAL(widthChanged()),this,SLOT(clearCache()));
- connect(this,SIGNAL(heightChanged()),this,SLOT(clearCache()));
+ connect(this,SIGNAL(widthChanged(qreal)),this,SLOT(clearCache()));
+ connect(this,SIGNAL(heightChanged(qreal)),this,SLOT(clearCache()));
connect(this,SIGNAL(visibleChanged()),this,SLOT(clearCache()));
}
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index cc17157..b9c8971 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -354,7 +354,7 @@ void QDeclarativePathView::setCurrentIndex(int idx)
/*!
\qmlproperty real PathView::offset
- The offset specifies how far along the path the items are from their initial positions.
+ The offset specifies how far along the path (0.0-1.0) the items are from their initial positions.
*/
qreal QDeclarativePathView::offset() const
{
@@ -373,9 +373,9 @@ void QDeclarativePathViewPrivate::setOffset(qreal o)
{
Q_Q(QDeclarativePathView);
if (_offset != o) {
- _offset = qmlMod(o, qreal(100.0));
+ _offset = qmlMod(o, qreal(1.0));
if (_offset < 0)
- _offset = 100.0 + _offset;
+ _offset = 1.0 + _offset;
q->refill();
}
}
@@ -503,7 +503,7 @@ QPointF QDeclarativePathViewPrivate::pointNear(const QPointF &point, qreal *near
}
if (nearPercent)
- *nearPercent = nearPc / 10.0;
+ *nearPercent = nearPc / 1000.0;
return nearPoint;
}
@@ -559,10 +559,10 @@ void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (diff) {
setOffset(d->_offset + diff);
- if (diff > 50)
- diff -= 100;
- else if (diff < -50)
- diff += 100;
+ if (diff > 0.5)
+ diff -= 1.0;
+ else if (diff < -0.5)
+ diff += 1.0;
d->lastElapsed = QDeclarativeItemPrivate::restart(d->lastPosTime);
d->lastDist = diff;
@@ -579,15 +579,15 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
qreal elapsed = qreal(d->lastElapsed + QDeclarativeItemPrivate::elapsed(d->lastPosTime)) / 1000.;
qreal velocity = elapsed > 0. ? d->lastDist / elapsed : 0;
- if (d->model && d->model->count() && qAbs(velocity) > 5) {
- if (velocity > 100)
- velocity = 100;
- else if (velocity < -100)
- velocity = -100;
- qreal inc = qmlMod(d->_offset - d->snapPos, qreal(100.0 / d->model->count()));
- qreal dist = qAbs(velocity/2 - qmlMod(velocity/2, qreal(100.0 / d->model->count()) - inc));
+ if (d->model && d->model->count() && qAbs(velocity) > 0.05) {
+ if (velocity > 1.5)
+ velocity = 1.5;
+ else if (velocity < -1.5)
+ velocity = -1.5;
+ qreal inc = qmlMod(d->_offset - d->snapPos, qreal(1.0 / d->model->count()));
+ qreal dist = qAbs(velocity/2 - qmlMod(velocity/2, qreal(1.0 / d->model->count()) - inc));
d->moveOffset.setValue(d->_offset);
- d->tl.accel(d->moveOffset, velocity, 10, dist);
+ d->tl.accel(d->moveOffset, velocity, 0.1, dist);
d->tl.callback(QDeclarativeTimeLineCallback(&d->moveOffset, d->fixOffsetCallback, d));
} else {
d->fixOffset();
@@ -676,10 +676,10 @@ void QDeclarativePathView::componentComplete()
itemIndex += d->pathOffset;
itemIndex %= d->items.count();
- qreal targetOffset = qmlMod(100 + (d->snapPos*100) - 100.0 * itemIndex / d->items.count(), qreal(100.0));
+ qreal targetOffset = qmlMod(1.0 + d->snapPos - qreal(itemIndex) / d->items.count(), qreal(1.0));
if (targetOffset < 0)
- targetOffset = 100.0 + targetOffset;
+ targetOffset = 1.0 + targetOffset;
if (targetOffset != d->_offset) {
d->moveOffset.setValue(targetOffset);
}
@@ -712,8 +712,8 @@ void QDeclarativePathViewPrivate::regenerate()
}
items.append(item);
item->setZValue(i);
- qreal percent = i * (100. / numItems) + _offset;
- percent = qAbs(qmlMod(percent, qreal(100.0))/100.0);
+ qreal percent = qreal(i) / numItems + _offset;
+ percent = qAbs(qmlMod(percent, qreal(1.0)));
updateItem(item, percent);
model->completeItem();
if (currentIndex == index) {
@@ -745,10 +745,10 @@ void QDeclarativePathView::refill()
QList<qreal> positions;
for (int i=0; i<d->items.count(); i++){
- qreal percent = i * (100. / d->items.count());
+ qreal percent = qreal(i) / d->items.count();
percent = percent + d->_offset;
- percent = qmlMod(percent, qreal(100.0));
- positions << qAbs(percent/100.0);
+ percent = qmlMod(percent, qreal(1.0));
+ positions << qAbs(percent);
}
if (d->pathItems==-1) {
@@ -843,10 +843,10 @@ void QDeclarativePathView::itemsInserted(int modelIndex, int count)
int itemIndex = (d->currentIndex - d->firstIndex + d->model->count())%d->model->count();
itemIndex += d->pathOffset;
itemIndex %= d->items.count();
- qreal targetOffset = qmlMod(100 + (d->snapPos*100) - 100.0 * itemIndex / d->items.count(), qreal(100.0));
+ qreal targetOffset = qmlMod(1.0 + d->snapPos - qreal(itemIndex) / d->items.count(), qreal(1.0));
if (targetOffset < 0)
- targetOffset = 100.0 + targetOffset;
+ targetOffset = 1.0 + targetOffset;
if (targetOffset != d->_offset)
d->moveOffset.setValue(targetOffset);
}
@@ -880,10 +880,10 @@ void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
int itemIndex = (d->currentIndex - d->firstIndex + d->model->count())%d->model->count();
itemIndex += d->pathOffset;
itemIndex %= d->items.count();
- qreal targetOffset = qmlMod(100 + (d->snapPos*100) - 100.0 * itemIndex / d->items.count(), qreal(100.0));
+ qreal targetOffset = qmlMod(1.0 + d->snapPos - qreal(itemIndex) / d->items.count(), qreal(1.0));
if (targetOffset < 0)
- targetOffset = 100.0 + targetOffset;
+ targetOffset = 1.0 + targetOffset;
if (targetOffset != d->_offset)
d->moveOffset.setValue(targetOffset);
}
@@ -919,15 +919,15 @@ int QDeclarativePathViewPrivate::calcCurrentIndex()
{
int current = -1;
if (model && items.count()) {
- _offset = qmlMod(_offset, qreal(100.0));
+ _offset = qmlMod(_offset, qreal(1.0));
if (_offset < 0)
- _offset += 100.0;
+ _offset += 1.0;
if (pathItems == -1) {
- qreal delta = qmlMod(_offset - snapPos, qreal(100.0));
+ qreal delta = qmlMod(_offset - snapPos, qreal(1.0));
if (delta < 0)
- delta = 100.0 + delta;
- int ii = model->count() - qRound(delta * model->count() / 100);
+ delta = 1.0 + delta;
+ int ii = model->count() - qRound(delta * model->count());
if (ii < 0)
ii = 0;
current = ii;
@@ -935,10 +935,10 @@ int QDeclarativePathViewPrivate::calcCurrentIndex()
qreal bestDiff=1e9;
int bestI=-1;
for (int i=0; i<items.count(); i++){
- qreal percent = i * (100. / items.count());
+ qreal percent = qreal(i) / items.count();
percent = percent + _offset;
- percent = qmlMod(percent, qreal(100.0));
- qreal diff = qAbs(snapPos - (percent/100.0));
+ percent = qmlMod(percent, qreal(1.0));
+ qreal diff = qAbs(snapPos - percent);
if (diff < bestDiff){
bestDiff = diff;
bestI = i;
@@ -1017,10 +1017,10 @@ void QDeclarativePathViewPrivate::snapToCurrent()
itemIndex = itemIndex - model->count() + items.count();
}
itemIndex %= items.count();
- qreal targetOffset = qmlMod(100 + (snapPos*100) - 100.0 * itemIndex / items.count(), qreal(100.0));
+ qreal targetOffset = qmlMod(1.0 + snapPos - qreal(itemIndex) / items.count(), qreal(1.0));
if (targetOffset < 0)
- targetOffset = 100.0 + targetOffset;
+ targetOffset = 1.0 + targetOffset;
if (targetOffset == _offset && rounds == 0)
return;
@@ -1031,24 +1031,24 @@ void QDeclarativePathViewPrivate::snapToCurrent()
if (rounds!=0){
//Compensate if the targetOffset would bring the target in from off the screen
qreal distance = targetOffset - _offset;
- if (distance <= -50)
+ if (distance <= -0.5)
rounds--;
- if (distance > 50)
+ if (distance > 0.5)
rounds++;
- tl.move(moveOffset, targetOffset + 100.0*(-rounds), QEasingCurve(QEasingCurve::InOutQuad),
- int(100*items.count()*qMax((qreal)(2.0/items.count()),(qreal)qAbs(rounds))));
+ tl.move(moveOffset, targetOffset -rounds, QEasingCurve(QEasingCurve::InOutQuad),
+ int(items.count()*qMax((qreal)(2.0/items.count()),(qreal)qAbs(rounds))));
tl.callback(QDeclarativeTimeLineCallback(&moveOffset, fixOffsetCallback, this));
return;
}
- if (targetOffset - _offset > 50.0) {
- qreal distance = 100 - targetOffset + _offset;
+ if (targetOffset - _offset > 0.5) {
+ qreal distance = 1 - targetOffset + _offset;
tl.move(moveOffset, 0.0, QEasingCurve(QEasingCurve::OutQuad), int(200 * _offset / distance));
- tl.set(moveOffset, 100.0);
- tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InQuad), int(200 * (100-targetOffset) / distance));
- } else if (targetOffset - _offset <= -50.0) {
- qreal distance = 100 - _offset + targetOffset;
- tl.move(moveOffset, 100.0, QEasingCurve(QEasingCurve::OutQuad), int(200 * (100-_offset) / distance));
+ tl.set(moveOffset, 1.0);
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InQuad), int(200 * (1.0-targetOffset) / distance));
+ } else if (targetOffset - _offset <= -0.5) {
+ qreal distance = 1 - _offset + targetOffset;
+ tl.move(moveOffset, 1.0, QEasingCurve(QEasingCurve::OutQuad), int(200 * (1.0-_offset) / distance));
tl.set(moveOffset, 0.0);
tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InQuad), int(200 * targetOffset / distance));
} else {
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
index 4083ab5..62f7d95 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -66,11 +66,6 @@
QT_BEGIN_NAMESPACE
-typedef struct PathViewItem{
- int index;
- QDeclarativeItem* item;
-}PathViewItem;
-
class QDeclarativeOpenMetaObjectType;
class QDeclarativePathViewAttached;
class QDeclarativePathViewPrivate : public QDeclarativeItemPrivate
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 1212e89..0f59a70 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -212,19 +212,22 @@ void QDeclarativeBasePositioner::prePositioning()
QList<QGraphicsItem *> children = d->QGraphicsItemPrivate::children;
qSort(children.begin(), children.end(), d->insertionOrder);
+ QPODVector<PositionedItem,8> oldItems;
+ positionedItems.copyAndClear(oldItems);
for (int ii = 0; ii < children.count(); ++ii) {
QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(ii));
if (!child)
continue;
PositionedItem *item = 0;
PositionedItem posItem(child);
- int wIdx = positionedItems.find(posItem);
+ int wIdx = oldItems.find(posItem);
if (wIdx < 0) {
d->watchChanges(child);
positionedItems.append(posItem);
item = &positionedItems[positionedItems.count()-1];
} else {
- item = &positionedItems[wIdx];
+ item = &oldItems[wIdx];
+ positionedItems.append(*item);
}
if (child->opacity() <= 0.0 || !child->isVisible()) {
item->isVisible = false;
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index e4cd499..b9696c8 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -296,6 +296,8 @@ void QDeclarativeRepeater::clear()
void QDeclarativeRepeater::regenerate()
{
Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
clear();
@@ -312,23 +314,65 @@ void QDeclarativeRepeater::regenerate()
}
}
-void QDeclarativeRepeater::itemsInserted(int, int)
+void QDeclarativeRepeater::itemsInserted(int index, int count)
{
- regenerate();
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
+ for (int i = 0; i < count; ++i) {
+ int modelIndex = index + i;
+ QDeclarativeItem *item = d->model->item(modelIndex);
+ if (item) {
+ item->setParent(parentItem());
+ if (modelIndex < d->deletables.count())
+ item->stackBefore(d->deletables.at(modelIndex));
+ else
+ item->stackBefore(this);
+ d->deletables.insert(modelIndex, item);
+ }
+ }
}
-void QDeclarativeRepeater::itemsRemoved(int, int)
+void QDeclarativeRepeater::itemsRemoved(int index, int count)
{
- regenerate();
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
+ while (count--) {
+ QDeclarativeItem *item = d->deletables.takeAt(index);
+ if (item) {
+ item->setParentItem(this);
+ d->model->release(item);
+ }
+ }
}
-void QDeclarativeRepeater::itemsMoved(int,int,int)
+void QDeclarativeRepeater::itemsMoved(int from, int to, int count)
{
- regenerate();
+ Q_D(QDeclarativeRepeater);
+ if (!isComponentComplete())
+ return;
+ QList<QDeclarativeItem*> removed;
+ int removedCount = count;
+ while (removedCount--)
+ removed << d->deletables.takeAt(from);
+ for (int i = 0; i < count; ++i)
+ d->deletables.insert(to + i, removed.at(i));
+ for (int i = 0; i < d->model->count(); ++i) {
+ if (i < from && i < to)
+ continue;
+ QDeclarativeItem *item = d->deletables.at(i);
+ if (i < d->deletables.count()-1)
+ item->stackBefore(d->deletables.at(i+1));
+ else
+ item->stackBefore(this);
+ }
}
void QDeclarativeRepeater::modelReset()
{
+ if (!isComponentComplete())
+ return;
regenerate();
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index be73b39..dbae47d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -760,17 +760,11 @@ void QDeclarativeTextEdit::keyReleaseEvent(QKeyEvent *event)
QDeclarativePaintedItem::keyReleaseEvent(event);
}
-/*!
- \overload
- Handles changing of the focus property. Focus is applied to the control
- even if the edit does not have active focus. This is because things
- like KeyProxy can give the behavior of focus even when hasFocus() isn't
- true.
-*/
-void QDeclarativeTextEdit::focusChanged(bool hasFocus)
+void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
{
- setCursorVisible(hasFocus);
- QDeclarativeItem::focusChanged(hasFocus);
+ Q_Q(QDeclarativeTextEdit);
+ q->setCursorVisible(hasFocus);
+ QDeclarativeItemPrivate::focusChanged(hasFocus);
}
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 6183b1d..b1682c4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -215,8 +215,6 @@ protected:
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
- void focusChanged(bool);
-
// mouse filter?
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 002fac4..dd2a29d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -80,6 +80,7 @@ public:
void updateDefaultTextOption();
void relayoutDocument();
void updateSelection();
+ void focusChanged(bool);
QString text;
QFont font;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 3382628..6df3533 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -636,12 +636,12 @@ int QDeclarativeTextInput::xToPos(int x)
return d->control->xToPos(x - d->hscroll);
}
-void QDeclarativeTextInput::focusChanged(bool hasFocus)
+void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
{
- Q_D(QDeclarativeTextInput);
- d->focused = hasFocus;
- setCursorVisible(hasFocus);
- QDeclarativeItem::focusChanged(hasFocus);
+ Q_Q(QDeclarativeTextInput);
+ focused = hasFocus;
+ q->setCursorVisible(hasFocus);
+ QDeclarativeItemPrivate::focusChanged(hasFocus);
}
void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index f690ae2..6a61c2d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -199,8 +199,6 @@ protected:
void keyPressEvent(QKeyEvent* ev);
bool event(QEvent *e);
- void focusChanged(bool hasFocus);
-
public Q_SLOTS:
void selectAll();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index 3d28f40..5d17a55 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -83,6 +83,7 @@ public:
void init();
void startCreatingCursor();
+ void focusChanged(bool hasFocus);
QLineControl* control;
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 6bad4da..6341764 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -196,7 +196,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express
return QVariant();
QDeclarativeContext *ccontext = qmlContext(this);
QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
- ctxt->addDefaultObject(d->children.at(index));
+ ctxt->setContextObject(d->children.at(index));
QDeclarativeExpression e(ctxt, expression, objectContext);
QVariant value = e.value();
delete ctxt;
@@ -991,7 +991,7 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray
QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
ctxt->setContextProperty(QLatin1String("model"), data);
- ctxt->addDefaultObject(data);
+ ctxt->setContextObject(data);
nobj = d->m_delegate->beginCreate(ctxt);
if (complete)
d->m_delegate->completeCreate();
@@ -1104,7 +1104,7 @@ QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &express
if (!ccontext) ccontext = qmlContext(this);
QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
- ctxt->addDefaultObject(data);
+ ctxt->setContextObject(data);
QDeclarativeExpression e(ctxt, expression, objectContext);
value = e.value();
delete data;
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 34163a4..6404be3 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -56,9 +56,11 @@
#include <stdio.h>
#include <string.h>
-QT_QML_BEGIN_NAMESPACE
-
+QT_BEGIN_NAMESPACE
extern double qstrtod(const char *s00, char const **se, bool *ok);
+QT_END_NAMESPACE
+
+QT_QML_BEGIN_NAMESPACE
#define shiftWindowsLineBreak() \
do { \
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index 77b7484..dfdef11 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -99,7 +99,7 @@ int qmlRegisterType()
qRegisterMetaType<T *>(pointerName.constData()),
qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
- 0,
+ 0, 0,
0, 0, 0, 0, &T::staticMetaObject,
@@ -131,7 +131,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
qRegisterMetaType<T *>(pointerName.constData()),
qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
- QDeclarativePrivate::create<T>,
+ sizeof(T), QDeclarativePrivate::createInto<T>,
uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
@@ -163,7 +163,7 @@ int qmlRegisterExtendedType()
qRegisterMetaType<T *>(pointerName.constData()),
qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
- 0,
+ 0, 0,
0, 0, 0, 0, &T::staticMetaObject,
@@ -203,7 +203,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
qRegisterMetaType<T *>(pointerName.constData()),
qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
- QDeclarativePrivate::create<T>,
+ sizeof(T), QDeclarativePrivate::createInto<T>,
uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
@@ -256,7 +256,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
qRegisterMetaType<T *>(pointerName.constData()),
qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
- QDeclarativePrivate::create<T>,
+ sizeof(T), QDeclarativePrivate::createInto<T>,
uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
@@ -275,18 +275,6 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
return QDeclarativePrivate::registerType(type);
}
-#define QML_REGISTER_INTERFACE(INTERFACE) \
- qmlRegisterInterface<INTERFACE>(#INTERFACE)
-
-#define QML_REGISTER_EXTENDED_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, CLASS, EXTENSION) \
- qmlRegisterExtendedType<CLASS,EXTENSION>(#URI, VERSION_MAJ, VERSION_MIN, #NAME)
-
-#define QML_REGISTER_TYPE(URI,VMAJ,VMIN,NAME,CLASS) \
- qmlRegisterType<CLASS>(#URI, VMAJ, VMIN, #NAME)
-
-#define QML_REGISTER_NOCREATE_TYPE(CLASS) \
- qmlRegisterType<CLASS>()
-
class QDeclarativeContext;
class QDeclarativeEngine;
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 88ca5cd..bc78b5b 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -223,7 +223,7 @@ void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteF
int QDeclarativeBinding::propertyIndex()
{
Q_D(QDeclarativeBinding);
- return d->bindingData()->property.index();
+ return QDeclarativePropertyPrivate::bindingIndex(d->bindingData()->property);
}
bool QDeclarativeBinding::enabled() const
@@ -259,23 +259,57 @@ void QDeclarativeAbstractBinding::addToObject(QObject *object)
{
Q_ASSERT(object);
+ if (m_object == object)
+ return;
+
+ int index = propertyIndex();
+
removeFromObject();
Q_ASSERT(!m_prevBinding);
- QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, true);
- m_nextBinding = data->bindings;
- if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
- m_prevBinding = &data->bindings;
- data->bindings = this;
m_object = object;
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, true);
+
+ if (index & 0xFF000000) {
+ // Value type
- data->setBindingBit(m_object, propertyIndex());
+ int coreIndex = index & 0xFFFFFF;
+
+ // Find the value type proxy (if there is one)
+ QDeclarativeValueTypeProxyBinding *proxy = 0;
+ if (data->hasBindingBit(coreIndex)) {
+ QDeclarativeAbstractBinding *b = data->bindings;
+ while (b && b->propertyIndex() != coreIndex)
+ b = b->m_nextBinding;
+ Q_ASSERT(b && b->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy);
+ proxy = static_cast<QDeclarativeValueTypeProxyBinding *>(b);
+ }
+
+ if (!proxy)
+ proxy = new QDeclarativeValueTypeProxyBinding(object, coreIndex);
+ proxy->addToObject(object);
+
+ m_nextBinding = proxy->m_bindings;
+ if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
+ m_prevBinding = &proxy->m_bindings;
+ proxy->m_bindings = this;
+
+ } else {
+ m_nextBinding = data->bindings;
+ if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
+ m_prevBinding = &data->bindings;
+ data->bindings = this;
+
+ data->setBindingBit(m_object, index);
+ }
}
void QDeclarativeAbstractBinding::removeFromObject()
{
if (m_prevBinding) {
+ int index = propertyIndex();
+
Q_ASSERT(m_object);
*m_prevBinding = m_nextBinding;
@@ -283,8 +317,14 @@ void QDeclarativeAbstractBinding::removeFromObject()
m_prevBinding = 0;
m_nextBinding = 0;
- QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(m_object, false);
- if (data) data->clearBindingBit(propertyIndex());
+ if (index & 0xFF000000) {
+ // Value type - we don't remove the proxy from the object. It will sit their happily
+ // doing nothing for ever more.
+ } else {
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(m_object, false);
+ if (data) data->clearBindingBit(index);
+ }
+
m_object = 0;
}
}
@@ -305,4 +345,88 @@ void QDeclarativeAbstractBinding::setEnabled(bool e, QDeclarativePropertyPrivate
if (e) m_mePtr = 0;
}
+QDeclarativeValueTypeProxyBinding::QDeclarativeValueTypeProxyBinding(QObject *o, int index)
+: m_object(o), m_index(index), m_bindings(0)
+{
+}
+
+QDeclarativeValueTypeProxyBinding::~QDeclarativeValueTypeProxyBinding()
+{
+ while (m_bindings) {
+ QDeclarativeAbstractBinding *binding = m_bindings;
+ binding->setEnabled(false, 0);
+ binding->destroy();
+ }
+}
+
+void QDeclarativeValueTypeProxyBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (e) {
+ addToObject(m_object);
+
+ QDeclarativeAbstractBinding *bindings = m_bindings;
+ m_bindings = 0;
+ recursiveEnable(bindings, flags);
+ } else {
+ removeFromObject();
+
+ QDeclarativeAbstractBinding *bindings = m_bindings;
+ m_bindings = 0;
+ recursiveDisable(bindings);
+ }
+}
+
+void QDeclarativeValueTypeProxyBinding::recursiveEnable(QDeclarativeAbstractBinding *b, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ if (!b)
+ return;
+
+ QDeclarativeAbstractBinding *next = b->m_nextBinding;
+ b->m_prevBinding = 0;
+ b->m_nextBinding = 0;
+ Q_ASSERT(b->m_mePtr == 0);
+ b->m_mePtr = &b;
+
+ recursiveEnable(next, flags);
+
+ if (b)
+ b->setEnabled(true, flags);
+}
+
+void QDeclarativeValueTypeProxyBinding::recursiveDisable(QDeclarativeAbstractBinding *b)
+{
+ if (!b)
+ return;
+
+ recursiveDisable(b->m_nextBinding);
+
+ b->setEnabled(false, 0);
+
+ Q_ASSERT(b->m_prevBinding == 0);
+ Q_ASSERT(b->m_nextBinding == 0);
+ b->m_nextBinding = m_bindings;
+ if (b->m_nextBinding) b->m_nextBinding->m_prevBinding = &b->m_nextBinding;
+ b->m_prevBinding = &m_bindings;
+ m_bindings = b;
+}
+
+int QDeclarativeValueTypeProxyBinding::propertyIndex()
+{
+ return m_index;
+}
+
+void QDeclarativeValueTypeProxyBinding::update(QDeclarativePropertyPrivate::WriteFlags)
+{
+}
+
+QDeclarativeAbstractBinding *QDeclarativeValueTypeProxyBinding::binding(int propertyIndex)
+{
+ QDeclarativeAbstractBinding *binding = m_bindings;
+
+ while (binding && binding->propertyIndex() != propertyIndex)
+ binding = binding->m_nextBinding;
+
+ return binding;
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 1a714f0..21e3248 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -74,6 +74,9 @@ public:
virtual QString expression() const;
+ enum Type { PropertyBinding, ValueTypeProxy };
+ virtual Type bindingType() const { return PropertyBinding; }
+
void setEnabled(bool e) { setEnabled(e, QDeclarativePropertyPrivate::DontRemoveBinding); }
virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags) = 0;
virtual int propertyIndex() = 0;
@@ -92,6 +95,7 @@ private:
friend class QDeclarativeProperty;
friend class QDeclarativePropertyPrivate;
friend class QDeclarativeVME;
+ friend class QDeclarativeValueTypeProxyBinding;
QObject *m_object;
QDeclarativeAbstractBinding **m_mePtr;
@@ -99,6 +103,30 @@ private:
QDeclarativeAbstractBinding *m_nextBinding;
};
+class QDeclarativeValueTypeProxyBinding : public QDeclarativeAbstractBinding
+{
+public:
+ QDeclarativeValueTypeProxyBinding(QObject *o, int coreIndex);
+ virtual ~QDeclarativeValueTypeProxyBinding();
+
+ virtual Type bindingType() const { return ValueTypeProxy; }
+
+ virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags);
+ virtual int propertyIndex();
+ virtual void update(QDeclarativePropertyPrivate::WriteFlags);
+
+ QDeclarativeAbstractBinding *binding(int propertyIndex);
+
+private:
+ void recursiveEnable(QDeclarativeAbstractBinding *, QDeclarativePropertyPrivate::WriteFlags);
+ void recursiveDisable(QDeclarativeAbstractBinding *);
+
+ friend class QDeclarativeAbstractBinding;
+ QObject *m_object;
+ int m_index;
+ QDeclarativeAbstractBinding *m_bindings;
+};
+
class QDeclarativeContext;
class QDeclarativeBindingPrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 17937fd..aa549a9 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -48,12 +48,17 @@
#include <private/qdeclarativejsast_p.h>
#include <private/qdeclarativejsengine_p.h>
#include <private/qdeclarativeexpression_p.h>
+#include <QtCore/qcoreapplication.h>
#include <QtCore/qdebug.h>
#include <QtCore/qnumeric.h>
#include <private/qdeclarativeanchors_p_p.h>
+#include <private/qdeclarativeglobal_p.h>
QT_BEGIN_NAMESPACE
+DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL);
+DEFINE_BOOL_CONFIG_OPTION(qmlDisableOptimizer, QML_DISABLE_OPTIMIZER);
+
using namespace QDeclarativeJS;
namespace {
@@ -124,24 +129,7 @@ public:
QDeclarativeCompiledBindingsPrivate *parent;
};
- struct Subscription {
- struct Signal {
- QDeclarativeGuard<QObject> source;
- int notifyIndex;
- };
-
- enum { InvalidType, SignalType, IdType } type;
- inline Subscription();
- inline ~Subscription();
- bool isSignal() const { return type == SignalType; }
- bool isId() const { return type == IdType; }
- inline Signal *signal();
- inline QDeclarativeContextPrivate::IdNotifier *id();
- union {
- char signalData[sizeof(Signal)];
- char idData[sizeof(QDeclarativeContextPrivate::IdNotifier)];
- };
- };
+ typedef QDeclarativeNotifierEndpoint Subscription;
Subscription *subscriptions;
QScriptDeclarativeClass::PersistentIdentifier *identifiers;
@@ -190,18 +178,6 @@ QDeclarativeCompiledBindingsPrivate::~QDeclarativeCompiledBindingsPrivate()
delete [] identifiers; identifiers = 0;
}
-QDeclarativeCompiledBindingsPrivate::Subscription::Subscription()
-: type(InvalidType)
-{
-}
-
-QDeclarativeCompiledBindingsPrivate::Subscription::~Subscription()
-{
- if (type == SignalType) ((Signal *)signalData)->~Signal();
- else if (type == IdType) ((QDeclarativeContextPrivate::IdNotifier *)idData)->~IdNotifier();
-}
-
-
int QDeclarativeCompiledBindingsPrivate::methodCount = -1;
QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContext *context)
@@ -248,7 +224,6 @@ void QDeclarativeCompiledBindingsPrivate::Binding::setEnabled(bool e, QDeclarati
{
if (e) {
addToObject(target);
- update(flags);
} else {
removeFromObject();
}
@@ -303,8 +278,6 @@ void QDeclarativeCompiledBindingsPrivate::run(Binding *binding)
if (!binding->enabled)
return;
- if (binding->updating)
- qWarning("ERROR: Circular binding");
QDeclarativeContext *context = q->QDeclarativeAbstractExpression::context();
if (!context) {
@@ -313,6 +286,25 @@ void QDeclarativeCompiledBindingsPrivate::run(Binding *binding)
}
QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(context);
+ if (binding->updating) {
+ QString name;
+ if (binding->property & 0xFFFF0000) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(cp->engine);
+
+ QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF];
+ Q_ASSERT(vt);
+
+ name = QLatin1String(binding->target->metaObject()->property(binding->property & 0xFFFF).name());
+ name.append(QLatin1String("."));
+ name.append(QLatin1String(vt->metaObject()->property(binding->property >> 24).name()));
+ } else {
+ name = binding->target->metaObject()->property(binding->property).name();
+ }
+ qmlInfo(binding->target) << QCoreApplication::translate("QDeclarativeCompiledBindings", "Binding loop detected for property \"%1\"").arg(name);
+ return;
+ }
+
+ binding->updating = true;
if (binding->property & 0xFFFF0000) {
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(cp->engine);
@@ -328,22 +320,7 @@ void QDeclarativeCompiledBindingsPrivate::run(Binding *binding)
} else {
run(binding->index, cp, binding, binding->scope, binding->target);
}
-}
-
-QDeclarativeCompiledBindingsPrivate::Subscription::Signal *QDeclarativeCompiledBindingsPrivate::Subscription::signal()
-{
- if (type == IdType) ((QDeclarativeContextPrivate::IdNotifier *)idData)->~IdNotifier();
- if (type != SignalType) new (signalData) Signal;
- type = SignalType;
- return (Signal *)signalData;
-}
-
-QDeclarativeContextPrivate::IdNotifier *QDeclarativeCompiledBindingsPrivate::Subscription::id()
-{
- if (type == SignalType) ((Signal *)signalData)->~Signal();
- if (type != IdType) new (idData) QDeclarativeContextPrivate::IdNotifier;
- type = IdType;
- return (QDeclarativeContextPrivate::IdNotifier *)idData;
+ binding->updating = false;
}
namespace {
@@ -656,20 +633,7 @@ void QDeclarativeCompiledBindingsPrivate::unsubscribe(int subIndex)
Q_Q(QDeclarativeCompiledBindings);
QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
- if (sub->isSignal()) {
- QDeclarativeCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
- if (s->source)
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
- QMetaObject::disconnectOne(s->source, s->notifyIndex,
- q, methodCount + subIndex);
-#else
- // QTBUG-6781
- QMetaObject::disconnect(s->source, s->notifyIndex,
- q, methodCount + subIndex);
-#endif
- } else if (sub->isId()) {
- sub->id()->clear();
- }
+ sub->disconnect();
}
void QDeclarativeCompiledBindingsPrivate::subscribeId(QDeclarativeContextPrivate *p, int idIndex, int subIndex)
@@ -680,15 +644,9 @@ void QDeclarativeCompiledBindingsPrivate::subscribeId(QDeclarativeContextPrivate
if (p->idValues[idIndex]) {
QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
- QDeclarativeContextPrivate::IdNotifier *i = sub->id();
-
- i->next = p->idValues[idIndex].bindings;
- i->prev = &p->idValues[idIndex].bindings;
- p->idValues[idIndex].bindings = i;
- if (i->next) i->next->prev = &i->next;
-
- i->target = q;
- i->methodIndex = methodCount + subIndex;
+ sub->target = q;
+ sub->targetMethod = methodCount + subIndex;
+ sub->connect(&p->idValues[idIndex].bindings);
}
}
@@ -697,27 +655,12 @@ void QDeclarativeCompiledBindingsPrivate::subscribe(QObject *o, int notifyIndex,
Q_Q(QDeclarativeCompiledBindings);
QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
-
- if (sub->isId())
- unsubscribe(subIndex);
-
- QDeclarativeCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
- if (o != s->source || notifyIndex != s->notifyIndex) {
- if (s->source)
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
- QMetaObject::disconnectOne(s->source, s->notifyIndex,
- q, methodCount + subIndex);
-#else
- // QTBUG-6781
- QMetaObject::disconnect(s->source, s->notifyIndex,
- q, methodCount + subIndex);
-#endif
- s->source = o;
- s->notifyIndex = notifyIndex;
- if (s->source && s->notifyIndex != -1)
- QMetaObject::connect(s->source, s->notifyIndex, q,
- methodCount + subIndex, Qt::DirectConnection);
- }
+ sub->target = q;
+ sub->targetMethod = methodCount + subIndex;
+ if (o)
+ sub->connect(o, notifyIndex);
+ else
+ sub->disconnect();
}
// Conversion functions - these MUST match the QtScript expression path
@@ -811,9 +754,9 @@ static QObject *variantToQObject(const QVariant &value, bool *ok)
}
bool QDeclarativeCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
- QDeclarativeEnginePrivate *enginePriv,
- int subIdx, const QScriptDeclarativeClass::Identifier &name,
- bool isTerminal)
+ QDeclarativeEnginePrivate *enginePriv,
+ int subIdx, const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal)
{
if (!obj) {
output->setUndefined();
@@ -884,10 +827,10 @@ bool QDeclarativeCompiledBindingsPrivate::findproperty(QObject *obj, Register *o
}
void QDeclarativeCompiledBindingsPrivate::findgeneric(Register *output,
- int subIdx,
- QDeclarativeContextPrivate *context,
- const QScriptDeclarativeClass::Identifier &name,
- bool isTerminal)
+ int subIdx,
+ QDeclarativeContextPrivate *context,
+ const QScriptDeclarativeClass::Identifier &name,
+ bool isTerminal)
{
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context->engine);
@@ -928,7 +871,7 @@ void QDeclarativeCompiledBindingsPrivate::findgeneric(Register *output,
}
}
- if (QObject *root = context->defaultObjects.isEmpty()?0:context->defaultObjects.first()) {
+ if (QObject *root = context->contextObject) {
if (findproperty(root, output, enginePriv, subIdx, name, isTerminal))
return;
@@ -1169,7 +1112,7 @@ void QDeclarativeCompiledBindingsPrivate::run(int instrIndex,
break;
case Instr::LoadRoot:
- registers[instr->load.reg].setQObject(context->defaultObjects.at(0));
+ registers[instr->load.reg].setQObject(context->contextObject);
break;
case Instr::LoadAttached:
@@ -1612,6 +1555,9 @@ bool QDeclarativeBindingCompilerPrivate::compile(QDeclarativeJS::AST::Node *node
return false;
if (type.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
if (destination->type != QMetaType::QReal &&
destination->type != QVariant::String &&
destination->type != QMetaType::Bool &&
@@ -1895,7 +1841,7 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type
if (!fetch(type, component->metaObject(), reg, d1Idx, subscribeName, nameNodes.at(ii)))
return false;
- } else {
+ } else if (qmlExperimental()) {
Instr find;
if (nameParts.count() == 1)
find.common.type = Instr::FindGenericTerminal;
@@ -2051,7 +1997,11 @@ bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result
int lhsTmp = -1;
int rhsTmp = -1;
+
if (lhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
lhsTmp = acquireReg();
Instr conv;
@@ -2062,6 +2012,9 @@ bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result
}
if (rhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
rhsTmp = acquireReg();
Instr conv;
@@ -2107,6 +2060,9 @@ bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result
int rhsTmp = -1;
if (lhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
lhsTmp = acquireReg(Instr::CleanupString);
Instr convert;
@@ -2117,6 +2073,9 @@ bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result
}
if (rhs.unknownType) {
+ if (!qmlExperimental())
+ return false;
+
rhsTmp = acquireReg(Instr::CleanupString);
Instr convert;
@@ -2637,6 +2596,12 @@ int QDeclarativeBindingCompiler::compile(const Expression &expression, QDeclarat
{
if (!expression.expression.asAST()) return false;
+ if (!qmlExperimental() && expression.property->isValueTypeSubProperty)
+ return -1;
+
+ if (qmlDisableOptimizer())
+ return -1;
+
d->context = expression.context;
d->component = expression.component;
d->destination = expression.property;
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index ef1032b..06ff47c 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP);
DEFINE_BOOL_CONFIG_OPTION(compilerStatDump, QML_COMPILER_STATISTICS_DUMP);
-DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL);
+DEFINE_BOOL_CONFIG_OPTION(bindingsDump, QML_BINDINGS_DUMP);
using namespace QDeclarativeParser;
@@ -1850,6 +1850,7 @@ bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
QMetaProperty p = type->metaObject()->property(idx);
prop->index = idx;
prop->type = p.userType();
+ prop->isValueTypeSubProperty = true;
if (prop->value)
COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Property assignment expected"));
@@ -2712,7 +2713,9 @@ bool QDeclarativeCompiler::completeComponentBuild()
QDeclarativeBindingCompiler bindingCompiler;
- for (QHash<QDeclarativeParser::Value*,BindingReference>::Iterator iter = compileState.bindings.begin(); iter != compileState.bindings.end(); ++iter) {
+ for (QHash<QDeclarativeParser::Value*,BindingReference>::Iterator iter = compileState.bindings.begin();
+ iter != compileState.bindings.end(); ++iter) {
+
BindingReference &binding = *iter;
expr.context = binding.bindingContext.object;
@@ -2720,18 +2723,13 @@ bool QDeclarativeCompiler::completeComponentBuild()
expr.expression = binding.expression;
expr.imports = unit->imports;
- if (qmlExperimental()) {
- int index = bindingCompiler.compile(expr, QDeclarativeEnginePrivate::get(engine));
- if (index != -1) {
- qWarning() << "Accepted for optimization:" << qPrintable(expr.expression.asScript());
- binding.dataType = BindingReference::Experimental;
- binding.compiledIndex = index;
- componentStat.optimizedBindings++;
- continue;
- } else {
- qWarning() << "Rejected for optimization:" << qPrintable(expr.expression.asScript());
- }
- }
+ int index = bindingCompiler.compile(expr, QDeclarativeEnginePrivate::get(engine));
+ if (index != -1) {
+ binding.dataType = BindingReference::Experimental;
+ binding.compiledIndex = index;
+ componentStat.optimizedBindings++;
+ continue;
+ }
binding.dataType = BindingReference::QtScript;
@@ -2768,7 +2766,8 @@ bool QDeclarativeCompiler::completeComponentBuild()
if (bindingCompiler.isValid()) {
compileState.compiledBindingData = bindingCompiler.program();
- QDeclarativeBindingCompiler::dump(compileState.compiledBindingData);
+ if (bindingsDump())
+ QDeclarativeBindingCompiler::dump(compileState.compiledBindingData);
}
saveComponentState();
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index d6bb216..d3608c4 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -512,7 +512,6 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
{
}
-
/*!
\internal
A version of create which returns a scriptObject, for use in script
@@ -526,7 +525,9 @@ QScriptValue QDeclarativeComponent::createObject()
return QScriptValue();
}
QObject* ret = create(ctxt);
- return QDeclarativeEnginePrivate::qmlScriptObject(ret, d->engine);
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine);
+ QDeclarativeDeclarativeData::get(ret, true)->setImplicitDestructible();
+ return priv->objectClass->newQObject(ret, QMetaType::QObjectStar);
}
/*!
@@ -541,7 +542,12 @@ QObject *QDeclarativeComponent::create(QDeclarativeContext *context)
{
Q_D(QDeclarativeComponent);
- return d->create(context, QBitField());
+ if (!context)
+ context = d->engine->rootContext();
+
+ QObject *rv = beginCreate(context);
+ completeCreate();
+ return rv;
}
QObject *QDeclarativeComponentPrivate::create(QDeclarativeContext *context,
@@ -586,7 +592,13 @@ QObject *QDeclarativeComponentPrivate::create(QDeclarativeContext *context,
QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
{
Q_D(QDeclarativeComponent);
- return d->beginCreate(context, QBitField());
+ QObject *rv = d->beginCreate(context, QBitField());
+ if (rv) {
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(rv);
+ Q_ASSERT(ddata);
+ ddata->indestructible = true;
+ }
+ return rv;
}
QObject *
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index b90a598..e2a6e0c 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -154,7 +154,7 @@ QDeclarativeCompositeTypeData::TypeReference::TypeReference()
}
QDeclarativeCompositeTypeManager::QDeclarativeCompositeTypeManager(QDeclarativeEngine *e)
-: engine(e)
+: engine(e), redirectCount(0)
{
}
@@ -172,6 +172,10 @@ QDeclarativeCompositeTypeManager::~QDeclarativeCompositeTypeManager()
QDeclarativeCompositeTypeData *QDeclarativeCompositeTypeManager::get(const QUrl &url)
{
+ Redirects::Iterator redir = redirects.find(url);
+ if (redir != redirects.end())
+ return get(*redir);
+
QDeclarativeCompositeTypeData *unit = components.value(url);
if (!unit) {
@@ -219,6 +223,8 @@ void QDeclarativeCompositeTypeManager::clearCache()
}
}
+#define TYPEMANAGER_MAXIMUM_REDIRECT_RECURSION 16
+
void QDeclarativeCompositeTypeManager::replyFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
@@ -226,6 +232,26 @@ void QDeclarativeCompositeTypeManager::replyFinished()
QDeclarativeCompositeTypeData *unit = components.value(reply->url());
Q_ASSERT(unit);
+ redirectCount++;
+ if (redirectCount < TYPEMANAGER_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ redirects.insert(reply->url(),url);
+ unit->imports.setBaseUrl(url);
+ components.remove(reply->url());
+ components.insert(url, unit);
+ reply->deleteLater();
+ reply = engine->networkAccessManager()->get(QNetworkRequest(url));
+ QObject::connect(reply, SIGNAL(finished()),
+ this, SLOT(replyFinished()));
+ QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
+ this, SLOT(requestProgress(qint64,qint64)));
+ return;
+ }
+ }
+ redirectCount = 0;
+
if (reply->error() != QNetworkReply::NoError) {
QString errorDescription;
// ### - Fill in error
@@ -256,6 +282,24 @@ void QDeclarativeCompositeTypeManager::resourceReplyFinished()
QDeclarativeCompositeTypeResource *resource = resources.value(reply->url());
Q_ASSERT(resource);
+ redirectCount++;
+ if (redirectCount < TYPEMANAGER_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = reply->url().resolved(redirect.toUrl());
+ redirects.insert(reply->url(),url);
+ resource->url = url.toString();
+ resources.remove(reply->url());
+ resources.insert(url, resource);
+ reply->deleteLater();
+ reply = engine->networkAccessManager()->get(QNetworkRequest(url));
+ QObject::connect(reply, SIGNAL(finished()),
+ this, SLOT(resourceReplyFinished()));
+ return;
+ }
+ }
+ redirectCount = 0;
+
if (reply->error() != QNetworkReply::NoError) {
resource->status = QDeclarativeCompositeTypeResource::Error;
@@ -462,17 +506,18 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
int waiting = 0;
foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) {
- QString qmldir;
+ QString qmldircontentnetwork;
if (imp.type == QDeclarativeScriptParser::Import::File && imp.qualifier.isEmpty()) {
QString importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir"))).toString();
for (int ii = 0; ii < unit->resources.count(); ++ii) {
if (unit->resources.at(ii)->url == importUrl) {
- qmldir = QString::fromUtf8(unit->resources.at(ii)->data);
+ qmldircontentnetwork = QString::fromUtf8(unit->resources.at(ii)->data);
break;
}
}
}
+
int vmaj = -1;
int vmin = -1;
if (!imp.version.isEmpty()) {
@@ -487,7 +532,7 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
}
if (!QDeclarativeEnginePrivate::get(engine)->
- addToImport(&unit->imports, qmldir, imp.uri, imp.qualifier, vmaj, vmin, imp.type))
+ addToImport(&unit->imports, qmldircontentnetwork, imp.uri, imp.qualifier, vmaj, vmin, imp.type))
{
QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
@@ -546,6 +591,10 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
continue;
}
+ Redirects::Iterator redir = redirects.find(url);
+ if (redir != redirects.end())
+ url = *redir;
+
QDeclarativeCompositeTypeData *urlUnit = components.value(url);
if (!urlUnit) {
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager_p.h b/src/declarative/qml/qdeclarativecompositetypemanager_p.h
index 03d16b8..a572e0c 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager_p.h
+++ b/src/declarative/qml/qdeclarativecompositetypemanager_p.h
@@ -109,6 +109,9 @@ private:
Components components;
typedef QHash<QUrl, QDeclarativeCompositeTypeResource *> Resources;
Resources resources;
+ typedef QHash<QUrl, QUrl> Redirects;
+ Redirects redirects;
+ int redirectCount;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index f70e143..237cb7e 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -59,12 +59,14 @@ QT_BEGIN_NAMESPACE
QDeclarativeContextPrivate::QDeclarativeContextPrivate()
: parent(0), engine(0), isInternal(false), propertyNames(0),
- notifyIndex(-1), highPriorityCount(0), imports(0), expressions(0), contextObjects(0),
+ notifyIndex(-1), contextObject(0), imports(0), childContexts(0),
+ nextChild(0), prevChild(0), expressions(0), contextObjects(0),
idValues(0), idValueCount(0), optimizedBindings(0)
{
}
-void QDeclarativeContextPrivate::addScript(const QDeclarativeParser::Object::ScriptBlock &script, QObject *scopeObject)
+void QDeclarativeContextPrivate::addScript(const QDeclarativeParser::Object::ScriptBlock &script,
+ QObject *scopeObject)
{
Q_Q(QDeclarativeContext);
@@ -109,12 +111,7 @@ void QDeclarativeContextPrivate::destroyed(ContextGuard *guard)
if (parent && QObjectPrivate::get(parent)->wasDeleted)
return;
- while(guard->bindings) {
- QObject *o = guard->bindings->target;
- int mi = guard->bindings->methodIndex;
- guard->bindings->clear();
- if (o) o->qt_metacall(QMetaObject::InvokeMetaMethod, mi, 0);
- }
+ guard->bindings.notify();
for (int ii = 0; ii < idValueCount; ++ii) {
if (&idValues[ii] == guard) {
@@ -128,8 +125,13 @@ void QDeclarativeContextPrivate::init()
{
Q_Q(QDeclarativeContext);
- if (parent)
- parent->d_func()->childContexts.insert(q);
+ if (parent) {
+ QDeclarativeContextPrivate *ppriv = parent->d_func();
+ nextChild = ppriv->childContexts;
+ if (nextChild) nextChild->d_func()->prevChild = &nextChild;
+ prevChild = &ppriv->childContexts;
+ ppriv->childContexts = q;
+ }
}
/*!
@@ -177,7 +179,7 @@ void QDeclarativeContextPrivate::init()
MyDataSet myDataSet;
QDeclarativeEngine engine;
QDeclarativeContext context(engine.rootContext());
- context.addDefaultObject(&myDataSet);
+ context.setContextObject(&myDataSet);
QDeclarativeComponent component(&engine, "ListView { model=myModel }");
component.create(&context);
@@ -275,15 +277,24 @@ QDeclarativeContext::QDeclarativeContext(QDeclarativeContext *parentContext, QOb
QDeclarativeContext::~QDeclarativeContext()
{
Q_D(QDeclarativeContext);
- if (d->parent)
- d->parent->d_func()->childContexts.remove(this);
-
- for (QSet<QDeclarativeContext *>::ConstIterator iter = d->childContexts.begin();
- iter != d->childContexts.end();
- ++iter) {
- (*iter)->d_func()->invalidateEngines();
- (*iter)->d_func()->parent = 0;
+
+ if (d->prevChild) {
+ *d->prevChild = d->nextChild;
+ if (d->nextChild) d->nextChild->d_func()->prevChild = d->prevChild;
+ d->nextChild = 0;
+ d->prevChild = 0;
}
+
+ QDeclarativeContext *child = d->childContexts;
+ while (child) {
+ QDeclarativeContextPrivate *childpriv = child->d_func();
+ childpriv->invalidateEngines();
+ childpriv->parent = 0;
+ child = childpriv->nextChild;
+ childpriv->nextChild = 0;
+ childpriv->prevChild = 0;
+ }
+ d->childContexts = 0;
QDeclarativeAbstractExpression *expression = d->expressions;
while (expression) {
@@ -322,10 +333,12 @@ void QDeclarativeContextPrivate::invalidateEngines()
if (!engine)
return;
engine = 0;
- for (QSet<QDeclarativeContext *>::ConstIterator iter = childContexts.begin();
- iter != childContexts.end();
- ++iter) {
- (*iter)->d_func()->invalidateEngines();
+
+ QDeclarativeContext *child = childContexts;
+ while (child) {
+ QDeclarativeContextPrivate *childpriv = child->d_func();
+ childpriv->invalidateEngines();
+ child = childpriv->nextChild;
}
}
@@ -336,10 +349,11 @@ time the context tree *structure* (not values) changes.
*/
void QDeclarativeContextPrivate::refreshExpressions()
{
- for (QSet<QDeclarativeContext *>::ConstIterator iter = childContexts.begin();
- iter != childContexts.end();
- ++iter) {
- (*iter)->d_func()->refreshExpressions();
+ QDeclarativeContext *child = childContexts;
+ while (child) {
+ QDeclarativeContextPrivate *childpriv = child->d_func();
+ childpriv->refreshExpressions();
+ child = childpriv->nextChild;
}
QDeclarativeAbstractExpression *expression = expressions;
@@ -370,13 +384,21 @@ QDeclarativeContext *QDeclarativeContext::parentContext() const
}
/*!
- Add \a defaultObject to this context. The object will be added after
- any existing default objects.
+ Return the context object, or 0 if there is no context object.
*/
-void QDeclarativeContext::addDefaultObject(QObject *defaultObject)
+QObject *QDeclarativeContext::contextObject() const
+{
+ Q_D(const QDeclarativeContext);
+ return d->contextObject;
+}
+
+/*!
+ Set the context \a object.
+*/
+void QDeclarativeContext::setContextObject(QObject *object)
{
Q_D(QDeclarativeContext);
- d->defaultObjects.prepend(defaultObject);
+ d->contextObject = object;
}
/*!
@@ -471,15 +493,12 @@ QVariant QDeclarativeContext::contextProperty(const QString &name) const
if (idx == -1) {
QByteArray utf8Name = name.toUtf8();
- for (int ii = d->defaultObjects.count() - 1; ii >= 0; --ii) {
- QObject *obj = d->defaultObjects.at(ii);
+ if (d->contextObject) {
+ QObject *obj = d->contextObject;
QDeclarativePropertyCache::Data local;
QDeclarativePropertyCache::Data *property = QDeclarativePropertyCache::property(d->engine, obj, name, local);
- if (property) {
- value = obj->metaObject()->property(property->coreIndex).read(obj);
- break;
- }
+ if (property) value = obj->metaObject()->property(property->coreIndex).read(obj);
}
if (!value.isValid() && parentContext())
value = parentContext()->contextProperty(name);
diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h
index 0fb9bee..3ad9863 100644
--- a/src/declarative/qml/qdeclarativecontext.h
+++ b/src/declarative/qml/qdeclarativecontext.h
@@ -72,11 +72,12 @@ public:
QDeclarativeEngine *engine() const;
QDeclarativeContext *parentContext() const;
- void addDefaultObject(QObject *);
- void setContextProperty(const QString &, QObject *);
- void setContextProperty(const QString &, const QVariant &);
+ QObject *contextObject() const;
+ void setContextObject(QObject *);
QVariant contextProperty(const QString &) const;
+ void setContextProperty(const QString &, QObject *);
+ void setContextProperty(const QString &, const QVariant &);
QUrl resolvedUrl(const QUrl &);
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 8297280..a1056b1 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -59,6 +59,7 @@
#include "qdeclarativeengine_p.h"
#include "qdeclarativeintegercache_p.h"
#include "qdeclarativetypenamecache_p.h"
+#include "qdeclarativenotifier_p.h"
#include <QtCore/qhash.h>
#include <QtScript/qscriptvalue.h>
@@ -93,8 +94,7 @@ public:
QList<QVariant> propertyValues;
int notifyIndex;
- QObjectList defaultObjects;
- int highPriorityCount;
+ QObject *contextObject;
QList<QScriptValue> scripts;
void addScript(const QDeclarativeParser::Object::ScriptBlock &, QObject *);
@@ -107,25 +107,16 @@ public:
void invalidateEngines();
void refreshExpressions();
- QSet<QDeclarativeContext *> childContexts;
+
+ QDeclarativeContext *childContexts;
+
+ QDeclarativeContext *nextChild;
+ QDeclarativeContext **prevChild;
QDeclarativeAbstractExpression *expressions;
QDeclarativeDeclarativeData *contextObjects;
- struct IdNotifier
- {
- inline IdNotifier();
- inline ~IdNotifier();
-
- inline void clear();
-
- IdNotifier *next;
- IdNotifier**prev;
- QObject *target;
- int methodIndex;
- };
-
struct ContextGuard : public QDeclarativeGuard<QObject>
{
inline ContextGuard();
@@ -133,7 +124,7 @@ public:
inline virtual void objectDestroyed(QObject *);
QDeclarativeContextPrivate *priv;
- IdNotifier *bindings;
+ QDeclarativeNotifier bindings;
};
ContextGuard *idValues;
int idValueCount;
@@ -157,26 +148,8 @@ public:
static QObject *context_at(QDeclarativeListProperty<QObject> *, int);
};
-QDeclarativeContextPrivate::IdNotifier::IdNotifier()
-: next(0), prev(0), target(0), methodIndex(-1)
-{
-}
-
-QDeclarativeContextPrivate::IdNotifier::~IdNotifier()
-{
- clear();
-}
-
-void QDeclarativeContextPrivate::IdNotifier::clear()
-{
- if (next) next->prev = prev;
- if (prev) *prev = next;
- next = 0; prev = 0; target = 0;
- methodIndex = -1;
-}
-
QDeclarativeContextPrivate::ContextGuard::ContextGuard()
-: priv(0), bindings(0)
+: priv(0)
{
}
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
index 5fcf4e2..874eeac 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
@@ -80,7 +80,7 @@ struct ContextData : public QScriptDeclarativeClass::Object {
*/
QDeclarativeContextScriptClass::QDeclarativeContextScriptClass(QDeclarativeEngine *bindEngine)
: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
- lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1), lastDefaultObject(-1)
+ lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1)
{
}
@@ -132,7 +132,6 @@ QDeclarativeContextScriptClass::queryProperty(Object *object, const Identifier &
lastContext = 0;
lastData = 0;
lastPropertyIndex = -1;
- lastDefaultObject = -1;
QDeclarativeContext *bindContext = ((ContextData *)object)->getContext(engine);
QObject *scopeObject = ((ContextData *)object)->getScope(engine);
@@ -210,13 +209,13 @@ QDeclarativeContextScriptClass::queryProperty(QDeclarativeContext *bindContext,
}
}
- for (int ii = cp->defaultObjects.count() - 1; ii >= 0; --ii) {
+ if (cp->contextObject) {
QScriptClass::QueryFlags rv =
- ep->objectClass->queryProperty(cp->defaultObjects.at(ii), name, flags, bindContext,
+ ep->objectClass->queryProperty(cp->contextObject, name, flags, bindContext,
QDeclarativeObjectScriptClass::ImplicitObject | QDeclarativeObjectScriptClass::SkipAttachedProperties);
if (rv) {
- lastDefaultObject = ii;
+ lastScopeObject = cp->contextObject;
lastContext = bindContext;
return rv;
}
@@ -244,9 +243,9 @@ QDeclarativeContextScriptClass::property(Object *object, const Identifier &name)
} else if (lastData) {
if (lastData->type)
- return Value(scriptEngine, ep->typeNameClass->newObject(cp->defaultObjects.at(0), lastData->type));
+ return Value(scriptEngine, ep->typeNameClass->newObject(cp->contextObject, lastData->type));
else
- return Value(scriptEngine, ep->typeNameClass->newObject(cp->defaultObjects.at(0), lastData->typeNamespace));
+ return Value(scriptEngine, ep->typeNameClass->newObject(cp->contextObject, lastData->typeNamespace));
} else if (lastPropertyIndex != -1) {
@@ -267,10 +266,6 @@ QDeclarativeContextScriptClass::property(Object *object, const Identifier &name)
return Value(scriptEngine, rv);
- } else if(lastDefaultObject != -1) {
-
- // Default object property
- return ep->objectClass->property(cp->defaultObjects.at(lastDefaultObject), name);
} else {
@@ -283,7 +278,7 @@ void QDeclarativeContextScriptClass::setProperty(Object *object, const Identifie
const QScriptValue &value)
{
Q_UNUSED(object);
- Q_ASSERT(lastScopeObject || lastDefaultObject != -1);
+ Q_ASSERT(lastScopeObject);
QDeclarativeContext *bindContext = lastContext;
Q_ASSERT(bindContext);
@@ -291,12 +286,7 @@ void QDeclarativeContextScriptClass::setProperty(Object *object, const Identifie
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(bindContext);
- if (lastScopeObject) {
- ep->objectClass->setProperty(lastScopeObject, name, value, bindContext);
- } else {
- ep->objectClass->setProperty(cp->defaultObjects.at(lastDefaultObject), name, value,
- bindContext);
- }
+ ep->objectClass->setProperty(lastScopeObject, name, value, bindContext);
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass_p.h b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
index 4b0dca0..32c117c 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
@@ -90,7 +90,6 @@ private:
QDeclarativeContext *lastContext;
QDeclarativeTypeNameCache::Data *lastData;
int lastPropertyIndex;
- int lastDefaultObject;
QScriptValue lastFunction;
uint m_id;
diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h
index 99587a8..39bd43c 100644
--- a/src/declarative/qml/qdeclarativecustomparser_p.h
+++ b/src/declarative/qml/qdeclarativecustomparser_p.h
@@ -128,9 +128,10 @@ private:
QList<QDeclarativeError> exceptions;
};
+#if 0
#define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \
qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN, #NAME, #TYPE, new CUSTOMTYPE)
-
+#endif
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativedeclarativedata_p.h b/src/declarative/qml/qdeclarativedeclarativedata_p.h
index ae40130..ffce9c9 100644
--- a/src/declarative/qml/qdeclarativedeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedeclarativedata_p.h
@@ -67,12 +67,21 @@ class Q_AUTOTEST_EXPORT QDeclarativeDeclarativeData : public QDeclarativeData
{
public:
QDeclarativeDeclarativeData(QDeclarativeContext *ctxt = 0)
- : context(ctxt), bindings(0), nextContextObject(0), prevContextObject(0),
- bindingBitsSize(0), bindingBits(0), outerContext(0), lineNumber(0),
- columnNumber(0), deferredComponent(0), deferredIdx(0), attachedProperties(0),
- propertyCache(0), guards(0) {}
+ : indestructible(true), explicitIndestructibleSet(false), context(ctxt),
+ bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0),
+ outerContext(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0),
+ attachedProperties(0), propertyCache(0), guards(0) {}
virtual void destroyed(QObject *);
+ virtual void parentChanged(QObject *, QObject *);
+
+ void setImplicitDestructible() {
+ if (!explicitIndestructibleSet) indestructible = false;
+ }
+
+ quint32 indestructible:1;
+ quint32 explicitIndestructibleSet:1;
+ quint32 dummy:29;
QDeclarativeContext *context;
QDeclarativeAbstractBinding *bindings;
diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp
index e730b92..b6d2115 100644
--- a/src/declarative/qml/qdeclarativedirparser.cpp
+++ b/src/declarative/qml/qdeclarativedirparser.cpp
@@ -151,13 +151,16 @@ bool QDeclarativeDirParser::parse()
_plugins.append(entry);
+ } else if (sectionCount == 2) {
+ // No version specified (should only be used for relative qmldir files)
+ const Component entry(sections[0], sections[1], -1, -1);
+ _components.append(entry);
} else if (sectionCount == 3) {
const QString &version = sections[1];
const int dotIndex = version.indexOf(QLatin1Char('.'));
if (dotIndex == -1) {
qWarning() << "expected '.'"; // ### use reportError
-
} else if (version.indexOf(QLatin1Char('.'), dotIndex + 1) != -1) {
qWarning() << "unexpected '.'"; // ### use reportError
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 3b8d603..e84e267 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -146,11 +146,11 @@ static bool qt_QmlQtModule_registered = false;
void QDeclarativeEnginePrivate::defineModule()
{
- QML_REGISTER_TYPE(Qt,4,6,Component,QDeclarativeComponent);
- QML_REGISTER_TYPE(Qt,4,6,QtObject,QObject);
- QML_REGISTER_TYPE(Qt,4,6,WorkerScript,QDeclarativeWorkerScript);
+ qmlRegisterType<QDeclarativeComponent>("Qt",4,6,"Component");
+ qmlRegisterType<QObject>("Qt",4,6,"QtObject");
+ qmlRegisterType<QDeclarativeWorkerScript>("Qt",4,6,"WorkerScript");
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeBinding);
+ qmlRegisterType<QDeclarativeBinding>();
}
QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
@@ -242,7 +242,6 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr
qtObject.setProperty(QLatin1String("formatDateTime"),newFunction(QDeclarativeEnginePrivate::formatDateTime, 2));
//misc methods
- qtObject.setProperty(QLatin1String("closestAngle"), newFunction(QDeclarativeEnginePrivate::closestAngle, 2));
qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1));
qtObject.setProperty(QLatin1String("md5"),newFunction(QDeclarativeEnginePrivate::md5, 1));
qtObject.setProperty(QLatin1String("btoa"),newFunction(QDeclarativeEnginePrivate::btoa, 1));
@@ -541,9 +540,9 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
This example creates a provider with id \e colors:
- \snippet examples/declarative/imageprovider/main.cpp 0
+ \snippet examples/declarative/imageprovider/imageprovider.cpp 0
- \snippet examples/declarative/imageprovider/view.qml 0
+ \snippet examples/declarative/imageprovider/imageprovider.qml 0
\sa removeImageProvider()
*/
@@ -667,6 +666,61 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex
context->d_func()->contextObjects = data;
}
+/*!
+\enum QDeclarativeEngine::ObjectOwnership
+
+Ownership controls whether or not QML automatically destroys the QObject when the object
+is garbage collected by the JavaScript engine. The two ownership options are:
+
+\list
+\o CppOwnership - The object is owned by C++ code, and will never be deleted by QML. The
+JavaScript destroy() method cannot be used on objects with CppOwnership. This option
+is similar to QScriptEngine::QtOwnership.
+
+\o JavaScriptOwnership - The object is owned by JavaScript. When the object is returned to QML
+as the return value of a method call or property access, QML will delete the object if there
+are no remaining JavaScript references to it and it has no QObject::parent(). This option
+is similar to QScriptEngine::ScriptOwnership.
+\endlist
+
+Generally an application doesn't need to set an object's ownership explicitly. QML uses
+a heuristic to set the default object ownership. By default, an object that is created by
+QML has JavaScriptOwnership. The exception to this are the root objects created by calling
+QDeclarativeCompnent::create() or QDeclarativeComponent::beginCreate() which have
+CppOwnership by default. The ownership of these root-level objects is considered to have
+been transfered to the C++ caller.
+
+Objects not-created by QML have CppOwnership by default. The exception to this is objects
+returned from a C++ method call. The ownership of these objects is passed to JavaScript.
+
+Calling setObjectOwnership() overrides the default ownership heuristic used by QML.
+*/
+
+/*!
+Sets the \a ownership of \a object.
+*/
+void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership ownership)
+{
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, true);
+ if (!ddata)
+ return;
+
+ ddata->indestructible = (ownership == CppOwnership)?true:false;
+ ddata->explicitIndestructibleSet = true;
+}
+
+/*!
+Returns the ownership of \a object.
+*/
+QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object)
+{
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, false);
+ if (!ddata)
+ return CppOwnership;
+ else
+ return ddata->indestructible?CppOwnership:JavaScriptOwnership;
+}
+
void qmlExecuteDeferred(QObject *object)
{
QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object);
@@ -777,6 +831,11 @@ void QDeclarativeDeclarativeData::destroyed(QObject *object)
delete this;
}
+void QDeclarativeDeclarativeData::parentChanged(QObject *, QObject *parent)
+{
+ if (!parent && scriptValue.isValid()) scriptValue = QScriptValue();
+}
+
bool QDeclarativeDeclarativeData::hasBindingBit(int bit) const
{
if (bindingBitsSize > bit)
@@ -857,6 +916,7 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt,
QUrl url = QUrl(context->resolvedUrl(QUrl(arg)));
QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine);
c->setCreationContext(context);
+ QDeclarativeDeclarativeData::get(c, true)->setImplicitDestructible();
return activeEnginePriv->objectClass->newQObject(c, qMetaTypeId<QDeclarativeComponent*>());
}
}
@@ -927,7 +987,8 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
if(gobj && gparent)
gobj->setParentItem(gparent);
- return qmlScriptObject(obj, activeEngine);
+ QDeclarativeDeclarativeData::get(obj, true)->setImplicitDestructible();
+ return activeEnginePriv->objectClass->newQObject(obj, QMetaType::QObjectStar);
}
QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1176,25 +1237,6 @@ QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptE
return QScriptValue();
}
-QScriptValue QDeclarativeEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine *e)
-{
- if(ctxt->argumentCount() < 2)
- return e->newVariant(QVariant(0.0));
- qreal a = ctxt->argument(0).toNumber();
- qreal b = ctxt->argument(1).toNumber();
- qreal ret = b;
- qreal diff = b-a;
- while(diff > 180.0){
- ret -= 360.0;
- diff -= 360.0;
- }
- while(diff < -180.0){
- ret += 360.0;
- diff += 360.0;
- }
- return e->newVariant(QVariant(ret));
-}
-
QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
@@ -1300,10 +1342,13 @@ QVariant QDeclarativeScriptClass::toVariant(QDeclarativeEngine *engine, const QS
// XXX this beyonds in QUrl::toLocalFile()
static QString toLocalFileOrQrc(const QUrl& url)
{
- QString r = url.toLocalFile();
- if (r.isEmpty() && url.scheme() == QLatin1String("qrc"))
- r = QLatin1Char(':') + url.path();
- return r;
+ if (url.scheme() == QLatin1String("qrc")) {
+ if (url.authority().isEmpty())
+ return QLatin1Char(':') + url.path();
+ qWarning() << "Invalid url:" << url.toString() << "authority" << url.authority() << "not known.";
+ return QString();
+ }
+ return url.toLocalFile();
}
/////////////////////////////////////////////////////////////
@@ -1315,7 +1360,7 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
QList<bool> isLibrary;
QList<QString> qmlDirContent;
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return) const
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return)
{
for (int i=0; i<urls.count(); ++i) {
int vmaj = majversions.at(i);
@@ -1325,14 +1370,10 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
qt += '/';
qt += type;
- if (qmlImportTrace())
- qDebug() << "Look in" << qt;
QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
if (t) {
if (vmajor) *vmajor = vmaj;
if (vminor) *vminor = vmin;
- if (qmlImportTrace())
- qDebug() << "Found" << qt;
if (type_return)
*type_return = t;
return true;
@@ -1340,14 +1381,8 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
QString qmldircontent = qmlDirContent.at(i);
- if (vmaj>=0 || !qmldircontent.isEmpty()) {
- // Check version file - XXX cache these in QDeclarativeEngine!
- if (qmldircontent.isEmpty()) {
- QFile qmldir(toLocalFileOrQrc(QUrl(urls.at(i)+QLatin1String("/qmldir"))));
- if (qmldir.open(QIODevice::ReadOnly)) {
- qmldircontent = QString::fromUtf8(qmldir.readAll());
- }
- }
+
+ if (!qmldircontent.isEmpty()) {
const QString typeName = QString::fromUtf8(type);
@@ -1361,7 +1396,6 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
if (c.typeName == typeName) {
if (url_return)
*url_return = url.resolved(QUrl(c.fileName));
-
return true;
}
}
@@ -1395,8 +1429,9 @@ public:
QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
- bool add(const QUrl& base, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, const QStringList& importPath, QDeclarativeEngine *engine)
+ bool add(const QUrl& base, const QString &qmldircontentnetwork, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, const QStringList& importPath, QDeclarativeEngine *engine)
{
+ QString qmldircontent = qmldircontentnetwork;
QDeclarativeEnginePrivate::ImportedNamespace *s;
if (prefix.isEmpty()) {
s = &unqualifiedset;
@@ -1409,15 +1444,21 @@ public:
if (importType == QDeclarativeScriptParser::Import::Library) {
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
- QString content;
QString dir;
// user import paths
QStringList paths;
// base..
- paths += QFileInfo(base.toLocalFile()).path();
+ QString localFileOrQrc = toLocalFileOrQrc(base);
+ QString localFileOrQrcPath = QFileInfo(localFileOrQrc).path();
+ paths += localFileOrQrcPath;
paths += importPath;
+
+ QString applicationDirPath = QCoreApplication::applicationDirPath();
+ if (!applicationDirPath.isEmpty())
+ paths += applicationDirPath;
+
paths += QDeclarativeEnginePrivate::get(engine)->environmentImportPath;
#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
QString builtinPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
@@ -1429,6 +1470,7 @@ public:
foreach (const QString &p, paths) {
dir = p+QLatin1Char('/')+url;
+
QFileInfo fi(dir+QLatin1String("/qmldir"));
const QString absoluteFilePath = fi.absoluteFilePath();
@@ -1438,22 +1480,31 @@ public:
url = QUrl::fromLocalFile(fi.absolutePath()).toString();
QFile file(absoluteFilePath);
- if (file.open(QFile::ReadOnly))
- content = QString::fromUtf8(file.readAll());
+ if (file.open(QFile::ReadOnly)) {
+ qmldircontent = QString::fromUtf8(file.readAll());
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeEngine::add: loaded" << absoluteFilePath;
+ }
if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
QDeclarativeDirParser qmldirParser;
- qmldirParser.setSource(content);
+ qmldirParser.setSource(qmldircontent);
qmldirParser.parse();
foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser.plugins()) {
- QString resolvedFilePath = QDeclarativeEnginePrivate::get(engine)->resolvePlugin(QDir(dir + QDir::separator() + plugin.path),
- plugin.name);
-
- if (!resolvedFilePath.isEmpty())
+ QDir pluginDir(dir + QDir::separator() + plugin.path);
+ if (p.startsWith(QLatin1Char(':')))
+ pluginDir = QDir(QCoreApplication::applicationDirPath());
+ QString resolvedFilePath =
+ QDeclarativeEnginePrivate::get(engine)
+ ->resolvePlugin(pluginDir,
+ plugin.name);
+
+ if (!resolvedFilePath.isEmpty()) {
engine->importExtension(resolvedFilePath, uri);
+ }
}
}
@@ -1641,9 +1692,10 @@ QUrl QDeclarativeEnginePrivate::Imports::baseUrl() const
type version mapping and possibly declarative extensions plugins.
The engine searches in the base directory of the qml file, then
- the paths added via addImportPath(), then the paths specified in the
- \c QML_IMPORT_PATH environment variable, then the builtin \c ImportsPath from
- QLibraryInfo.
+ the paths added via addImportPath(), then in the directory containing the
+ application executable (QCoreApplication::applicationDirPath()),
+ then the paths specified in the \c QML_IMPORT_PATH environment variable, then the
+ builtin \c ImportsPath from QLibraryInfo.
*/
void QDeclarativeEngine::addImportPath(const QString& path)
@@ -1655,13 +1707,13 @@ void QDeclarativeEngine::addImportPath(const QString& path)
}
/*!
- Imports the given \a extension into this QDeclarativeEngine. Returns
- true if the extension was successfully imported.
-
- \sa QDeclarativeExtensionInterface
+ Imports the extension named \a fileName from the \a uri provided.
+ Returns true if the extension was successfully imported.
*/
bool QDeclarativeEngine::importExtension(const QString &fileName, const QString &uri)
{
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeEngine::importExtension" << uri << "from" << fileName;
QFileInfo fileInfo(fileName);
const QString absoluteFilePath = fileInfo.absoluteFilePath();
QPluginLoader loader(absoluteFilePath);
@@ -1785,6 +1837,9 @@ QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString
return resolvePlugin(dir, baseName,
QStringList()
+# ifdef QT_DEBUG
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build first
+# endif
<< QLatin1String(".dylib")
<< QLatin1String(".so")
<< QLatin1String(".bundle"),
@@ -1831,12 +1886,12 @@ QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString
The base URL must already have been set with Import::setBaseUrl().
*/
-bool QDeclarativeEnginePrivate::addToImport(Imports* imports, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const
+bool QDeclarativeEnginePrivate::addToImport(Imports* imports, const QString &qmldircontentnetwork, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const
{
QDeclarativeEngine *engine = QDeclarativeEnginePrivate::get(const_cast<QDeclarativeEnginePrivate *>(this));
- bool ok = imports->d->add(imports->d->base,qmldircontent,uri,prefix,vmaj,vmin,importType,fileImportPath, engine);
if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::addToImport(" << imports << uri << prefix << vmaj << '.' << vmin << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File") << ": " << ok;
+ qDebug() << "QDeclarativeEngine::addToImport(" << imports << uri << prefix << vmaj << '.' << vmin << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File");
+ bool ok = imports->d->add(imports->d->base,qmldircontentnetwork, uri,prefix,vmaj,vmin,importType,fileImportPath, engine);
return ok;
}
@@ -1856,8 +1911,6 @@ bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteA
{
ImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
if (ns) {
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::resolveType" << type << "is namespace for" << ns->urls;
if (ns_return)
*ns_return = ns;
return true;
@@ -1865,15 +1918,15 @@ bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteA
if (type_return || url_return) {
if (imports.d->find(type,vmaj,vmin,type_return,url_return)) {
if (qmlImportTrace()) {
+ if (type_return && *type_return && url_return && !url_return->isEmpty())
+ qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName() << *url_return;
if (type_return && *type_return)
qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName();
- if (url_return)
+ if (url_return && !url_return->isEmpty())
qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << *url_return;
}
return true;
}
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::resolveType" << type << "not found";
}
return false;
}
diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h
index fd66358..19e81b6 100644
--- a/src/declarative/qml/qdeclarativeengine.h
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -98,6 +98,10 @@ public:
static QDeclarativeContext *contextForObject(const QObject *);
static void setContextForObject(QObject *, QDeclarativeContext *);
+ enum ObjectOwnership { CppOwnership, JavaScriptOwnership };
+ static void setObjectOwnership(QObject *, ObjectOwnership);
+ static ObjectOwnership objectOwnership(QObject *);
+
Q_SIGNALS:
void quit ();
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 459a325..c73a758 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -276,7 +276,7 @@ public:
QString resolvePlugin(const QDir &dir, const QString &baseName);
- bool addToImport(Imports*, const QString& qmlDirContent,const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const;
+ bool addToImport(Imports*, const QString& uri, const QString &qmldircontentnetwork, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const;
bool resolveType(const Imports&, const QByteArray& type,
QDeclarativeType** type_return, QUrl* url_return,
int *version_major, int *version_minor,
@@ -318,7 +318,6 @@ public:
static QScriptValue darker(QScriptContext*, QScriptEngine*);
static QScriptValue tint(QScriptContext*, QScriptEngine*);
- static QScriptValue closestAngle(QScriptContext*, QScriptEngine*);
static QScriptValue desktopOpenUrl(QScriptContext*, QScriptEngine*);
static QScriptValue md5(QScriptContext*, QScriptEngine*);
static QScriptValue btoa(QScriptContext*, QScriptEngine*);
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 3e4acbe..933683c 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -230,22 +230,22 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message,
int count = 0;
- for (QSet<QDeclarativeContext *>::ConstIterator iter = p->childContexts.begin();
- iter != p->childContexts.end(); ++iter) {
- QDeclarativeContextPrivate *p = (QDeclarativeContextPrivate *)QObjectPrivate::get(*iter);
- if (p->isInternal)
- continue;
- ++count;
+ QDeclarativeContext *child = p->childContexts;
+ while (child) {
+ QDeclarativeContextPrivate *p = QDeclarativeContextPrivate::get(child);
+ if (!p->isInternal)
+ ++count;
+ child = p->nextChild;
}
message << count;
- for (QSet<QDeclarativeContext *>::ConstIterator iter = p->childContexts.begin();
- iter != p->childContexts.end(); ++iter) {
- QDeclarativeContextPrivate *p = (QDeclarativeContextPrivate *)QObjectPrivate::get(*iter);
- if (p->isInternal)
- continue;
- buildObjectList(message, *iter);
+ child = p->childContexts;
+ while (child) {
+ QDeclarativeContextPrivate *p = QDeclarativeContextPrivate::get(child);
+ if (!p->isInternal)
+ buildObjectList(message, child);
+ child = p->nextChild;
}
// Clean deleted objects
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index e528e9e..5ff22f7 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -512,19 +512,20 @@ bool QDeclarativeExpression::notifyOnValueChanged() const
}
/*!
-Sets whether the valueChanged() signal is emitted when the expression's evaluated
-value changes.
-
-If true, the QDeclarativeExpression will monitor properties involved in the expression's
-evaluation, and emit QDeclarativeExpression::valueChanged() if they have changed. This allows
-an application to ensure that any value associated with the result of the expression
-remains up to date.
-
-If false, the QDeclarativeExpression will not montitor properties involved in the expression's
-evaluation, and QDeclarativeExpression::valueChanged() will never be emitted. This is more efficient
-if an application wants a "one off" evaluation of the expression.
-
-By default, notifyOnChange is false.
+ Sets whether the valueChanged() signal is emitted when the
+ expression's evaluated value changes.
+
+ If \a notifyOnChange is true, the QDeclarativeExpression will
+ monitor properties involved in the expression's evaluation, and emit
+ QDeclarativeExpression::valueChanged() if they have changed. This
+ allows an application to ensure that any value associated with the
+ result of the expression remains up to date.
+
+ If \a notifyOnChange is false (default), the QDeclarativeExpression
+ will not montitor properties involved in the expression's
+ evaluation, and QDeclarativeExpression::valueChanged() will never be
+ emitted. This is more efficient if an application wants a "one off"
+ evaluation of the expression.
*/
void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange)
{
@@ -621,137 +622,74 @@ void QDeclarativeExpression::__q_notify()
void QDeclarativeExpressionPrivate::clearGuards()
{
- Q_Q(QDeclarativeExpression);
-
- static int notifyIdx = -1;
- if (notifyIdx == -1)
- notifyIdx =
- QDeclarativeExpression::staticMetaObject.indexOfMethod("__q_notify()");
-
- for (int ii = 0; ii < data->guardListLength; ++ii) {
- if (data->guardList[ii].data()) {
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
- QMetaObject::disconnectOne(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#else
- // QTBUG-6781
- QMetaObject::disconnect(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#endif
- }
- }
-
- delete [] data->guardList; data->guardList = 0;
+ delete [] data->guardList;
+ data->guardList = 0;
data->guardListLength = 0;
}
void QDeclarativeExpressionPrivate::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties)
{
- //clearGuards();
Q_Q(QDeclarativeExpression);
static int notifyIdx = -1;
if (notifyIdx == -1)
- notifyIdx =
- QDeclarativeExpression::staticMetaObject.indexOfMethod("__q_notify()");
+ notifyIdx = QDeclarativeExpression::staticMetaObject.indexOfMethod("__q_notify()");
- QDeclarativeExpressionData::SignalGuard *newGuardList = 0;
-
- if (properties.count() != data->guardListLength)
- newGuardList = new QDeclarativeExpressionData::SignalGuard[properties.count()];
+ if (properties.count() != data->guardListLength) {
+ QDeclarativeNotifierEndpoint *newGuardList =
+ new QDeclarativeNotifierEndpoint[properties.count()];
+
+ for (int ii = 0; ii < qMin(data->guardListLength, properties.count()); ++ii)
+ data->guardList[ii].copyAndClear(newGuardList[ii]);
+
+ delete [] data->guardList;
+ data->guardList = newGuardList;
+ data->guardListLength = properties.count();
+ }
bool outputWarningHeader = false;
- int hit = 0;
+ bool noChanges = true;
for (int ii = 0; ii < properties.count(); ++ii) {
+ QDeclarativeNotifierEndpoint &guard = data->guardList[ii];
const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
- bool needGuard = true;
- if (ii >= data->guardListLength) {
- // New guard
- } else if(data->guardList[ii].data() == property.object &&
- data->guardList[ii].notifyIndex == property.notifyIndex) {
- // Cache hit
- if (!data->guardList[ii].isDuplicate ||
- (data->guardList[ii].isDuplicate && hit == ii)) {
- needGuard = false;
- ++hit;
- }
- } else if(data->guardList[ii].data() && !data->guardList[ii].isDuplicate) {
- // Cache miss
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
- QMetaObject::disconnectOne(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#else
- // QTBUG-6781
- QMetaObject::disconnect(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#endif
- }
- /* else {
- // Cache miss, but nothing to do
- } */
-
- if (needGuard) {
- if (!newGuardList) {
- newGuardList = new QDeclarativeExpressionData::SignalGuard[properties.count()];
- for (int jj = 0; jj < ii; ++jj)
- newGuardList[jj] = data->guardList[jj];
- }
+ guard.target = q;
+ guard.targetMethod = notifyIdx;
+
+ if (property.notifyIndex != -1) {
+
+ if (!noChanges && guard.isConnected(property.object, property.notifyIndex)) {
+ // Nothing to do
+
+ } else {
+ noChanges = false;
- if (property.notifyIndex != -1) {
bool existing = false;
for (int jj = 0; !existing && jj < ii; ++jj)
- existing = newGuardList[jj].data() == property.object &&
- newGuardList[jj].notifyIndex == property.notifyIndex;
-
- newGuardList[ii] = property.object;
- newGuardList[ii].notifyIndex = property.notifyIndex;
- if (existing)
- newGuardList[ii].isDuplicate = true;
- else
- QMetaObject::connect(property.object, property.notifyIndex,
- q, notifyIdx);
- } else {
- if (!outputWarningHeader) {
- outputWarningHeader = true;
- qWarning() << "QDeclarativeExpression: Expression" << q->expression()
- << "depends on non-NOTIFYable properties:";
+ if (data->guardList[jj].isConnected(property.object, property.notifyIndex))
+ existing = true;
+
+ if (existing) {
+ // duplicate
+ guard.disconnect();
+ } else {
+ guard.connect(property.object, property.notifyIndex);
}
+ }
- const QMetaObject *metaObj = property.object->metaObject();
- QMetaProperty metaProp = metaObj->property(property.coreIndex);
-
- qWarning().nospace() << " " << metaObj->className()
- << "::" << metaProp.name();
+ } else {
+ if (!outputWarningHeader) {
+ outputWarningHeader = true;
+ qWarning() << "QDeclarativeExpression: Expression" << q->expression()
+ << "depends on non-NOTIFYable properties:";
}
- } else if (newGuardList) {
- newGuardList[ii] = data->guardList[ii];
- }
- }
- for (int ii = properties.count(); ii < data->guardListLength; ++ii) {
- if (data->guardList[ii].data() && !data->guardList[ii].isDuplicate) {
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
- QMetaObject::disconnectOne(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#else
- // QTBUG-6781
- QMetaObject::disconnect(data->guardList[ii].data(),
- data->guardList[ii].notifyIndex,
- q, notifyIdx);
-#endif
- }
- }
+ const QMetaObject *metaObj = property.object->metaObject();
+ QMetaProperty metaProp = metaObj->property(property.coreIndex);
- if (newGuardList) {
- if (data->guardList) delete [] data->guardList;
- data->guardList = newGuardList;
- data->guardListLength = properties.count();
+ qWarning().nospace() << " " << metaObj->className()
+ << "::" << metaProp.name();
+ }
}
}
diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h
index cd1729d..d170559 100644
--- a/src/declarative/qml/qdeclarativeexpression_p.h
+++ b/src/declarative/qml/qdeclarativeexpression_p.h
@@ -129,24 +129,7 @@ public:
QString url; // This is a QString for a reason. QUrls are slooooooow...
int line;
- struct SignalGuard : public QDeclarativeGuard<QObject> {
- SignalGuard() : isDuplicate(false), notifyIndex(-1) {}
-
- SignalGuard &operator=(QObject *obj) {
- QDeclarativeGuard<QObject>::operator=(obj);
- return *this;
- }
- SignalGuard &operator=(const SignalGuard &o) {
- QDeclarativeGuard<QObject>::operator=(o);
- isDuplicate = o.isDuplicate;
- notifyIndex = o.notifyIndex;
- return *this;
- }
-
- bool isDuplicate:1;
- int notifyIndex:31;
- };
- SignalGuard *guardList;
+ QDeclarativeNotifierEndpoint *guardList;
int guardListLength;
};
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index 3d44d63..7617977 100644
--- a/src/declarative/qml/qdeclarativeextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -87,7 +87,7 @@ QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin()
/*!
\fn void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
- Initializes the extension specified in the given \a engine.
+ Initializes the extension from the \a uri using the \a engine.
*/
void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index daa2e87..9ef8545 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -52,6 +52,10 @@ QT_BEGIN_NAMESPACE
\sa QDeclarativeEngine::addImageProvider()
*/
+
+/*!
+ The destructor is virtual.
+ */
QDeclarativeImageProvider::~QDeclarativeImageProvider()
{
}
diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp
index cf485fe..a23ff75 100644
--- a/src/declarative/qml/qdeclarativeinstruction.cpp
+++ b/src/declarative/qml/qdeclarativeinstruction.cpp
@@ -90,7 +90,7 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
break;
case QDeclarativeInstruction::StoreUrl:
- qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << primitives.at(instr->storeUrl.value);
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value);
break;
case QDeclarativeInstruction::StoreColor:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 50ab56b..55c7413 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -124,7 +124,10 @@ public:
int m_version_maj;
int m_version_min;
int m_typeId; int m_listId;
- QObject *(*m_newFunc)();
+
+ int m_allocationSize;
+ void (*m_newFunc)(void *);
+
const QMetaObject *m_baseMetaObject;
QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc;
const QMetaObject *m_attachedPropertiesType;
@@ -141,7 +144,7 @@ public:
QDeclarativeTypePrivate::QDeclarativeTypePrivate()
: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0),
- m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0),
+ m_allocationSize(0), m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0),
m_parserStatusCast(-1), m_propertyValueSourceCast(-1), m_propertyValueInterceptorCast(-1),
m_extFunc(0), m_extMetaObject(0), m_index(-1), m_customParser(0), m_isSetup(false)
{
@@ -174,6 +177,7 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe
d->m_version_min = type.versionMinor;
d->m_typeId = type.typeId;
d->m_listId = type.listId;
+ d->m_allocationSize = type.objectSize;
d->m_newFunc = type.create;
d->m_baseMetaObject = type.metaObject;
d->m_attachedPropertiesFunc = type.attachedPropertiesFunction;
@@ -274,7 +278,9 @@ QObject *QDeclarativeType::create() const
{
d->init();
- QObject *rv = d->m_newFunc();
+ QObject *rv = (QObject *)operator new(d->m_allocationSize);
+ d->m_newFunc(rv);
+
if (rv && !d->m_metaObjects.isEmpty())
(void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects);
diff --git a/src/declarative/qml/qdeclarativenotifier.cpp b/src/declarative/qml/qdeclarativenotifier.cpp
new file mode 100644
index 0000000..8e5904c
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenotifier.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativenotifier_p.h"
+
+QT_BEGIN_NAMESPACE
+
+void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint)
+{
+ QDeclarativeNotifierEndpoint::Notifier *n = endpoint->asNotifier();
+
+ QDeclarativeNotifierEndpoint::Notifier **oldDisconnected = n->disconnected;
+ n->disconnected = &n;
+
+ if (n->next)
+ emitNotify(n->next);
+
+ if (n) {
+ void *args[] = { 0 };
+
+ QMetaObject::metacall(endpoint->target, QMetaObject::InvokeMetaMethod,
+ endpoint->targetMethod, args);
+
+ if (n)
+ n->disconnected = oldDisconnected;
+ }
+
+ if (oldDisconnected) *oldDisconnected = n;
+}
+
+void QDeclarativeNotifierEndpoint::copyAndClear(QDeclarativeNotifierEndpoint &other)
+{
+ other.disconnect();
+
+ other.target = target;
+ other.targetMethod = targetMethod;
+
+ if (!isConnected())
+ return;
+
+ if (SignalType == type) {
+ Signal *other_s = other.toSignal();
+ Signal *s = asSignal();
+
+ other_s->source = s->source;
+ other_s->sourceSignal = s->sourceSignal;
+ s->source = 0;
+ } else if(NotifierType == type) {
+ Notifier *other_n = other.toNotifier();
+ Notifier *n = asNotifier();
+
+ other_n->notifier = n->notifier;
+ other_n->disconnected = n->disconnected;
+ if (other_n->disconnected) *other_n->disconnected = other_n;
+
+ if (n->next) {
+ other_n->next = n->next;
+ n->next->asNotifier()->prev = &other_n->next;
+ }
+ other_n->prev = n->prev;
+ *other_n->prev = &other;
+
+ n->prev = 0;
+ n->next = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ }
+}
+
+
+QT_END_NAMESPACE
+
diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h
new file mode 100644
index 0000000..a0e6b43
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenotifier_p.h
@@ -0,0 +1,272 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVENOTIFIER_P_H
+#define QDECLARATIVENOTIFIER_P_H
+
+#include "qdeclarativeguard_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeNotifierEndpoint;
+class QDeclarativeNotifier
+{
+public:
+ inline QDeclarativeNotifier();
+ inline ~QDeclarativeNotifier();
+ inline void notify();
+
+private:
+ friend class QDeclarativeNotifierEndpoint;
+
+ static void emitNotify(QDeclarativeNotifierEndpoint *);
+ QDeclarativeNotifierEndpoint *endpoints;
+};
+
+class QDeclarativeNotifierEndpoint
+{
+public:
+ inline QDeclarativeNotifierEndpoint();
+ inline QDeclarativeNotifierEndpoint(QObject *t, int m);
+ inline ~QDeclarativeNotifierEndpoint();
+
+ QObject *target;
+ int targetMethod;
+
+ inline bool isConnected();
+ inline bool isConnected(QObject *source, int sourceSignal);
+ inline bool isConnected(QDeclarativeNotifier *);
+
+ inline void connect(QObject *source, int sourceSignal);
+ inline void connect(QDeclarativeNotifier *);
+ inline void disconnect();
+
+ void copyAndClear(QDeclarativeNotifierEndpoint &other);
+
+private:
+ friend class QDeclarativeNotifier;
+
+ struct Signal {
+ QDeclarativeGuard<QObject> source;
+ int sourceSignal;
+ };
+
+ struct Notifier {
+ QDeclarativeNotifier *notifier;
+ Notifier **disconnected;
+
+ QDeclarativeNotifierEndpoint *next;
+ QDeclarativeNotifierEndpoint **prev;
+ };
+
+ enum { InvalidType, SignalType, NotifierType } type;
+ union {
+ char signalData[sizeof(Signal)];
+ char notifierData[sizeof(Notifier)];
+ };
+
+ inline Notifier *toNotifier();
+ inline Notifier *asNotifier();
+ inline Signal *toSignal();
+ inline Signal *asSignal();
+};
+
+QDeclarativeNotifier::QDeclarativeNotifier()
+: endpoints(0)
+{
+ QDeclarativeNotifierEndpoint *endpoint = endpoints;
+ while (endpoint) {
+ QDeclarativeNotifierEndpoint *next = endpoint->asNotifier()->next;
+ endpoint->asNotifier()->next = 0;
+ endpoint->asNotifier()->prev = 0;
+ endpoint->asNotifier()->notifier = 0;
+ endpoint = next;
+ }
+}
+
+QDeclarativeNotifier::~QDeclarativeNotifier()
+{
+}
+
+void QDeclarativeNotifier::notify()
+{
+ if (endpoints) emitNotify(endpoints);
+}
+
+QDeclarativeNotifierEndpoint::QDeclarativeNotifierEndpoint()
+: target(0), targetMethod(0), type(InvalidType)
+{
+}
+
+QDeclarativeNotifierEndpoint::QDeclarativeNotifierEndpoint(QObject *t, int m)
+: target(t), targetMethod(m), type(InvalidType)
+{
+}
+
+QDeclarativeNotifierEndpoint::~QDeclarativeNotifierEndpoint()
+{
+ disconnect();
+ if (SignalType == type) {
+ Signal *s = asSignal();
+ s->~Signal();
+ }
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected()
+{
+ if (SignalType == type) {
+ return asSignal()->source;
+ } else if (NotifierType == type) {
+ return asNotifier()->notifier;
+ } else {
+ return false;
+ }
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected(QObject *source, int sourceSignal)
+{
+ return SignalType == type && asSignal()->source == source && asSignal()->sourceSignal == sourceSignal;
+}
+
+bool QDeclarativeNotifierEndpoint::isConnected(QDeclarativeNotifier *notifier)
+{
+ return NotifierType == type && asNotifier()->notifier == notifier;
+}
+
+void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal)
+{
+ Signal *s = toSignal();
+
+ if (s->source == source && s->sourceSignal == sourceSignal)
+ return;
+
+ disconnect();
+
+ QMetaObject::connect(source, sourceSignal, target, targetMethod);
+
+ s->source = source;
+ s->sourceSignal = sourceSignal;
+}
+
+void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier)
+{
+ Notifier *n = toNotifier();
+
+ if (n->notifier == notifier)
+ return;
+
+ disconnect();
+
+ n->next = notifier->endpoints;
+ if (n->next) { n->next->asNotifier()->prev = &n->next; }
+ notifier->endpoints = this;
+ n->prev = &notifier->endpoints;
+ n->notifier = notifier;
+}
+
+void QDeclarativeNotifierEndpoint::disconnect()
+{
+ if (type == SignalType) {
+ Signal *s = (Signal *)&signalData;
+ if (s->source) {
+ QMetaObject::disconnectOne(s->source, s->sourceSignal, target, targetMethod);
+ s->source = 0;
+ }
+ } else if (type == NotifierType) {
+ Notifier *n = asNotifier();
+
+ if (n->next) n->next->asNotifier()->prev = n->prev;
+ if (n->prev) *n->prev = n->next;
+ if (n->disconnected) *n->disconnected = 0;
+ n->next = 0;
+ n->prev = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ }
+}
+
+QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::toNotifier()
+{
+ if (NotifierType == type)
+ return asNotifier();
+
+ if (SignalType == type) {
+ disconnect();
+ Signal *s = asSignal();
+ s->~Signal();
+ }
+
+ Notifier *n = asNotifier();
+ n->next = 0;
+ n->prev = 0;
+ n->disconnected = 0;
+ n->notifier = 0;
+ type = NotifierType;
+ return n;
+}
+
+QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::asNotifier()
+{
+ return (Notifier *)(&notifierData);
+}
+
+QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::toSignal()
+{
+ if (SignalType == type)
+ return asSignal();
+
+ disconnect();
+ Signal *s = asSignal();
+ new (s) Signal;
+ type = SignalType;
+
+ return s;
+}
+
+QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::asSignal()
+{
+ return (Signal *)(&signalData);
+}
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVENOTIFIER_P_H
+
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index e6f6e5f..32a28fe 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -59,6 +59,15 @@ QT_BEGIN_NAMESPACE
struct ObjectData : public QScriptDeclarativeClass::Object {
ObjectData(QObject *o, int t) : object(o), type(t) {}
+
+ virtual ~ObjectData() {
+ if (object && !object->parent()) {
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, false);
+ if (ddata && !ddata->indestructible)
+ object->deleteLater();
+ }
+ }
+
QDeclarativeGuard<QObject> object;
int type;
};
@@ -87,7 +96,7 @@ QDeclarativeObjectScriptClass::~QDeclarativeObjectScriptClass()
{
}
-QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type)
+QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type)
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -96,7 +105,11 @@ QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type
QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, true);
- if (!ddata->scriptValue.isValid()) {
+ if (!ddata) {
+ return scriptEngine->undefinedValue();
+ } else if (!ddata->indestructible && !object->parent()) {
+ return newObject(scriptEngine, this, new ObjectData(object, type));
+ } else if (!ddata->scriptValue.isValid()) {
ddata->scriptValue = newObject(scriptEngine, this, new ObjectData(object, type));
return ddata->scriptValue;
} else if (ddata->scriptValue.engine() == QDeclarativeEnginePrivate::getScriptEngine(engine)) {
@@ -338,7 +351,8 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
}
}
- QDeclarativeAbstractBinding *delBinding = QDeclarativePropertyPrivate::setBinding(obj, *lastData, 0);
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativePropertyPrivate::setBinding(obj, lastData->coreIndex, -1, 0);
if (delBinding)
delBinding->destroy();
@@ -392,17 +406,30 @@ QScriptValue QDeclarativeObjectScriptClass::tostring(QScriptContext *context, QS
QScriptValue QDeclarativeObjectScriptClass::destroy(QScriptContext *context, QScriptEngine *engine)
{
- QObject* obj = context->thisObject().toQObject();
- if(obj){
- int delay = 0;
- if(context->argumentCount() > 0)
- delay = context->argument(0).toInt32();
- if (delay > 0)
- QTimer::singleShot(delay, obj, SLOT(deleteLater()));
- else
- obj->deleteLater();
- }
- return engine->nullValue();
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
+ QScriptValue that = context->thisObject();
+
+ if (scriptClass(that) != p->objectClass)
+ return engine->undefinedValue();
+
+ ObjectData *data = (ObjectData *)p->objectClass->object(that);
+ if (!data->object)
+ return engine->undefinedValue();
+
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(data->object, false);
+ if (!ddata || ddata->indestructible)
+ return engine->currentContext()->throwError(QLatin1String("Invalid attempt to destroy() an indestructible object"));
+
+ QObject *obj = data->object;
+ int delay = 0;
+ if (context->argumentCount() > 0)
+ delay = context->argument(0).toInt32();
+ if (delay > 0)
+ QTimer::singleShot(delay, obj, SLOT(deleteLater()));
+ else
+ obj->deleteLater();
+
+ return engine->undefinedValue();
}
QStringList QDeclarativeObjectScriptClass::propertyNames(Object *object)
@@ -428,6 +455,14 @@ QStringList QDeclarativeObjectScriptClass::propertyNames(Object *object)
return cache->propertyNames();
}
+bool QDeclarativeObjectScriptClass::compare(Object *o1, Object *o2)
+{
+ ObjectData *d1 = (ObjectData *)o1;
+ ObjectData *d2 = (ObjectData *)o2;
+
+ return d1 == d2 || d1->object == d2->object;
+}
+
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
struct MethodData : public QScriptDeclarativeClass::Object {
@@ -441,6 +476,8 @@ QDeclarativeObjectMethodScriptClass::QDeclarativeObjectMethodScriptClass(QDeclar
: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
engine(bindEngine)
{
+ qRegisterMetaType<QList<QObject *> >("QList<QObject *>");
+
setSupportsCall(true);
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -551,7 +588,7 @@ private:
inline void cleanup();
- char *data[16];
+ void *data[4];
int type;
};
}
@@ -569,11 +606,13 @@ MetaCallArgument::~MetaCallArgument()
void MetaCallArgument::cleanup()
{
if (type == QMetaType::QString) {
- ((QString *)data)->~QString();
+ ((QString *)&data)->~QString();
} else if (type == -1 || type == qMetaTypeId<QVariant>()) {
- ((QVariant *)data)->~QVariant();
+ ((QVariant *)&data)->~QVariant();
} else if (type == qMetaTypeId<QScriptValue>()) {
- ((QScriptValue *)data)->~QScriptValue();
+ ((QScriptValue *)&data)->~QScriptValue();
+ } else if (type == qMetaTypeId<QList<QObject *> >()) {
+ ((QList<QObject *> *)&data)->~QList<QObject *>();
}
}
@@ -582,7 +621,7 @@ void *MetaCallArgument::dataPtr()
if (type == -1)
return ((QVariant *)data)->data();
else
- return (void *)data;
+ return (void *)&data;
}
void MetaCallArgument::initAsType(int callType, QDeclarativeEngine *e)
@@ -593,7 +632,7 @@ void MetaCallArgument::initAsType(int callType, QDeclarativeEngine *e)
QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
if (callType == qMetaTypeId<QScriptValue>()) {
- new (data) QScriptValue(engine->undefinedValue());
+ new (&data) QScriptValue(engine->undefinedValue());
type = callType;
} else if (callType == QMetaType::Int ||
callType == QMetaType::UInt ||
@@ -602,17 +641,20 @@ void MetaCallArgument::initAsType(int callType, QDeclarativeEngine *e)
callType == QMetaType::Float) {
type = callType;
} else if (callType == QMetaType::QObjectStar) {
- *((QObject **)data) = 0;
+ *((QObject **)&data) = 0;
type = callType;
} else if (callType == QMetaType::QString) {
- new (data) QString();
+ new (&data) QString();
type = callType;
} else if (callType == qMetaTypeId<QVariant>()) {
- type = qMetaTypeId<QVariant>();
- new (data) QVariant();
+ type = callType;
+ new (&data) QVariant();
+ } else if (callType == qMetaTypeId<QList<QObject *> >()) {
+ type = callType;
+ new (&data) QList<QObject *>();
} else {
type = -1;
- new (data) QVariant(callType, (void *)0);
+ new (&data) QVariant(callType, (void *)0);
}
}
@@ -621,47 +663,50 @@ void MetaCallArgument::fromScriptValue(int callType, QDeclarativeEngine *engine,
if (type != 0) { cleanup(); type = 0; }
if (callType == qMetaTypeId<QScriptValue>()) {
- new (data) QScriptValue(value);
+ new (&data) QScriptValue(value);
type = qMetaTypeId<QScriptValue>();
} else if (callType == QMetaType::Int) {
- *((int *)data) = int(value.toInt32());
+ *((int *)&data) = int(value.toInt32());
type = callType;
} else if (callType == QMetaType::UInt) {
- *((uint *)data) = uint(value.toUInt32());
+ *((uint *)&data) = uint(value.toUInt32());
type = callType;
} else if (callType == QMetaType::Bool) {
- *((bool *)data) = value.toBool();
+ *((bool *)&data) = value.toBool();
type = callType;
} else if (callType == QMetaType::Double) {
- *((double *)data) = double(value.toNumber());
+ *((double *)&data) = double(value.toNumber());
type = callType;
} else if (callType == QMetaType::Float) {
- *((float *)data) = float(value.toNumber());
+ *((float *)&data) = float(value.toNumber());
type = callType;
} else if (callType == QMetaType::QString) {
if (value.isNull() || value.isUndefined())
- new (data) QString();
+ new (&data) QString();
else
- new (data) QString(value.toString());
+ new (&data) QString(value.toString());
type = callType;
} else if (callType == QMetaType::QObjectStar) {
- *((QObject **)data) = value.toQObject();
+ *((QObject **)&data) = value.toQObject();
type = callType;
} else if (callType == qMetaTypeId<QVariant>()) {
- new (data) QVariant(QDeclarativeScriptClass::toVariant(engine, value));
+ new (&data) QVariant(QDeclarativeScriptClass::toVariant(engine, value));
+ type = callType;
+ } else if (callType == qMetaTypeId<QList<QObject*> >()) {
+ new (&data) QList<QObject *>(); // We don't support passing in QList<QObject*>
type = callType;
} else {
- new (data) QVariant();
+ new (&data) QVariant();
type = -1;
QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
if (v.userType() == callType) {
- *((QVariant *)data) = v;
+ *((QVariant *)&data) = v;
} else if (v.canConvert((QVariant::Type)callType)) {
- *((QVariant *)data) = v;
- ((QVariant *)data)->convert((QVariant::Type)callType);
+ *((QVariant *)&data) = v;
+ ((QVariant *)&data)->convert((QVariant::Type)callType);
} else {
- *((QVariant *)data) = QVariant(callType, (void *)0);
+ *((QVariant *)&data) = QVariant(callType, (void *)0);
}
}
}
@@ -671,23 +716,36 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e)
QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
if (type == qMetaTypeId<QScriptValue>()) {
- return QScriptDeclarativeClass::Value(engine, *((QScriptValue *)data));
+ return QScriptDeclarativeClass::Value(engine, *((QScriptValue *)&data));
} else if (type == QMetaType::Int) {
- return QScriptDeclarativeClass::Value(engine, *((int *)data));
+ return QScriptDeclarativeClass::Value(engine, *((int *)&data));
} else if (type == QMetaType::UInt) {
- return QScriptDeclarativeClass::Value(engine, *((uint *)data));
+ return QScriptDeclarativeClass::Value(engine, *((uint *)&data));
} else if (type == QMetaType::Bool) {
- return QScriptDeclarativeClass::Value(engine, *((bool *)data));
+ return QScriptDeclarativeClass::Value(engine, *((bool *)&data));
} else if (type == QMetaType::Double) {
- return QScriptDeclarativeClass::Value(engine, *((double *)data));
+ return QScriptDeclarativeClass::Value(engine, *((double *)&data));
} else if (type == QMetaType::Float) {
- return QScriptDeclarativeClass::Value(engine, *((float *)data));
+ return QScriptDeclarativeClass::Value(engine, *((float *)&data));
} else if (type == QMetaType::QString) {
- return QScriptDeclarativeClass::Value(engine, *((QString *)data));
+ return QScriptDeclarativeClass::Value(engine, *((QString *)&data));
} else if (type == QMetaType::QObjectStar) {
- return QScriptDeclarativeClass::Value(engine, QDeclarativeEnginePrivate::get(e)->objectClass->newQObject(*((QObject **)data)));
+ QObject *object = *((QObject **)&data);
+ QDeclarativeDeclarativeData::get(object, true)->setImplicitDestructible();
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e);
+ return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(object));
+ } else if (type == qMetaTypeId<QList<QObject *> >()) {
+ QList<QObject *> &list = *(QList<QObject *>*)&data;
+ QScriptValue rv = engine->newArray(list.count());
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e);
+ for (int ii = 0; ii < list.count(); ++ii) {
+ QObject *object = list.at(ii);
+ QDeclarativeDeclarativeData::get(object, true)->setImplicitDestructible();
+ rv.setProperty(ii, priv->objectClass->newQObject(object));
+ }
+ return QScriptDeclarativeClass::Value(engine, rv);
} else if (type == -1 || type == qMetaTypeId<QVariant>()) {
- return QScriptDeclarativeClass::Value(engine, QDeclarativeEnginePrivate::get(e)->scriptValueFromVariant(*((QVariant *)data)));
+ return QScriptDeclarativeClass::Value(engine, QDeclarativeEnginePrivate::get(e)->scriptValueFromVariant(*((QVariant *)&data)));
} else {
return QScriptDeclarativeClass::Value();
}
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
index 04e760f..1f7d1c9 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
@@ -57,6 +57,7 @@
#include "qdeclarativetypenamecache_p.h"
#include <private/qdeclarativescriptclass_p.h>
+#include <QtScript/qscriptengine.h>
QT_BEGIN_NAMESPACE
@@ -99,6 +100,7 @@ public:
~QDeclarativeObjectScriptClass();
QScriptValue newQObject(QObject *, int type = QMetaType::QObjectStar);
+
QObject *toQObject(const QScriptValue &) const;
int objectType(const QScriptValue &) const;
@@ -118,6 +120,7 @@ public:
void setProperty(QObject *, const Identifier &name, const QScriptValue &,
QDeclarativeContext *evalContext = 0);
virtual QStringList propertyNames(Object *);
+ virtual bool compare(Object *, Object *);
protected:
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp
index b0599ad..51f1660 100644
--- a/src/declarative/qml/qdeclarativeparser.cpp
+++ b/src/declarative/qml/qdeclarativeparser.cpp
@@ -207,13 +207,14 @@ QDeclarativeParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o)
}
QDeclarativeParser::Property::Property()
-: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false)
+: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false),
+ isValueTypeSubProperty(false)
{
}
QDeclarativeParser::Property::Property(const QByteArray &n)
: parent(0), type(0), index(-1), value(0), name(n), isDefault(false),
- isDeferred(false)
+ isDeferred(false), isValueTypeSubProperty(false)
{
}
diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
index 5bf4b68..9dfb86b 100644
--- a/src/declarative/qml/qdeclarativeparser_p.h
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -351,6 +351,8 @@ namespace QDeclarativeParser
// True if the setting of this property will be deferred. Set by the
// QDeclarativeCompiler
bool isDeferred;
+ // True if this property is a value-type psuedo-property
+ bool isValueTypeSubProperty;
LocationSpan location;
LocationRange listValueRange;
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index 01369d4..bebe82c 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -73,6 +73,9 @@ namespace QDeclarativePrivate
QObject *create() { return new T; }
template<typename T>
+ void createInto(void *memory) { new (memory) T; }
+
+ template<typename T>
QObject *createParent(QObject *p) { return new T(p); }
template<class From, class To, int N>
@@ -172,7 +175,8 @@ namespace QDeclarativePrivate
int typeId;
int listId;
- QObject *(*create)();
+ int objectSize;
+ void (*create)(void *);
const char *uri;
int versionMajor;
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index 4f73b89..c55c22f 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -115,8 +115,10 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj)
}
/*!
- Creates a QDeclarativeProperty for the default property of \a obj. If there is no
- default property, an invalid QDeclarativeProperty will be created.
+ Creates a QDeclarativeProperty for the default property of \a obj
+ using the \l{QDeclarativeContext} {context} \a ctxt. If there is
+ no default property, an invalid QDeclarativeProperty will be
+ created.
*/
QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt)
: d(new QDeclarativePropertyPrivate)
@@ -128,11 +130,13 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ct
}
/*!
- Creates a QDeclarativeProperty for the default property of \a obj. If there is no
- default property, an invalid QDeclarativeProperty will be created.
+ Creates a QDeclarativeProperty for the default property of \a obj
+ using the environment for instantiating QML components that is
+ provided by \a engine. If there is no default property, an
+ invalid QDeclarativeProperty will be created.
*/
QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *engine)
-: d(new QDeclarativePropertyPrivate)
+ : d(new QDeclarativePropertyPrivate)
{
d->q = this;
d->context = 0;
@@ -166,8 +170,9 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name)
}
/*!
- Creates a QDeclarativeProperty for the property \a name of \a obj.
- */
+ Creates a QDeclarativeProperty for the property \a name of \a obj
+ using the \l{QDeclarativeContext} {context} \a ctxt.
+*/
QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt)
: d(new QDeclarativePropertyPrivate)
{
@@ -179,7 +184,9 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QD
}
/*!
- Creates a QDeclarativeProperty for the property \a name of \a obj.
+ Creates a QDeclarativeProperty for the property \a name of \a obj
+ using the environment for instantiating QML components that is
+ provided by \a engine.
*/
QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeEngine *engine)
: d(new QDeclarativePropertyPrivate)
@@ -487,15 +494,13 @@ QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty
*/
bool QDeclarativeProperty::isWritable() const
{
- QDeclarativeProperty::PropertyTypeCategory category = propertyTypeCategory();
-
if (!d->object)
return false;
- if (category == List)
+ if (d->core.flags & QDeclarativePropertyCache::Data::IsQList) //list
return true;
- else if (type() & SignalProperty)
+ else if (d->core.flags & QDeclarativePropertyCache::Data::IsFunction) //signal handler
return false;
- else if (d->core.isValid() && d->object)
+ else if (d->core.isValid()) //normal property
return d->core.flags & QDeclarativePropertyCache::Data::IsWritable;
else
return false;
@@ -591,7 +596,6 @@ QMetaMethod QDeclarativeProperty::method() const
return QMetaMethod();
}
-
/*!
Returns the binding associated with this property, or 0 if no binding
exists.
@@ -610,13 +614,18 @@ QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that)
return 0;
QDeclarativeAbstractBinding *binding = data->bindings;
- while (binding) {
- // ### This wont work for value types
- if (binding->propertyIndex() == that.d->core.coreIndex)
- return binding;
+ while (binding && binding->propertyIndex() != that.d->core.coreIndex)
binding = binding->m_nextBinding;
+
+ if (binding && that.d->valueType.valueTypeCoreIdx != -1) {
+ if (binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) {
+ QDeclarativeValueTypeProxyBinding *proxy = static_cast<QDeclarativeValueTypeProxyBinding *>(binding);
+
+ binding = proxy->binding(bindingIndex(that));
+ }
}
- return 0;
+
+ return binding;
}
/*!
@@ -643,36 +652,36 @@ QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that,
return 0;
}
- return that.d->setBinding(that.d->object, that.d->core, newBinding, flags);
+ return that.d->setBinding(that.d->object, that.d->core.coreIndex,
+ that.d->valueType.valueTypeCoreIdx, newBinding, flags);
}
QDeclarativeAbstractBinding *
-QDeclarativePropertyPrivate::setBinding(QObject *object, const QDeclarativePropertyCache::Data &core,
- QDeclarativeAbstractBinding *newBinding, WriteFlags flags)
+QDeclarativePropertyPrivate::setBinding(QObject *object, int coreIndex, int valueTypeIndex,
+ QDeclarativeAbstractBinding *newBinding, WriteFlags flags)
{
QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, 0 != newBinding);
+ QDeclarativeAbstractBinding *binding = 0;
- if (data && data->hasBindingBit(core.coreIndex)) {
- QDeclarativeAbstractBinding *binding = data->bindings;
- while (binding) {
- // ### This wont work for value types
- if (binding->propertyIndex() == core.coreIndex) {
- binding->setEnabled(false);
+ if (data && data->hasBindingBit(coreIndex)) {
+ binding = data->bindings;
- if (newBinding)
- newBinding->setEnabled(true, flags);
+ while (binding && binding->propertyIndex() != coreIndex)
+ binding = binding->m_nextBinding;
+ }
- return binding; // ### QDeclarativeAbstractBinding;
- }
+ if (binding && valueTypeIndex != -1 && binding->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy) {
+ int index = coreIndex | (valueTypeIndex << 24);
+ binding = static_cast<QDeclarativeValueTypeProxyBinding *>(binding)->binding(index);
+ }
- binding = binding->m_nextBinding;
- }
- }
+ if (binding)
+ binding->setEnabled(false);
- if (newBinding)
+ if (newBinding)
newBinding->setEnabled(true, flags);
- return 0;
+ return binding;
}
/*!
@@ -766,11 +775,14 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name)
}
/*!
-Return the \a name property value of \a object. This method is equivalent to:
-\code
+ Return the \a name property value of \a object using the
+ \l{QDeclarativeContext} {context} \a ctxt. This method is
+ equivalent to:
+
+ \code
QDeclarativeProperty p(object, name, context);
p.read();
-\endcode
+ \endcode
*/
QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeContext *ctxt)
{
@@ -779,11 +791,15 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDecla
}
/*!
-Return the \a name property value of \a object. This method is equivalent to:
-\code
+
+ Return the \a name property value of \a object using the environment
+ for instantiating QML components that is provided by \a engine. .
+ This method is equivalent to:
+
+ \code
QDeclarativeProperty p(object, name, engine);
p.read();
-\endcode
+ \endcode
*/
QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeEngine *engine)
{
@@ -1073,19 +1089,23 @@ const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativ
}
/*!
- Set the property value to \a value.
-*/
+ Sets the property value to \a value and returns true.
+ Returns false if the property can't be set because the
+ \a value is the wrong type, for example.
+ */
bool QDeclarativeProperty::write(const QVariant &value) const
{
return QDeclarativePropertyPrivate::write(*this, value, 0);
}
/*!
-Writes \a value to the \a name property of \a object. This method is equivalent to:
-\code
+ Writes \a value to the \a name property of \a object. This method
+ is equivalent to:
+
+ \code
QDeclarativeProperty p(object, name);
p.write(value);
-\endcode
+ \endcode
*/
bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value)
{
@@ -1094,13 +1114,18 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa
}
/*!
-Writes \a value to the \a name property of \a object. This method is equivalent to:
-\code
+ Writes \a value to the \a name property of \a object using the
+ \l{QDeclarativeContext} {context} \a ctxt. This method is
+ equivalent to:
+
+ \code
QDeclarativeProperty p(object, name, ctxt);
p.write(value);
-\endcode
+ \endcode
*/
-bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value,
+bool QDeclarativeProperty::write(QObject *object,
+ const QString &name,
+ const QVariant &value,
QDeclarativeContext *ctxt)
{
QDeclarativeProperty p(object, name, ctxt);
@@ -1108,11 +1133,15 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa
}
/*!
-Writes \a value to the \a name property of \a object. This method is equivalent to:
-\code
+
+ Writes \a value to the \a name property of \a object using the
+ environment for instantiating QML components that is provided by
+ \a engine. This method is equivalent to:
+
+ \code
QDeclarativeProperty p(object, name, engine);
p.write(value);
-\endcode
+ \endcode
*/
bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value,
QDeclarativeEngine *engine)
@@ -1122,7 +1151,9 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa
}
/*!
- Resets the property value.
+ Resets the property and returns true if the property is
+ resettable. If the property is not resettable, nothing happens
+ and false is returned.
*/
bool QDeclarativeProperty::reset() const
{
@@ -1224,6 +1255,18 @@ int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty &
return that.d->valueType.valueTypeCoreIdx;
}
+/*!
+ Returns the "property index" for use in bindings. The top 8 bits are the value type
+ offset, and 0 otherwise. The bottom 24-bits are the regular property index.
+*/
+int QDeclarativePropertyPrivate::bindingIndex(const QDeclarativeProperty &that)
+{
+ int rv = that.d->core.coreIndex;
+ if (rv != -1 && that.d->valueType.valueTypeCoreIdx != -1)
+ rv = rv | (that.d->valueType.valueTypeCoreIdx << 24);
+ return rv;
+}
+
struct SerializedData {
bool isValueType;
QDeclarativePropertyCache::Data core;
diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h
index c31e2d3..26b85b8 100644
--- a/src/declarative/qml/qdeclarativeproperty_p.h
+++ b/src/declarative/qml/qdeclarativeproperty_p.h
@@ -110,7 +110,7 @@ public:
const QVariant &value, int flags);
static bool write(QObject *, const QDeclarativePropertyCache::Data &, const QVariant &,
QDeclarativeContext *, WriteFlags flags = 0);
- static QDeclarativeAbstractBinding *setBinding(QObject *, const QDeclarativePropertyCache::Data &,
+ static QDeclarativeAbstractBinding *setBinding(QObject *, int coreIndex, int valueTypeIndex /* -1 */,
QDeclarativeAbstractBinding *,
WriteFlags flags = DontRemoveBinding);
@@ -133,6 +133,7 @@ public:
QDeclarativeExpression *) ;
static bool write(const QDeclarativeProperty &that, const QVariant &, WriteFlags);
static int valueTypeCoreIndex(const QDeclarativeProperty &that);
+ static int bindingIndex(const QDeclarativeProperty &that);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyPrivate::WriteFlags)
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index 68e6e6b..bfbeff4 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -55,15 +55,16 @@
#include "qdeclarativerefcount_p.h"
#include "qdeclarativecleanup_p.h"
+#include "qdeclarativenotifier_p.h"
#include <QtCore/qvector.h>
#include <QtScript/private/qscriptdeclarativeclass_p.h>
-
QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
class QMetaProperty;
+
class QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
@@ -83,9 +84,9 @@ public:
IsResettable = 0x00000004,
// These are mutualy exclusive
- IsFunction = 0x00000008,
- IsQObjectDerived = 0x00000010,
- IsEnumType = 0x00000020,
+ IsFunction = 0x00000010,
+ IsQObjectDerived = 0x00000020,
+ IsEnumType = 0x00000040,
IsQList = 0x00000080,
IsQmlBinding = 0x00000100,
IsQScriptValue = 0x00000200,
@@ -96,7 +97,7 @@ public:
};
Q_DECLARE_FLAGS(Flags, Flag)
-
+
bool isValid() const { return coreIndex != -1; }
Flags flags;
@@ -114,9 +115,9 @@ public:
struct ValueTypeData {
inline ValueTypeData();
inline bool operator==(const ValueTypeData &);
- Data::Flags flags; // flags on the value type wrapper
- int valueTypeCoreIdx; // The prop index of the access property on the value type wrapper
- int valueTypePropType; // The QVariant::Type of access property on the value type wrapper
+ Data::Flags flags; // flags of the access property on the value type proxy object
+ int valueTypeCoreIdx; // The prop index of the access property on the value type proxy object
+ int valueTypePropType; // The QVariant::Type of access property on the value type proxy object
};
void update(QDeclarativeEngine *, const QMetaObject *);
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index c070123..00e6704 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -61,7 +61,7 @@ int qmlRegisterValueTypeEnums(const char *qmlName)
QDeclarativePrivate::RegisterType type = {
0,
- qRegisterMetaType<T *>(pointerName.constData()), 0, 0,
+ qRegisterMetaType<T *>(pointerName.constData()), 0, 0, 0,
"Qt", 4, 6, qmlName, &T::staticMetaObject,
diff --git a/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
index 9cb65f8..a567c38 100644
--- a/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
@@ -41,6 +41,8 @@
#include "qdeclarativevaluetypescriptclass_p.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativeproperty_p.h"
#include "qdeclarativeengine_p.h"
#include "qdeclarativeguard_p.h"
@@ -115,6 +117,11 @@ void QDeclarativeValueTypeScriptClass::setProperty(Object *obj, const Identifier
{
QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
+ QDeclarativeAbstractBinding *delBinding =
+ QDeclarativePropertyPrivate::setBinding(ref->object, ref->property, m_lastIndex, 0);
+ if (delBinding)
+ delBinding->destroy();
+
QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
ref->type->read(ref->object, ref->property);
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 6a08674..05553fd 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -130,9 +130,9 @@ void QDeclarativeVME::runDeferred(QObject *object)
}
QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarativeContext *ctxt,
- QDeclarativeCompiledData *comp,
- int start, int count,
- const QBitField &bindingSkipList)
+ QDeclarativeCompiledData *comp,
+ int start, int count,
+ const QBitField &bindingSkipList)
{
Q_ASSERT(comp);
Q_ASSERT(ctxt);
@@ -197,6 +197,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati
QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(o);
Q_ASSERT(ddata);
+ ddata->setImplicitDestructible();
ddata->outerContext = ctxt;
ddata->lineNumber = instr.line;
ddata->columnNumber = instr.create.column;
@@ -236,7 +237,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati
case QDeclarativeInstruction::SetDefault:
{
QObject *target = stack.top();
- ctxt->addDefaultObject(target);
+ ctxt->setContextObject(target);
}
break;
@@ -247,6 +248,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati
QDeclarativeEngine::setContextForObject(qcomp, ctxt);
QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(qcomp);
Q_ASSERT(ddata);
+ ddata->setImplicitDestructible();
ddata->outerContext = ctxt;
ddata->lineNumber = instr.line;
ddata->columnNumber = instr.create.column;
@@ -832,11 +834,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati
if (parserStatus.count)
ep->parserStatus << parserStatus;
- if (stack.isEmpty())
- return 0;
- else
- return stack.top();
- return 0;
+ Q_ASSERT(stack.count() == 1);
+ return stack.top();
}
bool QDeclarativeVME::isError() const
diff --git a/src/declarative/qml/qdeclarativevme_p.h b/src/declarative/qml/qdeclarativevme_p.h
index 951f6a7..bcd3ac9 100644
--- a/src/declarative/qml/qdeclarativevme_p.h
+++ b/src/declarative/qml/qdeclarativevme_p.h
@@ -71,7 +71,7 @@ template<typename T, int N = 128>
class QDeclarativeVMEStack {
public:
QDeclarativeVMEStack() : index(-1), maxSize(N), data(fixedData) {}
- ~QDeclarativeVMEStack() { if (data != fixedData) qFree(fixedData); }
+ ~QDeclarativeVMEStack() { if (data != fixedData) qFree(data); }
bool isEmpty() const { return index == -1; }
const T &top() const { return data[index]; }
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index 87cab85..58e67fa 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -1245,7 +1245,7 @@ void QDeclarativeXMLHttpRequest::finished()
if (m_redirectCount < XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION) {
QVariant redirect = m_network->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (redirect.isValid()) {
- QUrl url = redirect.toUrl();
+ QUrl url = m_network->url().resolved(redirect.toUrl());
destroyNetwork();
requestFromUrl(url);
return;
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index aa1a34b..49888c3 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -38,6 +38,7 @@ SOURCES += \
$$PWD/qdeclarativescript.cpp \
$$PWD/qdeclarativecleanup.cpp \
$$PWD/qdeclarativepropertycache.cpp \
+ $$PWD/qdeclarativenotifier.cpp \
$$PWD/qdeclarativeintegercache.cpp \
$$PWD/qdeclarativetypenamecache.cpp \
$$PWD/qdeclarativescriptstring.cpp \
@@ -108,6 +109,7 @@ HEADERS += \
$$PWD/qdeclarativewatcher_p.h \
$$PWD/qdeclarativecleanup_p.h \
$$PWD/qdeclarativepropertycache_p.h \
+ $$PWD/qdeclarativenotifier_p.h \
$$PWD/qdeclarativeintegercache_p.h \
$$PWD/qdeclarativetypenamecache_p.h \
$$PWD/qdeclarativescriptstring.h \
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 8c8dd95..009e07f 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -838,10 +838,10 @@ void QDeclarativePropertyAction::setProperty(const QString &n)
}
/*!
+ \qmlproperty list<Object> PropertyAction::targets
\qmlproperty string PropertyAction::property
\qmlproperty string PropertyAction::properties
\qmlproperty Object PropertyAction::target
- \qmlproperty list<Object> PropertyAction::targets
These properties are used as a set to determine which properties should be
affected by this action.
@@ -876,6 +876,7 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets()
/*!
\qmlproperty list<Object> PropertyAction::exclude
This property holds the objects not to be affected by this animation.
+
\sa targets
*/
QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude()
@@ -1876,13 +1877,17 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t)
}
/*!
- \qmlproperty QEasingCurve PropertyAnimation::easing
- \brief the easing curve used for the transition.
+ \qmlproperty enum PropertyAnimation::easing.type
+ \qmlproperty real PropertyAnimation::easing.amplitude
+ \qmlproperty real PropertyAnimation::easing.overshoot
+ \qmlproperty real PropertyAnimation::easing.period
+ \brief the easing curve used for the animation.
- For the easing you can specify the following parameters: type, amplitude, period and overshoot.
+ To specify an easing curve you need to specify at least the type. For some curves you can also specify
+ amplitude, period and/or overshoot (more details provided after the table).
\qml
- PropertyAnimation { properties: "y"; easing.type: "InOutElastc"; easing.amplitude: 2.0; easing.period: 1.5 }
+ PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 }
\endqml
Available types are:
@@ -2220,7 +2225,7 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::targets()
/*!
\qmlproperty list<Object> PropertyAnimation::exclude
This property holds the items not to be affected by this animation.
- \sa targets
+ \sa PropertyAnimation::targets
*/
QDeclarativeListProperty<QObject> QDeclarativePropertyAnimation::exclude()
{
@@ -2428,11 +2433,12 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
be run in parallel (like those in a ParallelAnimation group).
In some cases, such as reparenting between items with clipping, it's useful
- to animate the parent change \i via another item with no clipping.
+ to animate the parent change via another item with no clipping.
When used in a transition, ParentAnimation will by default animate
all ParentChanges.
*/
+
/*!
\internal
\class QDeclarativeParentAnimation
@@ -2445,12 +2451,15 @@ QDeclarativeParentAnimation::QDeclarativeParentAnimation(QObject *parent)
QDeclarative_setParent_noEvent(d->topLevelGroup, this);
d->startAction = new QActionAnimation;
+ QDeclarative_setParent_noEvent(d->startAction, d->topLevelGroup);
d->topLevelGroup->addAnimation(d->startAction);
d->ag = new QParallelAnimationGroup;
+ QDeclarative_setParent_noEvent(d->ag, d->topLevelGroup);
d->topLevelGroup->addAnimation(d->ag);
d->endAction = new QActionAnimation;
+ QDeclarative_setParent_noEvent(d->endAction, d->topLevelGroup);
d->topLevelGroup->addAnimation(d->endAction);
}
@@ -2741,4 +2750,99 @@ QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation()
return d->topLevelGroup;
}
+/*!
+ \qmlclass AnchorAnimation QDeclarativeAnchorAnimation
+ \since 4.7
+ \inherits Animation
+ \brief The AnchorAnimation element allows you to animate anchor changes.
+
+ AnchorAnimation will animated any changes specified by a state's AnchorChanges.
+ In the following snippet we animate the addition of a right anchor to our item.
+ \qml
+ Item {
+ id: myItem
+ width: 100
+ }
+ ...
+ State {
+ AnchorChanges {
+ target: myItem
+ anchors.right: container.right
+ }
+ }
+ ...
+ Transition {
+ //smoothly reanchor myItem and move into new position
+ AnchorAnimation {}
+ }
+ \endqml
+
+ \sa AnchorChanges
+*/
+
+QDeclarativeAnchorAnimation::QDeclarativeAnchorAnimation(QObject *parent)
+: QDeclarativeAbstractAnimation(*(new QDeclarativeAnchorAnimationPrivate), parent)
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ d->va = new QDeclarativeBulkValueAnimator;
+ QDeclarative_setParent_noEvent(d->va, this);
+}
+
+QDeclarativeAnchorAnimation::~QDeclarativeAnchorAnimation()
+{
+}
+
+QAbstractAnimation *QDeclarativeAnchorAnimation::qtAnimation()
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ return d->va;
+}
+
+/*!
+ \qmlproperty list<Item> AnchorAnimation::targets
+ The items to reanchor.
+
+ If no targets are specified all AnchorChanges will be
+ animated by the AnchorAnimation.
+*/
+QDeclarativeListProperty<QDeclarativeItem> QDeclarativeAnchorAnimation::targets()
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ return QDeclarativeListProperty<QDeclarativeItem>(this, d->targets);
+}
+
+void QDeclarativeAnchorAnimation::transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction)
+{
+ Q_D(QDeclarativeAnchorAnimation);
+ PropertyUpdater *data = new PropertyUpdater;
+ data->interpolatorType = QMetaType::QReal;
+ data->interpolator = d->interpolator;
+
+ data->reverse = direction == Backward ? true : false;
+ data->fromSourced = false;
+ data->fromDefined = false;
+
+ for (int ii = 0; ii < actions.count(); ++ii) {
+ QDeclarativeAction &action = actions[ii];
+ if (action.event && action.event->typeName() == QLatin1String("AnchorChanges")
+ && (d->targets.isEmpty() || d->targets.contains(static_cast<QDeclarativeAnchorChanges*>(action.event)->object()))) {
+ data->actions << static_cast<QDeclarativeAnchorChanges*>(action.event)->additionalActions();
+ }
+ }
+
+ if (data->actions.count()) {
+ if (!d->rangeIsSet) {
+ d->va->setStartValue(qreal(0));
+ d->va->setEndValue(qreal(1));
+ d->rangeIsSet = true;
+ }
+ d->va->setAnimValue(data, QAbstractAnimation::DeleteWhenStopped);
+ d->va->setFromSourcedValue(&data->fromSourced);
+ } else {
+ delete data;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index af48309..eb339f6 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -480,6 +480,26 @@ protected:
virtual QAbstractAnimation *qtAnimation();
};
+class QDeclarativeAnchorAnimationPrivate;
+class QDeclarativeAnchorAnimation : public QDeclarativeAbstractAnimation
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDeclarativeAnchorAnimation)
+ Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> targets READ targets)
+
+public:
+ QDeclarativeAnchorAnimation(QObject *parent=0);
+ virtual ~QDeclarativeAnchorAnimation();
+
+ QDeclarativeListProperty<QDeclarativeItem> targets();
+
+protected:
+ virtual void transition(QDeclarativeStateActions &actions,
+ QDeclarativeProperties &modified,
+ TransitionDirection direction);
+ virtual QAbstractAnimation *qtAnimation();
+};
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QDeclarativeAbstractAnimation)
@@ -495,6 +515,7 @@ QML_DECLARE_TYPE(QDeclarativeParallelAnimation)
QML_DECLARE_TYPE(QDeclarativeVector3dAnimation)
QML_DECLARE_TYPE(QDeclarativeRotationAnimation)
QML_DECLARE_TYPE(QDeclarativeParentAnimation)
+QML_DECLARE_TYPE(QDeclarativeAnchorAnimation)
QT_END_HEADER
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
index ae82a90..0460312 100644
--- a/src/declarative/util/qdeclarativeanimation_p_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -393,6 +393,19 @@ public:
QPointF computeTransformOrigin(QDeclarativeItem::TransformOrigin origin, qreal width, qreal height) const;
};
+class QDeclarativeAnchorAnimationPrivate : public QDeclarativeAbstractAnimationPrivate
+{
+ Q_DECLARE_PUBLIC(QDeclarativeAnchorAnimation)
+public:
+ QDeclarativeAnchorAnimationPrivate() : rangeIsSet(false), va(0),
+ interpolator(QVariantAnimationPrivate::getInterpolator(QMetaType::QReal)) {}
+
+ bool rangeIsSet;
+ QDeclarativeBulkValueAnimator *va;
+ QVariantAnimation::Interpolator interpolator;
+ QList<QDeclarativeItem*> targets;
+};
+
QT_END_NAMESPACE
#endif // QDECLARATIVEANIMATION_P_H
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 8f5f537..bf98d40 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -61,7 +61,7 @@ class QDeclarativeFontLoaderPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QDeclarativeFontLoader)
public:
- QDeclarativeFontLoaderPrivate() : reply(0), status(QDeclarativeFontLoader::Null) {}
+ QDeclarativeFontLoaderPrivate() : reply(0), status(QDeclarativeFontLoader::Null), redirectCount(0) {}
void addFontToDatabase(const QByteArray &);
@@ -69,6 +69,7 @@ public:
QString name;
QNetworkReply *reply;
QDeclarativeFontLoader::Status status;
+ int redirectCount;
};
@@ -206,15 +207,31 @@ QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const
return d->status;
}
+#define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16
+
void QDeclarativeFontLoader::replyFinished()
{
Q_D(QDeclarativeFontLoader);
if (d->reply) {
+ d->redirectCount++;
+ if (d->redirectCount < FONTLOADER_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->reply->url().resolved(redirect.toUrl());
+ d->reply->deleteLater();
+ d->reply = 0;
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount=0;
+
if (!d->reply->error()) {
QByteArray ba = d->reply->readAll();
d->addFontToDatabase(ba);
} else {
d->status = Error;
+ qWarning() << "Cannot load font:" << d->reply->url();
emit statusChanged();
}
d->reply->deleteLater();
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index cfb25dd..942d5f6 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -137,7 +137,7 @@ class QDeclarativeImageRequestHandler : public QObject
Q_OBJECT
public:
QDeclarativeImageRequestHandler(QDeclarativeImageReader *read, QDeclarativeEngine *eng)
- : QObject(), accessManager(0), engine(eng), reader(read)
+ : QObject(), accessManager(0), engine(eng), reader(read), redirectCount(0)
{
QCoreApplication::postEvent(this, new QEvent(QEvent::User));
}
@@ -162,18 +162,24 @@ private:
QNetworkAccessManager *accessManager;
QDeclarativeEngine *engine;
QDeclarativeImageReader *reader;
+ int redirectCount;
+
+ static int replyDownloadProgress;
+ static int replyFinished;
+ static int downloadProgress;
+ static int thisNetworkRequestDone;
};
//===========================================================================
+int QDeclarativeImageRequestHandler::replyDownloadProgress = -1;
+int QDeclarativeImageRequestHandler::replyFinished = -1;
+int QDeclarativeImageRequestHandler::downloadProgress = -1;
+int QDeclarativeImageRequestHandler::thisNetworkRequestDone = -1;
+
bool QDeclarativeImageRequestHandler::event(QEvent *event)
{
if (event->type() == QEvent::User) {
- static int replyDownloadProgress = -1;
- static int replyFinished = -1;
- static int downloadProgress = -1;
- static int thisNetworkRequestDone = -1;
-
if (replyDownloadProgress == -1) {
replyDownloadProgress = QNetworkReply::staticMetaObject.indexOfSignal("downloadProgress(qint64,qint64)");
replyFinished = QNetworkReply::staticMetaObject.indexOfSignal("finished()");
@@ -264,10 +270,33 @@ bool QDeclarativeImageRequestHandler::event(QEvent *event)
return QObject::event(event);
}
+#define IMAGEREQUESTHANDLER_MAX_REDIRECT_RECURSION 16
+
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;
+ }
+ }
+ redirectCount=0;
+
if (job) {
QImage image;
QDeclarativeImageReaderEvent::ReadError error;
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 1d70d33..802ff1c 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -96,21 +96,12 @@ void QDeclarativeActionEvent::reverse()
{
}
-QList<QDeclarativeAction> QDeclarativeActionEvent::extraActions()
-{
- return QList<QDeclarativeAction>();
-}
-
bool QDeclarativeActionEvent::changesBindings()
{
return false;
}
-void QDeclarativeActionEvent::clearForwardBindings()
-{
-}
-
-void QDeclarativeActionEvent::clearReverseBindings()
+void QDeclarativeActionEvent::clearBindings()
{
}
@@ -368,47 +359,60 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
for (int ii = 0; ii < applyList.count(); ++ii) {
QDeclarativeAction &action = applyList[ii];
- bool found = false;
-
- int jj;
if (action.event) {
if (!action.event->isReversable())
continue;
- for (jj = 0; jj < d->revertList.count(); ++jj) {
+ bool found = false;
+ for (int jj = 0; jj < d->revertList.count(); ++jj) {
QDeclarativeActionEvent *event = d->revertList.at(jj).event;
if (event && event->typeName() == action.event->typeName()) {
if (action.event->override(event)) {
found = true;
+
+ if (action.event != d->revertList.at(jj).event) {
+ action.event->copyOriginals(d->revertList.at(jj).event);
+
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ d->revertList.removeAt(jj);
+ } else if (action.event->isRewindable()) //###why needed?
+ action.event->saveCurrentValues();
+
break;
}
}
}
- if (!found || action.event != d->revertList.at(jj).event)
+ if (!found) {
action.event->saveOriginals();
- else if (action.event->isRewindable())
- action.event->saveCurrentValues();
+ // Only need to revert the applyList action if the previous
+ // state doesn't have a higher priority revert already
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ }
} else {
+ bool found = false;
action.fromBinding = QDeclarativePropertyPrivate::binding(action.property);
- for (jj = 0; jj < d->revertList.count(); ++jj) {
+ for (int jj = 0; jj < d->revertList.count(); ++jj) {
if (d->revertList.at(jj).property == action.property) {
found = true;
+ if (d->revertList.at(jj).binding != action.fromBinding) {
+ action.deleteFromBinding();
+ }
break;
}
}
- }
- if (!found) {
- if (!action.restore) {
- action.deleteFromBinding();
- } else {
- // Only need to revert the applyList action if the previous
- // state doesn't have a higher priority revert already
- QDeclarativeSimpleAction r(action);
- additionalReverts << r;
+ if (!found) {
+ if (!action.restore) {
+ action.deleteFromBinding();
+ } else {
+ // Only need to revert the applyList action if the previous
+ // state doesn't have a higher priority revert already
+ QDeclarativeSimpleAction r(action);
+ additionalReverts << r;
+ }
}
- } else if (d->revertList.at(jj).binding != action.fromBinding) {
- action.deleteFromBinding();
}
}
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
index 0c6e7a3..ee2b7e8 100644
--- a/src/declarative/util/qdeclarativestate_p.h
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -92,17 +92,15 @@ public:
virtual bool isReversable();
virtual void reverse();
virtual void saveOriginals() {}
+ virtual void copyOriginals(QDeclarativeActionEvent *) {}
virtual bool isRewindable() { return isReversable(); }
virtual void rewind() {}
virtual void saveCurrentValues() {}
-
- //virtual bool hasExtraActions();
- virtual QList<QDeclarativeAction> extraActions();
+ virtual void saveTargetValues() {}
virtual bool changesBindings();
- virtual void clearForwardBindings();
- virtual void clearReverseBindings();
+ virtual void clearBindings();
virtual bool override(QDeclarativeActionEvent*other);
};
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index cd06380..6f5bb66 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -403,6 +403,17 @@ void QDeclarativeParentChange::saveOriginals()
d->origStackBefore = d->rewindStackBefore;
}
+void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other)
+{
+ Q_D(QDeclarativeParentChange);
+ QDeclarativeParentChange *pc = static_cast<QDeclarativeParentChange*>(other);
+
+ d->origParent = pc->d_func()->rewindParent;
+ d->origStackBefore = pc->d_func()->rewindStackBefore;
+
+ saveCurrentValues();
+}
+
void QDeclarativeParentChange::execute()
{
Q_D(QDeclarativeParentChange);
@@ -562,13 +573,16 @@ QString QDeclarativeStateChangeScript::typeName() const
\brief The AnchorChanges element allows you to change the anchors of an item in a state.
In the following example we change the top and bottom anchors of an item:
- \snippet examples/declarative/anchors/anchor-changes.qml 0
+ \qml
+ AnchorChanges {
+ target: content; top: window.top; bottom: window.bottom
+ }
+ \endqml
- AnchorChanges will 'inject' \c x, \c y, \c width, and \c height changes into the transition,
- so you can animate them as you would normally changes to these properties:
+ AnchorChanges can be animated using AnchorAnimation.
\qml
//animate our anchor changes
- NumberAnimation { targets: content; properties: "x,y,width,height" }
+ AnchorAnimation {}
\endqml
For more information on anchors see \l {anchor-layout}{Anchor Layouts}.
@@ -581,10 +595,10 @@ class QDeclarativeAnchorChangesPrivate : public QObjectPrivate
public:
QDeclarativeAnchorChangesPrivate() : target(0) {}
- QString name;
QDeclarativeItem *target;
QString resetString;
QStringList resetList;
+
QDeclarativeAnchorLine left;
QDeclarativeAnchorLine right;
QDeclarativeAnchorLine horizontalCenter;
@@ -613,6 +627,24 @@ public:
qreal fromY;
qreal fromWidth;
qreal fromHeight;
+
+ qreal toX;
+ qreal toY;
+ qreal toWidth;
+ qreal toHeight;
+
+ qreal rewindX;
+ qreal rewindY;
+ qreal rewindWidth;
+ qreal rewindHeight;
+
+ bool applyOrigLeft;
+ bool applyOrigRight;
+ bool applyOrigHCenter;
+ bool applyOrigTop;
+ bool applyOrigBottom;
+ bool applyOrigVCenter;
+ bool applyOrigBaseline;
};
/*!
@@ -765,6 +797,38 @@ void QDeclarativeAnchorChanges::execute()
if (!d->target)
return;
+ //incorporate any needed "reverts"
+ if (d->applyOrigLeft)
+ d->target->anchors()->setLeft(d->origLeft);
+ if (d->applyOrigRight)
+ d->target->anchors()->setRight(d->origRight);
+ if (d->applyOrigHCenter)
+ d->target->anchors()->setHorizontalCenter(d->origHCenter);
+ if (d->applyOrigTop)
+ d->target->anchors()->setTop(d->origTop);
+ if (d->applyOrigBottom)
+ d->target->anchors()->setBottom(d->origBottom);
+ if (d->applyOrigVCenter)
+ d->target->anchors()->setVerticalCenter(d->origVCenter);
+ if (d->applyOrigBaseline)
+ d->target->anchors()->setBaseline(d->origBaseline);
+
+ //reset any anchors that have been specified
+ if (d->resetList.contains(QLatin1String("left")))
+ d->target->anchors()->resetLeft();
+ if (d->resetList.contains(QLatin1String("right")))
+ d->target->anchors()->resetRight();
+ if (d->resetList.contains(QLatin1String("horizontalCenter")))
+ d->target->anchors()->resetHorizontalCenter();
+ if (d->resetList.contains(QLatin1String("top")))
+ d->target->anchors()->resetTop();
+ if (d->resetList.contains(QLatin1String("bottom")))
+ d->target->anchors()->resetBottom();
+ if (d->resetList.contains(QLatin1String("verticalCenter")))
+ d->target->anchors()->resetVerticalCenter();
+ if (d->resetList.contains(QLatin1String("baseline")))
+ d->target->anchors()->resetBaseline();
+
//set any anchors that have been specified
if (d->left.anchorLine != QDeclarativeAnchorLine::Invalid)
d->target->anchors()->setLeft(d->left);
@@ -793,6 +857,22 @@ void QDeclarativeAnchorChanges::reverse()
if (!d->target)
return;
+ //reset any anchors set by the state
+ if (d->left.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetLeft();
+ if (d->right.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetRight();
+ if (d->horizontalCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetHorizontalCenter();
+ if (d->top.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetTop();
+ if (d->bottom.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetBottom();
+ if (d->verticalCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetVerticalCenter();
+ if (d->baseline.anchorLine != QDeclarativeAnchorLine::Invalid)
+ d->target->anchors()->resetBaseline();
+
//restore previous anchors
if (d->origLeft.anchorLine != QDeclarativeAnchorLine::Invalid)
d->target->anchors()->setLeft(d->origLeft);
@@ -815,31 +895,33 @@ QString QDeclarativeAnchorChanges::typeName() const
return QLatin1String("AnchorChanges");
}
-QList<QDeclarativeAction> QDeclarativeAnchorChanges::extraActions()
+QList<QDeclarativeAction> QDeclarativeAnchorChanges::additionalActions()
{
Q_D(QDeclarativeAnchorChanges);
QList<QDeclarativeAction> extra;
- //### try to be smarter about which ones we add.
- // or short-circuit later on if they haven't actually changed.
- // we shouldn't set explicit width if there wasn't one before.
if (d->target) {
QDeclarativeAction a;
- a.fromValue = d->fromX;
- a.property = QDeclarativeProperty(d->target, QLatin1String("x"));
- extra << a;
-
- a.fromValue = d->fromY;
- a.property = QDeclarativeProperty(d->target, QLatin1String("y"));
- extra << a;
-
- a.fromValue = d->fromWidth;
- a.property = QDeclarativeProperty(d->target, QLatin1String("width"));
- extra << a;
-
- a.fromValue = d->fromHeight;
- a.property = QDeclarativeProperty(d->target, QLatin1String("height"));
- extra << a;
+ if (d->fromX != d->toX) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("x"));
+ a.toValue = d->toX;
+ extra << a;
+ }
+ if (d->fromY != d->toY) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("y"));
+ a.toValue = d->toY;
+ extra << a;
+ }
+ if (d->fromWidth != d->toWidth) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("width"));
+ a.toValue = d->toWidth;
+ extra << a;
+ }
+ if (d->fromHeight != d->toHeight) {
+ a.property = QDeclarativeProperty(d->target, QLatin1String("height"));
+ a.toValue = d->toHeight;
+ extra << a;
+ }
}
return extra;
@@ -861,10 +943,52 @@ void QDeclarativeAnchorChanges::saveOriginals()
d->origVCenter = d->target->anchors()->verticalCenter();
d->origBaseline = d->target->anchors()->baseline();
+ d->applyOrigLeft = d->applyOrigRight = d->applyOrigHCenter = d->applyOrigTop
+ = d->applyOrigBottom = d->applyOrigHCenter = d->applyOrigBaseline = false;
+
+ saveCurrentValues();
+}
+
+void QDeclarativeAnchorChanges::copyOriginals(QDeclarativeActionEvent *other)
+{
+ Q_D(QDeclarativeAnchorChanges);
+ QDeclarativeAnchorChanges *ac = static_cast<QDeclarativeAnchorChanges*>(other);
+ QDeclarativeAnchorChangesPrivate *acp = ac->d_func();
+
+ //probably also need to revert some things
+ d->applyOrigLeft = (acp->left.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("left")));
+
+ d->applyOrigRight = (acp->right.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("right")));
+
+ d->applyOrigHCenter = (acp->horizontalCenter.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("horizontalCenter")));
+
+ d->applyOrigTop = (acp->top.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("top")));
+
+ d->applyOrigBottom = (acp->bottom.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("bottom")));
+
+ d->applyOrigVCenter = (acp->verticalCenter.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("verticalCenter")));
+
+ d->applyOrigBaseline = (acp->baseline.anchorLine != QDeclarativeAnchorLine::Invalid ||
+ acp->resetList.contains(QLatin1String("baseline")));
+
+ d->origLeft = ac->d_func()->origLeft;
+ d->origRight = ac->d_func()->origRight;
+ d->origHCenter = ac->d_func()->origHCenter;
+ d->origTop = ac->d_func()->origTop;
+ d->origBottom = ac->d_func()->origBottom;
+ d->origVCenter = ac->d_func()->origVCenter;
+ d->origBaseline = ac->d_func()->origBaseline;
+
saveCurrentValues();
}
-void QDeclarativeAnchorChanges::clearForwardBindings()
+void QDeclarativeAnchorChanges::clearBindings()
{
Q_D(QDeclarativeAnchorChanges);
d->fromX = d->target->x();
@@ -872,6 +996,22 @@ void QDeclarativeAnchorChanges::clearForwardBindings()
d->fromWidth = d->target->width();
d->fromHeight = d->target->height();
+ //reset any anchors with corresponding reverts
+ if (d->applyOrigLeft)
+ d->target->anchors()->resetLeft();
+ if (d->applyOrigRight)
+ d->target->anchors()->resetRight();
+ if (d->applyOrigHCenter)
+ d->target->anchors()->resetHorizontalCenter();
+ if (d->applyOrigTop)
+ d->target->anchors()->resetTop();
+ if (d->applyOrigBottom)
+ d->target->anchors()->resetBottom();
+ if (d->applyOrigVCenter)
+ d->target->anchors()->resetVerticalCenter();
+ if (d->applyOrigBaseline)
+ d->target->anchors()->resetBaseline();
+
//reset any anchors that have been specified
if (d->resetList.contains(QLatin1String("left")))
d->target->anchors()->resetLeft();
@@ -905,47 +1045,6 @@ void QDeclarativeAnchorChanges::clearForwardBindings()
d->target->anchors()->resetBaseline();
}
-void QDeclarativeAnchorChanges::clearReverseBindings()
-{
- Q_D(QDeclarativeAnchorChanges);
- d->fromX = d->target->x();
- d->fromY = d->target->y();
- d->fromWidth = d->target->width();
- d->fromHeight = d->target->height();
-
- //reset any anchors that were set in the state
- if (d->left.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetLeft();
- if (d->right.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetRight();
- if (d->horizontalCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetHorizontalCenter();
- if (d->top.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetTop();
- if (d->bottom.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetBottom();
- if (d->verticalCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetVerticalCenter();
- if (d->baseline.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetBaseline();
-
- //reset any anchors that were set in the original state
- if (d->origLeft.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetLeft();
- if (d->origRight.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetRight();
- if (d->origHCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetHorizontalCenter();
- if (d->origTop.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetTop();
- if (d->origBottom.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetBottom();
- if (d->origVCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetVerticalCenter();
- if (d->origBaseline.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->resetBaseline();
-}
-
bool QDeclarativeAnchorChanges::override(QDeclarativeActionEvent*other)
{
if (other->typeName() != QLatin1String("AnchorChanges"))
@@ -978,6 +1077,11 @@ void QDeclarativeAnchorChanges::rewind()
d->target->anchors()->setVerticalCenter(d->rewindVCenter);
if (d->rewindBaseline.anchorLine != QDeclarativeAnchorLine::Invalid)
d->target->anchors()->setBaseline(d->rewindBaseline);
+
+ d->target->setX(d->rewindX);
+ d->target->setY(d->rewindY);
+ d->target->setWidth(d->rewindWidth);
+ d->target->setHeight(d->rewindHeight);
}
void QDeclarativeAnchorChanges::saveCurrentValues()
@@ -990,6 +1094,20 @@ void QDeclarativeAnchorChanges::saveCurrentValues()
d->rewindBottom = d->target->anchors()->bottom();
d->rewindVCenter = d->target->anchors()->verticalCenter();
d->rewindBaseline = d->target->anchors()->baseline();
+
+ d->rewindX = d->target->x();
+ d->rewindY = d->target->y();
+ d->rewindWidth = d->target->width();
+ d->rewindHeight = d->target->height();
+}
+
+void QDeclarativeAnchorChanges::saveTargetValues()
+{
+ Q_D(QDeclarativeAnchorChanges);
+ d->toX = d->target->x();
+ d->toY = d->target->y();
+ d->toWidth = d->target->width();
+ d->toHeight = d->target->height();
}
#include <qdeclarativestateoperations.moc>
diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h
index dd4248023..66a8717 100644
--- a/src/declarative/util/qdeclarativestateoperations_p.h
+++ b/src/declarative/util/qdeclarativestateoperations_p.h
@@ -107,6 +107,7 @@ public:
virtual ActionList actions();
virtual void saveOriginals();
+ virtual void copyOriginals(QDeclarativeActionEvent*);
virtual void execute();
virtual bool isReversable();
virtual void reverse();
@@ -196,13 +197,15 @@ public:
virtual void reverse();
virtual QString typeName() const;
virtual bool override(QDeclarativeActionEvent*other);
- virtual QList<QDeclarativeAction> extraActions();
virtual bool changesBindings();
virtual void saveOriginals();
- virtual void clearForwardBindings();
- virtual void clearReverseBindings();
+ virtual void copyOriginals(QDeclarativeActionEvent*);
+ virtual void clearBindings();
virtual void rewind();
virtual void saveCurrentValues();
+
+ QList<QDeclarativeAction> additionalActions();
+ virtual void saveTargetValues();
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp
index e1143fa..f07fb23 100644
--- a/src/declarative/util/qdeclarativetransitionmanager.cpp
+++ b/src/declarative/util/qdeclarativetransitionmanager.cpp
@@ -126,10 +126,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
QDeclarativePropertyPrivate::setBinding(action.property, 0); // Disable current binding
if (action.event && action.event->changesBindings()) { //### assume isReversable()?
d->bindingsList << action;
- if (action.reverseEvent)
- action.event->clearReverseBindings();
- else
- action.event->clearForwardBindings();
+ action.event->clearBindings();
}
}
@@ -144,8 +141,6 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
if (!d->bindingsList.isEmpty()) {
- //### do extra actions here?
-
// Apply all the property and binding changes
for (int ii = 0; ii < applyList.size(); ++ii) {
const QDeclarativeAction &action = applyList.at(ii);
@@ -158,17 +153,18 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
action.event->reverse();
else
action.event->execute();
- applyList << action.event->extraActions();
}
}
// Read all the end values for binding changes
for (int ii = 0; ii < applyList.size(); ++ii) {
QDeclarativeAction *action = &applyList[ii];
- if (action->event)
+ if (action->event) {
+ action->event->saveTargetValues();
continue;
+ }
const QDeclarativeProperty &prop = action->property;
- if (action->toBinding || !action->toValue.isValid()) { //### is this always right (used for exta actions)
+ if (action->toBinding || !action->toValue.isValid()) {
action->toValue = prop.read();
}
}
@@ -177,15 +173,9 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> &
foreach(const QDeclarativeAction &action, applyList) {
if (action.event) {
if (action.event->isReversable()) {
- if (action.reverseEvent) { //reverse the reverse
- action.event->clearForwardBindings();
- action.event->rewind();
- action.event->clearReverseBindings();
- } else {
- action.event->clearReverseBindings();
- action.event->rewind();
- action.event->clearForwardBindings();
- }
+ action.event->clearBindings();
+ action.event->rewind();
+ action.event->clearBindings();
}
continue;
}
diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp
index 65bfdc1..4d4678a 100644
--- a/src/declarative/util/qdeclarativeutilmodule.cpp
+++ b/src/declarative/util/qdeclarativeutilmodule.cpp
@@ -75,44 +75,48 @@
void QDeclarativeUtilModule::defineModule()
{
- QML_REGISTER_TYPE(Qt,4,6,AnchorChanges,QDeclarativeAnchorChanges);
- QML_REGISTER_TYPE(Qt,4,6,Behavior,QDeclarativeBehavior);
- QML_REGISTER_TYPE(Qt,4,6,Binding,QDeclarativeBind);
- QML_REGISTER_TYPE(Qt,4,6,ColorAnimation,QDeclarativeColorAnimation);
- QML_REGISTER_TYPE(Qt,4,6,Connections,QDeclarativeConnections);
- QML_REGISTER_TYPE(Qt,4,6,EaseFollow,QDeclarativeEaseFollow);;
- QML_REGISTER_TYPE(Qt,4,6,FontLoader,QDeclarativeFontLoader);
- QML_REGISTER_TYPE(Qt,4,6,ListElement,QDeclarativeListElement);
- QML_REGISTER_TYPE(Qt,4,6,NumberAnimation,QDeclarativeNumberAnimation);
- QML_REGISTER_TYPE(Qt,4,6,Package,QDeclarativePackage);
- QML_REGISTER_TYPE(Qt,4,6,ParallelAnimation,QDeclarativeParallelAnimation);
- QML_REGISTER_TYPE(Qt,4,6,ParentAction,QDeclarativeParentAction);
- QML_REGISTER_TYPE(Qt,4,6,ParentAnimation,QDeclarativeParentAnimation);
- QML_REGISTER_TYPE(Qt,4,6,ParentChange,QDeclarativeParentChange);
- QML_REGISTER_TYPE(Qt,4,6,PauseAnimation,QDeclarativePauseAnimation);
- QML_REGISTER_TYPE(Qt,4,6,PropertyAction,QDeclarativePropertyAction);
- QML_REGISTER_TYPE(Qt,4,6,PropertyAnimation,QDeclarativePropertyAnimation);
- QML_REGISTER_TYPE(Qt,4,6,RotationAnimation,QDeclarativeRotationAnimation);
- QML_REGISTER_TYPE(Qt,4,6,ScriptAction,QDeclarativeScriptAction);
- QML_REGISTER_TYPE(Qt,4,6,SequentialAnimation,QDeclarativeSequentialAnimation);
- QML_REGISTER_TYPE(Qt,4,6,SpringFollow,QDeclarativeSpringFollow);
- QML_REGISTER_TYPE(Qt,4,6,StateChangeScript,QDeclarativeStateChangeScript);
- QML_REGISTER_TYPE(Qt,4,6,StateGroup,QDeclarativeStateGroup);
- QML_REGISTER_TYPE(Qt,4,6,State,QDeclarativeState);
- QML_REGISTER_TYPE(Qt,4,6,SystemPalette,QDeclarativeSystemPalette);
- QML_REGISTER_TYPE(Qt,4,6,Timer,QDeclarativeTimer);
- QML_REGISTER_TYPE(Qt,4,6,Transition,QDeclarativeTransition);
- QML_REGISTER_TYPE(Qt,4,6,Vector3dAnimation,QDeclarativeVector3dAnimation);
+ qmlRegisterType<QDeclarativeAnchorAnimation>("Qt",4,6,"AnchorAnimation");
+ qmlRegisterType<QDeclarativeAnchorChanges>("Qt",4,6,"AnchorChanges");
+ qmlRegisterType<QDeclarativeBehavior>("Qt",4,6,"Behavior");
+ qmlRegisterType<QDeclarativeBind>("Qt",4,6,"Binding");
+ qmlRegisterType<QDeclarativeColorAnimation>("Qt",4,6,"ColorAnimation");
+ qmlRegisterType<QDeclarativeConnections>("Qt",4,6,"Connections");
+ qmlRegisterType<QDeclarativeEaseFollow>("Qt",4,6,"EaseFollow");
+ qmlRegisterType<QDeclarativeFontLoader>("Qt",4,6,"FontLoader");
+ qmlRegisterType<QDeclarativeListElement>("Qt",4,6,"ListElement");
+ qmlRegisterType<QDeclarativeNumberAnimation>("Qt",4,6,"NumberAnimation");
+ qmlRegisterType<QDeclarativePackage>("Qt",4,6,"Package");
+ qmlRegisterType<QDeclarativeParallelAnimation>("Qt",4,6,"ParallelAnimation");
+ qmlRegisterType<QDeclarativeParentAction>("Qt",4,6,"ParentAction");
+ qmlRegisterType<QDeclarativeParentAnimation>("Qt",4,6,"ParentAnimation");
+ qmlRegisterType<QDeclarativeParentChange>("Qt",4,6,"ParentChange");
+ qmlRegisterType<QDeclarativePauseAnimation>("Qt",4,6,"PauseAnimation");
+ qmlRegisterType<QDeclarativePropertyAction>("Qt",4,6,"PropertyAction");
+ qmlRegisterType<QDeclarativePropertyAnimation>("Qt",4,6,"PropertyAnimation");
+ qmlRegisterType<QDeclarativeRotationAnimation>("Qt",4,6,"RotationAnimation");
+ qmlRegisterType<QDeclarativeScriptAction>("Qt",4,6,"ScriptAction");
+ qmlRegisterType<QDeclarativeSequentialAnimation>("Qt",4,6,"SequentialAnimation");
+ qmlRegisterType<QDeclarativeSpringFollow>("Qt",4,6,"SpringFollow");
+ qmlRegisterType<QDeclarativeStateChangeScript>("Qt",4,6,"StateChangeScript");
+ qmlRegisterType<QDeclarativeStateGroup>("Qt",4,6,"StateGroup");
+ qmlRegisterType<QDeclarativeState>("Qt",4,6,"State");
+ qmlRegisterType<QDeclarativeSystemPalette>("Qt",4,6,"SystemPalette");
+ qmlRegisterType<QDeclarativeTimer>("Qt",4,6,"Timer");
+ qmlRegisterType<QDeclarativeTransition>("Qt",4,6,"Transition");
+ qmlRegisterType<QDeclarativeVector3dAnimation>("Qt",4,6,"Vector3dAnimation");
#ifndef QT_NO_XMLPATTERNS
- QML_REGISTER_TYPE(Qt,4,6,XmlListModel,QDeclarativeXmlListModel);
- QML_REGISTER_TYPE(Qt,4,6,XmlRole,QDeclarativeXmlListModelRole);
+ qmlRegisterType<QDeclarativeXmlListModel>("Qt",4,6,"XmlListModel");
+ qmlRegisterType<QDeclarativeXmlListModelRole>("Qt",4,6,"XmlRole");
#endif
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeAnchors);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeAbstractAnimation);
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeStateOperation);
+ qmlRegisterType<QDeclarativeAnchors>();
+ qmlRegisterType<QDeclarativeAbstractAnimation>();
+ qmlRegisterType<QDeclarativeStateOperation>();
- QML_REGISTER_CUSTOM_TYPE(Qt, 4,6, ListModel, QDeclarativeListModel, QDeclarativeListModelParser);
- QML_REGISTER_CUSTOM_TYPE(Qt, 4,6, PropertyChanges, QDeclarativePropertyChanges, QDeclarativePropertyChangesParser);
- QML_REGISTER_CUSTOM_TYPE(Qt, 4,6, Connections, QDeclarativeConnections, QDeclarativeConnectionsParser);
+ qmlRegisterCustomType<QDeclarativeListModel>("Qt", 4,6, "ListModel", "QDeclarativeListModel",
+ new QDeclarativeListModelParser);
+ qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 6, "PropertyChanges", "QDeclarativePropertyChanges",
+ new QDeclarativePropertyChangesParser);
+ qmlRegisterCustomType<QDeclarativeConnections>("Qt", 4, 6, "Connections", "QDeclarativeConnections",
+ new QDeclarativeConnectionsParser);
}
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index cd67aeb..486553a 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -221,7 +221,7 @@ void QDeclarativeViewPrivate::execute()
*/
/*! \fn void QDeclarativeView::statusChanged(QDeclarativeView::Status status)
- This signal is emitted when the component's current \l{QDeclarativeView::Status} {status} changes.
+ This signal is emitted when the component's current \a status changes.
*/
/*!
@@ -283,6 +283,12 @@ QDeclarativeView::~QDeclarativeView()
delete d->root;
}
+/*! \property QDeclarativeView::source
+ \brief The URL of the source of the QML component.
+
+ Changing this property causes the QML component to be reloaded.
+ */
+
/*!
Sets the source to the \a url, loads the QML component and instantiates it.
@@ -326,7 +332,6 @@ QDeclarativeContext* QDeclarativeView::rootContext()
return d->engine.rootContext();
}
-
/*!
\enum QDeclarativeView::Status
@@ -338,6 +343,14 @@ QDeclarativeContext* QDeclarativeView::rootContext()
\value Error An error has occured. Calling errorDescription() to retrieve a description.
*/
+/*! \enum QDeclarativeView::ResizeMode
+
+ This enum specifies how to resize the view.
+
+ \value SizeViewToRootObject
+ \value SizeRootObjectToView
+*/
+
/*!
\property QDeclarativeView::status
The component's current \l{QDeclarativeView::Status} {status}.
@@ -376,8 +389,6 @@ QList<QDeclarativeError> QDeclarativeView::errors() const
Regardless of this property, the sizeHint of the view
is the initial size of the root item. Note though that
since QML may load dynamically, that size may change.
-
- \sa initialSize()
*/
void QDeclarativeView::setResizeMode(ResizeMode mode)
@@ -447,8 +458,8 @@ void QDeclarativeView::setRootObject(QObject *obj)
QPerformanceLog::clear();
d->root = item;
d->qmlRoot = item;
- connect(item, SIGNAL(widthChanged()), this, SLOT(sizeChanged()));
- connect(item, SIGNAL(heightChanged()), this, SLOT(sizeChanged()));
+ connect(item, SIGNAL(widthChanged(qreal)), this, SLOT(sizeChanged()));
+ connect(item, SIGNAL(heightChanged(qreal)), this, SLOT(sizeChanged()));
if (d->initialSize.height() <= 0 && d->qmlRoot->width() > 0)
d->initialSize.setWidth(d->qmlRoot->width());
if (d->initialSize.height() <= 0 && d->qmlRoot->height() > 0)
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 49dbb27..01ae2ed 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -61,6 +61,9 @@
QT_BEGIN_NAMESPACE
+
+
+
typedef QPair<int, int> QDeclarativeXmlListRange;
/*!
@@ -111,6 +114,9 @@ class QDeclarativeXmlQuery : public QThread
{
Q_OBJECT
public:
+ QDeclarativeXmlQuery(QObject *parent=0)
+ : QThread(parent), m_quit(false), m_restart(false), m_abort(false), m_queryId(0) {
+ }
~QDeclarativeXmlQuery() {
m_mutex.lock();
m_quit = true;
@@ -120,11 +126,6 @@ public:
wait();
}
- static QDeclarativeXmlQuery *instance() {
- static QDeclarativeXmlQuery *query = new QDeclarativeXmlQuery;
- return query;
- }
-
void abort() {
QMutexLocker locker(&m_mutex);
m_abort = true;
@@ -163,11 +164,6 @@ public:
return m_removedItemRanges;
}
-private:
- QDeclarativeXmlQuery(QObject *parent=0)
- : QThread(parent), m_quit(false), m_restart(false), m_abort(false), m_queryId(0) {
- }
-
Q_SIGNALS:
void queryCompleted(int queryId, int size);
@@ -217,8 +213,6 @@ private:
QList<QDeclarativeXmlListRange> m_removedItemRanges;
};
-//Q_GLOBAL_STATIC(QDeclarativeXmlQuery, QDeclarativeXmlQuery::instance());
-
void QDeclarativeXmlQuery::doQueryJob()
{
QString r;
@@ -396,7 +390,7 @@ public:
QDeclarativeXmlListModelPrivate()
: isComponentComplete(true), size(-1), highestRole(Qt::UserRole)
, reply(0), status(QDeclarativeXmlListModel::Null), progress(0.0)
- , queryId(-1), roleObjects() {}
+ , queryId(-1), roleObjects(), redirectCount(0) {}
bool isComponentComplete;
QUrl src;
@@ -410,6 +404,7 @@ public:
QNetworkReply *reply;
QDeclarativeXmlListModel::Status status;
qreal progress;
+ QDeclarativeXmlQuery qmlXmlQuery;
int queryId;
QList<QDeclarativeXmlListModelRole *> roleObjects;
static void append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role);
@@ -417,6 +412,7 @@ public:
static void removeAt_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, int i);
static void insert_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, int i, QDeclarativeXmlListModelRole *role);
QList<QList<QVariant> > data;
+ int redirectCount;
};
@@ -493,7 +489,8 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
: QListModelInterface(*(new QDeclarativeXmlListModelPrivate), parent)
{
- connect(QDeclarativeXmlQuery::instance(), SIGNAL(queryCompleted(int,int)),
+ Q_D(QDeclarativeXmlListModel);
+ connect(&d->qmlXmlQuery, SIGNAL(queryCompleted(int,int)),
this, SLOT(queryCompleted(int,int)));
}
@@ -575,8 +572,8 @@ void QDeclarativeXmlListModel::setSource(const QUrl &src)
{
Q_D(QDeclarativeXmlListModel);
if (d->src != src) {
- reload();
d->src = src;
+ reload();
emit sourceChanged();
}
}
@@ -726,7 +723,7 @@ void QDeclarativeXmlListModel::reload()
if (!d->isComponentComplete)
return;
- QDeclarativeXmlQuery::instance()->abort();
+ d->qmlXmlQuery.abort();
d->queryId = -1;
int count = d->size;
@@ -758,7 +755,7 @@ void QDeclarativeXmlListModel::reload()
}
if (!d->xml.isEmpty()) {
- d->queryId = QDeclarativeXmlQuery::instance()->doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects);
+ d->queryId = d->qmlXmlQuery.doQuery(d->query, d->namespaces, d->xml.toUtf8(), &d->roleObjects);
d->progress = 1.0;
d->status = Ready;
emit progressChanged(d->progress);
@@ -778,9 +775,25 @@ void QDeclarativeXmlListModel::reload()
this, SLOT(requestProgress(qint64,qint64)));
}
+#define XMLLISTMODEL_MAX_REDIRECT 16
+
void QDeclarativeXmlListModel::requestFinished()
{
Q_D(QDeclarativeXmlListModel);
+
+ d->redirectCount++;
+ if (d->redirectCount < XMLLISTMODEL_MAX_REDIRECT) {
+ QVariant redirect = d->reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ QUrl url = d->reply->url().resolved(redirect.toUrl());
+ d->reply->deleteLater();
+ d->reply = 0;
+ setSource(url);
+ return;
+ }
+ }
+ d->redirectCount = 0;
+
if (d->reply->error() != QNetworkReply::NoError) {
disconnect(d->reply, 0, this, 0);
d->reply->deleteLater();
@@ -789,7 +802,7 @@ void QDeclarativeXmlListModel::requestFinished()
} else {
d->status = Ready;
QByteArray data = d->reply->readAll();
- d->queryId = QDeclarativeXmlQuery::instance()->doQuery(d->query, d->namespaces, data, &d->roleObjects);
+ d->queryId = d->qmlXmlQuery.doQuery(d->query, d->namespaces, data, &d->roleObjects);
disconnect(d->reply, 0, this, 0);
d->reply->deleteLater();
d->reply = 0;
@@ -815,10 +828,10 @@ void QDeclarativeXmlListModel::queryCompleted(int id, int size)
return;
bool sizeChanged = size != d->size;
d->size = size;
- d->data = QDeclarativeXmlQuery::instance()->modelData();
+ d->data = d->qmlXmlQuery.modelData();
- QList<QDeclarativeXmlListRange> removed = QDeclarativeXmlQuery::instance()->removedItemRanges();
- QList<QDeclarativeXmlListRange> inserted = QDeclarativeXmlQuery::instance()->insertedItemRanges();
+ QList<QDeclarativeXmlListRange> removed = d->qmlXmlQuery.removedItemRanges();
+ QList<QDeclarativeXmlListRange> inserted = d->qmlXmlQuery.insertedItemRanges();
for (int i=0; i<removed.count(); i++)
emit itemsRemoved(removed[i].first, removed[i].second);
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 2d75913..4faa193 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -415,8 +415,15 @@ bool QDialog::event(QEvent *e)
result = true;
}
#else
- if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize ))
- adjustPosition(parentWidget());
+ if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) {
+ if (!testAttribute(Qt::WA_Moved)) {
+ Qt::WindowStates state = windowState();
+ adjustPosition(parentWidget());
+ setAttribute(Qt::WA_Moved, false); // not really an explicit position
+ if (state != windowState())
+ setWindowState(state);
+ }
+ }
#endif
return result;
}
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 67daced..14a5f15 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -295,10 +295,14 @@ QT_USE_NAMESPACE
if (!mQDirFilterEntryList->contains(info.fileName()))
return NO;
- // Always accept directories regardless of their names:
+ // Always accept directories regardless of their names (unless it is a bundle):
BOOL isDir;
- if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir)
- return YES;
+ if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir) {
+ if ([mSavePanel treatsFilePackagesAsDirectories] == NO) {
+ if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename] == NO)
+ return YES;
+ }
+ }
// No filter means accept everything
if (mSelectedNameFilter->isEmpty())
@@ -725,6 +729,7 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
NavFileOrFolderInfo *theInfo = static_cast<NavFileOrFolderInfo *>(info);
QString file;
+ QString path;
const QtMacFilterName &fn
= fileDialogPrivate->filterInfo.filters.at(fileDialogPrivate->filterInfo.currentSelection);
if (theItem->descriptorType == typeFSRef) {
@@ -732,10 +737,12 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
AEGetDescData(theItem, &ref, sizeof(ref));
UInt8 str_buffer[1024];
FSRefMakePath(&ref, str_buffer, 1024);
- file = QString::fromUtf8(reinterpret_cast<const char *>(str_buffer));
- int slsh = file.lastIndexOf(QLatin1Char('/'));
+ path = QString::fromUtf8(reinterpret_cast<const char *>(str_buffer));
+ int slsh = path.lastIndexOf(QLatin1Char('/'));
if (slsh != -1)
- file = file.right(file.length() - slsh - 1);
+ file = path.right(path.length() - slsh - 1);
+ else
+ file = path;
}
QStringList reg = fn.regexp.split(QLatin1String(";"));
for (QStringList::const_iterator it = reg.constBegin(); it != reg.constEnd(); ++it) {
@@ -747,7 +754,13 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
if (rg.exactMatch(file))
return true;
}
- return (theInfo->isFolder && !file.endsWith(QLatin1String(".app")));
+
+ if (theInfo->isFolder) {
+ if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:qt_mac_QStringToNSString(path)])
+ return false;
+ return true;
+ }
+ return false;
}
void QFileDialogPrivate::qt_mac_filedialog_event_proc(const NavEventCallbackMessage msg,
diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h
index 44b7e43..7079925 100644
--- a/src/gui/dialogs/qfiledialog_win_p.h
+++ b/src/gui/dialogs/qfiledialog_win_p.h
@@ -82,7 +82,7 @@ typedef int GETPROPERTYSTOREFLAGS;
#define GPS_BESTEFFORT 0x00000040
#define GPS_MASK_VALID 0x0000007F
-typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
+typedef int (QT_WIN_CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
// message from browser
#define BFFM_INITIALIZED 1
#define BFFM_SELCHANGED 2
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index b987611..b159fa7 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -174,6 +174,11 @@ void QFontDialogPrivate::init()
{
Q_Q(QFontDialog);
+#ifdef Q_WS_MAC
+ nativeDialogInUse = false;
+ delegate = 0;
+#endif
+
q->setSizeGripEnabled(true);
q->setWindowTitle(QFontDialog::tr("Select Font"));
@@ -329,10 +334,6 @@ void QFontDialogPrivate::init()
familyList->setFocus();
retranslateStrings();
-
-#ifdef Q_WS_MAC
- delegate = 0;
-#endif
}
/*!
@@ -345,8 +346,7 @@ QFontDialog::~QFontDialog()
#ifdef Q_WS_MAC
Q_D(QFontDialog);
if (d->delegate) {
- QFontDialogPrivate::closeCocoaFontPanel(d->delegate);
- QFontDialogPrivate::sharedFontPanelAvailable = true;
+ d->closeCocoaFontPanel();
return;
}
#endif
@@ -428,14 +428,6 @@ QFont QFontDialog::getFont(bool *ok, QWidget *parent)
QFont QFontDialogPrivate::getFont(bool *ok, const QFont &initial, QWidget *parent,
const QString &title, QFontDialog::FontDialogOptions options)
{
-#ifdef Q_WS_MAC
- if (!(options & QFontDialog::DontUseNativeDialog)
- && QFontDialogPrivate::sharedFontPanelAvailable) {
- return QFontDialogPrivate::execCocoaFontPanel(ok, initial, parent,
- title.isEmpty() ? QFontDialog::tr("Select Font") : title, options);
- }
-#endif
-
QFontDialog dlg(parent);
dlg.setOptions(options);
dlg.setCurrentFont(initial);
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 67d32b8..919790b 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -58,6 +58,14 @@
typedef float CGFloat; // Should only not be defined on 32-bit platforms
#endif
+QT_BEGIN_NAMESPACE
+
+extern void macStartInterceptNSPanelCtor();
+extern void macStopInterceptNSPanelCtor();
+extern NSButton *macCreateButton(const char *text, NSView *superview);
+extern bool qt_mac_is_macsheet(const QWidget *w); // qwidget_mac.mm
+
+QT_END_NAMESPACE
QT_USE_NAMESPACE
// should a priori be kept in sync with qcolordialog_mac.mm
@@ -95,7 +103,8 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
BOOL mPanelHackedWithButtons;
CGFloat mDialogExtraWidth;
CGFloat mDialogExtraHeight;
- NSModalSession mModalSession;
+ int mReturnCode;
+ BOOL mAppModal;
}
- (id)initWithFontPanel:(NSFontPanel *)panel
stolenContentView:(NSView *)stolenContentView
@@ -104,9 +113,11 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
priv:(QFontDialogPrivate *)priv
extraWidth:(CGFloat)extraWidth
extraHeight:(CGFloat)extraHeight;
+- (void)showModelessPanel;
+- (void)showWindowModalSheet:(QWidget *)docWidget;
+- (void)runApplicationModalPanel;
- (void)changeFont:(id)sender;
- (void)changeAttributes:(id)sender;
-- (void)setModalSession:(NSModalSession)session;
- (BOOL)windowShouldClose:(id)window;
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
- (void)relayout;
@@ -163,7 +174,8 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
mPanelHackedWithButtons = (okButton != 0);
mDialogExtraWidth = extraWidth;
mDialogExtraHeight = extraHeight;
- mModalSession = 0;
+ mReturnCode = -1;
+ mAppModal = false;
if (mPanelHackedWithButtons) {
[self relayout];
@@ -174,6 +186,20 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
[cancelButton setAction:@selector(onCancelClicked)];
[cancelButton setTarget:self];
}
+
+#ifdef QT_MAC_USE_COCOA
+ // Stack the native dialog in front of its parent, if any:
+ QFontDialog *q = mPriv->fontDialog();
+ if (!qt_mac_is_macsheet(q)) {
+ if (QWidget *parent = q->parentWidget()) {
+ if (parent->isWindow()) {
+ [qt_mac_window_for(parent)
+ addChildWindow:[mStolenContentView window] ordered:NSWindowAbove];
+ }
+ }
+ }
+#endif
+
mQtFont = new QFont();
return self;
}
@@ -184,6 +210,50 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
[super dealloc];
}
+- (void)showModelessPanel
+{
+ mAppModal = false;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [ourPanel makeKeyAndOrderFront:self];
+}
+
+- (void)runApplicationModalPanel
+{
+ QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
+ mAppModal = true;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [NSApp runModalForWindow:ourPanel];
+ QAbstractEventDispatcher::instance()->interrupt();
+
+ if (mReturnCode == NSOKButton)
+ mPriv->fontDialog()->accept();
+ else
+ mPriv->fontDialog()->reject();
+}
+
+- (void)showWindowModalSheet:(QWidget *)docWidget
+{
+#ifdef QT_MAC_USE_COCOA
+ NSWindow *window = qt_mac_window_for(docWidget);
+#else
+ WindowRef hiwindowRef = qt_mac_window_for(docWidget);
+ NSWindow *window = [[NSWindow alloc] initWithWindowRef:hiwindowRef];
+ CFRetain(hiwindowRef);
+#endif
+
+ mAppModal = false;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [NSApp beginSheet:ourPanel
+ modalForWindow:window
+ modalDelegate:0
+ didEndSelector:0
+ contextInfo:0 ];
+
+#ifndef QT_MAC_USE_COCOA
+ CFRelease(hiwindowRef);
+#endif
+}
+
- (void)changeFont:(id)sender
{
NSFont *dummyFont = [NSFont userFontOfSize:12.0];
@@ -216,12 +286,6 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
mPriv->updateSampleFont(*mQtFont);
}
-- (void)setModalSession:(NSModalSession)session
-{
- Q_ASSERT(!mModalSession);
- mModalSession = session;
-}
-
- (BOOL)windowShouldClose:(id)window
{
Q_UNUSED(window);
@@ -282,9 +346,8 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
NSSize cancelSizeHint = [mCancelButton frame].size;
const CGFloat ButtonWidth = qMin(qMax(ButtonMinWidth,
- qMax(okSizeHint.width, cancelSizeHint.width)),
- CGFloat((frameSize.width - 2.0 * ButtonSideMargin
- - ButtonSpacing) * 0.5));
+ qMax(okSizeHint.width, cancelSizeHint.width)),
+ CGFloat((frameSize.width - 2.0 * ButtonSideMargin - ButtonSpacing) * 0.5));
const CGFloat ButtonHeight = qMax(ButtonMinHeight,
qMax(okSizeHint.height, cancelSizeHint.height));
@@ -317,14 +380,12 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
NSFontManager *fontManager = [NSFontManager sharedFontManager];
[self setQtFont:qfontForCocoaFont([fontManager convertFont:[fontManager selectedFont]],
*mQtFont)];
- [[mStolenContentView window] close];
[self finishOffWithCode:NSOKButton];
}
- (void)onCancelClicked
{
Q_ASSERT(mPanelHackedWithButtons);
- [[mStolenContentView window] close];
[self finishOffWithCode:NSCancelButton];
}
@@ -368,20 +429,26 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
- (void)finishOffWithCode:(NSInteger)code
{
- if (mPriv) {
- if (mModalSession) {
- [NSApp endModalSession:mModalSession];
- mModalSession = 0;
+#ifdef QT_MAC_USE_COCOA
+ QFontDialog *q = mPriv->fontDialog();
+ if (QWidget *parent = q->parentWidget()) {
+ if (parent->isWindow()) {
+ [qt_mac_window_for(parent) removeChildWindow:[mStolenContentView window]];
}
- // Hack alert!
- // Since this code path was never intended to be followed when starting from exec
- // we need to force the dialog to communicate the new font, otherwise the signal
- // won't get emitted.
- if(code == NSOKButton)
- mPriv->sampleEdit->setFont([self qtFont]);
- mPriv->done((code == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
- } else {
+ }
+#endif
+
+ if(code == NSOKButton)
+ mPriv->sampleEdit->setFont([self qtFont]);
+
+ if (mAppModal) {
+ mReturnCode = code;
[NSApp stopModalWithCode:code];
+ } else {
+ if (code == NSOKButton)
+ mPriv->fontDialog()->accept();
+ else
+ mPriv->fontDialog()->reject();
}
}
@@ -408,206 +475,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QT_BEGIN_NAMESPACE
-extern void macStartInterceptNSPanelCtor();
-extern void macStopInterceptNSPanelCtor();
-extern NSButton *macCreateButton(const char *text, NSView *superview);
-
-void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial,
- QWidget *parent, const QString &title, QFontDialog::FontDialogOptions options,
- QFontDialogPrivate *priv)
-{
- Q_UNUSED(parent); // we would use the parent if only NSFontPanel could be a sheet
- QMacCocoaAutoReleasePool pool;
-
- /*
- The standard Cocoa font panel has no OK or Cancel button and
- is created as a utility window. For strange reasons (which seem
- to stem from the fact that the font panel is based on a NIB
- file), the approach we use for the color panel doesn't work for
- the font panel (and, inversely, the approach we use here doesn't
- quite work for color panel, and crashed last time I tried). So
- instead, we take the following steps:
-
- 1. Constructs a plain NSPanel that looks the way we want it
- to look. Specifically, if the NoButtons option is off, we
- construct a panel without the NSUtilityWindowMask flag
- and with buttons (OK and Cancel).
-
- 2. Steal the content view from the shared NSFontPanel and
- put it inside our new NSPanel's content view, together
- with the OK and Cancel buttons.
-
- 3. Lay out the original content view and the buttons when
- the font panel is shown and whenever it is resized.
-
- 4. Clean up after ourselves.
-
- PS. Some customization is also done in QCocoaApplication
- validModesForFontPanel:.
- */
-
- Qt::WindowModality modality = Qt::ApplicationModal;
- if (priv)
- modality = priv->fontDialog()->windowModality();
-
- bool needButtons = !(options & QFontDialog::NoButtons);
- // don't need our own panel if the title bar isn't visible anyway (in a sheet)
- bool needOwnPanel = (needButtons && modality != Qt::WindowModal);
-
- bool sharedFontPanelExisted = [NSFontPanel sharedFontPanelExists];
- NSFontPanel *sharedFontPanel = [NSFontPanel sharedFontPanel];
- [sharedFontPanel setHidesOnDeactivate:false];
-
- // hack to ensure that QCocoaApplication's validModesForFontPanel:
- // implementation is honored
- if (!sharedFontPanelExisted && needOwnPanel) {
- [sharedFontPanel makeKeyAndOrderFront:sharedFontPanel];
- [sharedFontPanel close];
- }
-
- NSPanel *ourPanel = 0;
- NSView *stolenContentView = 0;
- NSButton *okButton = 0;
- NSButton *cancelButton = 0;
-
- CGFloat dialogExtraWidth = 0.0;
- CGFloat dialogExtraHeight = 0.0;
-
- if (!needOwnPanel) {
- // we can reuse the NSFontPanel unchanged
- ourPanel = sharedFontPanel;
- } else {
- // compute dialogExtra{Width,Height}
- dialogExtraWidth = 2.0 * DialogSideMargin;
- dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight
- + ButtonBottomMargin;
-
- // compute initial contents rectangle
- NSRect contentRect = [sharedFontPanel contentRectForFrameRect:[sharedFontPanel frame]];
- contentRect.size.width += dialogExtraWidth;
- contentRect.size.height += dialogExtraHeight;
-
- // create the new panel
- ourPanel = [[NSPanel alloc] initWithContentRect:contentRect
- styleMask:StyleMask
- backing:NSBackingStoreBuffered
- defer:YES];
- [ourPanel setReleasedWhenClosed:YES];
- }
-
- stolenContentView = [sharedFontPanel contentView];
-
- if (needButtons) {
- // steal the font panel's contents view
- [stolenContentView retain];
- [sharedFontPanel setContentView:0];
-
- // create a new content view and add the stolen one as a subview
- NSRect frameRect = { { 0.0, 0.0 }, { 0.0, 0.0 } };
- NSView *ourContentView = [[NSView alloc] initWithFrame:frameRect];
- [ourContentView addSubview:stolenContentView];
-
- // create OK and Cancel buttons and add these as subviews
- okButton = macCreateButton("&OK", ourContentView);
- cancelButton = macCreateButton("Cancel", ourContentView);
-
- [ourPanel setContentView:ourContentView];
- [ourPanel setDefaultButtonCell:[okButton cell]];
- }
-
- // create a delegate and set it
- QCocoaFontPanelDelegate *delegate =
- [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
- stolenContentView:stolenContentView
- okButton:okButton
- cancelButton:cancelButton
- priv:priv
- extraWidth:dialogExtraWidth
- extraHeight:dialogExtraHeight];
- [ourPanel setDelegate:delegate];
- [[NSFontManager sharedFontManager] setDelegate:delegate];
-#ifdef QT_MAC_USE_COCOA
- [[NSFontManager sharedFontManager] setTarget:delegate];
-#endif
- setFont(delegate, initial);
-
- // hack to get correct initial layout
- NSRect frameRect = [ourPanel frame];
- frameRect.size.width += 1.0;
- [ourPanel setFrame:frameRect display:NO];
- frameRect.size.width -= 1.0;
- frameRect.size = [delegate windowWillResize:ourPanel toSize:frameRect.size];
- [ourPanel setFrame:frameRect display:NO];
- [ourPanel center];
-
- [ourPanel setTitle:(NSString*)(CFStringRef)QCFString(title)];
-
- if (priv) {
- switch (modality) {
- case Qt::WindowModal:
- if (parent) {
-#ifndef QT_MAC_USE_COCOA
- WindowRef hiwindowRef = qt_mac_window_for(parent);
- NSWindow *window =
- [[NSWindow alloc] initWithWindowRef:hiwindowRef];
- // Cocoa docs say I should retain the Carbon ref.
- CFRetain(hiwindowRef);
-#else
- NSWindow *window = qt_mac_window_for(parent);
-#endif
- [NSApp beginSheet:ourPanel
- modalForWindow:window
- modalDelegate:0
- didEndSelector:0
- contextInfo:0];
-#ifndef QT_MAC_USE_COCOA
- [window release];
-#endif
- break;
- }
- // fallthrough
- case Qt::ApplicationModal:
- [delegate setModalSession:[NSApp beginModalSessionForWindow:ourPanel]];
- break;
- default:
- [ourPanel makeKeyAndOrderFront:ourPanel];
- }
- }
- return delegate;
-}
-
-void QFontDialogPrivate::closeCocoaFontPanel(void *delegate)
+void QFontDialogPrivate::closeCocoaFontPanel()
{
QMacCocoaAutoReleasePool pool;
QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
[theDelegate cleanUpAfterMyself];
- [theDelegate autorelease];
-}
-
-QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial,
- QWidget *parent, const QString &title, QFontDialog::FontDialogOptions options)
-{
- QMacCocoaAutoReleasePool pool;
- QCocoaFontPanelDelegate *delegate =
- static_cast<QCocoaFontPanelDelegate *>(
- openCocoaFontPanel(initial, parent, title, options));
- NSWindow *ourPanel = [delegate actualPanel];
- [ourPanel retain];
- int rval = [NSApp runModalForWindow:ourPanel];
- QFont font([delegate qtFont]);
- [ourPanel release];
- [delegate cleanUpAfterMyself];
- [delegate release];
- bool isOk = ((options & QFontDialog::NoButtons) || rval == NSOKButton);
- if (ok)
- *ok = isOk;
- if (isOk) {
- return font;
- } else {
- return initial;
- }
+ [theDelegate release];
+ this->delegate = 0;
+ sharedFontPanelAvailable = true;
}
void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
@@ -645,10 +522,13 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
[static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
}
-void *QFontDialogPrivate::_q_constructNativePanel()
+void QFontDialogPrivate::createNSFontPanelDelegate()
{
- QMacCocoaAutoReleasePool pool;
+ if (delegate)
+ return;
+ sharedFontPanelAvailable = false;
+ QMacCocoaAutoReleasePool pool;
bool sharedFontPanelExisted = [NSFontPanel sharedFontPanelExists];
NSFontPanel *sharedFontPanel = [NSFontPanel sharedFontPanel];
[sharedFontPanel setHidesOnDeactivate:false];
@@ -670,8 +550,7 @@ void *QFontDialogPrivate::_q_constructNativePanel()
// compute dialogExtra{Width,Height}
dialogExtraWidth = 2.0 * DialogSideMargin;
- dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight
- + ButtonBottomMargin;
+ dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight + ButtonBottomMargin;
// compute initial contents rectangle
NSRect contentRect = [sharedFontPanel contentRectForFrameRect:[sharedFontPanel frame]];
@@ -684,7 +563,6 @@ void *QFontDialogPrivate::_q_constructNativePanel()
backing:NSBackingStoreBuffered
defer:YES];
[ourPanel setReleasedWhenClosed:YES];
-
stolenContentView = [sharedFontPanel contentView];
// steal the font panel's contents view
@@ -704,21 +582,23 @@ void *QFontDialogPrivate::_q_constructNativePanel()
[ourPanel setContentView:ourContentView];
[ourPanel setDefaultButtonCell:[okButton cell]];
}
- // create a delegate and set it
- QCocoaFontPanelDelegate *delegate =
- [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
+
+ // create the delegate and set it
+ QCocoaFontPanelDelegate *del = [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
stolenContentView:stolenContentView
okButton:okButton
cancelButton:cancelButton
priv:this
extraWidth:dialogExtraWidth
extraHeight:dialogExtraHeight];
- [ourPanel setDelegate:delegate];
- [[NSFontManager sharedFontManager] setDelegate:delegate];
+ delegate = del;
+ [ourPanel setDelegate:del];
+
+ [[NSFontManager sharedFontManager] setDelegate:del];
#ifdef QT_MAC_USE_COCOA
- [[NSFontManager sharedFontManager] setTarget:delegate];
+ [[NSFontManager sharedFontManager] setTarget:del];
#endif
- setFont(delegate, QApplication::font());
+ setFont(del, q_func()->currentFont());
{
// hack to get correct initial layout
@@ -726,15 +606,12 @@ void *QFontDialogPrivate::_q_constructNativePanel()
frameRect.size.width += 1.0;
[ourPanel setFrame:frameRect display:NO];
frameRect.size.width -= 1.0;
- frameRect.size = [delegate windowWillResize:ourPanel toSize:frameRect.size];
+ frameRect.size = [del windowWillResize:ourPanel toSize:frameRect.size];
[ourPanel setFrame:frameRect display:NO];
[ourPanel center];
}
NSString *title = @"Select font";
[ourPanel setTitle:title];
-
- [delegate setModalSession:[NSApp beginModalSessionForWindow:ourPanel]];
- return delegate;
}
void QFontDialogPrivate::mac_nativeDialogModalHelp()
@@ -759,29 +636,47 @@ void QFontDialogPrivate::mac_nativeDialogModalHelp()
// and "adding" the buttons.
void QFontDialogPrivate::_q_macRunNativeAppModalPanel()
{
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
+ createNSFontPanelDelegate();
+ QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ [del runApplicationModalPanel];
+}
+
+bool QFontDialogPrivate::showCocoaFontPanel()
+{
+ if (!sharedFontPanelAvailable)
+ return false;
+
Q_Q(QFontDialog);
- QCocoaFontPanelDelegate *delegate = (QCocoaFontPanelDelegate *)_q_constructNativePanel();
- NSWindow *ourPanel = [delegate actualPanel];
- [ourPanel retain];
- int rval = [NSApp runModalForWindow:ourPanel];
- QAbstractEventDispatcher::instance()->interrupt();
- [ourPanel release];
- [delegate cleanUpAfterMyself];
- [delegate release];
- bool isOk = (rval == NSOKButton);
- if(isOk)
- rescode = QDialog::Accepted;
+ QMacCocoaAutoReleasePool pool;
+ createNSFontPanelDelegate();
+ QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ if (qt_mac_is_macsheet(q))
+ [del showWindowModalSheet:q->parentWidget()];
else
- rescode = QDialog::Rejected;
+ [del showModelessPanel];
+ return true;
}
+bool QFontDialogPrivate::hideCocoaFontPanel()
+{
+ if (!delegate){
+ // Nothing to do. We return false to leave the question
+ // open regarding whether or not to go native:
+ return false;
+ } else {
+ closeCocoaFontPanel();
+ // Even when we hide it, we are still using a
+ // native dialog, so return true:
+ return true;
+ }
+}
bool QFontDialogPrivate::setVisible_sys(bool visible)
{
Q_Q(QFontDialog);
if (!visible == q->isHidden())
return false;
- return visible;
+
+ return visible ? showCocoaFontPanel() : hideCocoaFontPanel();
}
QT_END_NAMESPACE
diff --git a/src/gui/dialogs/qfontdialog_p.h b/src/gui/dialogs/qfontdialog_p.h
index 7654a80..8676be3 100644
--- a/src/gui/dialogs/qfontdialog_p.h
+++ b/src/gui/dialogs/qfontdialog_p.h
@@ -139,25 +139,21 @@ public:
QByteArray memberToDisconnectOnClose;
#ifdef Q_WS_MAC
- static void *openCocoaFontPanel(const QFont &initial,
- QWidget *parent, const QString &title,
- QFontDialog::FontDialogOptions options,
- QFontDialogPrivate *priv = 0);
- static void closeCocoaFontPanel(void *delegate);
- static QFont execCocoaFontPanel(bool *ok, const QFont &initial, QWidget *parent,
- const QString &title, QFontDialog::FontDialogOptions options);
static void setFont(void *delegate, const QFont &font);
inline void done(int result) { q_func()->done(result); }
inline QFontDialog *fontDialog() { return q_func(); }
void *delegate;
+ void closeCocoaFontPanel();
bool nativeDialogInUse;
bool canBeNativeDialog();
bool setVisible_sys(bool visible);
- void *_q_constructNativePanel();
+ void createNSFontPanelDelegate();
void _q_macRunNativeAppModalPanel();
void mac_nativeDialogModalHelp();
+ bool showCocoaFontPanel();
+ bool hideCocoaFontPanel();
static bool sharedFontPanelAvailable;
#endif
diff --git a/src/gui/dialogs/qprintdialog.h b/src/gui/dialogs/qprintdialog.h
index ecd50c1..94177ea 100644
--- a/src/gui/dialogs/qprintdialog.h
+++ b/src/gui/dialogs/qprintdialog.h
@@ -56,7 +56,7 @@ class QPrintDialogPrivate;
class QPushButton;
class QPrinter;
-#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC)
+#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN)
class QUnixPrintWidgetPrivate;
class Q_GUI_EXPORT QUnixPrintWidget : public QWidget
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 0487f23..17283f5 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -152,6 +152,9 @@ public:
bool checkFields();
void setupPrinter();
void setOptionsPane(QPrintDialogPrivate *pane);
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ void setCupsProperties();
+#endif
// slots
void _q_printerChanged(int index);
@@ -949,7 +952,7 @@ bool QUnixPrintWidgetPrivate::checkFields()
void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked()
{
- if (propertiesDialog == 0) {
+ if (!propertiesDialog) {
propertiesDialog = new QPrintPropertiesDialog(q);
propertiesDialog->setResult(QDialog::Rejected);
}
@@ -969,6 +972,35 @@ void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked()
propertiesDialog->exec();
}
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+void QUnixPrintWidgetPrivate::setCupsProperties()
+{
+ if (cups && QCUPSSupport::isAvailable()) {
+ QPrintEngine *engine = printer->printEngine();
+ const ppd_option_t* pageSizes = cups->pageSizes();
+ QByteArray cupsPageSize;
+ for (int i = 0; i < pageSizes->num_choices; ++i) {
+ if (static_cast<int>(pageSizes->choices[i].marked) == 1)
+ cupsPageSize = pageSizes->choices[i].choice;
+ }
+ engine->setProperty(PPK_CupsStringPageSize, QString::fromLatin1(cupsPageSize));
+ engine->setProperty(PPK_CupsOptions, cups->options());
+
+ QRect pageRect = cups->pageRect(cupsPageSize);
+ engine->setProperty(PPK_CupsPageRect, pageRect);
+
+ QRect paperRect = cups->paperRect(cupsPageSize);
+ engine->setProperty(PPK_CupsPaperRect, paperRect);
+
+ for (int ps = 0; ps < QPrinter::NPaperSize; ++ps) {
+ QPdf::PaperSize size = QPdf::paperSize(QPrinter::PaperSize(ps));
+ if (size.width == paperRect.width() && size.height == paperRect.height())
+ printer->setPaperSize(static_cast<QPrinter::PaperSize>(ps));
+ }
+ }
+}
+#endif
+
void QUnixPrintWidgetPrivate::setupPrinter()
{
const int printerCount = widget.printers->count();
@@ -993,6 +1025,10 @@ void QUnixPrintWidgetPrivate::setupPrinter()
if (propertiesDialog && propertiesDialog->result() == QDialog::Accepted)
propertiesDialog->setupPrinter();
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ if (!propertiesDialog)
+ setCupsProperties();
+#endif
}
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 485bfbf..b870523 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -60,7 +60,7 @@ static QEglContext * volatile currentVGContext = 0;
QEglContext::QEglContext()
: apiType(QEgl::OpenGL)
, ctx(EGL_NO_CONTEXT)
- , cfg(0)
+ , cfg(QEGL_NO_CONFIG)
, currentSurface(EGL_NO_SURFACE)
, current(false)
, ownsContext(true)
@@ -392,6 +392,11 @@ bool QEglContext::makeCurrent(EGLSurface surface)
return false;
}
+ if (surface == EGL_NO_SURFACE) {
+ qWarning() << "QEglContext::makeCurrent(): Cannot make invalid surface current";
+ return false;
+ }
+
// If lazyDoneCurrent() was called on the surface, then we may be able
// to assume that it is still current within the thread.
if (surface == currentSurface && currentContext(apiType) == this) {
@@ -417,7 +422,7 @@ bool QEglContext::makeCurrent(EGLSurface surface)
bool ok = eglMakeCurrent(QEgl::display(), surface, surface, ctx);
if (!ok)
- qWarning() << "QEglContext::makeCurrent():" << QEgl::errorString();
+ qWarning() << "QEglContext::makeCurrent(" << surface << "):" << QEgl::errorString();
return ok;
}
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 53c4711..91423c8 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -408,7 +408,7 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg
EGLSurface surf = eglCreatePixmapSurface(QEgl::display(), config,
(EGLNativePixmapType) x11PixmapData->handle(),
surfaceAttribs.properties());
- x11PixmapData->gl_surface = (Qt::HANDLE)surf;
+ x11PixmapData->gl_surface = (void*)surf;
QImagePixmapCleanupHooks::enableCleanupHooks(x11PixmapData);
return surf;
}
diff --git a/src/gui/embedded/qwsmanager_qws.cpp b/src/gui/embedded/qwsmanager_qws.cpp
index d6ef148..79076c5 100644
--- a/src/gui/embedded/qwsmanager_qws.cpp
+++ b/src/gui/embedded/qwsmanager_qws.cpp
@@ -267,8 +267,10 @@ void QWSManager::mouseMoveEvent(QMouseEvent *e)
#ifndef QT_NO_CURSOR
- QWSDisplay *qwsd = QApplication::desktop()->qwsDisplay();
- qwsd->selectCursor(d->managed, regionToShape(d->cachedRegionAt()));
+ if (d->managed->minimumSize() != d->managed->maximumSize()) {
+ QWSDisplay *qwsd = QApplication::desktop()->qwsDisplay();
+ qwsd->selectCursor(d->managed, regionToShape(d->cachedRegionAt()));
+ }
#endif //QT_NO_CURSOR
if (d->activeRegion)
diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h
index 033a996..c8a0028 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.h
+++ b/src/gui/graphicsview/qgraphicssceneevent.h
@@ -77,6 +77,8 @@ protected:
QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
+private:
+ Q_DISABLE_COPY(QGraphicsSceneEvent)
};
class QGraphicsSceneMouseEventPrivate;
@@ -124,6 +126,7 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
+ Q_DISABLE_COPY(QGraphicsSceneMouseEvent)
};
class QGraphicsSceneWheelEventPrivate;
@@ -156,6 +159,7 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
+ Q_DISABLE_COPY(QGraphicsSceneWheelEvent)
};
class QGraphicsSceneContextMenuEventPrivate;
@@ -184,6 +188,7 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
+ Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent)
};
class QGraphicsSceneHoverEventPrivate;
@@ -216,6 +221,7 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
+ Q_DISABLE_COPY(QGraphicsSceneHoverEvent)
};
class QGraphicsSceneHelpEventPrivate;
@@ -233,6 +239,7 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
+ Q_DISABLE_COPY(QGraphicsSceneHelpEvent)
};
class QGraphicsSceneDragDropEventPrivate;
@@ -275,12 +282,14 @@ public:
private:
Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
+ Q_DISABLE_COPY(QGraphicsSceneDragDropEvent)
};
class QGraphicsSceneResizeEventPrivate;
class Q_GUI_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent
{
Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
+ Q_DISABLE_COPY(QGraphicsSceneResizeEvent)
public:
QGraphicsSceneResizeEvent();
~QGraphicsSceneResizeEvent();
@@ -296,6 +305,7 @@ class QGraphicsSceneMoveEventPrivate;
class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
{
Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
+ Q_DISABLE_COPY(QGraphicsSceneMoveEvent)
public:
QGraphicsSceneMoveEvent();
~QGraphicsSceneMoveEvent();
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index 521a612..7575838 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -94,7 +94,7 @@ public:
static Qt::HANDLE createBitmapFromImage(const QImage &image);
- Qt::HANDLE gl_surface;
+ void* gl_surface;
#ifndef QT_NO_XRENDER
void convertToARGB32(bool preserveContents = true);
#endif
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index c63a07b..5c7d24b7 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -122,10 +122,10 @@ public:
QVector<int> proxy_rows;
QVector<int> proxy_columns;
QVector<QModelIndex> mapped_children;
- QMap<QModelIndex, Mapping *>::const_iterator map_iter;
+ QHash<QModelIndex, Mapping *>::const_iterator map_iter;
};
- mutable QMap<QModelIndex, Mapping*> source_index_mapping;
+ mutable QHash<QModelIndex, Mapping*> source_index_mapping;
int source_sort_column;
int proxy_sort_column;
@@ -142,7 +142,7 @@ public:
QModelIndexPairList saved_persistent_indexes;
- QMap<QModelIndex, Mapping *>::const_iterator create_mapping(
+ QHash<QModelIndex, Mapping *>::const_iterator create_mapping(
const QModelIndex &source_parent) const;
QModelIndex proxy_to_source(const QModelIndex &proxyIndex) const;
QModelIndex source_to_proxy(const QModelIndex &sourceIndex) const;
@@ -150,14 +150,14 @@ public:
void remove_from_mapping(const QModelIndex &source_parent);
- inline QMap<QModelIndex, Mapping *>::const_iterator index_to_iterator(
+ inline QHash<QModelIndex, Mapping *>::const_iterator index_to_iterator(
const QModelIndex &proxy_index) const
{
Q_ASSERT(proxy_index.isValid());
Q_ASSERT(proxy_index.model() == q_func());
const void *p = proxy_index.internalPointer();
Q_ASSERT(p);
- QMap<QModelIndex, Mapping *>::const_iterator it =
+ QHash<QModelIndex, Mapping *>::const_iterator it =
static_cast<const Mapping*>(p)->map_iter;
Q_ASSERT(it != source_index_mapping.constEnd());
Q_ASSERT(it.value());
@@ -165,7 +165,7 @@ public:
}
inline QModelIndex create_index(int row, int column,
- QMap<QModelIndex, Mapping*>::const_iterator it) const
+ QHash<QModelIndex, Mapping*>::const_iterator it) const
{
return q_func()->createIndex(row, column, *it);
}
@@ -246,7 +246,7 @@ public:
virtual void _q_sourceModelDestroyed();
};
-typedef QMap<QModelIndex, QSortFilterProxyModelPrivate::Mapping *> IndexMap;
+typedef QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping *> IndexMap;
void QSortFilterProxyModelPrivate::_q_sourceModelDestroyed()
{
@@ -292,11 +292,13 @@ IndexMap::const_iterator QSortFilterProxyModelPrivate::create_mapping(
Mapping *m = new Mapping;
int source_rows = model->rowCount(source_parent);
+ m->source_rows.reserve(source_rows);
for (int i = 0; i < source_rows; ++i) {
if (q->filterAcceptsRow(i, source_parent))
m->source_rows.append(i);
}
int source_cols = model->columnCount(source_parent);
+ m->source_columns.reserve(source_cols);
for (int i = 0; i < source_cols; ++i) {
if (q->filterAcceptsColumn(i, source_parent))
m->source_columns.append(i);
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 46fd9d0..702a8bb 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -2549,7 +2549,7 @@ void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint)
// check if we really need to do anything
if (!d->isIndexValid(index)
|| (d->model->parent(index) != d->root)
- || isIndexHidden(index))
+ || isRowHidden(index.row()) || isColumnHidden(index.column()))
return;
QSpanCollection::Span span;
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 1145235..4135ba0 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -679,16 +679,20 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto
d->defaultItemHeight = indexRowSizeHint(topLeft);
bool sizeChanged = false;
if (topViewIndex != -1) {
- if (topLeft == bottomRight) {
+ if (topLeft.row() == bottomRight.row()) {
int oldHeight = d->itemHeight(topViewIndex);
d->invalidateHeightCache(topViewIndex);
sizeChanged = (oldHeight != d->itemHeight(topViewIndex));
+ if (topLeft.column() == 0)
+ d->viewItems[topViewIndex].hasChildren = d->hasVisibleChildren(topLeft);
} else {
int bottomViewIndex = d->viewIndex(bottomRight);
for (int i = topViewIndex; i <= bottomViewIndex; ++i) {
int oldHeight = d->itemHeight(i);
d->invalidateHeightCache(i);
sizeChanged |= (oldHeight != d->itemHeight(i));
+ if (topLeft.column() == 0)
+ d->viewItems[i].hasChildren = d->hasVisibleChildren(d->viewItems.at(i).index);
}
}
}
@@ -2403,9 +2407,9 @@ void QTreeView::reexpand()
/*!
\internal
+ This function assume that left is a (grand-)child of the parent of left.
*/
-static bool treeViewItemLessThan(const QTreeViewItem &left,
- const QTreeViewItem &right)
+static bool treeViewItemLessThanInInsert(const QTreeViewItem &left, const QTreeViewItem &right)
{
if (left.level != right.level) {
Q_ASSERT(left.level > right.level);
@@ -2476,6 +2480,7 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end)
for (int i = 0; i < delta; ++i) {
QTreeViewItem &item = insertedItems[i];
item.index = d->model->index(i + start, 0, parent);
+ item.parentItem = parentItem;
item.level = childLevel;
item.hasChildren = d->hasVisibleChildren(item.index);
item.hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1));
@@ -2491,7 +2496,7 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end)
QVector<QTreeViewItem>::iterator it;
it = qLowerBound(d->viewItems.begin() + firstChildItem,
d->viewItems.begin() + lastChildItem + 1,
- insertedItems.at(0), treeViewItemLessThan);
+ insertedItems.at(0), treeViewItemLessThanInInsert);
insertPos = it - d->viewItems.begin();
// update stale model indexes of siblings
@@ -2514,7 +2519,7 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end)
}
}
- d->viewItems.insert(insertPos, delta, insertedItems.at(0));
+ d->insertViewItems(insertPos, delta, insertedItems.at(0));
if (delta > 1) {
qCopy(insertedItems.begin() + 1, insertedItems.end(),
d->viewItems.begin() + insertPos + 1);
@@ -2657,17 +2662,8 @@ void QTreeView::expandAll()
{
Q_D(QTreeView);
d->viewItems.clear();
- d->expandedIndexes.clear();
d->interruptDelayedItemsLayout();
- d->layout(-1);
- for (int i = 0; i < d->viewItems.count(); ++i) {
- if (d->viewItems[i].expanded)
- continue;
- d->viewItems[i].expanded = true;
- d->layout(i);
- QModelIndex idx = d->viewItems.at(i).index;
- d->expandedIndexes.insert(idx);
- }
+ d->layout(-1, true);
updateGeometries();
d->viewport->update();
}
@@ -2948,6 +2944,39 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
}
}
+void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &viewItem)
+{
+ viewItems.insert(pos, count, viewItem);
+ QTreeViewItem *items = viewItems.data();
+ for (int i = pos + count; i < viewItems.count(); i++)
+ if (items[i].parentItem >= pos)
+ items[i].parentItem += count;
+}
+
+void QTreeViewPrivate::removeViewItems(int pos, int count)
+{
+ viewItems.remove(pos, count);
+ QTreeViewItem *items = viewItems.data();
+ for (int i = pos; i < viewItems.count(); i++)
+ if (items[i].parentItem >= pos)
+ items[i].parentItem -= count;
+}
+
+#if 0
+bool QTreeViewPrivate::checkViewItems() const
+{
+ for (int i = 0; i < viewItems.count(); ++i) {
+ const QTreeViewItem &vi = viewItems.at(i);
+ if (vi.parentItem == -1) {
+ Q_ASSERT(!vi.index.parent().isValid() || vi.index.parent() == root);
+ } else {
+ Q_ASSERT(vi.index.parent() == viewItems.at(vi.parentItem).index);
+ }
+ }
+ return true;
+}
+#endif
+
void QTreeViewPrivate::collapse(int item, bool emitSignal)
{
Q_Q(QTreeView);
@@ -2976,14 +3005,11 @@ void QTreeViewPrivate::collapse(int item, bool emitSignal)
expandedIndexes.erase(it);
viewItems[item].expanded = false;
int index = item;
- QModelIndex parent = modelIndex;
- while (parent.isValid() && parent != root) {
- Q_ASSERT(index > -1);
+ while (index > -1) {
viewItems[index].total -= total;
- parent = parent.parent();
- index = viewIndex(parent);
+ index = viewItems[index].parentItem;
}
- viewItems.remove(item + 1, total); // collapse
+ removeViewItems(item + 1, total); // collapse
q->setState(oldState);
if (emitSignal) {
@@ -3120,7 +3146,14 @@ void QTreeViewPrivate::_q_columnsRemoved(const QModelIndex &parent, int start, i
QAbstractItemViewPrivate::_q_columnsRemoved(parent, start, end);
}
-void QTreeViewPrivate::layout(int i)
+/** \internal
+ creates and initialize the viewItem structure of the children of the element \i
+
+ set \a recursiveExpanding if the function has to expand all the children (called from expandAll)
+ \a afterIsUninitialized is when we recurse from layout(-1), it means all the items after 'i' are
+ not yet initialized and need not to be moved
+ */
+void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninitialized)
{
Q_Q(QTreeView);
QModelIndex current;
@@ -3147,8 +3180,12 @@ void QTreeViewPrivate::layout(int i)
defaultItemHeight = q->indexRowSizeHint(index);
}
viewItems.resize(count);
+ afterIsUninitialized = true;
} else if (viewItems[i].total != (uint)count) {
- viewItems.insert(i + 1, count, QTreeViewItem()); // expand
+ if (!afterIsUninitialized)
+ insertViewItems(i + 1, count, QTreeViewItem()); // expand
+ else if (count > 0)
+ viewItems.resize(viewItems.count() + count);
} else {
expanding = false;
}
@@ -3170,15 +3207,18 @@ void QTreeViewPrivate::layout(int i)
item->hasMoreSiblings = true;
item = &viewItems[last];
item->index = current;
+ item->parentItem = i;
item->level = level;
item->height = 0;
item->spanning = q->isFirstColumnSpanned(current.row(), parent);
item->expanded = false;
item->total = 0;
item->hasMoreSiblings = false;
- if (isIndexExpanded(current)) {
+ if (recursiveExpanding || isIndexExpanded(current)) {
+ if (recursiveExpanding)
+ expandedIndexes.insert(current);
item->expanded = true;
- layout(last);
+ layout(last, recursiveExpanding, afterIsUninitialized);
item = &viewItems[last];
children += item->total;
item->hasChildren = item->total > 0;
@@ -3190,17 +3230,19 @@ void QTreeViewPrivate::layout(int i)
}
// remove hidden items
- if (hidden > 0)
- viewItems.remove(last + 1, hidden); // collapse
+ if (hidden > 0) {
+ if (!afterIsUninitialized)
+ removeViewItems(last + 1, hidden);
+ else
+ viewItems.resize(viewItems.size() - hidden);
+ }
if (!expanding)
return; // nothing changed
- while (parent != root) {
- Q_ASSERT(i > -1);
+ while (i > -1) {
viewItems[i].total += count - hidden;
- parent = parent.parent();
- i = viewIndex(parent);
+ i = viewItems[i].parentItem;
}
}
@@ -3355,46 +3397,39 @@ int QTreeViewPrivate::viewIndex(const QModelIndex &_index) const
const int totalCount = viewItems.count();
const QModelIndex index = _index.sibling(_index.row(), 0);
+ const int row = index.row();
+ const quint64 internalId = index.internalId();
-
- // A quick check near the last item to see if we are just incrementing
- const int start = lastViewedItem > 2 ? lastViewedItem - 2 : 0;
- const int end = lastViewedItem < totalCount - 2 ? lastViewedItem + 2 : totalCount;
- int row = index.row();
- for (int i = start; i < end; ++i) {
- const QModelIndex &idx = viewItems.at(i).index;
- if (idx.row() == row) {
- if (idx.internalId() == index.internalId()) {
- lastViewedItem = i;
- return i;
- }
+ // We start nearest to the lastViewedItem
+ int localCount = qMin(lastViewedItem - 1, totalCount - lastViewedItem);
+ for (int i = 0; i < localCount; ++i) {
+ const QModelIndex &idx1 = viewItems.at(lastViewedItem + i).index;
+ if (idx1.row() == row && idx1.internalId() == internalId) {
+ lastViewedItem = lastViewedItem + i;
+ return lastViewedItem;
+ }
+ const QModelIndex &idx2 = viewItems.at(lastViewedItem - i - 1).index;
+ if (idx2.row() == row && idx2.internalId() == internalId) {
+ lastViewedItem = lastViewedItem - i - 1;
+ return lastViewedItem;
}
}
- // NOTE: this function is slow if the item is outside the visible area
- // search in visible items first and below
- int t = firstVisibleItem();
- t = t > 100 ? t - 100 : 0; // start 100 items above the visible area
-
- for (int i = t; i < totalCount; ++i) {
- const QModelIndex &idx = viewItems.at(i).index;
- if (idx.row() == row) {
- if (idx.internalId() == index.internalId()) {
- lastViewedItem = i;
- return i;
- }
+ for (int j = qMax(0, lastViewedItem + localCount); j < totalCount; ++j) {
+ const QModelIndex &idx = viewItems.at(j).index;
+ if (idx.row() == row && idx.internalId() == internalId) {
+ lastViewedItem = j;
+ return j;
}
}
- // search from top to first visible
- for (int j = 0; j < t; ++j) {
+ for (int j = qMin(totalCount, lastViewedItem - localCount) - 1; j >= 0; --j) {
const QModelIndex &idx = viewItems.at(j).index;
- if (idx.row() == row) {
- if (idx.internalId() == index.internalId()) {
- lastViewedItem = j;
- return j;
- }
+ if (idx.row() == row && idx.internalId() == internalId) {
+ lastViewedItem = j;
+ return j;
}
}
+
// nothing found
return -1;
}
@@ -3719,7 +3754,6 @@ bool QTreeViewPrivate::hasVisibleChildren(const QModelIndex& parent) const
void QTreeViewPrivate::rowsRemoved(const QModelIndex &parent,
int start, int end, bool after)
{
- Q_Q(QTreeView);
// if we are going to do a complete relayout anyway, there is no need to update
if (delayedPendingLayout) {
_q_rowsRemoved(parent, start, end);
@@ -3753,7 +3787,7 @@ void QTreeViewPrivate::rowsRemoved(const QModelIndex &parent,
item += count;
} else if (modelIndex.row() <= end) {
// removed
- viewItems.remove(item, count);
+ removeViewItems(item, count);
removedCount += count;
lastChildItem -= count;
} else {
diff --git a/src/gui/itemviews/qtreeview_p.h b/src/gui/itemviews/qtreeview_p.h
index 589a224..48997b7 100644
--- a/src/gui/itemviews/qtreeview_p.h
+++ b/src/gui/itemviews/qtreeview_p.h
@@ -55,6 +55,7 @@
#include "private/qabstractitemview_p.h"
#include <QtCore/qvariantanimation.h>
+#include <QtCore/qabstractitemmodel.h>
#ifndef QT_NO_TREEVIEW
@@ -62,9 +63,10 @@ QT_BEGIN_NAMESPACE
struct QTreeViewItem
{
- QTreeViewItem() : expanded(false), spanning(false), hasChildren(false),
+ QTreeViewItem() : parentItem(-1), expanded(false), spanning(false), hasChildren(false),
hasMoreSiblings(false), total(0), level(0), height(0) {}
QModelIndex index; // we remove items whenever the indexes are invalidated
+ int parentItem; // parent item index in viewItems
uint expanded : 1;
uint spanning : 1;
uint hasChildren : 1; // if the item has visible children (even if collapsed)
@@ -74,6 +76,8 @@ struct QTreeViewItem
int height : 16; // row height
};
+Q_DECLARE_TYPEINFO(QTreeViewItem, Q_MOVABLE_TYPE);
+
class QTreeViewPrivate : public QAbstractItemViewPrivate
{
Q_DECLARE_PUBLIC(QTreeView)
@@ -123,7 +127,7 @@ public:
void _q_sortIndicatorChanged(int column, Qt::SortOrder order);
void _q_modelDestroyed();
- void layout(int item);
+ void layout(int item, bool recusiveExpanding = false, bool afterIsUninitialized = false);
int pageUp(int item) const;
int pageDown(int item) const;
@@ -136,6 +140,12 @@ public:
int viewIndex(const QModelIndex &index) const;
QModelIndex modelIndex(int i, int column = 0) const;
+ void insertViewItems(int pos, int count, const QTreeViewItem &viewItem);
+ void removeViewItems(int pos, int count);
+#if 0
+ bool checkViewItems() const;
+#endif
+
int firstVisibleItem(int *offset = 0) const;
int columnAt(int x) const;
bool hasVisibleChildren( const QModelIndex& parent) const;
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index ccc39c9..4a15cf2 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1034,7 +1034,7 @@ void QSymbianControl::HandleResourceChange(int resourceType)
qwidget->adjustSize();
qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize
}
- if (!qwidget->testAttribute(Qt::WA_Moved)) {
+ if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) {
TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
SetPosition(r.iTl);
qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 9872514..ae9b34c 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -441,7 +441,7 @@ extern QCursor *qt_grab_cursor();
#define __export
#endif
-extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
+extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
class QETWidget : public QWidget // event translator widget
{
@@ -1400,8 +1400,7 @@ static bool qt_is_translatable_mouse_event(UINT message)
;
}
-extern "C"
-LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
bool result = true;
QEvent::Type evt_type = QEvent::None;
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index ab71a05..5dcf613 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -179,7 +179,7 @@ static void cleanupCocoaApplicationDelegate()
}
// This function will only be called when NSApp is actually running. Before
-// that, the kAEQuitApplication apple event will be sendt to
+// that, the kAEQuitApplication Apple event will be sent to
// QApplicationPrivate::globalAppleEventProcessor in qapplication_mac.mm
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
@@ -196,21 +196,18 @@ static void cleanupCocoaApplicationDelegate()
qAppInstance()->quit();
startedQuit = false;
}
+ return NSTerminateNow;
}
if (qtPrivate->threadData->eventLoops.size() == 0) {
// INVARIANT: No event loop is executing. This probably
// means that Qt is used as a plugin, or as a part of a native
- // Cocoa application. In any case it should be fine to
+ // Cocoa application. In any case it should be fine to
// terminate now:
return NSTerminateNow;
- } else {
- // Prevent Cocoa from terminating the application, since this simply
- // exits the program whithout allowing QApplication::exec() to return.
- // The call to QApplication::quit() above will instead quit the
- // application from the Qt side.
- return NSTerminateCancel;
}
+
+ return NSTerminateCancel;
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index f38e4f5..ae1f60d 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -348,7 +348,8 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
\o B=1 and M=1 gives black.
\o B=0 and M=1 gives white.
\o B=0 and M=0 gives transparent.
- \o B=1 and M=0 gives an XOR'd result.
+ \o B=1 and M=0 gives an XOR'd result under Windows, undefined
+ results on all other platforms.
\endlist
Use the global Qt color Qt::color0 to draw 0-pixels and Qt::color1 to
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 84e3c5d..e4d0bf3 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -88,6 +88,7 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate()
void QDesktopWidgetPrivate::init(QDesktopWidget *that)
{
+ Q_UNUSED(that);
// int screenCount=0;
// ### TODO: Implement proper multi-display support
diff --git a/src/gui/kernel/qdesktopwidget_win.cpp b/src/gui/kernel/qdesktopwidget_win.cpp
index 1fea8d6..07dbc24 100644
--- a/src/gui/kernel/qdesktopwidget_win.cpp
+++ b/src/gui/kernel/qdesktopwidget_win.cpp
@@ -76,7 +76,7 @@ public:
};
typedef BOOL (WINAPI *InfoFunc)(HMONITOR, MONITORINFO*);
- typedef BOOL (CALLBACK *EnumProc)(HMONITOR, HDC, LPRECT, LPARAM);
+ typedef BOOL (QT_WIN_CALLBACK *EnumProc)(HMONITOR, HDC, LPRECT, LPARAM);
typedef BOOL (WINAPI *EnumFunc)(HDC, LPCRECT, EnumProc, LPARAM);
static EnumFunc enumDisplayMonitors;
@@ -107,7 +107,7 @@ static inline void qt_get_sip_info(QRect &rect)
#endif
-BOOL CALLBACK enumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM)
+BOOL QT_WIN_CALLBACK enumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM)
{
QDesktopWidgetPrivate::screenCount++;
QDesktopWidgetPrivate::rects->resize(QDesktopWidgetPrivate::screenCount);
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp
index e555c5c..f84b902 100644
--- a/src/gui/kernel/qkeymapper_win.cpp
+++ b/src/gui/kernel/qkeymapper_win.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
//#define DEBUG_KEYMAPPER
// Implemented elsewhere
-extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
+extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
extern Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id);
#ifndef LANG_PASHTO
diff --git a/src/gui/kernel/qkeymapper_x11.cpp b/src/gui/kernel/qkeymapper_x11.cpp
index b32b626..d6d1042 100644
--- a/src/gui/kernel/qkeymapper_x11.cpp
+++ b/src/gui/kernel/qkeymapper_x11.cpp
@@ -1186,6 +1186,8 @@ static const unsigned int KeyTbl[] = {
XF86XK_LaunchB, Qt::Key_LaunchD,
XF86XK_LaunchC, Qt::Key_LaunchE,
XF86XK_LaunchD, Qt::Key_LaunchF,
+ XF86XK_LaunchE, Qt::Key_LaunchG,
+ XF86XK_LaunchF, Qt::Key_LaunchH,
// Qtopia keys
QTOPIAXK_Select, Qt::Key_Select,
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 735ca7a..cedede1 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -68,12 +68,12 @@
#include <eikappui.h>
#ifdef Q_WS_S60
-#include <aknutils.h> // AknLayoutUtils
+#include <AknUtils.h> // AknLayoutUtils
#include <avkon.hrh> // EEikStatusPaneUidTitle
#include <akntitle.h> // CAknTitlePane
#include <akncontext.h> // CAknContextPane
#include <eikspane.h> // CEikStatusPane
-#include <aknpopupfader.h> // MAknFadedComponent and TAknPopupFader
+#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 5889589..a0e4050 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3428,8 +3428,10 @@ void QWidgetPrivate::show_sys()
// The window is modally shaddowed, so we need to make
// sure that we don't pop in front of the modal window:
[window orderFront:window];
- if (NSWindow *modalWin = qt_mac_window_for(top))
- [modalWin orderFront:window];
+ if (!top->testAttribute(Qt::WA_DontShowOnScreen)) {
+ if (NSWindow *modalWin = qt_mac_window_for(top))
+ [modalWin orderFront:window];
+ }
}
#endif
if (q->windowType() == Qt::Popup) {
@@ -4781,8 +4783,10 @@ void QWidgetPrivate::syncCocoaMask()
if (!q->testAttribute(Qt::WA_WState_Created) || !extra)
return;
- if (extra->hasMask && extra->maskBits.size() != q->size()) {
- extra->maskBits = QImage(q->size(), QImage::Format_Mono);
+ if (extra->hasMask) {
+ if(extra->maskBits.size() != q->size()) {
+ extra->maskBits = QImage(q->size(), QImage::Format_Mono);
+ }
extra->maskBits.fill(QColor(Qt::color1).rgba());
extra->maskBits.setNumColors(2);
extra->maskBits.setColor(0, QColor(Qt::color0).rgba());
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 7fb21d2..79702af 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1037,6 +1037,17 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
return widgetPos;
}
+static Qt::WindowStates effectiveState(Qt::WindowStates state)
+{
+ if (state & Qt::WindowMinimized)
+ return Qt::WindowMinimized;
+ else if (state & Qt::WindowFullScreen)
+ return Qt::WindowFullScreen;
+ else if (state & Qt::WindowMaximized)
+ return Qt::WindowMaximized;
+ return Qt::WindowNoState;
+}
+
void QWidget::setWindowState(Qt::WindowStates newstate)
{
Q_D(QWidget);
@@ -1052,6 +1063,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+ const bool wasResized = testAttribute(Qt::WA_Resized);
+ const bool wasMoved = testAttribute(Qt::WA_Moved);
QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId());
if (window && newstate & Qt::WindowMinimized) {
@@ -1090,7 +1103,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
createWinId();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
// Ensure the initial size is valid, since we store it as normalGeometry below.
- if (!testAttribute(Qt::WA_Resized) && !isVisible())
+ if (!wasResized && !isVisible())
adjustSize();
QTLWExtra *top = d->topData();
@@ -1105,6 +1118,15 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
//restore normal geometry
top->normalGeometry = normalGeometry;
+
+ // FixMe QTBUG-8977
+ // In some platforms, WA_Resized and WA_Moved are also not set when application window state is
+ // anything else than normal. In Symbian we can restore them only for normal window state since
+ // restoring for other modes, will make fluidlauncher to be launched in wrong size (200x100)
+ if (effectiveState(newstate) == Qt::WindowNoState) {
+ setAttribute(Qt::WA_Resized, wasResized);
+ setAttribute(Qt::WA_Moved, wasMoved);
+ }
}
data->window_state = newstate;
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 2dcbfc3..7d647b7 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -243,7 +243,7 @@ static QCursor *mouseGrbCur = 0;
static QWidget *keyboardGrb = 0;
static HHOOK journalRec = 0;
-extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
+extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
#define XCOORD_MAX 16383
#define WRECT_MAX 16383
@@ -825,7 +825,7 @@ QCursor *qt_grab_cursor()
// The procedure does nothing, but is required for mousegrabbing to work
#ifndef Q_WS_WINCE
-LRESULT CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam)
+LRESULT QT_WIN_CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam)
{
return CallNextHookEx(journalRec, nCode, wParam, lParam);
}
diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp
index fa94703..509847b 100644
--- a/src/gui/kernel/qwidget_wince.cpp
+++ b/src/gui/kernel/qwidget_wince.cpp
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
const QString qt_reg_winclass(QWidget *w); // defined in qapplication_win.cpp
-extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
+extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM);
//#define TABLET_DEBUG
#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE \
@@ -586,7 +586,7 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level) {
}
// The procedure does nothing, but is required for mousegrabbing to work
-LRESULT CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam) {
+LRESULT QT_WIN_CALLBACK qJournalRecordProc(int nCode, WPARAM wParam, LPARAM lParam) {
Q_UNUSED(nCode);
Q_UNUSED(wParam);
Q_UNUSED(lParam);
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index cd448a7..08d5572 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -543,7 +543,8 @@ void QColor::setNamedColor(const QString &name)
be used to construct a valid QColor object, otherwise returns
false.
- The algorithm used is the same as with \a setNamedColor().
+ It uses the same algorithm used in setNamedColor().
+
\sa setNamedColor()
*/
bool QColor::isValidColor(const QString &name)
@@ -2716,12 +2717,4 @@ QDataStream &operator>>(QDataStream &stream, QColor &color)
\sa QColor::rgb(), QColor::rgba()
*/
-/*! \fn void QColormap::initialize()
- \internal
-*/
-
-/*! \fn void QColormap::cleanup()
- \internal
-*/
-
QT_END_NAMESPACE
diff --git a/src/gui/painting/qcolormap.qdoc b/src/gui/painting/qcolormap.qdoc
index 56fabf7..22a73fd 100644
--- a/src/gui/painting/qcolormap.qdoc
+++ b/src/gui/painting/qcolormap.qdoc
@@ -150,3 +150,13 @@
Assigns the given \a colormap to \e this color map and returns
a reference to \e this color map.
*/
+
+/*!
+ \fn void QColormap::initialize()
+ \internal
+*/
+
+/*!
+ \fn void QColormap::cleanup()
+ \internal
+*/
diff --git a/src/gui/painting/qcups.cpp b/src/gui/painting/qcups.cpp
index ac41692..1ea1670 100644
--- a/src/gui/painting/qcups.cpp
+++ b/src/gui/painting/qcups.cpp
@@ -343,7 +343,8 @@ bool QCUPSSupport::printerHasPPD(const char *printerName)
if (!isAvailable())
return false;
const char *ppdFile = _cupsGetPPD(printerName);
- unlink(ppdFile);
+ if (ppdFile)
+ unlink(ppdFile);
return (ppdFile != 0);
}
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5f70cb7..581b538 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -7820,7 +7820,6 @@ void qInitDrawhelperAsm()
CompositionFunction *functionForModeAsm = 0;
CompositionFunctionSolid *functionForModeSolidAsm = 0;
-#ifdef QT_NO_DEBUG
const uint features = qDetectCPUFeatures();
if (false) {
#ifdef QT_HAVE_SSE2
@@ -7944,8 +7943,6 @@ void qInitDrawhelperAsm()
}
#endif // IWMMXT
-#endif // QT_NO_DEBUG
-
#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
functionForModeAsm = qt_functionForMode_ARMv6;
functionForModeSolidAsm = qt_functionForModeSolid_ARMv6;
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index d76c709..a62f06b 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -1081,7 +1081,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
according to the \a margins structure.
*/
-typedef QVarLengthArray<QPainter::Fragment, 16> QPixmapFragmentsArray;
+typedef QVarLengthArray<QPainter::PixmapFragment, 16> QPixmapFragmentsArray;
/*!
\since 4.6
@@ -1102,7 +1102,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin
const QPixmap &pixmap, const QRect &sourceRect,const QMargins &sourceMargins,
const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
{
- QPainter::Fragment d;
+ QPainter::PixmapFragment d;
d.opacity = 1.0;
d.rotation = 0.0;
diff --git a/src/gui/painting/qmemrotate_p.h b/src/gui/painting/qmemrotate_p.h
index 8df0520..2911860 100644
--- a/src/gui/painting/qmemrotate_p.h
+++ b/src/gui/painting/qmemrotate_p.h
@@ -82,8 +82,9 @@ QT_BEGIN_NAMESPACE
void Q_GUI_QWS_EXPORT qt_memrotate270(const srctype*, int, int, int, desttype*, int)
void Q_GUI_EXPORT qt_memrotate90(const quint32*, int, int, int, quint32*, int);
+void Q_GUI_QWS_EXPORT qt_memrotate180(const quint32*, int, int, int, quint32*, int);
+void Q_GUI_QWS_EXPORT qt_memrotate270(const quint32*, int, int, int, quint32*, int);
-QT_DECL_MEMROTATE(quint32, quint32);
QT_DECL_MEMROTATE(quint32, quint16);
QT_DECL_MEMROTATE(quint16, quint32);
QT_DECL_MEMROTATE(quint16, quint16);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index a7c2a0b..03d0825 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1725,9 +1725,10 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
if (patternLength > 0) {
int n = qFloor(dashOffset / patternLength);
dashOffset -= n * patternLength;
- while (dashOffset > pattern.at(dashIndex)) {
+ while (dashOffset >= pattern.at(dashIndex)) {
dashOffset -= pattern.at(dashIndex);
- dashIndex = (dashIndex + 1) % pattern.size();
+ if (++dashIndex >= pattern.size())
+ dashIndex = 0;
inDash = !inDash;
}
}
@@ -1738,7 +1739,6 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
const QLineF *lines = reinterpret_cast<const QLineF *>(path.points());
for (int i = 0; i < lineCount; ++i) {
- dashOffset = s->lastPen.dashOffset();
if (lines[i].p1() == lines[i].p2()) {
if (s->lastPen.capStyle() != Qt::FlatCap) {
QPointF p = lines[i].p1();
@@ -3390,7 +3390,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte
};
for(int i = 0; i < glyphs.size(); i++) {
- QFontEngineFT::Glyph *glyph = gset->glyph_data.value(glyphs[i]);
+ QFontEngineFT::Glyph *glyph = gset->getGlyph(glyphs[i]);
if (!glyph || glyph->format != neededFormat) {
if (!lockedFace)
@@ -3626,13 +3626,14 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line,
} else {
*dashOffset = 0;
*inDash = !(*inDash);
- *dashIndex = (*dashIndex + 1) % pattern.size();
+ if (++*dashIndex >= pattern.size())
+ *dashIndex = 0;
length -= dash;
l.setLength(dash);
line.setP1(l.p2());
}
- if (rasterize && dash != 0)
+ if (rasterize && dash > 0)
rasterizer->rasterizeLine(l.p1(), l.p2(), width / dash, squareCap);
}
}
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 98762f0..1fd622d 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -970,8 +970,8 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con
fill(path, brush);
}
-void QPaintEngineEx::drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount,
- const QPixmap &pixmap, QPainter::FragmentHints /*hints*/)
+void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount,
+ const QPixmap &pixmap, QPainter::PixmapFragmentHints /*hints*/)
{
qreal oldOpacity = state()->opacity;
QTransform oldTransform = state()->matrix;
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 2401b94..6c654bd 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -197,7 +197,8 @@ public:
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
- virtual void drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount, const QPixmap &pixmap, QFlags<QPainter::FragmentHint> hints);
+ virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
+ QFlags<QPainter::PixmapFragmentHint> hints);
virtual void updateState(const QPaintEngineState &state);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 9d83718..a1ed8f5 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5758,18 +5758,18 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, const QPointF *posit
/*!
\fn void QPainter::drawStaticText(const QPoint &position, const QStaticText &staticText)
-
\since 4.7
-
\overload
+
+ Draws the \a staticText at the \a position.
*/
/*!
\fn void QPainter::drawStaticText(int x, int y, const QStaticText &staticText)
-
\since 4.7
-
\overload
+
+ Draws the \a staticText at coordinates \a x and \a y.
*/
/*!
@@ -7994,10 +7994,11 @@ start_lengthVariant:
for (int i = 0; i < textLayout.lineCount(); i++) {
QTextLine line = textLayout.lineAt(i);
+ qreal advance = textLayout.engine()->lines[i].textAdvance.toReal();
if (tf & Qt::AlignRight)
- xoff = r.width() - line.naturalTextWidth();
+ xoff = r.width() - advance;
else if (tf & Qt::AlignHCenter)
- xoff = (r.width() - line.naturalTextWidth())/2;
+ xoff = (r.width() - advance)/2;
line.draw(painter, QPointF(r.x() + xoff + line.x(), r.y() + yoff));
}
@@ -8914,11 +8915,11 @@ QTransform QPainter::combinedTransform() const
This function is potentially faster than multiple calls to drawPixmap(),
since the backend can optimize state changes.
- \sa QPainter::Fragment, QPainter::FragmentHint
+ \sa QPainter::PixmapFragment, QPainter::PixmapFragmentHint
*/
-void QPainter::drawPixmapFragments(const Fragment *fragments, int fragmentCount,
- const QPixmap &pixmap, FragmentHints hints)
+void QPainter::drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
+ const QPixmap &pixmap, PixmapFragmentHints hints)
{
Q_D(QPainter);
@@ -8959,7 +8960,7 @@ void QPainter::drawPixmapFragments(const Fragment *fragments, int fragmentCount,
/*!
\since 4.7
- \class QPainter::Fragment
+ \class QPainter::PixmapFragment
\brief This class is used in conjunction with the
QPainter::drawPixmapFragments() function to specify how a pixmap, or
@@ -8980,73 +8981,73 @@ void QPainter::drawPixmapFragments(const Fragment *fragments, int fragmentCount,
/*!
\since 4.7
- This is a convenience function that returns a QPainter::Fragment that is
+ This is a convenience function that returns a QPainter::PixmapFragment that is
initialized with the \a pos, \a sourceRect, \a scaleX, \a scaleY, \a
rotation, \a opacity parameters.
*/
-QPainter::Fragment QPainter::Fragment::create(const QPointF &pos, const QRectF &sourceRect,
+QPainter::PixmapFragment QPainter::PixmapFragment::create(const QPointF &pos, const QRectF &sourceRect,
qreal scaleX, qreal scaleY, qreal rotation,
qreal opacity)
{
- Fragment fragment = {pos.x(), pos.y(), sourceRect.x(), sourceRect.y(), sourceRect.width(),
- sourceRect.height(), scaleX, scaleY, rotation, opacity};
+ PixmapFragment fragment = {pos.x(), pos.y(), sourceRect.x(), sourceRect.y(), sourceRect.width(),
+ sourceRect.height(), scaleX, scaleY, rotation, opacity};
return fragment;
}
/*!
- \variable QPainter::Fragment::x
+ \variable QPainter::PixmapFragment::x
\brief the x coordinate of center point in the target rectangle.
*/
/*!
- \variable QPainter::Fragment::y
+ \variable QPainter::PixmapFragment::y
\brief the y coordinate of the center point in the target rectangle.
*/
/*!
- \variable QPainter::Fragment::sourceLeft
+ \variable QPainter::PixmapFragment::sourceLeft
\brief the left coordinate of the source rectangle.
*/
/*!
- \variable QPainter::Fragment::sourceTop
+ \variable QPainter::PixmapFragment::sourceTop
\brief the top coordinate of the source rectangle.
*/
/*!
- \variable QPainter::Fragment::width
+ \variable QPainter::PixmapFragment::width
\brief the width of the source rectangle and is used to calculate the width
of the target rectangle.
*/
/*!
- \variable QPainter::Fragment::height
+ \variable QPainter::PixmapFragment::height
\brief the height of the source rectangle and is used to calculate the
height of the target rectangle.
*/
/*!
- \variable QPainter::Fragment::scaleX
+ \variable QPainter::PixmapFragment::scaleX
\brief the horizontal scale of the target rectangle.
*/
/*!
- \variable QPainter::Fragment::scaleY
+ \variable QPainter::PixmapFragment::scaleY
\brief the vertical scale of the target rectangle.
*/
/*!
- \variable QPainter::Fragment::rotation
+ \variable QPainter::PixmapFragment::rotation
\brief the rotation of the target rectangle in degrees. The target
rectangle is rotated after it has been scaled.
*/
/*!
- \variable QPainter::Fragment::opacity
+ \variable QPainter::PixmapFragment::opacity
\brief the opacity of the target rectangle, where 0.0 is fully transparent
and 1.0 is fully opaque.
@@ -9055,12 +9056,12 @@ QPainter::Fragment QPainter::Fragment::create(const QPointF &pos, const QRectF &
/*!
\since 4.7
- \enum QPainter::FragmentHint
+ \enum QPainter::PixmapFragmentHint
\value OpaqueHint Indicates that the pixmap fragments to be drawn are
opaque. Opaque fragments are potentially faster to draw.
- \sa QPainter::drawPixmapFragments(), QPainter::Fragment
+ \sa QPainter::drawPixmapFragments(), QPainter::PixmapFragment
*/
void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivate::DrawOperation operation)
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index bcb0b50..443925b 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -99,7 +99,7 @@ public:
Q_DECLARE_FLAGS(RenderHints, RenderHint)
- class Fragment {
+ class PixmapFragment {
public:
qreal x;
qreal y;
@@ -111,16 +111,16 @@ public:
qreal scaleY;
qreal rotation;
qreal opacity;
- static Fragment Q_GUI_EXPORT create(const QPointF &pos, const QRectF &sourceRect,
+ static PixmapFragment Q_GUI_EXPORT create(const QPointF &pos, const QRectF &sourceRect,
qreal scaleX = 1, qreal scaleY = 1,
qreal rotation = 0, qreal opacity = 1);
};
- enum FragmentHint {
+ enum PixmapFragmentHint {
OpaqueHint = 0x01
};
- Q_DECLARE_FLAGS(FragmentHints, FragmentHint)
+ Q_DECLARE_FLAGS(PixmapFragmentHints, PixmapFragmentHint)
QPainter();
explicit QPainter(QPaintDevice *);
@@ -375,8 +375,8 @@ public:
inline void drawPixmap(const QRect &r, const QPixmap &pm);
inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm);
- void drawPixmapFragments(const Fragment *fragments, int fragmentCount,
- const QPixmap &pixmap, FragmentHints hints = 0);
+ void drawPixmapFragments(const PixmapFragment *fragments, int fragmentCount,
+ const QPixmap &pixmap, PixmapFragmentHints hints = 0);
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect,
Qt::ImageConversionFlags flags = Qt::AutoColor);
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 614d2c0..bfeef72 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -704,28 +704,13 @@ bool QRegion::intersects(const QRegion &region) const
}
/*!
+ \fn bool QRegion::intersects(const QRect &rect) const
\since 4.2
Returns true if this region intersects with \a rect, otherwise
returns false.
*/
-bool QRegion::intersects(const QRect &rect) const
-{
- if (isEmpty() || rect.isNull())
- return false;
- const QRect r = rect.normalized();
- if (!rect_intersects(boundingRect(), r))
- return false;
- if (rectCount() == 1)
- return true;
-
- const QVector<QRect> myRects = rects();
- for (QVector<QRect>::const_iterator it = myRects.constBegin(); it < myRects.constEnd(); ++it)
- if (rect_intersects(r, *it))
- return true;
- return false;
-}
#if !defined (Q_OS_UNIX) && !defined (Q_WS_WIN)
/*!
@@ -3134,8 +3119,8 @@ SOFTWARE.
************************************************************************/
/* $XFree86: xc/lib/X11/PolyReg.c,v 1.1.1.2.8.2 1998/10/04 15:22:49 hohndel Exp $ */
-#define LARGE_COORDINATE 1000000
-#define SMALL_COORDINATE -LARGE_COORDINATE
+#define LARGE_COORDINATE INT_MAX
+#define SMALL_COORDINATE INT_MIN
/*
* InsertEdgeInET
@@ -4349,5 +4334,24 @@ bool QRegion::operator==(const QRegion &r) const
return EqualRegion(d->qt_rgn, r.d->qt_rgn);
}
+bool QRegion::intersects(const QRect &rect) const
+{
+ if (isEmptyHelper(d->qt_rgn) || rect.isNull())
+ return false;
+
+ const QRect r = rect.normalized();
+ if (!rect_intersects(d->qt_rgn->extents, r))
+ return false;
+ if (d->qt_rgn->numRects == 1)
+ return true;
+
+ const QVector<QRect> myRects = rects();
+ for (QVector<QRect>::const_iterator it = myRects.constBegin(); it < myRects.constEnd(); ++it)
+ if (rect_intersects(r, *it))
+ return true;
+ return false;
+}
+
+
#endif
QT_END_NAMESPACE
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 16e3c38..9740fce 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -1043,6 +1043,47 @@ QVector<qfixed> QDashStroker::patternForStyle(Qt::PenStyle style)
return pattern;
}
+static inline bool lineRectIntersectsRect(qfixed2d p1, qfixed2d p2, const qfixed2d &tl, const qfixed2d &br)
+{
+ return ((p1.x > tl.x || p2.x > tl.x) && (p1.x < br.x || p2.x < br.x)
+ && (p1.y > tl.y || p2.y > tl.y) && (p1.y < br.y || p2.y < br.y));
+}
+
+// If the line intersects the rectangle, this function will return true.
+static bool lineIntersectsRect(qfixed2d p1, qfixed2d p2, const qfixed2d &tl, const qfixed2d &br)
+{
+ if (!lineRectIntersectsRect(p1, p2, tl, br))
+ return false;
+ if (p1.x == p2.x || p1.y == p2.y)
+ return true;
+
+ if (p1.y > p2.y)
+ qSwap(p1, p2); // make p1 above p2
+ qfixed2d u;
+ qfixed2d v;
+ qfixed2d w = {p2.x - p1.x, p2.y - p1.y};
+ if (p1.x < p2.x) {
+ // backslash
+ u.x = tl.x - p1.x; u.y = br.y - p1.y;
+ v.x = br.x - p1.x; v.y = tl.y - p1.y;
+ } else {
+ // slash
+ u.x = tl.x - p1.x; u.y = tl.y - p1.y;
+ v.x = br.x - p1.x; v.y = br.y - p1.y;
+ }
+#if defined(QFIXED_IS_26_6) || defined(QFIXED_IS_16_16)
+ qint64 val1 = qint64(u.x) * qint64(w.y) - qint64(u.y) * qint64(w.x);
+ qint64 val2 = qint64(v.x) * qint64(w.y) - qint64(v.y) * qint64(w.x);
+ return (val1 < 0 && val2 > 0) || (val1 > 0 && val2 < 0);
+#elif defined(QFIXED_IS_32_32)
+ // Cannot do proper test because it may overflow.
+ return true;
+#else
+ qreal val1 = u.x * w.y - u.y * w.x;
+ qreal val2 = v.x * w.y - v.y * w.x;
+ return (val1 < 0 && val2 > 0) || (val1 > 0 && val2 < 0);
+#endif
+}
void QDashStroker::processCurrentSubpath()
{
@@ -1067,9 +1108,11 @@ void QDashStroker::processCurrentSubpath()
if (qFuzzyIsNull(sumLength))
return;
+ qreal invSumLength = qreal(1) / sumLength;
+
Q_ASSERT(dashCount > 0);
- dashCount = (dashCount / 2) * 2; // Round down to even number
+ dashCount = dashCount & -2; // Round down to even number
int idash = 0; // Index to current dash
qreal pos = 0; // The position on the curve, 0 <= pos <= path.length
@@ -1077,11 +1120,12 @@ void QDashStroker::processCurrentSubpath()
qreal doffset = m_dashOffset * m_stroke_width;
// make sure doffset is in range [0..sumLength)
- doffset -= qFloor(doffset / sumLength) * sumLength;
+ doffset -= qFloor(doffset * invSumLength) * sumLength;
while (doffset >= dashes[idash]) {
doffset -= dashes[idash];
- idash = (idash + 1) % dashCount;
+ if (++idash >= dashCount)
+ idash = 0;
}
qreal estart = 0; // The elements starting position
@@ -1119,12 +1163,41 @@ void QDashStroker::processCurrentSubpath()
estop = estart + elen;
bool done = pos >= estop;
+
+ if (clipping) {
+ // Check if the entire line can be clipped away.
+ if (!lineIntersectsRect(prev, e, clip_tl, clip_br)) {
+ // Cut away full dash sequences.
+ elen -= qFloor(elen * invSumLength) * sumLength;
+ // Update dash offset.
+ while (!done) {
+ qreal dpos = pos + dashes[idash] - doffset - estart;
+
+ Q_ASSERT(dpos >= 0);
+
+ if (dpos > elen) { // dash extends this line
+ doffset = dashes[idash] - (dpos - elen); // subtract the part already used
+ pos = estop; // move pos to next path element
+ done = true;
+ } else { // Dash is on this line
+ pos = dpos + estart;
+ done = pos >= estop;
+ if (++idash >= dashCount)
+ idash = 0;
+ doffset = 0; // full segment so no offset on next.
+ }
+ }
+ hasMoveTo = false;
+ move_to_pos = e;
+ }
+ }
+
// Dash away...
while (!done) {
QPointF p2;
- int idash_incr = 0;
bool has_offset = doffset > 0;
+ bool evenDash = (idash & 1) == 0;
qreal dpos = pos + dashes[idash] - doffset - estart;
Q_ASSERT(dpos >= 0);
@@ -1138,39 +1211,36 @@ void QDashStroker::processCurrentSubpath()
p2 = cline.pointAt(dpos/elen);
pos = dpos + estart;
done = pos >= estop;
- idash_incr = 1;
+ if (++idash >= dashCount)
+ idash = 0;
doffset = 0; // full segment so no offset on next.
}
- if (idash % 2 == 0) {
+ if (evenDash) {
line_to_pos.x = qt_real_to_fixed(p2.x());
line_to_pos.y = qt_real_to_fixed(p2.y());
- // If we have an offset, we're continuing a dash
- // from a previous element and should only
- // continue the current dash, without starting a
- // new subpath.
- if (!has_offset || !hasMoveTo) {
- emitMoveTo(move_to_pos.x, move_to_pos.y);
- hasMoveTo = true;
- }
-
if (!clipping
- // if move_to is inside...
- || (move_to_pos.x > clip_tl.x && move_to_pos.x < clip_br.x
- && move_to_pos.y > clip_tl.y && move_to_pos.y < clip_br.y)
- // Or if line_to is inside...
- || (line_to_pos.x > clip_tl.x && line_to_pos.x < clip_br.x
- && line_to_pos.y > clip_tl.y && line_to_pos.y < clip_br.y))
+ || lineRectIntersectsRect(move_to_pos, line_to_pos, clip_tl, clip_br))
{
+ // If we have an offset, we're continuing a dash
+ // from a previous element and should only
+ // continue the current dash, without starting a
+ // new subpath.
+ if (!has_offset || !hasMoveTo) {
+ emitMoveTo(move_to_pos.x, move_to_pos.y);
+ hasMoveTo = true;
+ }
+
emitLineTo(line_to_pos.x, line_to_pos.y);
+ } else {
+ hasMoveTo = false;
}
+ move_to_pos = line_to_pos;
} else {
move_to_pos.x = qt_real_to_fixed(p2.x());
move_to_pos.y = qt_real_to_fixed(p2.y());
}
-
- idash = (idash + idash_incr) % dashCount;
}
// Shuffle to the next cycle...
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index cf3957b..4418018 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -195,7 +195,7 @@ QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g) const
QFontEngineFT::QGlyphSet *gset = ft->loadTransformedGlyphSet(m_transform);
if (gset && ft->loadGlyphs(gset, &g, 1, format)) {
- QFontEngineFT::Glyph *glyph = gset->glyph_data.value(g);
+ QFontEngineFT::Glyph *glyph = gset->getGlyph(g);
const int bytesPerLine = (format == QFontEngineFT::Format_Mono ? ((glyph->width + 31) & ~31) >> 3
: (glyph->width + 3) & ~3);
return QImage(glyph->data, glyph->width, glyph->height, bytesPerLine, imageFormat);
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 9909643..212a582 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -293,7 +293,8 @@ inline QTransform &QTransform::operator*=(qreal num)
affine._dx *= num;
affine._dy *= num;
m_33 *= num;
- m_dirty |= TxScale;
+ if (m_dirty < TxScale)
+ m_dirty = TxScale;
return *this;
}
inline QTransform &QTransform::operator/=(qreal div)
@@ -316,7 +317,7 @@ inline QTransform &QTransform::operator+=(qreal num)
affine._dx += num;
affine._dy += num;
m_33 += num;
- m_dirty |= TxProject;
+ m_dirty = TxProject;
return *this;
}
inline QTransform &QTransform::operator-=(qreal num)
@@ -332,7 +333,7 @@ inline QTransform &QTransform::operator-=(qreal num)
affine._dx -= num;
affine._dy -= num;
m_33 -= num;
- m_dirty |= TxProject;
+ m_dirty = TxProject;
return *this;
}
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 028ec48..d05c7e4 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -70,13 +70,13 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
// We create empty CFbsBitmap here -> it will be resized in setGeometry
CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new
qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) );
-
+
QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType);
if (data) {
data->fromSymbianBitmap(bitmap, true);
d_ptr->device = QPixmap(data);
}
-
+
setStaticContentsSupport(true);
}
QS60WindowSurface::~QS60WindowSurface()
@@ -89,24 +89,15 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
if (!qt_widget_private(window())->isOpaque) {
QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
pixmapData->beginDataAccess();
- QImage &image = pixmapData->image;
- QRgb *data = reinterpret_cast<QRgb *>(image.bits());
- const int row_stride = image.bytesPerLine() / 4;
+ QPainter p(&pixmapData->image);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
const QVector<QRect> rects = rgn.rects();
+ const QColor blank = Qt::transparent;
for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
- const int x_start = it->x();
- const int width = it->width();
-
- const int y_start = it->y();
- const int height = it->height();
-
- QRgb *row = data + row_stride * y_start;
- for (int y = 0; y < height; ++y) {
- qt_memfill(row + x_start, 0U, width);
- row += row_stride;
- }
+ p.fillRect(*it, blank);
}
+
pixmapData->endDataAccess();
}
}
@@ -128,7 +119,7 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget)
const QPoint off = offset(widget);
QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image);
-
+
QRect rect(off, widget->size());
rect &= QRect(QPoint(), img->size());
diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h
index 438b80c..553675f 100644
--- a/src/gui/s60framework/qs60maindocument.h
+++ b/src/gui/s60framework/qs60maindocument.h
@@ -46,7 +46,7 @@
#ifdef Q_WS_S60
-#include <akndoc.h>
+#include <AknDoc.h>
class CEikApplication;
diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri
index 5884b68..6080e6d 100644
--- a/src/gui/s60framework/s60framework.pri
+++ b/src/gui/s60framework/s60framework.pri
@@ -5,7 +5,7 @@ minimalAppResource31 = \
"SOURCEPATH s60framework" \
"START RESOURCE s60main.rss" \
"HEADER" \
- "TARGETPATH resource\apps" \
+ "TARGETPATH /resource/apps" \
"END"
MMP_RULES += minimalAppResource31
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index cb49fbc..ecac3d6 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/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp
index 359e7e1..296c51c 100644
--- a/src/gui/styles/qstylehelper.cpp
+++ b/src/gui/styles/qstylehelper.cpp
@@ -44,7 +44,6 @@
#include <qstyleoption.h>
#include <qpainter.h>
#include <qpixmapcache.h>
-#include <qstringbuilder.h>
#include <private/qmath_p.h>
#include <private/qstyle_p.h>
#include <qmath.h>
@@ -55,6 +54,8 @@
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
+#include <qstringbuilder.h>
+
QT_BEGIN_NAMESPACE
// internal helper. Converts an integer value to an unique string token
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 676f59e..5084442 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -164,17 +164,17 @@ contains( styles, windowsmobile ) {
}
contains( styles, s60 ):contains(QT_CONFIG, s60) {
- HEADERS += \
- styles/qs60style.h \
- styles/qs60style_p.h
- SOURCES += styles/qs60style.cpp
- symbian {
- SOURCES += styles/qs60style_s60.cpp
- LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul -lbmpanim
- } else {
- SOURCES += styles/qs60style_simulated.cpp
- RESOURCES += styles/qstyle_s60_simulated.qrc
- }
+ HEADERS += \
+ styles/qs60style.h \
+ styles/qs60style_p.h
+ SOURCES += styles/qs60style.cpp
+ symbian {
+ SOURCES += styles/qs60style_s60.cpp
+ LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils -legul -lbmpanim
+ } else {
+ SOURCES += styles/qs60style_simulated.cpp
+ RESOURCES += styles/qstyle_s60_simulated.qrc
+ }
} else {
- DEFINES += QT_NO_STYLE_S60
+ DEFINES += QT_NO_STYLE_S60
}
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index 62d7793..a3d8d65 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -632,8 +632,9 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
#ifndef QT_NO_FREETYPE
QScopedPointer<QFontEngineFT> fte(new QFontEngineFT(def));
- if (fte->init(faceId, style->antialiased,
- style->antialiased ? QFontEngineFT::Format_A8 : QFontEngineFT::Format_Mono)) {
+ bool antialias = style->antialiased && !(request.styleStrategy & QFont::NoAntialias);
+ if (fte->init(faceId, antialias,
+ antialias ? QFontEngineFT::Format_A8 : QFontEngineFT::Format_Mono)) {
#ifdef QT_NO_QWS_QPF2
return fte.take();
#else
@@ -793,7 +794,7 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
" family: %s [%s], script: %d\n"
" weight: %d, style: %d\n"
" stretch: %d\n"
- " pixelSize: %d\n"
+ " pixelSize: %g\n"
" pitch: %c",
family_name.isEmpty() ? "-- first in script --" : family_name.toLatin1().constData(),
foundry_name.isEmpty() ? "-- any --" : foundry_name.toLatin1().constData(),
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 17ade64..a9def8e 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -619,7 +619,7 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd)
transform = false;
antialias = true;
freetype = 0;
- default_load_flags = 0;
+ default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
default_hint_style = HintNone;
subpixelType = Subpixel_None;
lcdFilterType = 0;
@@ -746,7 +746,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format)
QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph) const
{
- Glyph *g = set->glyph_data.value(glyph);
+ Glyph *g = set->getGlyph(glyph);
if (g)
return g;
@@ -858,10 +858,10 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, Glyph
}
}
- Glyph *g = set->glyph_data.value(glyph);
+ Glyph *g = set->getGlyph(glyph);
if (g && g->format == format) {
if (uploadToServer && !g->uploadedToServer) {
- set->glyph_data[glyph] = 0;
+ set->setGlyph(glyph, 0);
delete g;
g = 0;
} else {
@@ -1158,7 +1158,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, Glyph
uploadGlyphToServer(set, glyph, g, &info, glyph_buffer_size);
}
- set->glyph_data[glyph] = g;
+ set->setGlyph(glyph, g);
return g;
}
@@ -1381,8 +1381,7 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadTransformedGlyphSet(const QTransfor
}
gs = &transformedGlyphSets[0];
- qDeleteAll(gs->glyph_data);
- gs->glyph_data.clear();
+ gs->clear();
gs->id = allocateServerGlyphSet();
@@ -1398,7 +1397,7 @@ bool QFontEngineFT::loadGlyphs(QGlyphSet *gs, glyph_t *glyphs, int num_glyphs, G
FT_Face face = 0;
for (int i = 0; i < num_glyphs; ++i) {
- Glyph *glyph = gs->glyph_data.value(glyphs[i]);
+ Glyph *glyph = gs->getGlyph(glyphs[i]);
if (glyph == 0 || glyph->format != format) {
if (!face) {
face = lockFace();
@@ -1635,7 +1634,7 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag
FT_Face face = 0;
if (flags & QTextEngine::DesignMetrics) {
for (int i = 0; i < glyphs->numGlyphs; i++) {
- Glyph *g = defaultGlyphSet.glyph_data.value(glyphs->glyphs[i]);
+ Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]);
if (g) {
glyphs->advances_x[i] = QFixed::fromFixed(g->linearAdvance);
} else {
@@ -1648,7 +1647,7 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag
}
} else {
for (int i = 0; i < glyphs->numGlyphs; i++) {
- Glyph *g = defaultGlyphSet.glyph_data.value(glyphs->glyphs[i]);
+ Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]);
if (g) {
glyphs->advances_x[i] = QFixed(g->advance);
} else {
@@ -1677,7 +1676,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs)
QFixed ymax = 0;
QFixed xmax = 0;
for (int i = 0; i < glyphs.numGlyphs; i++) {
- Glyph *g = defaultGlyphSet.glyph_data.value(glyphs.glyphs[i]);
+ Glyph *g = defaultGlyphSet.getGlyph(glyphs.glyphs[i]);
if (!g) {
if (!face)
face = lockFace();
@@ -1719,7 +1718,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph)
{
FT_Face face = 0;
glyph_metrics_t overall;
- Glyph *g = defaultGlyphSet.glyph_data.value(glyph);
+ Glyph *g = defaultGlyphSet.getGlyph(glyph);
if (!g) {
face = lockFace();
g = loadGlyph(glyph, Format_None, true);
@@ -1783,8 +1782,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matr
transformedGlyphSets.prepend(QGlyphSet());
}
glyphSet = &transformedGlyphSets[0];
- qDeleteAll(glyphSet->glyph_data);
- glyphSet->glyph_data.clear();
+ glyphSet->clear();
glyphSet->id = allocateServerGlyphSet();
glyphSet->transformationMatrix = m;
}
@@ -1792,7 +1790,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matr
} else {
glyphSet = &defaultGlyphSet;
}
- Glyph * g = glyphSet->glyph_data.value(glyph);
+ Glyph * g = glyphSet->getGlyph(glyph);
if (!g) {
face = lockFace();
g = loadGlyphMetrics(glyphSet, glyph);
@@ -1881,7 +1879,7 @@ QImage QFontEngineFT::alphaRGBMapForGlyph(glyph_t g, int margin, const QTransfor
void QFontEngineFT::removeGlyphFromCache(glyph_t glyph)
{
- delete defaultGlyphSet.glyph_data.take(glyph);
+ defaultGlyphSet.removeGlyphFromCache(glyph);
}
int QFontEngineFT::glyphCount() const
@@ -1937,11 +1935,53 @@ QFontEngineFT::QGlyphSet::QGlyphSet()
transformationMatrix.yy = 0x10000;
transformationMatrix.xy = 0;
transformationMatrix.yx = 0;
+ memset(fast_glyph_data, 0, sizeof(fast_glyph_data));
+ fast_glyph_count = 0;
}
QFontEngineFT::QGlyphSet::~QGlyphSet()
{
+ clear();
+}
+
+void QFontEngineFT::QGlyphSet::clear()
+{
+ if (fast_glyph_count > 0) {
+ for (int i = 0; i < 256; ++i) {
+ if (fast_glyph_data[i]) {
+ delete fast_glyph_data[i];
+ fast_glyph_data[i] = 0;
+ }
+ }
+ fast_glyph_count = 0;
+ }
qDeleteAll(glyph_data);
+ glyph_data.clear();
+}
+
+void QFontEngineFT::QGlyphSet::removeGlyphFromCache(int index)
+{
+ if (index < 256) {
+ if (fast_glyph_data[index]) {
+ delete fast_glyph_data[index];
+ fast_glyph_data[index] = 0;
+ if (fast_glyph_count > 0)
+ --fast_glyph_count;
+ }
+ } else {
+ delete glyph_data.take(index);
+ }
+}
+
+void QFontEngineFT::QGlyphSet::setGlyph(int index, Glyph *glyph)
+{
+ if (index < 256) {
+ if (!fast_glyph_data[index])
+ ++fast_glyph_count;
+ fast_glyph_data[index] = glyph;
+ } else {
+ glyph_data.insert(index, glyph);
+ }
}
unsigned long QFontEngineFT::allocateServerGlyphSet()
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 98dd002..12b7da8 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -180,7 +180,21 @@ public:
FT_Matrix transformationMatrix;
unsigned long id; // server sided id, GlyphSet for X11
bool outline_drawing;
+
+ void removeGlyphFromCache(int index);
+ void clear();
+ inline Glyph *getGlyph(int index) const
+ {
+ if (index < 256)
+ return fast_glyph_data[index];
+ return glyph_data.value(index);
+ }
+ void setGlyph(int index, Glyph *glyph);
+
+private:
mutable QHash<int, Glyph *> glyph_data; // maps from glyph index to glyph data
+ mutable Glyph *fast_glyph_data[256]; // for fast lookup of glyphs < 256
+ mutable int fast_glyph_count;
};
virtual QFontEngine::FaceId faceId() const;
@@ -252,7 +266,7 @@ public:
QGlyphSet *defaultGlyphs() { return &defaultGlyphSet; }
GlyphFormat defaultGlyphFormat() const { return defaultFormat; }
- inline Glyph *cachedGlyph(glyph_t g) const { return defaultGlyphSet.glyph_data.value(g); }
+ inline Glyph *cachedGlyph(glyph_t g) const { return defaultGlyphSet.getGlyph(g); }
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);
bool loadGlyphs(QGlyphSet *gs, glyph_t *glyphs, int num_glyphs, GlyphFormat format = Format_Render);
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 48bc635..8588214 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -308,7 +308,7 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
CTFontGetAdvancesForGlyphs(runFont, kCTFontHorizontalOrientation, tmpGlyphs + glyphCount - 1, &lastGlyphAdvance, 1);
outGlyphs[rtl ? 0 : (glyphCount - 1)] = tmpGlyphs[glyphCount - 1] | fontIndex;
- outAdvances_x[rtl ? 0 : (glyphCount - 1)] = QFixed::fromReal(lastGlyphAdvance.width).ceil();
+ outAdvances_x[rtl ? 0 : (glyphCount - 1)] = QFixed::fromReal(lastGlyphAdvance.width);
}
outGlyphs += glyphCount;
outAttributes += glyphCount;
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index 136737d..a0593cc 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -920,8 +920,18 @@ void QFontEngineQPF::loadGlyph(glyph_t glyph)
if (!renderingFontEngine)
return;
-
- QImage img = renderingFontEngine->alphaMapForGlyph(glyph).convertToFormat(QImage::Format_Indexed8);
+ QImage img = renderingFontEngine->alphaMapForGlyph(glyph);
+ if (img.format() != QImage::Format_Indexed8) {
+ bool mono = img.depth() == 1;
+ img = img.convertToFormat(QImage::Format_Indexed8);
+ if (mono) {
+ //### we know that 1 is opaque and 0 is transparent
+ uchar *byte = img.bits();
+ int count = img.byteCount();
+ while (count--)
+ *byte++ *= 0xff;
+ }
+ }
glyph_metrics_t metrics = renderingFontEngine->boundingBox(glyph);
renderingFontEngine->removeGlyphFromCache(glyph);
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 8fe4c47..1fabf12 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -282,8 +282,10 @@ QString QStaticText::text() const
}
/*!
- Sets the performance hint of the QStaticText. This hint can be used to customize how much
- caching is done internally to improve performance.
+ Sets the performance hint of the QStaticText according to the \a
+ performanceHint provided. The \a performanceHint is used to
+ customize how much caching is done internally to improve
+ performance.
The default is QStaticText::ModerateCaching.
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index f36cbd2..5054b66 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -382,6 +382,7 @@ struct Q_AUTOTEST_EXPORT QScriptLine
QFixed y;
QFixed width;
QFixed textWidth;
+ QFixed textAdvance;
int from;
signed int length : 29;
mutable uint justified : 1;
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index dca2da5..140cf43 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -3085,7 +3085,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format)
f.d = new QTextFormatPrivate;
f.d->resolveFont(defaultFnt);
- hashes.insert(hash, idx);
+ if (!hashes.contains(hash, idx))
+ hashes.insert(hash, idx);
} QT_CATCH(...) {
formats.pop_back();
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index af91603..cc6793d 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1875,6 +1875,7 @@ void QTextLine::layout_helper(int maxGlyphs)
line.textWidth += lbh.softHyphenWidth;
}
+ line.textAdvance = line.textWidth;
line.textWidth += lbh.rightBearing;
goto found;
@@ -1885,6 +1886,7 @@ void QTextLine::layout_helper(int maxGlyphs)
}
LB_DEBUG("reached end of line");
lbh.checkFullOtherwiseExtend(line);
+ line.textAdvance = line.textWidth;
line.textWidth += lbh.rightBearing;
found:
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 65b998f..a415180 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -62,8 +62,8 @@ const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592
#ifdef Q_WS_S60
# include <pathinfo.h> // PathInfo
# ifdef USE_DOCUMENTHANDLER
-# include <documenthandler.h> // CDocumentHandler
-# include <aknserverapp.h>
+# include <DocumentHandler.h> // CDocumentHandler
+# include <AknServerApp.h>
# endif
#else
# warning CDocumentHandler requires support for S60
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index cdbb7cc..3074367 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -41,5 +41,5 @@ embedded {
symbian {
LIBS += -lsendas2 -letext -lapmime
- contains(QT_CONFIG, s60): LIBS += -lplatformenv -lcommonui
+ contains(QT_CONFIG, s60): LIBS += -lplatformenv -lCommonUI
}
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index f44858a..806654c 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -1995,16 +1995,19 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
#ifdef QT_NO_TABBAR
const int tabBarShape = 0;
#endif
- QDockAreaLayoutInfo *info = new QDockAreaLayoutInfo(sep, dockPos, o,
- tabBarShape, mainWindow);
- QDockAreaLayoutItem item(info);
+ QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o,
+ tabBarShape, mainWindow));
stream >> item.pos >> item.size >> dummy >> dummy;
- if (!info->restoreState(stream, widgets, testing))
+ //we need to make sure the element is in the list so the dock widget can eventually be docked correctly
+ if (!testing)
+ item_list.append(item);
+
+ //here we need to make sure we change the item in the item_list
+ QDockAreaLayoutItem &lastItem = testing ? item : item_list.last();
+
+ if (!lastItem.subinfo->restoreState(stream, widgets, testing))
return false;
- if (!testing) {
- item_list.append(item);
- }
} else {
return false;
}
diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp
index 2c76a5c..468c111 100644
--- a/src/gui/widgets/qlineedit_p.cpp
+++ b/src/gui/widgets/qlineedit_p.cpp
@@ -134,7 +134,7 @@ void QLineEditPrivate::_q_selectionChanged()
q->initStyleOption(&opt);
bool showCursor = control->hasSelectedText() ?
q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q):
- true;
+ q->hasFocus();
setCursorVisible(showCursor);
}
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index bf926f8..d2eda80 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -65,9 +65,6 @@ QT_BEGIN_NAMESPACE
extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp
QT_END_NAMESPACE
#endif
-#ifdef QT_SOFTKEYS_ENABLED
-#include <private/qsoftkeymanager_p.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -80,9 +77,6 @@ public:
#ifdef Q_WS_MAC
, useHIToolBar(false)
#endif
-#ifdef QT_SOFTKEYS_ENABLED
- , menuBarAction(0)
-#endif
#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
, hasOldCursor(false) , cursorAdjusted(false)
#endif
@@ -94,9 +88,6 @@ public:
#ifdef Q_WS_MAC
bool useHIToolBar;
#endif
-#ifdef QT_SOFTKEYS_ENABLED
- QAction *menuBarAction;
-#endif
void init();
QList<int> hoverSeparator;
QPoint hoverPos;
@@ -117,10 +108,6 @@ void QMainWindowPrivate::init()
const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q);
iconSize = QSize(metric, metric);
q->setAttribute(Qt::WA_Hover);
-#ifdef QT_SOFTKEYS_ENABLED
- menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q);
- menuBarAction->setVisible(false);
-#endif
}
/*
@@ -492,13 +479,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar)
oldMenuBar->deleteLater();
}
d->layout->setMenuBar(menuBar);
-
-#ifdef QT_SOFTKEYS_ENABLED
- if (menuBar)
- addAction(d->menuBarAction);
- else
- removeAction(d->menuBarAction);
-#endif
}
/*!
@@ -1428,11 +1408,6 @@ bool QMainWindow::event(QEvent *event)
}
break;
#endif
-#ifdef QT_SOFTKEYS_ENABLED
- case QEvent::LanguageChange:
- d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey));
- break;
-#endif
default:
break;
}
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 2570cb5..43722a1 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1935,7 +1935,7 @@ static bool qt_mac_should_disable_menu(QMenuBar *menuBar)
if (w->isVisible() && w->windowModality() == Qt::ApplicationModal) {
for (int i=0; i<topLevelWidgets.size(); ++i) {
QWidget *top = topLevelWidgets.at(i);
- if (w != top && [qt_mac_window_for(top) isVisible]) {
+ if (w != top && top->isVisible()) {
// INVARIANT: we found another visible window
// on screen other than our modalWidget. We therefore
// disable the menu bar to follow normal modality logic:
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index 276ffe6..39cbbd8 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -347,7 +347,7 @@ public:
void syncAction(QWceMenuAction *);
inline void syncAction(QAction *a) { syncAction(findAction(a)); }
void removeAction(QWceMenuAction *);
- void rebuild(bool reCreate = false);
+ void rebuild();
inline void removeAction(QAction *a) { removeAction(findAction(a)); }
inline QWceMenuAction *findAction(QAction *a) {
for(int i = 0; i < actionItems.size(); i++) {
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index e46688c..7224768 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -324,6 +324,14 @@ void QMenuBarPrivate::symbianDestroyMenuBar()
symbian_menubar = 0;
}
+void QMenuBarPrivate::reparentMenuBar(QWidget *oldParent, QWidget *newParent)
+{
+ if (menubars()->contains(oldParent)) {
+ QMenuBarPrivate *object = menubars()->take(oldParent);
+ menubars()->insert(newParent, object);
+ }
+}
+
QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar)
{
d = menubar;
diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp
index 28b6b8b..1577f0a 100644
--- a/src/gui/widgets/qmenu_wince.cpp
+++ b/src/gui/widgets/qmenu_wince.cpp
@@ -101,7 +101,6 @@ struct qt_SHMENUBARINFO
COLORREF clrBk;
};
-typedef int (WINAPI *superfunc)(int, int);
typedef BOOL (WINAPI *AygCreateMenuBar)(qt_SHMENUBARINFO*);
typedef HRESULT (WINAPI *AygEnableSoftKey)(HWND,UINT,BOOL,BOOL);
@@ -254,6 +253,12 @@ static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action, bool create
}
}
+// Removes all items from the menu without destroying the handles.
+static void qt_wce_clear_menu(HMENU hMenu)
+{
+ while (RemoveMenu(hMenu, 0, MF_BYPOSITION));
+}
+
/*!
\internal
@@ -404,7 +409,8 @@ QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate() {
QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate() {
qt_wce_delete_action_list(&actionItems);
- menuHandle = 0;
+ if (menuHandle)
+ DestroyMenu(menuHandle);
}
void QMenuPrivate::QWceMenuPrivate::addAction(QAction *a, QWceMenuAction *before) {
@@ -439,14 +445,17 @@ HMENU QMenuPrivate::wceMenu(bool create) {
if (!wce_menu)
wce_menu = new QWceMenuPrivate;
if (!wce_menu->menuHandle || create)
- wce_menu->rebuild(create);
+ wce_menu->rebuild();
return wce_menu->menuHandle;
}
-void QMenuPrivate::QWceMenuPrivate::rebuild(bool reCreate) {
- if (menuHandle && !reCreate)
- DestroyMenu(menuHandle);
- menuHandle = CreatePopupMenu();
+void QMenuPrivate::QWceMenuPrivate::rebuild()
+{
+ if (!menuHandle)
+ menuHandle = CreatePopupMenu();
+ else
+ qt_wce_clear_menu(menuHandle);
+
for (int i = 0; i < actionItems.size(); ++i) {
QWceMenuAction *action = actionItems.at(i);
action->menuHandle = menuHandle;
@@ -522,6 +531,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() {
resourceHandle = IDR_MAIN_MENU5;
}
Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted");
+ qt_wce_clear_menu(menuHandle);
DestroyWindow(menubarHandle);
menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), resourceHandle);
Q_ASSERT_X(menubarHandle, "rebuild classic menu", "cannot create menubar from resource");
@@ -563,6 +573,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() {
leftButtonIsMenu = (leftButtonAction && leftButtonAction->menu());
Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted");
+ qt_wce_clear_menu(menuHandle);
DestroyWindow(menubarHandle);
if (leftButtonIsMenu) {
menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU2);
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index 9caadb7..13aa02b 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -71,6 +71,10 @@
extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp
#endif
+#ifdef QT_SOFTKEYS_ENABLED
+#include <private/qsoftkeymanager_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QMenuBarExtension : public QToolButton
@@ -740,17 +744,14 @@ void QMenuBarPrivate::init()
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
}
#endif
-#ifdef Q_WS_S60
- symbianCreateMenuBar(q->parentWidget());
- if(symbian_menubar)
- q->hide();
-#endif
-
q->setBackgroundRole(QPalette::Button);
oldWindow = oldParent = 0;
#ifdef QT3_SUPPORT
doAutoResize = false;
#endif
+#ifdef QT_SOFTKEYS_ENABLED
+ menuBarAction = 0;
+#endif
handleReparent();
q->setMouseTracking(q->style()->styleHint(QStyle::SH_MenuBar_MouseTracking, 0, q));
@@ -1384,10 +1385,38 @@ void QMenuBarPrivate::handleReparent()
wce_menubar->rebuild();
#endif
#ifdef Q_WS_S60
- if (symbian_menubar)
+
+ // Construct symbian_menubar when this code path is entered first time
+ // and when newParent != NULL
+ if (!symbian_menubar)
+ symbianCreateMenuBar(newParent);
+
+ // Reparent and rebuild menubar when parent is changed
+ if (symbian_menubar) {
+ if (oldParent != newParent)
+ reparentMenuBar(oldParent, newParent);
+ q->hide();
symbian_menubar->rebuild();
-#endif
+ }
+#ifdef QT_SOFTKEYS_ENABLED
+ // Constuct menuBarAction when this code path is entered first time
+ if (!menuBarAction) {
+ if (newParent) {
+ menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent);
+ menuBarAction->setVisible(false);
+ newParent->addAction(menuBarAction);
+ }
+ } else {
+ // If reparenting i.e. we already have menuBarAction, remove it from old parent
+ // and add for a new parent
+ if (oldParent)
+ oldParent->removeAction(menuBarAction);
+ if (newParent)
+ newParent->addAction(menuBarAction);
+ }
+#endif // QT_SOFTKEYS_ENABLED
+#endif // Q_WS_S60
}
#ifdef QT3_SUPPORT
@@ -1440,7 +1469,13 @@ void QMenuBar::changeEvent(QEvent *e)
|| e->type() == QEvent::ApplicationFontChange) {
d->itemsDirty = true;
d->updateGeometries();
+#ifdef QT_SOFTKEYS_ENABLED
+ } else if (e->type() == QEvent::LanguageChange) {
+ if (d->menuBarAction)
+ d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey));
+#endif
}
+
QWidget::changeEvent(e);
}
diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h
index 819aee4..82070fe 100644
--- a/src/gui/widgets/qmenubar_p.h
+++ b/src/gui/widgets/qmenubar_p.h
@@ -244,6 +244,7 @@ public:
#ifdef Q_WS_S60
void symbianCreateMenuBar(QWidget *);
void symbianDestroyMenuBar();
+ void reparentMenuBar(QWidget *oldParent, QWidget *newParent);
struct QSymbianMenuBarPrivate {
QList<QSymbianMenuAction*> actionItems;
QMenuBarPrivate *d;
@@ -268,7 +269,9 @@ public:
} *symbian_menubar;
static int symbianCommands(int command);
-
+#ifdef QT_SOFTKEYS_ENABLED
+ QAction *menuBarAction;
+#endif
#endif
};
#endif
diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp
index 4eff260..c0eeb2f 100644
--- a/src/gui/widgets/qscrollbar.cpp
+++ b/src/gui/widgets/qscrollbar.cpp
@@ -523,6 +523,7 @@ bool QScrollBar::event(QEvent *event)
break;
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel: {
+ event->ignore();
// override wheel event without adding virtual function override
QWheelEvent *ev = static_cast<QWheelEvent *>(event);
int delta = ev->delta();
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 8b47043..3886f5c 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-SUBDIRS += widgets
+SUBDIRS += widgets particles
contains(QT_CONFIG, webkit): SUBDIRS += webkit
contains(QT_CONFIG, multimedia): SUBDIRS += multimedia
diff --git a/src/imports/multimedia/multimedia.pro b/src/imports/multimedia/multimedia.pro
index f7a1d1b..16b3ace 100644
--- a/src/imports/multimedia/multimedia.pro
+++ b/src/imports/multimedia/multimedia.pro
@@ -17,10 +17,10 @@ SOURCES += \
qdeclarativevideo.cpp \
qmetadatacontrolmetaobject.cpp
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/Qt/multimedia
-target.path = $$TARGETPATH
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-qmldir.files += $$QT_BUILD_TREE/imports/Qt/multimedia/qmldir
+qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += target qmldir
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index df2888c..40133ee 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -316,8 +316,9 @@ QDeclarativeAudio::Error QDeclarativeAudio::error() const
/*!
\qmlsignal Audio::onError(error, errorString)
- This handler is called when an \l {Error}{error} has occurred. The errorString parameter
- may contain more detailed information about the error.
+ This handler is called when an \l {QMediaPlayer::Error}{error} has
+ occurred. The errorString parameter may contain more detailed
+ information about the error.
*/
QT_END_NAMESPACE
diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp
index 064f242..80c0ba4 100644
--- a/src/imports/multimedia/qdeclarativevideo.cpp
+++ b/src/imports/multimedia/qdeclarativevideo.cpp
@@ -317,8 +317,9 @@ QDeclarativeVideo::Error QDeclarativeVideo::error() const
/*!
\qmlsignal Video::onError(error, errorString)
- This handler is called when an \l {Error}{error} has occurred. The errorString parameter
- may contain more detailed information about the error.
+ This handler is called when an \l {QMediaPlayer::Error}{error} has
+ occurred. The errorString parameter may contain more detailed
+ information about the error.
*/
/*!
diff --git a/src/imports/particles/particles.cpp b/src/imports/particles/particles.cpp
new file mode 100644
index 0000000..ae3f318
--- /dev/null
+++ b/src/imports/particles/particles.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins 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 <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+
+#include "qdeclarativeparticles_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QParticlesQmlModule : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.particles"));
+ qmlRegisterType<QDeclarativeParticleMotion>(uri,1,0,"ParticleMotion");
+ qmlRegisterType<QDeclarativeParticleMotionGravity>(uri,1,0,"ParticleMotionGravity");
+ qmlRegisterType<QDeclarativeParticleMotionLinear>(uri,1,0,"ParticleMotionLinear");
+ qmlRegisterType<QDeclarativeParticleMotionWander>(uri,1,0,"ParticleMotionWander");
+ qmlRegisterType<QDeclarativeParticles>(uri,1,0,"Particles");
+ }
+};
+
+QT_END_NAMESPACE
+
+#include "particles.moc"
+
+Q_EXPORT_PLUGIN2(particlesqmlmodule, QT_PREPEND_NAMESPACE(QParticlesQmlModule));
+
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
new file mode 100644
index 0000000..02d9ea6
--- /dev/null
+++ b/src/imports/particles/particles.pro
@@ -0,0 +1,20 @@
+TARGET = particles
+TARGETPATH = Qt/labs/particles
+include(../qimportbase.pri)
+
+QT += declarative
+
+SOURCES += \
+ qdeclarativeparticles.cpp \
+ particles.cpp
+
+HEADERS += \
+ qdeclarativeparticles_p.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+INSTALLS += target qmldir
diff --git a/src/declarative/graphicsitems/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index ec0bf6c..bb6669a 100644
--- a/src/declarative/graphicsitems/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -41,13 +41,12 @@
#include "qdeclarativeparticles_p.h"
-#include "qdeclarativeitem_p.h"
+#include <private/qdeclarativeitem_p.h>
-#include <qdeclarativepixmapcache_p.h>
-#include <qfxperf_p_p.h>
-#include <qdeclarativeanimation_p_p.h>
+#include <private/qdeclarativepixmapcache_p.h>
+#include <private/qfxperf_p_p.h>
+#include <QtCore/QAbstractAnimation>
-#include <QNetworkReply>
#include <QPainter>
#include <QtGui/qdrawutil.h>
#include <QVarLengthArray>
@@ -412,6 +411,20 @@ public:
QDeclarativeParticlesPrivate* d;
};
+//an animation that just gives a tick
+template<class T, void (T::*method)(int)>
+class TickAnimationProxy : public QAbstractAnimation
+{
+public:
+ TickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {}
+ virtual int duration() const { return -1; }
+protected:
+ virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); }
+
+private:
+ T *m_p;
+};
+
//---------------------------------------------------------------------------
class QDeclarativeParticlesPrivate : public QDeclarativeItemPrivate
{
@@ -464,7 +477,7 @@ public:
QList<QPair<int, int> > bursts;//countLeft, emissionRate pairs
QList<QDeclarativeParticle> particles;
- QTickAnimationProxy<QDeclarativeParticlesPrivate, &QDeclarativeParticlesPrivate::tick> clock;
+ TickAnimationProxy<QDeclarativeParticlesPrivate, &QDeclarativeParticlesPrivate::tick> clock;
};
@@ -1263,7 +1276,7 @@ void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphics
const int myY = y() + parentItem()->y();
#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
- QVarLengthArray<QPainter::Fragment, 256> pixmapData;
+ QVarLengthArray<QPainter::PixmapFragment, 256> pixmapData;
#else
QVarLengthArray<QDrawPixmaps::Data, 256> pixmapData;
#endif
diff --git a/src/declarative/graphicsitems/qdeclarativeparticles_p.h b/src/imports/particles/qdeclarativeparticles_p.h
index 06acbb9..993796d 100644
--- a/src/declarative/graphicsitems/qdeclarativeparticles_p.h
+++ b/src/imports/particles/qdeclarativeparticles_p.h
@@ -42,7 +42,7 @@
#ifndef QDECLARATIVEPARTICLES_H
#define QDECLARATIVEPARTICLES_H
-#include "qdeclarativeitem.h"
+#include <QtDeclarative/qdeclarativeitem.h>
QT_BEGIN_HEADER
@@ -52,7 +52,7 @@ QT_MODULE(Declarative)
class QDeclarativeParticle;
class QDeclarativeParticles;
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotion : public QObject
+class QDeclarativeParticleMotion : public QObject
{
Q_OBJECT
public:
@@ -63,7 +63,7 @@ public:
virtual void destroy(QDeclarativeParticle &);
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionLinear : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionLinear : public QDeclarativeParticleMotion
{
Q_OBJECT
public:
@@ -73,7 +73,7 @@ public:
virtual void advance(QDeclarativeParticle &, int interval);
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionGravity : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionGravity : public QDeclarativeParticleMotion
{
Q_OBJECT
@@ -106,7 +106,7 @@ private:
qreal _accel;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
{
Q_OBJECT
public:
@@ -142,7 +142,7 @@ Q_SIGNALS:
void xvarianceChanged();
void yvarianceChanged();
void paceChanged();
-
+
private:
QDeclarativeParticles *particles;
qreal _xvariance;
@@ -151,7 +151,7 @@ private:
};
class QDeclarativeParticlesPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeParticles : public QDeclarativeItem
+class QDeclarativeParticles : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/imports/particles/qmldir b/src/imports/particles/qmldir
new file mode 100644
index 0000000..15456bb
--- /dev/null
+++ b/src/imports/particles/qmldir
@@ -0,0 +1 @@
+plugin particles
diff --git a/src/imports/qimportbase.pri b/src/imports/qimportbase.pri
index 5433059..ea12356 100644
--- a/src/imports/qimportbase.pri
+++ b/src/imports/qimportbase.pri
@@ -22,7 +22,7 @@ QMAKE_EXTRA_COMPILERS += copy2build
TARGET = $$qtLibraryTarget($$TARGET)
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-include(../../qt_targets.pri)
+include(../qt_targets.pri)
wince*:LIBS += $$QMAKE_LIBS_GUI
diff --git a/src/imports/webkit/plugin.cpp b/src/imports/webkit/plugin.cpp
index 799fe9e..e3d73ec 100644
--- a/src/imports/webkit/plugin.cpp
+++ b/src/imports/webkit/plugin.cpp
@@ -54,7 +54,7 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.webkit"));
- QML_REGISTER_NOCREATE_TYPE(QDeclarativeWebSettings);
+ qmlRegisterType<QDeclarativeWebSettings>();
qmlRegisterType<QDeclarativeWebView>(uri,1,0,"WebView");
}
};
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
index d78ba28..f8b2b88 100644
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ b/src/imports/webkit/qdeclarativewebview.cpp
@@ -80,6 +80,7 @@ public:
rendering(true)
{
}
+ void focusChanged(bool);
QUrl url; // page url might be different if it has not loaded yet
QWebPage *page;
@@ -378,11 +379,12 @@ QVariant QDeclarativeWebView::evaluateJavaScript(const QString &scriptSource)
return this->page()->mainFrame()->evaluateJavaScript(scriptSource);
}
-void QDeclarativeWebView::focusChanged(bool hasFocus)
+void QDeclarativeWebViewPrivate::focusChanged(bool hasFocus)
{
+ Q_Q(QDeclarativeWebView);
QFocusEvent e(hasFocus ? QEvent::FocusIn : QEvent::FocusOut);
- page()->event(&e);
- QDeclarativeItem::focusChanged(hasFocus);
+ q->page()->event(&e);
+ QDeclarativeItemPrivate::focusChanged(hasFocus);
}
void QDeclarativeWebView::initialLayout()
diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h
index 145e74b..36b18a6 100644
--- a/src/imports/webkit/qdeclarativewebview_p.h
+++ b/src/imports/webkit/qdeclarativewebview_p.h
@@ -42,8 +42,6 @@
#ifndef QDECLARATIVEWEBVIEW_H
#define QDECLARATIVEWEBVIEW_H
-#include "webkitqmlplugin_export.h"
-
#include <private/qdeclarativepainteditem_p.h>
#include <QtGui/QAction>
@@ -64,7 +62,7 @@ class QDeclarativeWebViewPrivate;
class QNetworkRequest;
class QDeclarativeWebView;
-class WEBKITQMLPLUGIN_EXPORT QDeclarativeWebPage : public QWebPage
+class QDeclarativeWebPage : public QWebPage
{
Q_OBJECT
public:
@@ -88,7 +86,7 @@ class QDeclarativeWebViewAttached;
//### TODO: browser plugins
-class WEBKITQMLPLUGIN_EXPORT QDeclarativeWebView : public QDeclarativePaintedItem
+class QDeclarativeWebView : public QDeclarativePaintedItem
{
Q_OBJECT
@@ -239,7 +237,6 @@ protected:
void keyReleaseEvent(QKeyEvent* event);
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
- virtual void focusChanged(bool);
virtual bool sceneEvent(QEvent *event);
QDeclarativeWebView *createWindow(QWebPage::WebWindowType type);
diff --git a/src/imports/webkit/qdeclarativewebview_p_p.h b/src/imports/webkit/qdeclarativewebview_p_p.h
index 3ad9e9a..258b472 100644
--- a/src/imports/webkit/qdeclarativewebview_p_p.h
+++ b/src/imports/webkit/qdeclarativewebview_p_p.h
@@ -42,8 +42,6 @@
#ifndef QDECLARATIVEWEBVIEW_P_H
#define QDECLARATIVEWEBVIEW_P_H
-#include "webkitqmlplugin_export.h"
-
#include <qdeclarative.h>
#include <QtWebKit/QWebPage>
@@ -54,7 +52,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class WEBKITQMLPLUGIN_EXPORT QDeclarativeWebSettings : public QObject {
+class QDeclarativeWebSettings : public QObject {
Q_OBJECT
Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily)
diff --git a/src/imports/webkit/webkit.pro b/src/imports/webkit/webkit.pro
index fdc12cc..ef08efe 100644
--- a/src/imports/webkit/webkit.pro
+++ b/src/imports/webkit/webkit.pro
@@ -3,17 +3,15 @@ TARGETPATH = org/webkit
include(../qimportbase.pri)
QT += webkit declarative
-DEFINES += WEBKITQMLPLUGIN_EXPORTS
SOURCES += qdeclarativewebview.cpp plugin.cpp
HEADERS += qdeclarativewebview_p.h \
- qdeclarativewebview_p_p.h \
- webkitqmlplugin_export.h
+ qdeclarativewebview_p_p.h
-QTDIR_build:DESTDIR = $$TARGETPATH
-target.path = $$TARGETPATH
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-qmldir.files += $$QT_BUILD_TREE/imports/org/webkit/qmldir
+qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += target qmldir
diff --git a/src/imports/widgets/widgets.cpp b/src/imports/widgets/widgets.cpp
index ec21cc4..bc18e8a 100644
--- a/src/imports/widgets/widgets.cpp
+++ b/src/imports/widgets/widgets.cpp
@@ -118,15 +118,15 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.widgets"));
- QML_REGISTER_INTERFACE(QGraphicsLayoutItem);
- QML_REGISTER_INTERFACE(QGraphicsLayout);
+ qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem");
+ qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout");
qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>(uri,4,6,"QGraphicsLinearLayoutStretchItem");
qmlRegisterType<QGraphicsLinearLayoutObject>(uri,4,6,"QGraphicsLinearLayout");
qmlRegisterType<QGraphicsGridLayoutObject>(uri,4,6,"QGraphicsGridLayout");
qmlRegisterExtendedType<QGraphicsView, QGraphicsViewDeclarativeUI>(uri,4,6,"QGraphicsView");
qmlRegisterExtendedType<QGraphicsScene,QGraphicsSceneDeclarativeUI>(uri,4,6,"QGraphicsScene");
qmlRegisterExtendedType<QGraphicsWidget,QGraphicsWidgetDeclarativeUI>(uri,4,6,"QGraphicsWidget");
- QML_REGISTER_INTERFACE(QGraphicsItem);
+ qmlRegisterInterface<QGraphicsItem>("QGraphicsItem");
}
};
diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro
index 02223d7..aa09b3c 100644
--- a/src/imports/widgets/widgets.pro
+++ b/src/imports/widgets/widgets.pro
@@ -12,11 +12,10 @@ HEADERS += \
graphicswidgets_p.h \
graphicslayouts_p.h
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/Qt/widgets
-target.path = $$TARGETPATH
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-# install qmldir file
-qmldir.files += qmldir
-qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
INSTALLS += target qmldir
diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri
index 625b871c..ae28a26 100644
--- a/src/multimedia/audio/audio.pri
+++ b/src/multimedia/audio/audio.pri
@@ -41,6 +41,21 @@ mac {
!wince*:LIBS += -lwinmm
wince*:LIBS += -lcoredll
+} else:symbian {
+ INCLUDEPATH += /epoc32/include/mmf/common
+ INCLUDEPATH += /epoc32/include/mmf/server
+
+ HEADERS += $$PWD/qaudio_symbian_p.h \
+ $$PWD/qaudiodeviceinfo_symbian_p.h \
+ $$PWD/qaudioinput_symbian_p.h \
+ $$PWD/qaudiooutput_symbian_p.h
+
+ SOURCES += $$PWD/qaudio_symbian_p.cpp \
+ $$PWD/qaudiodeviceinfo_symbian_p.cpp \
+ $$PWD/qaudioinput_symbian_p.cpp \
+ $$PWD/qaudiooutput_symbian_p.cpp
+
+ LIBS += -lmmfdevsound
} else:unix {
unix:contains(QT_CONFIG, alsa) {
linux-*|freebsd-*|openbsd-*:{
diff --git a/src/plugins/audio/symbian/symbianaudioutils.cpp b/src/multimedia/audio/qaudio_symbian_p.cpp
index f04c198..58e3745 100644
--- a/src/plugins/audio/symbian/symbianaudioutils.cpp
+++ b/src/multimedia/audio/qaudio_symbian_p.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "symbianaudioutils.h"
+#include "qaudio_symbian_p.h"
#include <mmffourcc.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/audio/symbian/symbianaudioutils.h b/src/multimedia/audio/qaudio_symbian_p.h
index 53274e0..d5238b4 100644
--- a/src/plugins/audio/symbian/symbianaudioutils.h
+++ b/src/multimedia/audio/qaudio_symbian_p.h
@@ -39,19 +39,50 @@
**
****************************************************************************/
-#ifndef SYMBIANAUDIOUTILS_H
-#define SYMBIANAUDIOUTILS_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QAUDIO_SYMBIAN_P_H
+#define QAUDIO_SYMBIAN_P_H
#include <QtCore/qnamespace.h>
#include <QtMultimedia/qaudioformat.h>
#include <QtMultimedia/qaudio.h>
#include <sounddevice.h>
-#include "symbianaudio.h"
QT_BEGIN_NAMESPACE
namespace SymbianAudio {
+/**
+ * Default values used by audio input and output classes, when underlying
+ * DevSound instance has not yet been created.
+ */
+
+const int DefaultBufferSize = 4096; // bytes
+const int DefaultNotifyInterval = 1000; // ms
+
+/**
+ * Enumeration used to track state of internal DevSound instances.
+ * Values are translated to the corresponding QAudio::State values by
+ * SymbianAudio::Utils::stateNativeToQt.
+ */
+enum State {
+ ClosedState
+ , InitializingState
+ , ActiveState
+ , IdleState
+ , SuspendedState
+};
+
/*
* Helper class for querying DevSound codec / format support
*/
diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp
index 459b7f5..4f45110 100644
--- a/src/multimedia/audio/qaudiodevicefactory.cpp
+++ b/src/multimedia/audio/qaudiodevicefactory.cpp
@@ -58,6 +58,10 @@
#include "qaudiodeviceinfo_alsa_p.h"
#include "qaudiooutput_alsa_p.h"
#include "qaudioinput_alsa_p.h"
+#elif defined(Q_OS_SYMBIAN)
+#include "qaudiodeviceinfo_symbian_p.h"
+#include "qaudiooutput_symbian_p.h"
+#include "qaudioinput_symbian_p.h"
#endif
#endif
@@ -128,7 +132,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
{
QList<QAudioDeviceInfo> devices;
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode))
devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode);
#endif
@@ -158,7 +162,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput);
}
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput);
#endif
#endif
@@ -175,7 +179,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput);
}
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput);
#endif
#endif
@@ -187,7 +191,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re
QAbstractAudioDeviceInfo *rc = 0;
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
if (realm == QLatin1String("builtin"))
return new QAudioDeviceInfoInternal(handle, mode);
#endif
@@ -216,7 +220,7 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con
if (deviceInfo.isNull())
return new QNullInputDevice();
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioInputPrivate(deviceInfo.handle(), format);
#endif
@@ -235,7 +239,7 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c
if (deviceInfo.isNull())
return new QNullOutputDevice();
#ifndef QT_NO_AUDIO_BACKEND
-#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
+#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioOutputPrivate(deviceInfo.handle(), format);
#endif
diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp
index 9701dad..36284d3 100644
--- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp
@@ -39,26 +39,26 @@
**
****************************************************************************/
-#include "symbianaudiodeviceinfo.h"
-#include "symbianaudioutils.h"
+#include "qaudiodeviceinfo_symbian_p.h"
+#include "qaudio_symbian_p.h"
QT_BEGIN_NAMESPACE
-SymbianAudioDeviceInfo::SymbianAudioDeviceInfo(QByteArray device,
+QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray device,
QAudio::Mode mode)
- : m_deviceName(device)
+ : m_deviceName(QLatin1String(device))
, m_mode(mode)
, m_updated(false)
{
QT_TRAP_THROWING(m_devsound.reset(CMMFDevSound::NewL()));
}
-SymbianAudioDeviceInfo::~SymbianAudioDeviceInfo()
+QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal()
{
}
-QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const
+QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const
{
QAudioFormat format;
switch (m_mode) {
@@ -100,7 +100,7 @@ QAudioFormat SymbianAudioDeviceInfo::preferredFormat() const
return format;
}
-bool SymbianAudioDeviceInfo::isFormatSupported(
+bool QAudioDeviceInfoInternal::isFormatSupported(
const QAudioFormat &format) const
{
getSupportedFormats();
@@ -115,7 +115,7 @@ bool SymbianAudioDeviceInfo::isFormatSupported(
return supported;
}
-QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) const
+QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat &format) const
{
if (isFormatSupported(format))
return format;
@@ -123,56 +123,65 @@ QAudioFormat SymbianAudioDeviceInfo::nearestFormat(const QAudioFormat &format) c
return preferredFormat();
}
-QString SymbianAudioDeviceInfo::deviceName() const
+QString QAudioDeviceInfoInternal::deviceName() const
{
return m_deviceName;
}
-QStringList SymbianAudioDeviceInfo::codecList()
+QStringList QAudioDeviceInfoInternal::codecList()
{
getSupportedFormats();
return m_codecs;
}
-QList<int> SymbianAudioDeviceInfo::frequencyList()
+QList<int> QAudioDeviceInfoInternal::frequencyList()
{
getSupportedFormats();
return m_frequencies;
}
-QList<int> SymbianAudioDeviceInfo::channelsList()
+QList<int> QAudioDeviceInfoInternal::channelsList()
{
getSupportedFormats();
return m_channels;
}
-QList<int> SymbianAudioDeviceInfo::sampleSizeList()
+QList<int> QAudioDeviceInfoInternal::sampleSizeList()
{
getSupportedFormats();
return m_sampleSizes;
}
-QList<QAudioFormat::Endian> SymbianAudioDeviceInfo::byteOrderList()
+QList<QAudioFormat::Endian> QAudioDeviceInfoInternal::byteOrderList()
{
getSupportedFormats();
return m_byteOrders;
}
-QList<QAudioFormat::SampleType> SymbianAudioDeviceInfo::sampleTypeList()
+QList<QAudioFormat::SampleType> QAudioDeviceInfoInternal::sampleTypeList()
{
getSupportedFormats();
return m_sampleTypes;
}
-QList<QByteArray> SymbianAudioDeviceInfo::deviceList(QAudio::Mode mode)
+QByteArray QAudioDeviceInfoInternal::defaultInputDevice()
{
- Q_UNUSED(mode)
- QList<QByteArray> devices;
- devices.append("default");
- return devices;
+ return QByteArray("default");
}
-void SymbianAudioDeviceInfo::getSupportedFormats() const
+QByteArray QAudioDeviceInfoInternal::defaultOutputDevice()
+{
+ return QByteArray("default");
+}
+
+QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode)
+{
+ QList<QByteArray> result;
+ result += QByteArray("default");
+ return result;
+}
+
+void QAudioDeviceInfoInternal::getSupportedFormats() const
{
if (!m_updated) {
QScopedPointer<SymbianAudio::DevSoundCapabilities> caps(
diff --git a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h
index 250804d..89e539f 100644
--- a/src/plugins/audio/symbian/symbianaudiodeviceinfo.h
+++ b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h
@@ -39,22 +39,33 @@
**
****************************************************************************/
-#ifndef SYMBIANAUDIODEVICEINFO_H
-#define SYMBIANAUDIODEVICEINFO_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QAUDIODEVICEINFO_SYMBIAN_P_H
+#define QAUDIODEVICEINFO_SYMBIAN_P_H
#include <QtMultimedia/qaudioengine.h>
#include <sounddevice.h>
QT_BEGIN_NAMESPACE
-class SymbianAudioDeviceInfo
+class QAudioDeviceInfoInternal
: public QAbstractAudioDeviceInfo
{
Q_OBJECT
public:
- SymbianAudioDeviceInfo(QByteArray device, QAudio::Mode mode);
- ~SymbianAudioDeviceInfo();
+ QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode);
+ ~QAudioDeviceInfoInternal();
// QAbstractAudioDeviceInfo
QAudioFormat preferredFormat() const;
@@ -67,7 +78,9 @@ public:
QList<int> sampleSizeList();
QList<QAudioFormat::Endian> byteOrderList();
QList<QAudioFormat::SampleType> sampleTypeList();
- QList<QByteArray> deviceList(QAudio::Mode);
+ static QByteArray defaultInputDevice();
+ static QByteArray defaultOutputDevice();
+ static QList<QByteArray> availableDevices(QAudio::Mode);
private:
void getSupportedFormats() const;
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index fd892dd..10bab01 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -95,7 +95,7 @@ QT_BEGIN_NAMESPACE
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
- if (QAudioDeviceInfo info(QAudioDeviceInfo::defaultInputDevice());
+ QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
if (!info.isFormatSupported(format)) {
qWarning()<<"default format not supported try to use nearest";
format = info.nearestFormat(format);
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp
index 6010f3c..ead9995 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
@@ -121,6 +121,11 @@ int QAudioInputPrivate::xrun_recovery(int err)
err = snd_pcm_prepare(handle);
if(err < 0)
reset = true;
+ else {
+ bytesAvailable = bytesReady();
+ if (bytesAvailable <= 0)
+ reset = true;
+ }
} else if((err == -ESTRPIPE)||(err == -EIO)) {
errorState = QAudio::IOError;
@@ -443,6 +448,7 @@ int QAudioInputPrivate::bytesReady() const
if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState)
return 0;
int frames = snd_pcm_avail_update(handle);
+ if (frames < 0) return frames;
if((int)frames > (int)buffer_frames)
frames = buffer_frames;
@@ -459,6 +465,20 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len)
bytesAvailable = bytesReady();
+ if (bytesAvailable < 0) {
+ // bytesAvailable as negative is error code, try to recover from it.
+ xrun_recovery(bytesAvailable);
+ bytesAvailable = bytesReady();
+ if (bytesAvailable < 0) {
+ // recovery failed must stop and set error.
+ close();
+ errorState = QAudio::IOError;
+ deviceState = QAudio::StoppedState;
+ emit stateChanged(deviceState);
+ return 0;
+ }
+ }
+
int count=0, err = 0;
while(count < 5) {
int chunks = bytesAvailable/period_size;
@@ -588,7 +608,11 @@ int QAudioInputPrivate::notifyInterval() const
qint64 QAudioInputPrivate::processedUSecs() const
{
- return qint64(1000000) * totalTimeValue / settings.frequency();
+ qint64 result = qint64(1000000) * totalTimeValue /
+ (settings.channels()*(settings.sampleSize()/8)) /
+ settings.frequency();
+
+ return result;
}
void QAudioInputPrivate::suspend()
diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp
index bd2de52..f394ca4 100644
--- a/src/multimedia/audio/qaudioinput_mac_p.cpp
+++ b/src/multimedia/audio/qaudioinput_mac_p.cpp
@@ -229,6 +229,7 @@ public:
QObject* parent):
QObject(parent),
m_deviceError(false),
+ m_audioConverter(0),
m_inputFormat(inputFormat),
m_outputFormat(outputFormat)
{
diff --git a/src/plugins/audio/symbian/symbianaudioinput.cpp b/src/multimedia/audio/qaudioinput_symbian_p.cpp
index 8200925..52daa88 100644
--- a/src/plugins/audio/symbian/symbianaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput_symbian_p.cpp
@@ -39,8 +39,7 @@
**
****************************************************************************/
-#include "symbianaudioinput.h"
-#include "symbianaudioutils.h"
+#include "qaudioinput_symbian_p.h"
QT_BEGIN_NAMESPACE
@@ -56,7 +55,7 @@ const int PushInterval = 50; // ms
//-----------------------------------------------------------------------------
SymbianAudioInputPrivate::SymbianAudioInputPrivate(
- SymbianAudioInput *audioDevice)
+ QAudioInputPrivate *audioDevice)
: m_audioDevice(audioDevice)
{
@@ -104,7 +103,7 @@ void SymbianAudioInputPrivate::dataReady()
// Public functions
//-----------------------------------------------------------------------------
-SymbianAudioInput::SymbianAudioInput(const QByteArray &device,
+QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device,
const QAudioFormat &format)
: m_device(device)
, m_format(format)
@@ -132,12 +131,12 @@ SymbianAudioInput::SymbianAudioInput(const QByteArray &device,
connect(m_pullTimer.data(), SIGNAL(timeout()), this, SLOT(pullData()));
}
-SymbianAudioInput::~SymbianAudioInput()
+QAudioInputPrivate::~QAudioInputPrivate()
{
close();
}
-QIODevice* SymbianAudioInput::start(QIODevice *device)
+QIODevice* QAudioInputPrivate::start(QIODevice *device)
{
stop();
@@ -157,19 +156,19 @@ QIODevice* SymbianAudioInput::start(QIODevice *device)
return m_sink;
}
-void SymbianAudioInput::stop()
+void QAudioInputPrivate::stop()
{
close();
}
-void SymbianAudioInput::reset()
+void QAudioInputPrivate::reset()
{
m_totalSamplesRecorded += getSamplesRecorded();
m_devSound->Stop();
startRecording();
}
-void SymbianAudioInput::suspend()
+void QAudioInputPrivate::suspend()
{
if (SymbianAudio::ActiveState == m_internalState
|| SymbianAudio::IdleState == m_internalState) {
@@ -188,24 +187,24 @@ void SymbianAudioInput::suspend()
}
}
-void SymbianAudioInput::resume()
+void QAudioInputPrivate::resume()
{
if (SymbianAudio::SuspendedState == m_internalState)
startDataTransfer();
}
-int SymbianAudioInput::bytesReady() const
+int QAudioInputPrivate::bytesReady() const
{
Q_ASSERT(m_devSoundBufferPos <= m_totalBytesReady);
return m_totalBytesReady - m_devSoundBufferPos;
}
-int SymbianAudioInput::periodSize() const
+int QAudioInputPrivate::periodSize() const
{
return bufferSize();
}
-void SymbianAudioInput::setBufferSize(int value)
+void QAudioInputPrivate::setBufferSize(int value)
{
// Note that DevSound does not allow its client to specify the buffer size.
// This functionality is available via custom interfaces, but since these
@@ -218,12 +217,12 @@ void SymbianAudioInput::setBufferSize(int value)
m_clientBufferSize = value;
}
-int SymbianAudioInput::bufferSize() const
+int QAudioInputPrivate::bufferSize() const
{
return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize;
}
-void SymbianAudioInput::setNotifyInterval(int ms)
+void QAudioInputPrivate::setNotifyInterval(int ms)
{
if (ms > 0) {
const int oldNotifyInterval = m_notifyInterval;
@@ -233,12 +232,12 @@ void SymbianAudioInput::setNotifyInterval(int ms)
}
}
-int SymbianAudioInput::notifyInterval() const
+int QAudioInputPrivate::notifyInterval() const
{
return m_notifyInterval;
}
-qint64 SymbianAudioInput::processedUSecs() const
+qint64 QAudioInputPrivate::processedUSecs() const
{
int samplesPlayed = 0;
if (m_devSound && SymbianAudio::SuspendedState != m_internalState)
@@ -254,24 +253,24 @@ qint64 SymbianAudioInput::processedUSecs() const
return result;
}
-qint64 SymbianAudioInput::elapsedUSecs() const
+qint64 QAudioInputPrivate::elapsedUSecs() const
{
const qint64 result = (QAudio::StoppedState == state()) ?
0 : m_elapsed.elapsed() * 1000;
return result;
}
-QAudio::Error SymbianAudioInput::error() const
+QAudio::Error QAudioInputPrivate::error() const
{
return m_error;
}
-QAudio::State SymbianAudioInput::state() const
+QAudio::State QAudioInputPrivate::state() const
{
return m_externalState;
}
-QAudioFormat SymbianAudioInput::format() const
+QAudioFormat QAudioInputPrivate::format() const
{
return m_format;
}
@@ -280,7 +279,7 @@ QAudioFormat SymbianAudioInput::format() const
// MDevSoundObserver implementation
//-----------------------------------------------------------------------------
-void SymbianAudioInput::InitializeComplete(TInt aError)
+void QAudioInputPrivate::InitializeComplete(TInt aError)
{
Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState,
Q_FUNC_INFO, "Invalid state");
@@ -289,7 +288,7 @@ void SymbianAudioInput::InitializeComplete(TInt aError)
startRecording();
}
-void SymbianAudioInput::ToneFinished(TInt aError)
+void QAudioInputPrivate::ToneFinished(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound's tone playback functions, so should
@@ -297,7 +296,7 @@ void SymbianAudioInput::ToneFinished(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer)
+void QAudioInputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer)
{
Q_UNUSED(aBuffer)
// This class doesn't use DevSound in play mode, so should never receive
@@ -305,7 +304,7 @@ void SymbianAudioInput::BufferToBeFilled(CMMFBuffer *aBuffer)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioInput::PlayError(TInt aError)
+void QAudioInputPrivate::PlayError(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound in play mode, so should never receive
@@ -313,7 +312,7 @@ void SymbianAudioInput::PlayError(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer)
+void QAudioInputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer)
{
// Following receipt of this callback, DevSound should not provide another
// buffer until we have returned the current one.
@@ -338,13 +337,13 @@ void SymbianAudioInput::BufferToBeEmptied(CMMFBuffer *aBuffer)
}
}
-void SymbianAudioInput::RecordError(TInt aError)
+void QAudioInputPrivate::RecordError(TInt aError)
{
Q_UNUSED(aError)
setError(QAudio::IOError);
}
-void SymbianAudioInput::ConvertError(TInt aError)
+void QAudioInputPrivate::ConvertError(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound's format conversion functions, so
@@ -352,7 +351,7 @@ void SymbianAudioInput::ConvertError(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
+void QAudioInputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
{
Q_UNUSED(aMessageType)
Q_UNUSED(aMsg)
@@ -363,7 +362,7 @@ void SymbianAudioInput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
// Private functions
//-----------------------------------------------------------------------------
-void SymbianAudioInput::open()
+void QAudioInputPrivate::open()
{
Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState,
Q_FUNC_INFO, "DevSound already opened");
@@ -388,7 +387,7 @@ void SymbianAudioInput::open()
}
}
-void SymbianAudioInput::startRecording()
+void QAudioInputPrivate::startRecording()
{
const int samplesRecorded = m_devSound->SamplesRecorded();
Q_ASSERT(samplesRecorded == 0);
@@ -402,7 +401,7 @@ void SymbianAudioInput::startRecording()
}
}
-void SymbianAudioInput::startDevSoundL()
+void QAudioInputPrivate::startDevSoundL()
{
TMMFCapabilities nativeFormat = m_devSound->Config();
m_nativeFormat.iBufferSize = nativeFormat.iBufferSize;
@@ -410,7 +409,7 @@ void SymbianAudioInput::startDevSoundL()
m_devSound->RecordInitL();
}
-void SymbianAudioInput::startDataTransfer()
+void QAudioInputPrivate::startDataTransfer()
{
m_notifyTimer->start(m_notifyInterval);
@@ -429,7 +428,7 @@ void SymbianAudioInput::startDataTransfer()
}
}
-CMMFDataBuffer* SymbianAudioInput::currentBuffer() const
+CMMFDataBuffer* QAudioInputPrivate::currentBuffer() const
{
CMMFDataBuffer *result = m_devSoundBuffer;
if (!result && !m_devSoundBufferQ.empty())
@@ -437,14 +436,14 @@ CMMFDataBuffer* SymbianAudioInput::currentBuffer() const
return result;
}
-void SymbianAudioInput::pushData()
+void QAudioInputPrivate::pushData()
{
Q_ASSERT_X(bytesReady(), Q_FUNC_INFO, "No data available");
Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, "pushData called when in pull mode");
qobject_cast<SymbianAudioInputPrivate *>(m_sink)->dataReady();
}
-qint64 SymbianAudioInput::read(char *data, qint64 len)
+qint64 QAudioInputPrivate::read(char *data, qint64 len)
{
// SymbianAudioInputPrivate is ready to read data
@@ -478,7 +477,7 @@ qint64 SymbianAudioInput::read(char *data, qint64 len)
return bytesRead;
}
-void SymbianAudioInput::pullData()
+void QAudioInputPrivate::pullData()
{
Q_ASSERT_X(m_pullMode, Q_FUNC_INFO,
"pullData called when in push mode");
@@ -504,7 +503,7 @@ void SymbianAudioInput::pullData()
}
}
-void SymbianAudioInput::bufferEmptied()
+void QAudioInputPrivate::bufferEmptied()
{
m_devSoundBufferPos = 0;
@@ -525,7 +524,7 @@ void SymbianAudioInput::bufferEmptied()
Q_ASSERT(m_totalBytesReady >= 0);
}
-void SymbianAudioInput::close()
+void QAudioInputPrivate::close()
{
m_notifyTimer->stop();
m_pullTimer->stop();
@@ -551,7 +550,7 @@ void SymbianAudioInput::close()
setState(SymbianAudio::ClosedState);
}
-qint64 SymbianAudioInput::getSamplesRecorded() const
+qint64 QAudioInputPrivate::getSamplesRecorded() const
{
qint64 result = 0;
if (m_devSound)
@@ -559,7 +558,7 @@ qint64 SymbianAudioInput::getSamplesRecorded() const
return result;
}
-void SymbianAudioInput::setError(QAudio::Error error)
+void QAudioInputPrivate::setError(QAudio::Error error)
{
m_error = error;
@@ -576,7 +575,7 @@ void SymbianAudioInput::setError(QAudio::Error error)
QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection);
}
-void SymbianAudioInput::setState(SymbianAudio::State newInternalState)
+void QAudioInputPrivate::setState(SymbianAudio::State newInternalState)
{
const QAudio::State oldExternalState = m_externalState;
m_internalState = newInternalState;
@@ -587,7 +586,7 @@ void SymbianAudioInput::setState(SymbianAudio::State newInternalState)
emit stateChanged(m_externalState);
}
-QAudio::State SymbianAudioInput::initializingState() const
+QAudio::State QAudioInputPrivate::initializingState() const
{
return QAudio::IdleState;
}
diff --git a/src/plugins/audio/symbian/symbianaudioinput.h b/src/multimedia/audio/qaudioinput_symbian_p.h
index 34b7d38..ca3ccf7 100644
--- a/src/plugins/audio/symbian/symbianaudioinput.h
+++ b/src/multimedia/audio/qaudioinput_symbian_p.h
@@ -39,25 +39,36 @@
**
****************************************************************************/
-#ifndef SYMBIANAUDIOINPUT_H
-#define SYMBIANAUDIOINPUT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QAUDIOINPUT_SYMBIAN_P_H
+#define QAUDIOINPUT_SYMBIAN_P_H
#include <QtMultimedia/qaudioengine.h>
#include <QTime>
#include <QTimer>
#include <sounddevice.h>
-#include "symbianaudio.h"
+#include "qaudio_symbian_p.h"
QT_BEGIN_NAMESPACE
-class SymbianAudioInput;
+class QAudioInputPrivate;
class SymbianAudioInputPrivate : public QIODevice
{
- friend class SymbianAudioInput;
+ friend class QAudioInputPrivate;
Q_OBJECT
public:
- SymbianAudioInputPrivate(SymbianAudioInput *audio);
+ SymbianAudioInputPrivate(QAudioInputPrivate *audio);
~SymbianAudioInputPrivate();
qint64 readData(char *data, qint64 len);
@@ -66,19 +77,19 @@ public:
void dataReady();
private:
- SymbianAudioInput *const m_audioDevice;
+ QAudioInputPrivate *const m_audioDevice;
};
-class SymbianAudioInput
+class QAudioInputPrivate
: public QAbstractAudioInput
, public MDevSoundObserver
{
friend class SymbianAudioInputPrivate;
Q_OBJECT
public:
- SymbianAudioInput(const QByteArray &device,
+ QAudioInputPrivate(const QByteArray &device,
const QAudioFormat &audioFormat);
- ~SymbianAudioInput();
+ ~QAudioInputPrivate();
// QAbstractAudioInput
QIODevice* start(QIODevice *device = 0);
diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp
index 594f6ca..180cbda 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.cpp
+++ b/src/multimedia/audio/qaudioinput_win32_p.cpp
@@ -88,7 +88,7 @@ QAudioInputPrivate::~QAudioInputPrivate()
DeleteCriticalSection(&waveInCriticalSection);
}
-void CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg,
+void QT_WIN_CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
{
Q_UNUSED(dwParam1)
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
index e49c75a..1cef335 100644
--- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
@@ -648,9 +648,10 @@ void QAudioOutputPrivate::userFeed()
void QAudioOutputPrivate::feedback()
{
- QMetaObject::invokeMethod(this, SLOT(updateAvailable()), Qt::QueuedConnection);
+ updateAvailable();
}
+
void QAudioOutputPrivate::updateAvailable()
{
#ifdef DEBUG_AUDIO
diff --git a/src/plugins/audio/symbian/symbianaudiooutput.cpp b/src/multimedia/audio/qaudiooutput_symbian_p.cpp
index 385e169..945a08d 100644
--- a/src/plugins/audio/symbian/symbianaudiooutput.cpp
+++ b/src/multimedia/audio/qaudiooutput_symbian_p.cpp
@@ -39,8 +39,7 @@
**
****************************************************************************/
-#include "symbianaudiooutput.h"
-#include "symbianaudioutils.h"
+#include "qaudiooutput_symbian_p.h"
QT_BEGIN_NAMESPACE
@@ -56,7 +55,7 @@ const int UnderflowTimerInterval = 50; // ms
//-----------------------------------------------------------------------------
SymbianAudioOutputPrivate::SymbianAudioOutputPrivate(
- SymbianAudioOutput *audioDevice)
+ QAudioOutputPrivate *audioDevice)
: m_audioDevice(audioDevice)
{
@@ -99,7 +98,7 @@ qint64 SymbianAudioOutputPrivate::writeData(const char *data, qint64 len)
// Public functions
//-----------------------------------------------------------------------------
-SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device,
+QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device,
const QAudioFormat &format)
: m_device(device)
, m_format(format)
@@ -132,12 +131,12 @@ SymbianAudioOutput::SymbianAudioOutput(const QByteArray &device,
SLOT(underflowTimerExpired()));
}
-SymbianAudioOutput::~SymbianAudioOutput()
+QAudioOutputPrivate::~QAudioOutputPrivate()
{
close();
}
-QIODevice* SymbianAudioOutput::start(QIODevice *device)
+QIODevice* QAudioOutputPrivate::start(QIODevice *device)
{
stop();
@@ -164,12 +163,12 @@ QIODevice* SymbianAudioOutput::start(QIODevice *device)
return m_source;
}
-void SymbianAudioOutput::stop()
+void QAudioOutputPrivate::stop()
{
close();
}
-void SymbianAudioOutput::reset()
+void QAudioOutputPrivate::reset()
{
m_totalSamplesPlayed += getSamplesPlayed();
m_devSound->Stop();
@@ -177,7 +176,7 @@ void SymbianAudioOutput::reset()
startPlayback();
}
-void SymbianAudioOutput::suspend()
+void QAudioOutputPrivate::suspend()
{
if (SymbianAudio::ActiveState == m_internalState
|| SymbianAudio::IdleState == m_internalState) {
@@ -208,13 +207,13 @@ void SymbianAudioOutput::suspend()
}
}
-void SymbianAudioOutput::resume()
+void QAudioOutputPrivate::resume()
{
if (SymbianAudio::SuspendedState == m_internalState)
startPlayback();
}
-int SymbianAudioOutput::bytesFree() const
+int QAudioOutputPrivate::bytesFree() const
{
int result = 0;
if (m_devSoundBuffer) {
@@ -224,12 +223,12 @@ int SymbianAudioOutput::bytesFree() const
return result;
}
-int SymbianAudioOutput::periodSize() const
+int QAudioOutputPrivate::periodSize() const
{
return bufferSize();
}
-void SymbianAudioOutput::setBufferSize(int value)
+void QAudioOutputPrivate::setBufferSize(int value)
{
// Note that DevSound does not allow its client to specify the buffer size.
// This functionality is available via custom interfaces, but since these
@@ -242,12 +241,12 @@ void SymbianAudioOutput::setBufferSize(int value)
m_clientBufferSize = value;
}
-int SymbianAudioOutput::bufferSize() const
+int QAudioOutputPrivate::bufferSize() const
{
return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize;
}
-void SymbianAudioOutput::setNotifyInterval(int ms)
+void QAudioOutputPrivate::setNotifyInterval(int ms)
{
if (ms > 0) {
const int oldNotifyInterval = m_notifyInterval;
@@ -257,12 +256,12 @@ void SymbianAudioOutput::setNotifyInterval(int ms)
}
}
-int SymbianAudioOutput::notifyInterval() const
+int QAudioOutputPrivate::notifyInterval() const
{
return m_notifyInterval;
}
-qint64 SymbianAudioOutput::processedUSecs() const
+qint64 QAudioOutputPrivate::processedUSecs() const
{
int samplesPlayed = 0;
if (m_devSound && SymbianAudio::SuspendedState != m_internalState)
@@ -278,24 +277,24 @@ qint64 SymbianAudioOutput::processedUSecs() const
return result;
}
-qint64 SymbianAudioOutput::elapsedUSecs() const
+qint64 QAudioOutputPrivate::elapsedUSecs() const
{
const qint64 result = (QAudio::StoppedState == state()) ?
0 : m_elapsed.elapsed() * 1000;
return result;
}
-QAudio::Error SymbianAudioOutput::error() const
+QAudio::Error QAudioOutputPrivate::error() const
{
return m_error;
}
-QAudio::State SymbianAudioOutput::state() const
+QAudio::State QAudioOutputPrivate::state() const
{
return m_externalState;
}
-QAudioFormat SymbianAudioOutput::format() const
+QAudioFormat QAudioOutputPrivate::format() const
{
return m_format;
}
@@ -304,7 +303,7 @@ QAudioFormat SymbianAudioOutput::format() const
// MDevSoundObserver implementation
//-----------------------------------------------------------------------------
-void SymbianAudioOutput::InitializeComplete(TInt aError)
+void QAudioOutputPrivate::InitializeComplete(TInt aError)
{
Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState,
Q_FUNC_INFO, "Invalid state");
@@ -313,7 +312,7 @@ void SymbianAudioOutput::InitializeComplete(TInt aError)
startPlayback();
}
-void SymbianAudioOutput::ToneFinished(TInt aError)
+void QAudioOutputPrivate::ToneFinished(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound's tone playback functions, so should
@@ -321,7 +320,7 @@ void SymbianAudioOutput::ToneFinished(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer)
+void QAudioOutputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer)
{
// Following receipt of this callback, DevSound should not provide another
// buffer until we have returned the current one.
@@ -339,7 +338,7 @@ void SymbianAudioOutput::BufferToBeFilled(CMMFBuffer *aBuffer)
pullData();
}
-void SymbianAudioOutput::PlayError(TInt aError)
+void QAudioOutputPrivate::PlayError(TInt aError)
{
switch (aError) {
case KErrUnderflow:
@@ -355,7 +354,7 @@ void SymbianAudioOutput::PlayError(TInt aError)
}
}
-void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer)
+void QAudioOutputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer)
{
Q_UNUSED(aBuffer)
// This class doesn't use DevSound in record mode, so should never receive
@@ -363,7 +362,7 @@ void SymbianAudioOutput::BufferToBeEmptied(CMMFBuffer *aBuffer)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioOutput::RecordError(TInt aError)
+void QAudioOutputPrivate::RecordError(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound in record mode, so should never receive
@@ -371,7 +370,7 @@ void SymbianAudioOutput::RecordError(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioOutput::ConvertError(TInt aError)
+void QAudioOutputPrivate::ConvertError(TInt aError)
{
Q_UNUSED(aError)
// This class doesn't use DevSound's format conversion functions, so
@@ -379,7 +378,7 @@ void SymbianAudioOutput::ConvertError(TInt aError)
Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback");
}
-void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
+void QAudioOutputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
{
Q_UNUSED(aMessageType)
Q_UNUSED(aMsg)
@@ -390,7 +389,7 @@ void SymbianAudioOutput::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg)
// Private functions
//-----------------------------------------------------------------------------
-void SymbianAudioOutput::dataReady()
+void QAudioOutputPrivate::dataReady()
{
// Client-provided QIODevice has data ready to read.
@@ -401,7 +400,7 @@ void SymbianAudioOutput::dataReady()
pullData();
}
-void SymbianAudioOutput::underflowTimerExpired()
+void QAudioOutputPrivate::underflowTimerExpired()
{
const TInt samplesPlayed = getSamplesPlayed();
if (m_samplesPlayed && (samplesPlayed == m_samplesPlayed)) {
@@ -412,7 +411,7 @@ void SymbianAudioOutput::underflowTimerExpired()
}
}
-void SymbianAudioOutput::open()
+void QAudioOutputPrivate::open()
{
Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState,
Q_FUNC_INFO, "DevSound already opened");
@@ -438,7 +437,7 @@ void SymbianAudioOutput::open()
}
}
-void SymbianAudioOutput::startPlayback()
+void QAudioOutputPrivate::startPlayback()
{
TRAPD(err, startDevSoundL());
if (KErrNone == err) {
@@ -462,7 +461,7 @@ void SymbianAudioOutput::startPlayback()
}
}
-void SymbianAudioOutput::startDevSoundL()
+void QAudioOutputPrivate::startDevSoundL()
{
TMMFCapabilities nativeFormat = m_devSound->Config();
m_nativeFormat.iBufferSize = nativeFormat.iBufferSize;
@@ -470,7 +469,7 @@ void SymbianAudioOutput::startDevSoundL()
m_devSound->PlayInitL();
}
-void SymbianAudioOutput::writePaddingData()
+void QAudioOutputPrivate::writePaddingData()
{
// See comments in suspend()
@@ -494,7 +493,7 @@ void SymbianAudioOutput::writePaddingData()
}
}
-qint64 SymbianAudioOutput::pushData(const char *data, qint64 len)
+qint64 QAudioOutputPrivate::pushData(const char *data, qint64 len)
{
// Data has been written to SymbianAudioOutputPrivate
@@ -538,7 +537,7 @@ qint64 SymbianAudioOutput::pushData(const char *data, qint64 len)
return bytesWritten;
}
-void SymbianAudioOutput::pullData()
+void QAudioOutputPrivate::pullData()
{
Q_ASSERT_X(m_pullMode, Q_FUNC_INFO,
"pullData called when in push mode");
@@ -575,7 +574,7 @@ void SymbianAudioOutput::pullData()
}
}
-void SymbianAudioOutput::bufferFilled()
+void QAudioOutputPrivate::bufferFilled()
{
Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to return");
@@ -593,7 +592,7 @@ void SymbianAudioOutput::bufferFilled()
m_devSound->PlayData();
}
-void SymbianAudioOutput::lastBufferFilled()
+void QAudioOutputPrivate::lastBufferFilled()
{
Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to fill");
Q_ASSERT_X(!m_lastBuffer, Q_FUNC_INFO, "Last buffer already sent");
@@ -602,7 +601,7 @@ void SymbianAudioOutput::lastBufferFilled()
bufferFilled();
}
-void SymbianAudioOutput::close()
+void QAudioOutputPrivate::close()
{
m_notifyTimer->stop();
m_underflowTimer->stop();
@@ -631,7 +630,7 @@ void SymbianAudioOutput::close()
setState(SymbianAudio::ClosedState);
}
-qint64 SymbianAudioOutput::getSamplesPlayed() const
+qint64 QAudioOutputPrivate::getSamplesPlayed() const
{
qint64 result = 0;
if (m_devSound) {
@@ -651,7 +650,7 @@ qint64 SymbianAudioOutput::getSamplesPlayed() const
return result;
}
-void SymbianAudioOutput::setError(QAudio::Error error)
+void QAudioOutputPrivate::setError(QAudio::Error error)
{
m_error = error;
@@ -671,7 +670,7 @@ void SymbianAudioOutput::setError(QAudio::Error error)
QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection);
}
-void SymbianAudioOutput::setState(SymbianAudio::State newInternalState)
+void QAudioOutputPrivate::setState(SymbianAudio::State newInternalState)
{
const QAudio::State oldExternalState = m_externalState;
m_internalState = newInternalState;
@@ -682,14 +681,14 @@ void SymbianAudioOutput::setState(SymbianAudio::State newInternalState)
emit stateChanged(m_externalState);
}
-bool SymbianAudioOutput::isDataReady() const
+bool QAudioOutputPrivate::isDataReady() const
{
return (m_source && m_source->bytesAvailable())
|| m_bytesPadding
|| m_pushDataReady;
}
-QAudio::State SymbianAudioOutput::initializingState() const
+QAudio::State QAudioOutputPrivate::initializingState() const
{
return isDataReady() ? QAudio::ActiveState : QAudio::IdleState;
}
diff --git a/src/plugins/audio/symbian/symbianaudiooutput.h b/src/multimedia/audio/qaudiooutput_symbian_p.h
index 8994e46..00ccb24 100644
--- a/src/plugins/audio/symbian/symbianaudiooutput.h
+++ b/src/multimedia/audio/qaudiooutput_symbian_p.h
@@ -39,44 +39,55 @@
**
****************************************************************************/
-#ifndef SYMBIANAUDIOOUTPUT_H
-#define SYMBIANAUDIOOUTPUT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QAUDIOOUTPUT_SYMBIAN_P_H
+#define QAUDIOOUTPUT_SYMBIAN_P_H
#include <QtMultimedia/qaudioengine.h>
#include <QTime>
#include <QTimer>
#include <sounddevice.h>
-#include "symbianaudio.h"
+#include "qaudio_symbian_p.h"
QT_BEGIN_NAMESPACE
-class SymbianAudioOutput;
+class QAudioOutputPrivate;
class SymbianAudioOutputPrivate : public QIODevice
{
- friend class SymbianAudioOutput;
+ friend class QAudioOutputPrivate;
Q_OBJECT
public:
- SymbianAudioOutputPrivate(SymbianAudioOutput *audio);
+ SymbianAudioOutputPrivate(QAudioOutputPrivate *audio);
~SymbianAudioOutputPrivate();
qint64 readData(char *data, qint64 len);
qint64 writeData(const char *data, qint64 len);
private:
- SymbianAudioOutput *const m_audioDevice;
+ QAudioOutputPrivate *const m_audioDevice;
};
-class SymbianAudioOutput
+class QAudioOutputPrivate
: public QAbstractAudioOutput
, public MDevSoundObserver
{
friend class SymbianAudioOutputPrivate;
Q_OBJECT
public:
- SymbianAudioOutput(const QByteArray &device,
+ QAudioOutputPrivate(const QByteArray &device,
const QAudioFormat &audioFormat);
- ~SymbianAudioOutput();
+ ~QAudioOutputPrivate();
// QAbstractAudioOutput
QIODevice* start(QIODevice *device = 0);
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 6200160..ab8da53 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -88,7 +88,7 @@ QAudioOutputPrivate::~QAudioOutputPrivate()
DeleteCriticalSection(&waveOutCriticalSection);
}
-void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
+void QT_WIN_CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
{
Q_UNUSED(dwParam1)
@@ -455,6 +455,9 @@ void QAudioOutputPrivate::feedback()
bool QAudioOutputPrivate::deviceReady()
{
+ if(deviceState == QAudio::StoppedState)
+ return false;
+
if(pullMode) {
int chunks = bytesAvailable/period_size;
#ifdef DEBUG_AUDIO
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h
index 6e0899f..bb176a0 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.h
+++ b/src/multimedia/audio/qaudiooutput_win32_p.h
@@ -116,7 +116,7 @@ private:
qint64 totalTimeValue;
bool pullMode;
int intervalTime;
- static void CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
+ static void QT_WIN_CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 );
WAVEHDR* allocateBlocks(int size, int count);
diff --git a/src/multimedia/base/qpaintervideosurface.cpp b/src/multimedia/base/qpaintervideosurface.cpp
index fc3d493..ed93fad 100644
--- a/src/multimedia/base/qpaintervideosurface.cpp
+++ b/src/multimedia/base/qpaintervideosurface.cpp
@@ -434,6 +434,9 @@ void QVideoSurfaceGLPainter::initRgbTextureInfo(
void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size)
{
+ int w = (size.width() + 3) & ~3;
+ int w2 = (size.width()/2 + 3) & ~3;
+
m_yuv = true;
m_textureInternalFormat = GL_LUMINANCE;
m_textureFormat = GL_LUMINANCE;
@@ -444,14 +447,17 @@ void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size)
m_textureOffsets[0] = 0;
m_textureWidths[1] = size.width() / 2;
m_textureHeights[1] = size.height() / 2;
- m_textureOffsets[1] = size.width() * size.height();
+ m_textureOffsets[1] = w * size.height();
m_textureWidths[2] = size.width() / 2;
m_textureHeights[2] = size.height() / 2;
- m_textureOffsets[2] = size.width() * size.height() * 5 / 4;
+ m_textureOffsets[2] = w * size.height() + w2 * (size.height() / 2);
}
void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size)
{
+ int w = (size.width() + 3) & ~3;
+ int w2 = (size.width()/2 + 3) & ~3;
+
m_yuv = true;
m_textureInternalFormat = GL_LUMINANCE;
m_textureFormat = GL_LUMINANCE;
@@ -462,10 +468,10 @@ void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size)
m_textureOffsets[0] = 0;
m_textureWidths[1] = size.width() / 2;
m_textureHeights[1] = size.height() / 2;
- m_textureOffsets[1] = size.width() * size.height() * 5 / 4;
+ m_textureOffsets[1] = w * size.height() + w2 * (size.height() / 2);
m_textureWidths[2] = size.width() / 2;
m_textureHeights[2] = size.height() / 2;
- m_textureOffsets[2] = size.width() * size.height();
+ m_textureOffsets[2] = w * size.height();
}
#ifndef QT_OPENGL_ES
diff --git a/src/multimedia/effects/qsoundeffect.cpp b/src/multimedia/effects/qsoundeffect.cpp
index f64d9ee..53cad8e 100644
--- a/src/multimedia/effects/qsoundeffect.cpp
+++ b/src/multimedia/effects/qsoundeffect.cpp
@@ -71,8 +71,6 @@ QT_BEGIN_NAMESPACE
}
}
\endqml
-
- \sa SoundEffect
*/
/*!
@@ -134,7 +132,7 @@ QSoundEffect::QSoundEffect(QObject *parent) :
QSoundEffect::~QSoundEffect()
{
- delete d;
+ d->deleteLater();
}
QUrl QSoundEffect::source() const
diff --git a/src/multimedia/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/effects/qsoundeffect_pulse_p.cpp
index c322722..e379259 100644
--- a/src/multimedia/effects/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/effects/qsoundeffect_pulse_p.cpp
@@ -234,6 +234,7 @@ Q_GLOBAL_STATIC(PulseDaemon, daemon)
QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
QObject(parent),
+ m_retry(false),
m_muted(false),
m_playQueued(false),
m_sampleLoaded(false),
@@ -250,7 +251,7 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
QSoundEffectPrivate::~QSoundEffectPrivate()
{
- delete m_reply;
+ m_reply->deleteLater();
unloadSample();
}
@@ -310,6 +311,12 @@ void QSoundEffectPrivate::setMuted(bool muted)
void QSoundEffectPrivate::play()
{
+ if (m_retry) {
+ m_retry = false;
+ setSource(m_source);
+ return;
+ }
+
if (!m_sampleLoaded) {
m_playQueued = true;
return;
@@ -338,6 +345,7 @@ void QSoundEffectPrivate::decoderReady()
pa_stream_set_state_callback(stream, stream_state_callback, this);
pa_stream_set_write_callback(stream, stream_write_callback, this);
pa_stream_connect_upload(stream, (size_t)m_waveDecoder->size());
+ m_pulseStream = stream;
daemon()->unlock();
}
@@ -377,6 +385,52 @@ void QSoundEffectPrivate::unloadSample()
m_sampleLoaded = false;
}
+void QSoundEffectPrivate::uploadSample()
+{
+ daemon()->lock();
+
+ size_t bufferSize = qMin(pa_stream_writable_size(m_pulseStream),
+ size_t(m_waveDecoder->bytesAvailable()));
+ char buffer[bufferSize];
+
+ size_t len = 0;
+ while (len < (m_waveDecoder->size())) {
+ qint64 read = m_waveDecoder->read(buffer, qMin((int)bufferSize,
+ (int)(m_waveDecoder->size()-len)));
+ if (read > 0) {
+ if (pa_stream_write(m_pulseStream, buffer, size_t(read), 0, 0, PA_SEEK_RELATIVE) == 0)
+ len += size_t(read);
+ else
+ break;
+ }
+ }
+
+ m_dataUploaded += len;
+ pa_stream_set_write_callback(m_pulseStream, NULL, NULL);
+
+ if (m_waveDecoder->size() == m_dataUploaded) {
+ int err = pa_stream_finish_upload(m_pulseStream);
+ if(err != 0) {
+ qWarning("pa_stream_finish_upload() err=%d",err);
+ pa_stream_disconnect(m_pulseStream);
+ m_retry = true;
+ m_playQueued = false;
+ QMetaObject::invokeMethod(this, "play");
+ daemon()->unlock();
+ return;
+ }
+ m_duration = m_waveDecoder->duration();
+ m_waveDecoder->deleteLater();
+ m_stream->deleteLater();
+ m_sampleLoaded = true;
+ if (m_playQueued) {
+ m_playQueued = false;
+ QMetaObject::invokeMethod(this, "play");
+ }
+ }
+ daemon()->unlock();
+}
+
void QSoundEffectPrivate::playSample()
{
pa_volume_t volume = PA_VOLUME_NORM;
@@ -412,36 +466,7 @@ void QSoundEffectPrivate::stream_write_callback(pa_stream *s, size_t length, voi
QSoundEffectPrivate *self = reinterpret_cast<QSoundEffectPrivate*>(userdata);
- size_t bufferSize = qMin(pa_stream_writable_size(s),
- size_t(self->m_waveDecoder->bytesAvailable()));
- char buffer[bufferSize];
-
- size_t len = 0;
- while (len < length) {
- qint64 read = self->m_waveDecoder->read(buffer, qMin(bufferSize, length -len));
- if (read > 0) {
- if (pa_stream_write(s, buffer, size_t(read), 0, 0, PA_SEEK_RELATIVE) == 0)
- len += size_t(read);
- else
- break;
- }
- }
- self->m_dataUploaded += len;
-
- if (self->m_waveDecoder->size() == self->m_dataUploaded) {
- pa_stream_finish_upload(s);
-
- self->m_duration = self->m_waveDecoder->duration();
-
- self->m_waveDecoder->deleteLater();
- self->m_stream->deleteLater();
-
- self->m_sampleLoaded = true;
- if (self->m_playQueued) {
- self->m_playQueued = false;
- QMetaObject::invokeMethod(self, "play");
- }
- }
+ QMetaObject::invokeMethod(self, "uploadSample", Qt::QueuedConnection);
}
void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata)
diff --git a/src/multimedia/effects/qsoundeffect_pulse_p.h b/src/multimedia/effects/qsoundeffect_pulse_p.h
index 3aed018..aff729c 100644
--- a/src/multimedia/effects/qsoundeffect_pulse_p.h
+++ b/src/multimedia/effects/qsoundeffect_pulse_p.h
@@ -97,6 +97,7 @@ private Q_SLOTS:
void decoderReady();
void decoderError();
void checkPlayTime();
+ void uploadSample();
private:
void loadSample();
@@ -109,6 +110,9 @@ private:
static void stream_state_callback(pa_stream *s, void *userdata);
static void play_callback(pa_context *c, int success, void *userdata);
+ pa_stream *m_pulseStream;
+
+ bool m_retry;
bool m_muted;
bool m_playQueued;
bool m_sampleLoaded;
diff --git a/src/multimedia/effects/qsoundeffect_qmedia_p.cpp b/src/multimedia/effects/qsoundeffect_qmedia_p.cpp
index 43ba22f..36c36dd 100644
--- a/src/multimedia/effects/qsoundeffect_qmedia_p.cpp
+++ b/src/multimedia/effects/qsoundeffect_qmedia_p.cpp
@@ -67,8 +67,6 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
m_player(0)
{
m_player = new QMediaPlayer(this, QMediaPlayer::LowLatency);
- connect(m_player, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged()));
- connect(m_player, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged()));
connect(m_player, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(stateChanged(QMediaPlayer::State)));
}
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 5876ee2..7bb1399 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -880,11 +880,16 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
return new QDisabledNetworkReply(this, req, op);
}
- if (d->initializeSession && !d->networkSession) {
+ if (!d->networkSession && (d->initializeSession || !d->networkConfiguration.isEmpty())) {
QNetworkConfigurationManager manager;
- d->createSession(manager.defaultConfiguration());
+ if (d->networkConfiguration.isEmpty())
+ d->createSession(manager.defaultConfiguration());
+ else
+ d->createSession(manager.configurationFromIdentifier(d->networkConfiguration));
d->initializeSession = false;
+ } else if (d->networkSession) {
+ d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1);
}
QNetworkRequest request = req;
@@ -943,6 +948,9 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());
if (reply)
emit q->finished(reply);
+
+ if (networkSession && q->findChildren<QNetworkReply *>().count() == 1)
+ networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), 120000);
}
void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors)
@@ -1210,6 +1218,7 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
networkSession = new QNetworkSession(config, q);
QObject::connect(networkSession, SIGNAL(opened()), q, SIGNAL(networkSessionOnline()));
+ QObject::connect(networkSession, SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::connect(networkSession, SIGNAL(newConfigurationActivated()),
q, SLOT(_q_networkSessionNewConfigurationActivated()));
QObject::connect(networkSession,
@@ -1218,6 +1227,14 @@ void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &co
SLOT(_q_networkSessionPreferredConfigurationChanged(QNetworkConfiguration,bool)));
}
+void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
+{
+ networkConfiguration = networkSession->configuration().identifier();
+
+ delete networkSession;
+ networkSession = 0;
+}
+
void QNetworkAccessManagerPrivate::_q_networkSessionNewConfigurationActivated()
{
Q_Q(QNetworkAccessManager);
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 252dfd0..694a54f 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -139,6 +139,7 @@ private:
Q_DECLARE_PRIVATE(QNetworkAccessManager)
Q_PRIVATE_SLOT(d_func(), void _q_replyFinished())
Q_PRIVATE_SLOT(d_func(), void _q_replySslErrors(QList<QSslError>))
+ Q_PRIVATE_SLOT(d_func(), void _q_networkSessionClosed())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionNewConfigurationActivated())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionPreferredConfigurationChanged(QNetworkConfiguration,bool))
};
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 8d772f0..0140268 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -105,6 +105,7 @@ public:
void createSession(const QNetworkConfiguration &config);
+ void _q_networkSessionClosed();
void _q_networkSessionNewConfigurationActivated();
void _q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &config,
bool isSeamless);
@@ -121,6 +122,7 @@ public:
#endif
QNetworkSession *networkSession;
+ QString networkConfiguration;
bool networkAccessEnabled;
bool initializeSession;
diff --git a/src/network/bearer/qbearerengine.cpp b/src/network/bearer/qbearerengine.cpp
index eb851cc..c42e2d2 100644
--- a/src/network/bearer/qbearerengine.cpp
+++ b/src/network/bearer/qbearerengine.cpp
@@ -70,6 +70,44 @@ QBearerEngine::~QBearerEngine()
}
}
+bool QBearerEngine::requiresPolling() const
+{
+ return false;
+}
+
+/*
+ Returns true if configurations are in use; otherwise returns false.
+
+ If configurations are in use and requiresPolling() returns true, polling will be enabled for
+ this engine.
+*/
+bool QBearerEngine::configurationsInUse() const
+{
+ QHash<QString, QNetworkConfigurationPrivatePointer>::ConstIterator it;
+ QHash<QString, QNetworkConfigurationPrivatePointer>::ConstIterator end;
+
+ QMutexLocker locker(&mutex);
+
+ for (it = accessPointConfigurations.begin(),
+ end = accessPointConfigurations.end(); it != end; ++it) {
+ if (it.value()->ref > 1)
+ return true;
+ }
+
+ for (it = snapConfigurations.begin(), end = snapConfigurations.end(); it != end; ++it) {
+ if (it.value()->ref > 1)
+ return true;
+ }
+
+ for (it = userChoiceConfigurations.begin(),
+ end = userChoiceConfigurations.end(); it != end; ++it) {
+ if (it.value()->ref > 1)
+ return true;
+ }
+
+ return false;
+}
+
#include "moc_qbearerengine_p.cpp"
QT_END_NAMESPACE
diff --git a/src/network/bearer/qbearerengine_p.h b/src/network/bearer/qbearerengine_p.h
index 5e12b0f..028c174 100644
--- a/src/network/bearer/qbearerengine_p.h
+++ b/src/network/bearer/qbearerengine_p.h
@@ -89,6 +89,9 @@ public:
virtual QNetworkConfigurationPrivatePointer defaultConfiguration() = 0;
+ virtual bool requiresPolling() const;
+ bool configurationsInUse() const;
+
Q_SIGNALS:
void configurationAdded(QNetworkConfigurationPrivatePointer config);
void configurationRemoved(QNetworkConfigurationPrivatePointer config);
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 9ff197b..b631cf1 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -174,7 +174,8 @@ QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent )
: QObject(parent)
{
- QNetworkConfigurationManagerPrivate* priv = connManager();
+ QNetworkConfigurationManagerPrivate *priv = connManager();
+
connect(priv, SIGNAL(configurationAdded(QNetworkConfiguration)),
this, SIGNAL(configurationAdded(QNetworkConfiguration)));
connect(priv, SIGNAL(configurationRemoved(QNetworkConfiguration)),
@@ -185,6 +186,8 @@ QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent )
this, SIGNAL(onlineStateChanged(bool)));
connect(priv, SIGNAL(configurationChanged(QNetworkConfiguration)),
this, SIGNAL(configurationChanged(QNetworkConfiguration)));
+
+ priv->enablePolling();
}
/*!
@@ -192,6 +195,9 @@ QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent )
*/
QNetworkConfigurationManager::~QNetworkConfigurationManager()
{
+ QNetworkConfigurationManagerPrivate *priv = connManager();
+
+ priv->disablePolling();
}
@@ -221,7 +227,7 @@ QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const
// Engines don't have a default configuration.
// Return first active snap
- QNetworkConfigurationPrivatePointer firstDiscovered;
+ QNetworkConfigurationPrivatePointer defaultConfiguration;
foreach (QBearerEngine *engine, conPriv->engines()) {
QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it;
@@ -236,22 +242,35 @@ QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const
QNetworkConfiguration config;
config.d = it.value();
return config;
- } else if ((it.value()->state & QNetworkConfiguration::Discovered) ==
- QNetworkConfiguration::Discovered) {
- firstDiscovered = it.value();
+ } else if (!defaultConfiguration) {
+ if ((it.value()->state & QNetworkConfiguration::Discovered) ==
+ QNetworkConfiguration::Discovered) {
+ defaultConfiguration = it.value();
+ }
}
}
}
// No Active SNAPs return first Discovered SNAP.
- if (firstDiscovered) {
+ if (defaultConfiguration) {
QNetworkConfiguration config;
- config.d = firstDiscovered;
+ config.d = defaultConfiguration;
return config;
}
- // No Active or Discovered SNAPs, do same for InternetAccessPoints.
- firstDiscovered.reset();
+ /*
+ No Active or Discovered SNAPs, find the perferred access point.
+ The following priority order is used:
+
+ 1. Active Ethernet
+ 2. Active WLAN
+ 3. Active Other
+ 4. Discovered Ethernet
+ 5. Discovered WLAN
+ 6. Discovered Other
+ */
+
+ defaultConfiguration.reset();
foreach (QBearerEngine *engine, conPriv->engines()) {
QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it;
@@ -261,22 +280,42 @@ QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const
for (it = engine->accessPointConfigurations.begin(),
end = engine->accessPointConfigurations.end(); it != end; ++it) {
- if ((it.value()->state & QNetworkConfiguration::Active) ==
- QNetworkConfiguration::Active) {
- QNetworkConfiguration config;
- config.d = it.value();
- return config;
- } else if ((it.value()->state & QNetworkConfiguration::Discovered) ==
- QNetworkConfiguration::Discovered) {
- firstDiscovered = it.value();
+
+ if ((it.value()->state & QNetworkConfiguration::Discovered) ==
+ QNetworkConfiguration::Discovered) {
+ if (!defaultConfiguration) {
+ defaultConfiguration = it.value();
+ } else {
+ if (defaultConfiguration->state == it.value()->state) {
+ if (defaultConfiguration->bearerName() == QLatin1String("Ethernet")) {
+ // do nothing
+ } else if (defaultConfiguration->bearerName() == QLatin1String("WLAN")) {
+ // ethernet beats wlan
+ if (it.value()->bearerName() == QLatin1String("Ethernet"))
+ defaultConfiguration = it.value();
+ } else {
+ // ethernet and wlan beats other
+ if (it.value()->bearerName() == QLatin1String("Ethernet") ||
+ it.value()->bearerName() == QLatin1String("WLAN")) {
+ defaultConfiguration = it.value();
+ }
+ }
+ } else {
+ // active beats discovered
+ if ((defaultConfiguration->state & QNetworkConfiguration::Active) !=
+ QNetworkConfiguration::Active) {
+ defaultConfiguration = it.value();
+ }
+ }
+ }
}
}
}
// No Active InternetAccessPoint return first Discovered InternetAccessPoint.
- if (firstDiscovered) {
+ if (defaultConfiguration) {
QNetworkConfiguration config;
- config.d = firstDiscovered;
+ config.d = defaultConfiguration;
return config;
}
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 1ac10c5..9740424 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -55,7 +55,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QBearerEngineFactoryInterface_iid, QLatin1String("/bearer")))
QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
-: capFlags(0), mutex(QMutex::Recursive), firstUpdate(true)
+: capFlags(0), mutex(QMutex::Recursive), pollTimer(0), forcedPolling(0), firstUpdate(true)
{
updateConfigurations();
@@ -82,7 +82,7 @@ void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurati
}
if (ptr->state == QNetworkConfiguration::Active) {
- onlineConfigurations.insert(ptr);
+ onlineConfigurations.insert(ptr->id);
if (!firstUpdate && onlineConfigurations.count() == 1)
emit onlineStateChanged(true);
}
@@ -100,7 +100,7 @@ void QNetworkConfigurationManagerPrivate::configurationRemoved(QNetworkConfigura
emit configurationRemoved(item);
}
- onlineConfigurations.remove(ptr);
+ onlineConfigurations.remove(ptr->id);
if (!firstUpdate && onlineConfigurations.isEmpty())
emit onlineStateChanged(false);
}
@@ -118,9 +118,9 @@ void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigura
bool previous = !onlineConfigurations.isEmpty();
if (ptr->state == QNetworkConfiguration::Active)
- onlineConfigurations.insert(ptr);
+ onlineConfigurations.insert(ptr->id);
else
- onlineConfigurations.remove(ptr);
+ onlineConfigurations.remove(ptr->id);
bool online = !onlineConfigurations.isEmpty();
@@ -133,6 +133,9 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
QMutexLocker locker(&mutex);
if (firstUpdate) {
+ if (sender())
+ return;
+
updating = false;
QFactoryLoader *l = loader();
@@ -161,6 +164,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
capFlags |= engine->capabilities();
+
+ engine->requestUpdate();
}
}
@@ -180,6 +185,15 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
emit configurationUpdateComplete();
}
+ if (engine && !pollingEngines.isEmpty()) {
+ int index = sessionEngines.indexOf(engine);
+ if (index >= 0)
+ pollingEngines.remove(index);
+
+ if (pollingEngines.isEmpty())
+ startPolling();
+ }
+
if (firstUpdate)
firstUpdate = false;
}
@@ -208,4 +222,70 @@ QList<QBearerEngine *> QNetworkConfigurationManagerPrivate::engines()
return sessionEngines;
}
+void QNetworkConfigurationManagerPrivate::startPolling()
+{
+ QMutexLocker locker(&mutex);
+
+ bool pollingRequired = false;
+
+ if (forcedPolling > 0) {
+ foreach (QBearerEngine *engine, sessionEngines) {
+ if (engine->requiresPolling()) {
+ pollingRequired = true;
+ break;
+ }
+ }
+ }
+
+ if (!pollingRequired) {
+ foreach (QBearerEngine *engine, sessionEngines) {
+ if (engine->configurationsInUse()) {
+ pollingRequired = true;
+ break;
+ }
+ }
+ }
+
+ if (pollingRequired) {
+ if (!pollTimer) {
+ pollTimer = new QTimer(this);
+ pollTimer->setInterval(10000);
+ pollTimer->setSingleShot(true);
+ connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollEngines()));
+ }
+
+ pollTimer->start();
+ }
+}
+
+void QNetworkConfigurationManagerPrivate::pollEngines()
+{
+ QMutexLocker locker(&mutex);
+
+ for (int i = 0; i < sessionEngines.count(); ++i) {
+ if ((forcedPolling && sessionEngines.at(i)->requiresPolling()) ||
+ sessionEngines.at(i)->configurationsInUse()) {
+ pollingEngines.insert(i);
+ sessionEngines.at(i)->requestUpdate();
+ }
+ }
+}
+
+void QNetworkConfigurationManagerPrivate::enablePolling()
+{
+ QMutexLocker locker(&mutex);
+
+ ++forcedPolling;
+
+ if (forcedPolling == 1)
+ startPolling();
+}
+
+void QNetworkConfigurationManagerPrivate::disablePolling()
+{
+ QMutexLocker locker(&mutex);
+
+ --forcedPolling;
+}
+
QT_END_NAMESPACE
diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h
index c7e988e..ac8518c 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.h
+++ b/src/network/bearer/qnetworkconfigmanager_p.h
@@ -61,6 +61,7 @@
QT_BEGIN_NAMESPACE
class QBearerEngine;
+class QTimer;
class Q_NETWORK_EXPORT QNetworkConfigurationManagerPrivate : public QObject
{
@@ -77,6 +78,11 @@ public:
QList<QBearerEngine *> engines();
+ void startPolling();
+
+ void enablePolling();
+ void disablePolling();
+
public slots:
void updateConfigurations();
@@ -92,19 +98,26 @@ Q_SIGNALS:
private:
QMutex mutex;
+ QTimer *pollTimer;
+
QList<QBearerEngine *> sessionEngines;
- QSet<QNetworkConfigurationPrivatePointer> onlineConfigurations;
+ QSet<QString> onlineConfigurations;
QSet<int> updatingEngines;
bool updating;
+ QSet<int> pollingEngines;
+ int forcedPolling;
+
bool firstUpdate;
private Q_SLOTS:
void configurationAdded(QNetworkConfigurationPrivatePointer ptr);
void configurationRemoved(QNetworkConfigurationPrivatePointer ptr);
void configurationChanged(QNetworkConfigurationPrivatePointer ptr);
+
+ void pollEngines();
};
Q_NETWORK_EXPORT QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate();
diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp
index 047c8d3..cf9f4b2 100644
--- a/src/network/bearer/qnetworksession.cpp
+++ b/src/network/bearer/qnetworksession.cpp
@@ -492,6 +492,20 @@ QString QNetworkSession::errorString() const
\o Setting this property to \i true before calling \l open() implies that the connection attempt
is made but if no connection can be established, the user is not connsulted and asked to select
a suitable connection. This property is not set by default and support for it depends on the platform.
+
+ \row
+ \o AutoCloseSessionTimeout
+ \o If the session requires polling to keep its state up to date, this property holds
+ the timeout in milliseconds before the session will automatically close. If the
+ value of this property is -1 the session will not automatically close. This property
+ is set to -1 by default.
+
+ The purpose of this property is to minimize resource use on platforms that use
+ polling to update the state of the session. Applications can set the value of this
+ property to the desired timeout before the session is closed. In response to the
+ closed() signal the network session should be deleted to ensure that all polling is
+ stopped. The session can then be recreated once it is required again. This property
+ has no effect for sessions that do not require polling.
\endtable
*/
QVariant QNetworkSession::sessionProperty(const QString& key) const
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 4800e9d..3d0c32d 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -639,7 +639,7 @@ void qt_qhostinfo_clear_cache()
}
}
-void Q_NETWORK_EXPORT qt_qhostinfo_enable_cache(bool e)
+void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
{
QHostInfoLookupManager* manager = theHostInfoLookupManager();
if (manager) {
diff --git a/src/network/ssl/qsslkey.cpp b/src/network/ssl/qsslkey.cpp
index 41b2384..da39662 100644
--- a/src/network/ssl/qsslkey.cpp
+++ b/src/network/ssl/qsslkey.cpp
@@ -119,9 +119,7 @@ void QSslKeyPrivate::decodePem(const QByteArray &pem, const QByteArray &passPhra
if (!bio)
return;
- void *phrase = passPhrase.isEmpty()
- ? (void *)0
- : (void *)passPhrase.constData();
+ void *phrase = (void *)passPhrase.constData();
if (algorithm == QSsl::Rsa) {
RSA *result = (type == QSsl::PublicKey)
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
index d1e7615..adc69ee 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
@@ -132,6 +132,11 @@ public:
}
+ inline void addVertex(const GLfloat x, const GLfloat y)
+ {
+ vertexArray.add(QGLPoint(x, y));
+ }
+
void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
void clear();
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index ee04166..c88c041 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -331,9 +331,14 @@ static const char* const qglslImageSrcFragmentShader = "\n\
varying highp vec2 textureCoords; \n\
uniform lowp sampler2D imageTexture; \n\
lowp vec4 srcPixel() \n\
- { \n\
- return texture2D(imageTexture, textureCoords); \n\
- }\n";
+ { \n"
+#ifdef QT_OPENGL_ES_2
+ // work-around for driver bug
+ "return 1.0 * texture2D(imageTexture, textureCoords); \n"
+#else
+ "return texture2D(imageTexture, textureCoords); \n"
+#endif
+ "}\n";
static const char* const qglslCustomSrcFragmentShader = "\n\
varying highp vec2 textureCoords; \n\
diff --git a/src/opengl/gl2paintengineex/qglgradientcache.cpp b/src/opengl/gl2paintengineex/qglgradientcache.cpp
index 192e01c..a1495dd 100644
--- a/src/opengl/gl2paintengineex/qglgradientcache.cpp
+++ b/src/opengl/gl2paintengineex/qglgradientcache.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
+#include "qglgradientcache_p.h"
#include <private/qdrawhelper_p.h>
#include <private/qgl_p.h>
-#include "qglgradientcache_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 8eb72b0..1884138 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -64,6 +64,7 @@
// #define QT_OPENGL_CACHE_AS_VBOS
+#include "qglgradientcache_p.h"
#include "qpaintengineex_opengl2_p.h"
#include <string.h> //for memcpy
@@ -80,7 +81,6 @@
#include <private/qstatictext_p.h>
#include <private/qtriangulator_p.h>
-#include "qglgradientcache_p.h"
#include "qglengineshadermanager_p.h"
#include "qgl2pexvertexarray_p.h"
#include "qtriangulatingstroker_p.h"
@@ -1155,16 +1155,20 @@ void QGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &pen)
// prepareForDraw() down below.
updateMatrix();
+ QRectF clip = q->state()->matrix.inverted().mapRect(q->state()->clipEnabled
+ ? q->state()->rectangleClip
+ : QRectF(0, 0, width, height));
+
if (penStyle == Qt::SolidLine) {
- stroker.process(path, pen);
+ stroker.process(path, pen, clip);
} else { // Some sort of dash
- dasher.process(path, pen);
+ dasher.process(path, pen, clip);
QVectorPath dashStroke(dasher.points(),
dasher.elementCount(),
dasher.elementTypes());
- stroker.process(dashStroke, pen);
+ stroker.process(dashStroke, pen, clip);
}
if (opaque) {
@@ -1641,7 +1645,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
s->matrix = old;
}
-void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::FragmentHints hints)
+void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
+ QPainter::PixmapFragmentHints hints)
{
Q_D(QGL2PaintEngineEx);
// Use fallback for extended composition modes.
@@ -1655,9 +1660,9 @@ void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::Fragment *fragments,
}
-void QGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::Fragment *fragments,
+void QGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::PixmapFragment *fragments,
int fragmentCount, const QPixmap &pixmap,
- QPainter::FragmentHints hints)
+ QPainter::PixmapFragmentHints hints)
{
GLfloat dx = 1.0f / pixmap.size().width();
GLfloat dy = 1.0f / pixmap.size().height();
@@ -1691,23 +1696,23 @@ void QGL2PaintEngineExPrivate::drawPixmapFragments(const QPainter::Fragment *fra
QGLPoint bottomRight(right * c - bottom * s, right * s + bottom * c);
QGLPoint bottomLeft(-right * c - bottom * s, -right * s + bottom * c);
- vertexCoordinateArray.lineToArray(bottomRight.x + fragments[i].x, bottomRight.y + fragments[i].y);
- vertexCoordinateArray.lineToArray(-bottomLeft.x + fragments[i].x, -bottomLeft.y + fragments[i].y);
- vertexCoordinateArray.lineToArray(-bottomRight.x + fragments[i].x, -bottomRight.y + fragments[i].y);
- vertexCoordinateArray.lineToArray(-bottomRight.x + fragments[i].x, -bottomRight.y + fragments[i].y);
- vertexCoordinateArray.lineToArray(bottomLeft.x + fragments[i].x, bottomLeft.y + fragments[i].y);
- vertexCoordinateArray.lineToArray(bottomRight.x + fragments[i].x, bottomRight.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(bottomRight.x + fragments[i].x, bottomRight.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(-bottomLeft.x + fragments[i].x, -bottomLeft.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(-bottomRight.x + fragments[i].x, -bottomRight.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(-bottomRight.x + fragments[i].x, -bottomRight.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(bottomLeft.x + fragments[i].x, bottomLeft.y + fragments[i].y);
+ vertexCoordinateArray.addVertex(bottomRight.x + fragments[i].x, bottomRight.y + fragments[i].y);
QGLRect src(fragments[i].sourceLeft * dx, fragments[i].sourceTop * dy,
(fragments[i].sourceLeft + fragments[i].width) * dx,
(fragments[i].sourceTop + fragments[i].height) * dy);
- textureCoordinateArray.lineToArray(src.right, src.bottom);
- textureCoordinateArray.lineToArray(src.right, src.top);
- textureCoordinateArray.lineToArray(src.left, src.top);
- textureCoordinateArray.lineToArray(src.left, src.top);
- textureCoordinateArray.lineToArray(src.left, src.bottom);
- textureCoordinateArray.lineToArray(src.right, src.bottom);
+ textureCoordinateArray.addVertex(src.right, src.bottom);
+ textureCoordinateArray.addVertex(src.right, src.top);
+ textureCoordinateArray.addVertex(src.left, src.top);
+ textureCoordinateArray.addVertex(src.left, src.top);
+ textureCoordinateArray.addVertex(src.left, src.bottom);
+ textureCoordinateArray.addVertex(src.right, src.bottom);
qreal opacity = fragments[i].opacity * q->state()->opacity;
opacityArray << opacity << opacity << opacity << opacity << opacity << opacity;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 5d3608b..ed8fbbc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -125,7 +125,8 @@ public:
virtual void drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr);
virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr);
- virtual void drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::FragmentHints hints);
+ virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
+ QPainter::PixmapFragmentHints hints);
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
Qt::ImageConversionFlags flags = Qt::AutoColor);
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
@@ -196,7 +197,8 @@ public:
void fill(const QVectorPath &path);
void stroke(const QVectorPath &path, const QPen &pen);
void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false);
- void drawPixmapFragments(const QPainter::Fragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::FragmentHints hints);
+ void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
+ QPainter::PixmapFragmentHints hints);
void drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType, QStaticTextItem *staticTextItem,
bool includeMatrixInCache);
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
index 5229d3f..d952988 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
@@ -73,7 +73,7 @@ void QTriangulatingStroker::endCapOrJoinClosed(const qreal *start, const qreal *
}
-void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen)
+void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, const QRectF &)
{
const qreal *pts = path.points();
const QPainterPath::ElementType *types = path.elements();
@@ -480,7 +480,7 @@ QDashedStrokeProcessor::QDashedStrokeProcessor()
m_dash_stroker.setCubicToHook(qdashprocessor_cubicTo);
}
-void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen)
+void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, const QRectF &clip)
{
const qreal *pts = path.points();
@@ -497,6 +497,7 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen)
m_dash_stroker.setDashPattern(pen.dashPattern());
m_dash_stroker.setStrokeWidth(pen.isCosmetic() ? width * m_inv_scale : width);
m_dash_stroker.setMiterLimit(pen.miterLimit());
+ m_dash_stroker.setClipRect(clip);
qreal curvyness = sqrt(width) * m_inv_scale / 8;
if (count < 2)
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
index 06b8a44..956d7cc 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
class QTriangulatingStroker
{
public:
- void process(const QVectorPath &path, const QPen &pen);
+ void process(const QVectorPath &path, const QPen &pen, const QRectF &clip);
inline int vertexCount() const { return m_vertices.size(); }
inline const float *vertices() const { return m_vertices.data(); }
@@ -96,7 +96,7 @@ class QDashedStrokeProcessor
public:
QDashedStrokeProcessor();
- void process(const QVectorPath &path, const QPen &pen);
+ void process(const QVectorPath &path, const QPen &pen, const QRectF &clip);
inline void addElement(QPainterPath::ElementType type, qreal x, qreal y) {
m_points.add(x);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 73cd6a8..e0030ad 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -766,6 +766,7 @@ void QGLFormat::setSamples(int numSamples)
return;
}
d->numSamples = numSamples;
+ setSampleBuffers(numSamples > 0);
}
/*!
@@ -904,6 +905,7 @@ void QGLFormat::setDepthBufferSize(int size)
return;
}
d->depthSize = size;
+ setDepth(size > 0);
}
/*!
@@ -1017,7 +1019,7 @@ void QGLFormat::setAlphaBufferSize(int size)
return;
}
d->alphaSize = size;
- setOption(QGL::AlphaChannel);
+ setAlpha(size > 0);
}
/*!
@@ -1044,6 +1046,7 @@ void QGLFormat::setAccumBufferSize(int size)
return;
}
d->accumSize = size;
+ setAccum(size > 0);
}
/*!
@@ -1069,6 +1072,7 @@ void QGLFormat::setStencilBufferSize(int size)
return;
}
d->stencilSize = size;
+ setStencil(size > 0);
}
/*!
@@ -1579,6 +1583,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
vi = 0;
#endif
#if defined(QT_OPENGL_ES)
+ ownsEglContext = false;
eglContext = 0;
eglSurface = EGL_NO_SURFACE;
#endif
@@ -1684,14 +1689,12 @@ typedef void (*_qt_image_cleanup_hook_64)(qint64);
extern Q_GUI_EXPORT _qt_pixmap_cleanup_hook_64 qt_pixmap_cleanup_hook_64;
extern Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64;
-static QGLTextureCache *qt_gl_texture_cache = 0;
+
+Q_GLOBAL_STATIC(QGLTextureCache, qt_gl_texture_cache)
QGLTextureCache::QGLTextureCache()
: m_cache(64*1024) // cache ~64 MB worth of textures - this is not accurate though
{
- Q_ASSERT(qt_gl_texture_cache == 0);
- qt_gl_texture_cache = this;
-
QImagePixmapCleanupHooks::instance()->addPixmapDataModificationHook(cleanupTexturesForPixampData);
QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->addImageHook(cleanupTexturesForCacheKey);
@@ -1699,8 +1702,7 @@ QGLTextureCache::QGLTextureCache()
QGLTextureCache::~QGLTextureCache()
{
- qt_gl_texture_cache = 0;
-
+ Q_ASSERT(size() == 0);
QImagePixmapCleanupHooks::instance()->removePixmapDataModificationHook(cleanupTexturesForPixampData);
QImagePixmapCleanupHooks::instance()->removePixmapDataDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->removeImageHook(cleanupTexturesForCacheKey);
@@ -1750,22 +1752,14 @@ void QGLTextureCache::removeContextTextures(QGLContext* ctx)
}
}
-QGLTextureCache* QGLTextureCache::instance()
-{
- if (!qt_gl_texture_cache)
- qt_gl_texture_cache = new QGLTextureCache;
-
- return qt_gl_texture_cache;
-}
-
/*
a hook that removes textures from the cache when a pixmap/image
is deref'ed
*/
void QGLTextureCache::cleanupTexturesForCacheKey(qint64 cacheKey)
{
- instance()->remove(cacheKey);
- Q_ASSERT(instance()->getTexture(cacheKey) == 0);
+ qt_gl_texture_cache()->remove(cacheKey);
+ Q_ASSERT(qt_gl_texture_cache()->getTexture(cacheKey) == 0);
}
@@ -1787,10 +1781,9 @@ void QGLTextureCache::cleanupBeforePixmapDestruction(QPixmapData* pmd)
#endif
}
-void QGLTextureCache::deleteIfEmpty()
+QGLTextureCache *QGLTextureCache::instance()
{
- if (instance()->size() == 0)
- delete instance();
+ return qt_gl_texture_cache();
}
// DDS format structure
@@ -1956,7 +1949,6 @@ QGLContext::~QGLContext()
{
// remove any textures cached in this context
QGLTextureCache::instance()->removeContextTextures(this);
- QGLTextureCache::deleteIfEmpty(); // ### thread safety
d_ptr->group->cleanupResources(this);
@@ -5068,6 +5060,20 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
return glExtensions;
}
+
+class QGLDefaultExtensions
+{
+public:
+ QGLDefaultExtensions() {
+ QGLTemporaryContext tempContext;
+ extensions = QGLExtensions::currentContextExtensions();
+ }
+
+ QGLExtensions::Extensions extensions;
+};
+
+Q_GLOBAL_STATIC(QGLDefaultExtensions, qtDefaultExtensions)
+
/*
Returns the GL extensions for the current QGLContext. If there is no
current QGLContext, a default context will be created and the extensions
@@ -5075,34 +5081,19 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
*/
QGLExtensions::Extensions QGLExtensions::glExtensions()
{
- QGLTemporaryContext *tmpContext = 0;
- static bool cachedDefault = false;
- static Extensions defaultExtensions = 0;
+ Extensions extensionFlags = 0;
QGLContext *currentCtx = const_cast<QGLContext *>(QGLContext::currentContext());
if (currentCtx && currentCtx->d_func()->extension_flags_cached)
return currentCtx->d_func()->extension_flags;
if (!currentCtx) {
- if (cachedDefault) {
- return defaultExtensions;
- } else {
- tmpContext = new QGLTemporaryContext;
- cachedDefault = true;
- }
- }
-
- Extensions extensionFlags = currentContextExtensions();
- if (currentCtx) {
+ extensionFlags = qtDefaultExtensions()->extensions;
+ } else {
+ extensionFlags = currentContextExtensions();
currentCtx->d_func()->extension_flags_cached = true;
currentCtx->d_func()->extension_flags = extensionFlags;
- } else {
- defaultExtensions = extensionFlags;
}
-
- if (tmpContext)
- delete tmpContext;
-
return extensionFlags;
}
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 91b271b..822c9f6 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -53,77 +53,96 @@ QT_BEGIN_NAMESPACE
void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLFormat& glFormat)
{
- // NOTE: QGLFormat uses a magic value of -1 to indicate "don't care", even when a buffer of that
- // type has been requested.
- if (glFormat.depth()) {
- int depthSize = glFormat.depthBufferSize();
- eglProperties.setValue(EGL_DEPTH_SIZE, depthSize == -1 ? 1 : depthSize);
- }
- if (glFormat.stencil()) {
- int stencilSize = glFormat.stencilBufferSize();
- eglProperties.setValue(EGL_STENCIL_SIZE, stencilSize == -1 ? 1 : stencilSize);
- }
- if (glFormat.sampleBuffers()) {
- int sampleCount = glFormat.samples();
- eglProperties.setValue(EGL_SAMPLES, sampleCount == -1 ? 1 : sampleCount);
- eglProperties.setValue(EGL_SAMPLE_BUFFERS, 1);
- }
- if (glFormat.alpha()) {
- int alphaSize = glFormat.alphaBufferSize();
- eglProperties.setValue(EGL_ALPHA_SIZE, alphaSize == -1 ? 1 : alphaSize);
- }
-
- int redSize = glFormat.redBufferSize();
- int greenSize = glFormat.greenBufferSize();
- int blueSize = glFormat.blueBufferSize();
- int alphaSize = glFormat.alphaBufferSize();
-
- eglProperties.setValue(EGL_RED_SIZE, redSize > 0 ? redSize : 1);
- eglProperties.setValue(EGL_GREEN_SIZE, greenSize > 0 ? greenSize : 1);
- eglProperties.setValue(EGL_BLUE_SIZE, blueSize > 0 ? blueSize : 1);
- eglProperties.setValue(EGL_ALPHA_SIZE, alphaSize > 0 ? alphaSize : 0);
+ int redSize = glFormat.redBufferSize();
+ int greenSize = glFormat.greenBufferSize();
+ int blueSize = glFormat.blueBufferSize();
+ int alphaSize = glFormat.alphaBufferSize();
+ int depthSize = glFormat.depthBufferSize();
+ int stencilSize = glFormat.stencilBufferSize();
+ int sampleCount = glFormat.samples();
+
+ // QGLFormat uses a magic value of -1 to indicate "don't care", even when a buffer of that
+ // type has been requested. So we must check QGLFormat's booleans too if size is -1:
+ if (glFormat.alpha() && alphaSize <= 0)
+ alphaSize = 1;
+ if (glFormat.depth() && depthSize <= 0)
+ depthSize = 1;
+ if (glFormat.stencil() && stencilSize <= 0)
+ stencilSize = 1;
+ if (glFormat.sampleBuffers() && sampleCount <= 0)
+ sampleCount = 1;
+
+ // We want to make sure 16-bit configs are chosen over 32-bit configs as they will provide
+ // the best performance. The EGL config selection algorithm is a bit stange in this regard:
+ // The selection criteria for EGL_BUFFER_SIZE is "AtLeast", so we can't use it to discard
+ // 32-bit configs completely from the selection. So it then comes to the sorting algorithm.
+ // The red/green/blue sizes have a sort priority of 3, so they are sorted by first. The sort
+ // order is special and described as "by larger _total_ number of color bits.". So EGL will
+ // put 32-bit configs in the list before the 16-bit configs. However, the spec also goes on
+ // to say "If the requested number of bits in attrib_list for a particular component is 0,
+ // then the number of bits for that component is not considered". This part of the spec also
+ // seems to imply that setting the red/green/blue bits to zero means none of the components
+ // are considered and EGL disregards the entire sorting rule. It then looks to the next
+ // highest priority rule, which is EGL_BUFFER_SIZE. Despite the selection criteria being
+ // "AtLeast" for EGL_BUFFER_SIZE, it's sort order is "smaller" meaning 16-bit configs are
+ // put in the list before 32-bit configs. So, to make sure 16-bit is preffered over 32-bit,
+ // we must set the red/green/blue sizes to zero. This has an unfortunate consequence that
+ // if the application sets the red/green/blue size to 5/6/5 on the QGLFormat, they will
+ // probably get a 32-bit config, even when there's an RGB565 config avaliable. Oh well.
+
+ // Now normalize the values so -1 becomes 0
+ redSize = redSize > 0 ? redSize : 0;
+ greenSize = greenSize > 0 ? greenSize : 0;
+ blueSize = blueSize > 0 ? blueSize : 0;
+ alphaSize = alphaSize > 0 ? alphaSize : 0;
+ depthSize = depthSize > 0 ? depthSize : 0;
+ stencilSize = stencilSize > 0 ? stencilSize : 0;
+ sampleCount = sampleCount > 0 ? sampleCount : 0;
+
+ eglProperties.setValue(EGL_RED_SIZE, redSize);
+ eglProperties.setValue(EGL_GREEN_SIZE, greenSize);
+ eglProperties.setValue(EGL_BLUE_SIZE, blueSize);
+ eglProperties.setValue(EGL_ALPHA_SIZE, alphaSize);
+ eglProperties.setValue(EGL_DEPTH_SIZE, depthSize);
+ eglProperties.setValue(EGL_STENCIL_SIZE, stencilSize);
+ eglProperties.setValue(EGL_SAMPLES, sampleCount);
+ eglProperties.setValue(EGL_SAMPLE_BUFFERS, sampleCount ? 1 : 0);
}
-
// Updates "format" with the parameters of the selected configuration.
-void qt_egl_update_format(const QEglContext& context, QGLFormat& format)
+void qt_glformat_from_eglconfig(QGLFormat& format, const EGLConfig config)
{
- EGLint value = 0;
-
- if (context.configAttrib(EGL_RED_SIZE, &value))
- format.setRedBufferSize(value);
- if (context.configAttrib(EGL_GREEN_SIZE, &value))
- format.setGreenBufferSize(value);
- if (context.configAttrib(EGL_BLUE_SIZE, &value))
- format.setBlueBufferSize(value);
- if (context.configAttrib(EGL_ALPHA_SIZE, &value)) {
- format.setAlpha(value != 0);
- if (format.alpha())
- format.setAlphaBufferSize(value);
- }
-
- if (context.configAttrib(EGL_DEPTH_SIZE, &value)) {
- format.setDepth(value != 0);
- if (format.depth())
- format.setDepthBufferSize(value);
- }
-
- if (context.configAttrib(EGL_LEVEL, &value))
- format.setPlane(value);
-
- if (context.configAttrib(EGL_SAMPLE_BUFFERS, &value)) {
- format.setSampleBuffers(value != 0);
- if (format.sampleBuffers()) {
- context.configAttrib(EGL_SAMPLES, &value);
- format.setSamples(value);
- }
- }
-
- if (context.configAttrib(EGL_STENCIL_SIZE, &value)) {
- format.setStencil(value != 0);
- if (format.stencil())
- format.setStencilBufferSize(value);
- }
+ EGLint redSize = 0;
+ EGLint greenSize = 0;
+ EGLint blueSize = 0;
+ EGLint alphaSize = 0;
+ EGLint depthSize = 0;
+ EGLint stencilSize = 0;
+ EGLint sampleCount = 0;
+ EGLint level = 0;
+
+ EGLDisplay display = QEgl::display();
+ eglGetConfigAttrib(display, config, EGL_RED_SIZE, &redSize);
+ eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &greenSize);
+ eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &blueSize);
+ eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &alphaSize);
+ eglGetConfigAttrib(display, config, EGL_DEPTH_SIZE, &depthSize);
+ eglGetConfigAttrib(display, config, EGL_STENCIL_SIZE, &stencilSize);
+ eglGetConfigAttrib(display, config, EGL_SAMPLES, &sampleCount);
+ eglGetConfigAttrib(display, config, EGL_LEVEL, &level);
+
+ format.setRedBufferSize(redSize);
+ format.setGreenBufferSize(greenSize);
+ format.setBlueBufferSize(blueSize);
+ format.setAlphaBufferSize(alphaSize);
+ format.setDepthBufferSize(depthSize);
+ format.setStencilBufferSize(stencilSize);
+ format.setSamples(sampleCount);
+ format.setPlane(level + 1); // EGL calls level 0 "normal" whereas Qt calls 1 "normal"
+ format.setDirectRendering(true); // All EGL contexts are direct-rendered
+ format.setRgba(true); // EGL doesn't support colour index rendering
+ format.setStereo(false); // EGL doesn't support stereo buffers
+ format.setAccumBufferSize(0); // EGL doesn't support accululation buffers
// Clear the EGL error state because some of the above may
// have errored out because the attribute is not applicable
@@ -143,10 +162,11 @@ void QGLContext::reset()
return;
d->cleanup();
doneCurrent();
- if (d->eglContext) {
+ if (d->eglContext && d->ownsEglContext) {
d->destroyEglSurfaceForDevice();
delete d->eglContext;
}
+ d->ownsEglContext = false;
d->eglContext = 0;
d->eglSurface = EGL_NO_SURFACE;
d->crWin = false;
@@ -194,7 +214,7 @@ void QGLContextPrivate::destroyEglSurfaceForDevice()
#ifdef Q_WS_X11
// Make sure we don't call eglDestroySurface on a surface which
// was created for a different winId:
- if (paintDevice->devType() == QInternal::Widget) {
+ if (paintDevice && paintDevice->devType() == QInternal::Widget) {
QGLWidget* w = static_cast<QGLWidget*>(paintDevice);
if (w->d_func()->eglSurfaceWindowId == w->winId())
diff --git a/src/opengl/qgl_egl_p.h b/src/opengl/qgl_egl_p.h
index 6b65227..43793cd 100644
--- a/src/opengl/qgl_egl_p.h
+++ b/src/opengl/qgl_egl_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
class QGLFormat;
void qt_eglproperties_set_glformat(QEglProperties& props, const QGLFormat& format);
-void qt_egl_update_format(const QEglContext& context, QGLFormat& format);
+void qt_glformat_from_eglconfig(QGLFormat& format, const EGLConfig config);
QT_END_NAMESPACE
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index ed34f79..45f8f30 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -278,8 +278,6 @@ public:
Q_DECLARE_FLAGS(Extensions, Extension)
static Extensions glExtensions();
-
-private:
static Extensions currentContextExtensions();
};
@@ -347,6 +345,7 @@ public:
HDC hbitmap_hdc;
#endif
#if defined(QT_OPENGL_ES)
+ bool ownsEglContext;
QEglContext *eglContext;
EGLSurface eglSurface;
void destroyEglSurfaceForDevice();
@@ -532,7 +531,6 @@ public:
bool remove(QGLContext *ctx, GLuint textureId);
void removeContextTextures(QGLContext *ctx);
static QGLTextureCache *instance();
- static void deleteIfEmpty();
static void cleanupTexturesForCacheKey(qint64 cacheKey);
static void cleanupTexturesForPixampData(QPixmapData* pixmap);
static void cleanupBeforePixmapDestruction(QPixmapData* pixmap);
diff --git a/src/opengl/qgl_qws.cpp b/src/opengl/qgl_qws.cpp
index f72f051..38c3774 100644
--- a/src/opengl/qgl_qws.cpp
+++ b/src/opengl/qgl_qws.cpp
@@ -182,6 +182,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
// Get the display and initialize it.
d->eglContext = new QEglContext();
+ d->ownsEglContext = true;
d->eglContext->setApi(QEgl::OpenGL);
// Construct the configuration we need for this surface.
@@ -200,7 +201,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}
// Inform the higher layers about the actual format properties.
- qt_egl_update_format(*(d->eglContext), d->glFormat);
+ qt_glformat_from_eglconfig(d->glFormat, d->eglContext->config());
// Create a new context for the configuration.
if (!d->eglContext->createContext
diff --git a/src/opengl/qgl_wince.cpp b/src/opengl/qgl_wince.cpp
index 3bf7f3a..47a19b5 100644
--- a/src/opengl/qgl_wince.cpp
+++ b/src/opengl/qgl_wince.cpp
@@ -145,6 +145,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
// Get the display and initialize it.
d->eglContext = new QEglContext();
+ d->ownsEglContext = true;
d->eglContext->setApi(QEgl::OpenGL);
// Construct the configuration we need for this surface.
@@ -163,7 +164,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}
// Inform the higher layers about the actual format properties.
- qt_egl_update_format(*(d->eglContext), d->glFormat);
+ qt_glformat_from_eglconfig(d->glFormat, d->eglContext->config());
// Create a new context for the configuration.
if (!d->eglContext->createContext
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index f0b06ef5..4fa1467 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1753,7 +1753,7 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
if (!glxPixmap)
return 0;
- pixmapData->gl_surface = (Qt::HANDLE)glxPixmap;
+ pixmapData->gl_surface = (void*)glxPixmap;
// Make sure the cleanup hook gets called so we can delete the glx pixmap
QImagePixmapCleanupHooks::enableCleanupHooks(pixmapData);
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index fdcc412..0954e69 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -182,6 +182,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
// Only create the eglContext if we don't already have one:
if (d->eglContext == 0) {
d->eglContext = new QEglContext();
+ d->ownsEglContext = true;
d->eglContext->setApi(QEgl::OpenGL);
// If the device is a widget with WA_TranslucentBackground set, make sure the glFormat
@@ -198,10 +199,6 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
configProps.setRenderableType(QEgl::OpenGL);
qt_eglproperties_set_glformat(configProps, d->glFormat);
- // Use EGL_BUFFER_SIZE to make sure we prefer a 16-bit config over a 32-bit config
- if (device()->depth() == 16 && !d->glFormat.alpha())
- configProps.setValue(EGL_BUFFER_SIZE, 16);
-
if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) {
delete d->eglContext;
d->eglContext = 0;
@@ -220,9 +217,8 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
const_cast<QGLContext *>(shareContext)->d_func()->sharing = true;
}
- // Inform the higher layers about the actual format properties.
- qt_egl_update_format(*(d->eglContext), d->glFormat);
-
+ // Inform the higher layers about the actual format properties
+ qt_glformat_from_eglconfig(d->glFormat, d->eglContext->config());
// Do don't create the EGLSurface for everything.
// QWidget - yes, create the EGLSurface and store it in QGLContextPrivate::eglSurface
@@ -243,7 +239,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
if (x11PixmapData->gl_surface)
eglDestroySurface(d->eglContext->display(), (EGLSurface)x11PixmapData->gl_surface);
- x11PixmapData->gl_surface = (Qt::HANDLE)QEgl::createSurface(device(), d->eglContext->config());
+ x11PixmapData->gl_surface = (void*)QEgl::createSurface(device(), d->eglContext->config());
}
return true;
@@ -404,8 +400,8 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons
hasAlpha ? QEgl::Translucent : QEgl::NoOptions);
QPixmap tmpPixmap(pixmapData); //###
- pixmapData->gl_surface = (Qt::HANDLE)QEgl::createSurface(&tmpPixmap, config);
- if (pixmapData->gl_surface == (Qt::HANDLE)EGL_NO_SURFACE) {
+ pixmapData->gl_surface = (void*)QEgl::createSurface(&tmpPixmap, config);
+ if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE) {
haveTFP = false;
return 0;
}
@@ -423,7 +419,7 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons
if (success == EGL_FALSE) {
qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
eglDestroySurface(eglContext->display(), (EGLSurface)pixmapData->gl_surface);
- pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE;
+ pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
haveTFP = false;
return 0;
}
diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp
index ee0714f..db9e754 100644
--- a/src/opengl/qglpixelbuffer_egl.cpp
+++ b/src/opengl/qglpixelbuffer_egl.cpp
@@ -113,7 +113,7 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge
}
// Retrieve the actual format properties.
- qt_egl_update_format(*ctx, format);
+ qt_glformat_from_eglconfig(format, ctx->config());
// Create the attributes needed for the pbuffer.
QEglProperties attribs;
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index 34915f5..a01eec4 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -61,6 +61,10 @@ QT_BEGIN_NAMESPACE
// On 16bpp systems, RGB & ARGB pixmaps are different bit-depths and therefore need
// different contexts:
+
+Q_GLOBAL_STATIC(QEglContext, qt_x11gl_rgbContext);
+Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext)
+
QEglContext* QX11GLPixmapData::rgbContext = 0;
QEglContext* QX11GLPixmapData::argbContext = 0;
@@ -75,6 +79,9 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
checkedForX11Pixmaps = true;
+ EGLint rgbConfigId;
+ EGLint argbConfigId;
+
do {
if (qgetenv("QT_USE_X11GL_PIXMAPS").isEmpty())
break;
@@ -83,8 +90,11 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
EGLConfig argbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL,
QEgl::Renderable | QEgl::Translucent);
+ eglGetConfigAttrib(QEgl::display(), rgbConfig, EGL_CONFIG_ID, &rgbConfigId);
+ eglGetConfigAttrib(QEgl::display(), argbConfig, EGL_CONFIG_ID, &argbConfigId);
+
if (!rgbContext) {
- rgbContext = new QEglContext;
+ rgbContext = qt_x11gl_rgbContext();
rgbContext->setConfig(rgbConfig);
rgbContext->createContext();
}
@@ -97,7 +107,7 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
argbContext = rgbContext;
if (!argbContext) {
- argbContext = new QEglContext;
+ argbContext = qt_x11gl_argbContext();
argbContext->setConfig(argbConfig);
argbContext->createContext();
}
@@ -138,6 +148,10 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
break;
}
}
+
+ // The pixmap surface destruction hooks are installed by QGLTextureCache, so we
+ // must make sure this is instanciated:
+ QGLTextureCache::instance();
} while (0);
if (!haveX11Pixmaps) {
@@ -152,7 +166,7 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
}
if (haveX11Pixmaps)
- qDebug("QX11GLPixmapData is supported");
+ qDebug("Using QX11GLPixmapData with EGL config %d for ARGB and config %d for RGB", argbConfigId, rgbConfigId);
else
qDebug("QX11GLPixmapData is *NOT* being used");
@@ -167,6 +181,8 @@ QX11GLPixmapData::QX11GLPixmapData()
QX11GLPixmapData::~QX11GLPixmapData()
{
+ if (ctx)
+ delete ctx;
}
#if !defined(QT_OPENGL_ES_1)
@@ -231,8 +247,15 @@ void QX11GLPixmapData::beginPaint()
if ((EGLSurface)gl_surface == EGL_NO_SURFACE) {
QPixmap tmpPixmap(this);
EGLConfig cfg = ctx->d_func()->eglContext->config();
- gl_surface = (Qt::HANDLE)QEgl::createSurface(&tmpPixmap, cfg);
- ctx->d_func()->eglSurface = (EGLSurface)gl_surface;
+ Q_ASSERT(cfg != QEGL_NO_CONFIG);
+
+ EGLSurface surface = QEgl::createSurface(&tmpPixmap, cfg);
+ if (surface == EGL_NO_SURFACE) {
+ qWarning() << "Error creating EGL surface for pixmap:" << QEgl::errorString();
+ return;
+ }
+ gl_surface = (void*)surface;
+ ctx->d_func()->eglSurface = surface;
ctx->d_func()->valid = true;
}
QGLPaintDevice::beginPaint();
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 4df894a..4902cbd 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3041,8 +3041,8 @@ void QVGPaintEngine::drawTiledPixmap
// (i.e. no opacity), no rotation or scaling, and drawing the full
// pixmap rather than parts of the pixmap. Even having just one of
// these conditions will improve performance.
-void QVGPaintEngine::drawPixmapFragments(const QPainter::Fragment *drawingData, int dataCount,
- const QPixmap &pixmap, QFlags<QPainter::FragmentHint> hints)
+void QVGPaintEngine::drawPixmapFragments(const QPainter::PixmapFragment *drawingData, int dataCount,
+ const QPixmap &pixmap, QFlags<QPainter::PixmapFragmentHint> hints)
{
#if !defined(QT_SHIVAVG)
Q_D(QVGPaintEngine);
@@ -3307,6 +3307,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
bool QVGPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font,
QFontEngine *fontEngine, const QPointF &p)
{
+#if !defined(QVG_NO_DRAW_GLYPHS)
Q_D(QVGPaintEngine);
// Find the glyph cache for this font.
@@ -3361,6 +3362,14 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
NULL, NULL, VG_FILL_PATH, VG_TRUE);
return true;
+#else
+ Q_UNUSED(numGlyphs);
+ Q_UNUSED(glyphs);
+ Q_UNUSED(font);
+ Q_UNUSED(fontEngine);
+ Q_UNUSED(p);
+ return false;
+#endif
}
void QVGPaintEngine::setState(QPainterState *s)
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 1203af5..1e7e26c 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -137,7 +137,8 @@ public:
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
- void drawPixmapFragments(const QPainter::Fragment *drawingData, int dataCount, const QPixmap &pixmap, QFlags<QPainter::FragmentHint> hints);
+ void drawPixmapFragments(const QPainter::PixmapFragment *drawingData, int dataCount, const QPixmap &pixmap,
+ QFlags<QPainter::PixmapFragmentHint> hints);
void drawTextItem(const QPointF &p, const QTextItem &textItem);
void drawStaticTextItem(QStaticTextItem *staticTextItem);
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 9c44545..693312a 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -177,7 +177,8 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd)
pd->prev->next = pd->next;
} else {
QVGSharedContext *shared = sharedContext();
- shared->firstPixmap = pd->next;
+ if (shared)
+ shared->firstPixmap = pd->next;
}
}
diff --git a/src/plugins/audio/audio.pro b/src/plugins/audio/audio.pro
index 5f75a8d..b7a775b 100644
--- a/src/plugins/audio/audio.pro
+++ b/src/plugins/audio/audio.pro
@@ -1,9 +1,3 @@
TEMPLATE = subdirs
SUBDIRS =
-contains(QT_CONFIG, audio-backend) {
- symbian {
- SUBDIRS += symbian
- }
-}
-
diff --git a/src/plugins/audio/symbian/main.cpp b/src/plugins/audio/symbian/main.cpp
deleted file mode 100644
index 536a8ec..0000000
--- a/src/plugins/audio/symbian/main.cpp
+++ /dev/null
@@ -1,121 +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 QtMultimedia module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtMultimedia/qaudioengineplugin.h>
-#include <QtMultimedia/qaudioengine.h>
-
-#include <qstringlist.h>
-#include <qiodevice.h>
-#include <qbytearray.h>
-#include <qdebug.h>
-
-#include "symbianaudiodeviceinfo.h"
-#include "symbianaudioinput.h"
-#include "symbianaudiooutput.h"
-
-QT_BEGIN_NAMESPACE
-
-class SymbianAudioPlugin : public QAudioEnginePlugin
-{
-public:
- SymbianAudioPlugin(QObject *parent = 0);
- ~SymbianAudioPlugin();
-
- QStringList keys() const;
-
- QList<QByteArray> availableDevices(QAudio::Mode) const;
- QAbstractAudioInput* createInput(const QByteArray& device,
- const QAudioFormat& format = QAudioFormat());
- QAbstractAudioOutput* createOutput(const QByteArray& device,
- const QAudioFormat& format = QAudioFormat());
- QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device,
- QAudio::Mode mode);
-};
-
-SymbianAudioPlugin::SymbianAudioPlugin(QObject *parent)
- : QAudioEnginePlugin(parent)
-{
-
-}
-
-SymbianAudioPlugin::~SymbianAudioPlugin()
-{
-
-}
-
-QStringList SymbianAudioPlugin::keys() const
-{
- QStringList keys(QLatin1String("default"));
- keys << QLatin1String("default");
- return keys;
-}
-
-QList<QByteArray> SymbianAudioPlugin::availableDevices(QAudio::Mode mode) const
-{
- Q_UNUSED(mode)
- QList<QByteArray> devices;
- devices.append("default");
- return devices;
-}
-
-QAbstractAudioInput* SymbianAudioPlugin::createInput(
- const QByteArray &device, const QAudioFormat &format)
-{
- return new SymbianAudioInput(device, format);
-}
-
-QAbstractAudioOutput* SymbianAudioPlugin::createOutput(
- const QByteArray &device, const QAudioFormat &format)
-{
- return new SymbianAudioOutput(device, format);
-}
-
-QAbstractAudioDeviceInfo* SymbianAudioPlugin::createDeviceInfo(
- const QByteArray& device, QAudio::Mode mode)
-{
- return new SymbianAudioDeviceInfo(device, mode);
-}
-
-Q_EXPORT_STATIC_PLUGIN(SymbianAudioPlugin)
-Q_EXPORT_PLUGIN2(qaudio, SymbianAudioPlugin)
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/audio/symbian/symbian.pro b/src/plugins/audio/symbian/symbian.pro
deleted file mode 100644
index 7355daa..0000000
--- a/src/plugins/audio/symbian/symbian.pro
+++ /dev/null
@@ -1,31 +0,0 @@
-QT += multimedia
-TARGET = qaudio
-
-# Paths to DevSound headers
-INCLUDEPATH += /epoc32/include/mmf/common
-INCLUDEPATH += /epoc32/include/mmf/server
-
-HEADERS += \
- symbianaudio.h \
- symbianaudiodeviceinfo.h \
- symbianaudioinput.h \
- symbianaudiooutput.h \
- symbianaudioutils.h
-
-SOURCES += \
- main.cpp \
- symbianaudiodeviceinfo.cpp \
- symbianaudioinput.cpp \
- symbianaudiooutput.cpp \
- symbianaudioutils.cpp
-
-LIBS += -lmmfdevsound
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/audio
-target.path = $$[QT_INSTALL_PLUGINS]/audio
-INSTALLS += target
-
-include(../../qpluginbase.pri)
-
-TARGET.UID3 = 0x2001E630
-
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 7ba62b3..a67c8f6 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -6,7 +6,7 @@ TEMPLATE = subdirs
#win32:SUBDIRS += nla
win32:SUBDIRS += generic
win32:!wince*:SUBDIRS += nativewifi
-macx:SUBDIRS += corewlan
+macx:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan
macx:SUBDIRS += generic
symbian:SUBDIRS += symbian
maemo6:contains(QT_CONFIG, dbus):SUBDIRS += icd
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h
index cfd89e4..cbaa9d6 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.h
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.h
@@ -78,7 +78,9 @@ public:
QNetworkConfigurationPrivatePointer defaultConfiguration();
- bool getAllScInterfaces();
+ bool getWifiInterfaces();
+
+ bool requiresPolling() const;
private Q_SLOTS:
void doRequestUpdate();
@@ -86,7 +88,6 @@ private Q_SLOTS:
private:
bool isWifiReady(const QString &dev);
QMap<QString, QString> configurationInterface;
- QTimer pollTimer;
QStringList scanForSsids(const QString &interfaceName);
bool isKnownSsid(const QString &interfaceName, const QString &ssid);
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 2d33d36..cb278d9 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -61,44 +61,78 @@
#include <Foundation/NSEnumerator.h>
#include <Foundation/NSKeyValueObserving.h>
#include <Foundation/NSAutoreleasePool.h>
+#include <Foundation/NSLock.h>
#include <SystemConfiguration/SCNetworkConfiguration.h>
+#include <private/qt_cocoa_helpers_mac_p.h>
+#include "private/qcore_mac_p.h"
+
QMap <QString, QString> networkInterfaces;
-QT_BEGIN_NAMESPACE
+#ifdef MAC_SDK_10_6
+@interface QNSListener : NSObject
+{
+ NSNotificationCenter *center;
+ CWInterface *currentInterface;
+ QCoreWlanEngine *engine;
+ NSAutoreleasePool *autoreleasepool;
+ NSLock *locker;
+}
+- (void)notificationHandler:(NSNotification *)notification;
+- (void)remove;
+- (void)setEngine:(QCoreWlanEngine *)coreEngine;
+- (void)dealloc;
-inline QString cfstringRefToQstring(CFStringRef cfStringRef) {
-// return QString([cfStringRef UTF8String]);
- QString retVal;
- CFIndex maxLength = 2 * CFStringGetLength(cfStringRef) + 1/*zero term*/; // max UTF8
- char *cstring = new char[maxLength];
- if (CFStringGetCString(CFStringRef(cfStringRef), cstring, maxLength, kCFStringEncodingUTF8)) {
- retVal = QString::fromUtf8(cstring);
- }
- delete[] cstring;
- return retVal;
+@property (assign) QCoreWlanEngine* engine;
+
+@end
+
+@implementation QNSListener
+- (id) init
+{
+ [locker lock];
+ autoreleasepool = [[NSAutoreleasePool alloc] init];
+ center = [NSNotificationCenter defaultCenter];
+ currentInterface = [CWInterface interface];
+// [center addObserver:self selector:@selector(notificationHandler:) name:kCWLinkDidChangeNotification object:nil];
+ [center addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil];
+ [locker unlock];
+ return self;
}
-inline CFStringRef qstringToCFStringRef(const QString &string)
+-(void)dealloc
{
- return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(string.unicode()),
- string.length());
+ [autoreleasepool release];
+ [super dealloc];
}
-inline NSString *qstringToNSString(const QString &qstr)
-{ return [reinterpret_cast<const NSString *>(qstringToCFStringRef(qstr)) autorelease]; }
+-(void)setEngine:(QCoreWlanEngine *)coreEngine
+{
+ [locker lock];
+ if(!engine)
+ engine = coreEngine;
+ [locker unlock];
+}
-inline QString nsstringToQString(const NSString *nsstr)
-{ return cfstringRefToQstring(reinterpret_cast<const CFStringRef>(nsstr)); }
+-(void)remove
+{
+ [locker lock];
+ [center removeObserver:self];
+ [locker unlock];
+}
-inline QStringList nsarrayToQStringList(void *nsarray)
+- (void)notificationHandler:(NSNotification *)notification
{
- QStringList result;
- NSArray *array = static_cast<NSArray *>(nsarray);
- for (NSUInteger i=0; i<[array count]; ++i)
- result << nsstringToQString([array objectAtIndex:i]);
- return result;
+ engine->requestUpdate();
}
+@end
+
+QNSListener *listener = 0;
+
+#endif
+
+QT_BEGIN_NAMESPACE
+
static QString qGetInterfaceType(const QString &interfaceString)
{
@@ -109,8 +143,8 @@ void networkChangeCallback(SCDynamicStoreRef/* store*/, CFArrayRef changedKeys,
{
for ( long i = 0; i < CFArrayGetCount(changedKeys); i++) {
- CFStringRef changed = (CFStringRef)CFArrayGetValueAtIndex(changedKeys, i);
- if( cfstringRefToQstring(changed).contains("/Network/Global/IPv4")) {
+ QString changed = QCFString::toQString((CFStringRef)CFArrayGetValueAtIndex(changedKeys, i));
+ if( changed.contains("/Network/Global/IPv4")) {
QCoreWlanEngine* wlanEngine = static_cast<QCoreWlanEngine*>(info);
wlanEngine->requestUpdate();
}
@@ -122,12 +156,23 @@ QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
: QBearerEngineImpl(parent)
{
startNetworkChangeLoop();
+
+#if defined(MAC_SDK_10_6)
+ if(!listener) {
+ listener = [[QNSListener alloc] init];
+ listener.engine = this;
+ }
+#endif
}
QCoreWlanEngine::~QCoreWlanEngine()
{
while (!foundConfigurations.isEmpty())
delete foundConfigurations.takeFirst();
+#if defined(MAC_SDK_10_6)
+ [listener remove];
+ [listener release];
+#endif
}
QString QCoreWlanEngine::getInterfaceFromId(const QString &id)
@@ -153,7 +198,7 @@ void QCoreWlanEngine::connectToId(const QString &id)
if(networkInterfaces.value(interfaceString) == "WLAN") {
#if defined(MAC_SDK_10_6)
- CWInterface *wifiInterface = [CWInterface interfaceWithName: qstringToNSString(interfaceString)];
+ CWInterface *wifiInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)];
CWConfiguration *userConfig = [ wifiInterface configuration];
NSSet *remNets = [userConfig rememberedNetworks]; //CWWirelessProfile
@@ -170,7 +215,7 @@ void QCoreWlanEngine::connectToId(const QString &id)
while ((wProfile = [enumerator nextObject])) { //CWWirelessProfile
- if(id == QString::number(qHash(QLatin1String("corewlan:") + nsstringToQString([wProfile ssid])))) {
+ if(id == QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString([wProfile ssid])))) {
user8021XProfile = nil;
user8021XProfile = [ wProfile user8021XProfile];
@@ -224,7 +269,7 @@ void QCoreWlanEngine::disconnectFromId(const QString &id)
if(networkInterfaces.value(getInterfaceFromId(id)) == "WLAN") { //wifi only for now
#if defined(MAC_SDK_10_6)
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
- CWInterface *wifiInterface = [CWInterface interfaceWithName: qstringToNSString(interfaceString)];
+ CWInterface *wifiInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceString)];
[wifiInterface disassociate];
if([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) {
emit connectionError(id, DisconnectionError);
@@ -242,15 +287,14 @@ void QCoreWlanEngine::requestUpdate()
{
QMutexLocker locker(&mutex);
- pollTimer.stop();
- QTimer::singleShot(0, this, SLOT(doRequestUpdate()));
+ doRequestUpdate();
}
void QCoreWlanEngine::doRequestUpdate()
{
QMutexLocker locker(&mutex);
- getAllScInterfaces();
+ getWifiInterfaces();
QStringList previous = accessPointConfigurations.keys();
@@ -328,8 +372,6 @@ void QCoreWlanEngine::doRequestUpdate()
emit configurationRemoved(ptr);
}
- pollTimer.start();
-
emit updateCompleted();
}
@@ -340,9 +382,9 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
QStringList found;
#if defined(MAC_SDK_10_6)
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacCocoaAutoReleasePool pool;
- CWInterface *currentInterface = [CWInterface interfaceWithName:qstringToNSString(interfaceName)];
+ CWInterface *currentInterface = [CWInterface interfaceWithName:qt_mac_QStringToNSString(interfaceName)];
if([currentInterface power]) {
NSError *err = nil;
NSDictionary *parametersDict = nil;
@@ -351,11 +393,10 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
CWNetwork *apNetwork;
if (!err) {
for(uint row=0; row < [apArray count]; row++ ) {
- NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init];
apNetwork = [apArray objectAtIndex:row];
- const QString networkSsid = nsstringToQString([apNetwork ssid]);
+ const QString networkSsid = qt_mac_NSStringToQString([apNetwork ssid]);
const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid));
found.append(id);
@@ -363,7 +404,7 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
if ([currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) {
- if (networkSsid == nsstringToQString([currentInterface ssid]))
+ if (networkSsid == qt_mac_NSStringToQString([currentInterface ssid]))
state = QNetworkConfiguration::Active;
} else {
if (isKnownSsid(interfaceName, networkSsid))
@@ -414,11 +455,9 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
emit configurationAdded(ptr);
}
- [looppool release];
}
}
}
- [autoreleasepool drain];
#else
Q_UNUSED(interfaceName);
#endif
@@ -430,7 +469,7 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName)
QMutexLocker locker(&mutex);
#if defined(MAC_SDK_10_6)
- CWInterface *defaultInterface = [CWInterface interfaceWithName: qstringToNSString(wifiDeviceName)];
+ CWInterface *defaultInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(wifiDeviceName)];
if([defaultInterface power])
return true;
#else
@@ -444,11 +483,11 @@ bool QCoreWlanEngine::isKnownSsid(const QString &interfaceName, const QString &s
QMutexLocker locker(&mutex);
#if defined(MAC_SDK_10_6)
- CWInterface *wifiInterface = [CWInterface interfaceWithName: qstringToNSString(interfaceName)];
+ CWInterface *wifiInterface = [CWInterface interfaceWithName: qt_mac_QStringToNSString(interfaceName)];
CWConfiguration *userConfig = [wifiInterface configuration];
NSSet *remNets = [userConfig rememberedNetworks];
for (CWWirelessProfile *wProfile in remNets) {
- if(ssid == nsstringToQString([wProfile ssid]))
+ if(ssid == qt_mac_NSStringToQString([wProfile ssid]))
return true;
}
#else
@@ -458,39 +497,18 @@ bool QCoreWlanEngine::isKnownSsid(const QString &interfaceName, const QString &s
return false;
}
-bool QCoreWlanEngine::getAllScInterfaces()
+bool QCoreWlanEngine::getWifiInterfaces()
{
QMutexLocker locker(&mutex);
networkInterfaces.clear();
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacCocoaAutoReleasePool pool;
- CFArrayRef interfaces = SCNetworkInterfaceCopyAll();
- if (interfaces != NULL) {
- CFIndex interfaceCount;
- CFIndex interfaceIndex;
- interfaceCount = CFArrayGetCount(interfaces);
- for (interfaceIndex = 0; interfaceIndex < interfaceCount; interfaceIndex++) {
- NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init];
-
- CFStringRef bsdName;
- CFTypeRef thisInterface = CFArrayGetValueAtIndex(interfaces, interfaceIndex);
- bsdName = SCNetworkInterfaceGetBSDName((SCNetworkInterfaceRef)thisInterface);
- QString interfaceName = cfstringRefToQstring(bsdName);
- QString typeStr;
- CFStringRef type = SCNetworkInterfaceGetInterfaceType((SCNetworkInterfaceRef)thisInterface);
- if ( CFEqual(type, kSCNetworkInterfaceTypeIEEE80211)) {
- typeStr = "WLAN";
- }
- if(!networkInterfaces.contains(interfaceName) && !typeStr.isEmpty()) {
- networkInterfaces.insert(interfaceName,typeStr);
- }
- [looppool release];
- }
+ NSArray *wifiInterfaces = [CWInterface supportedInterfaces];
+ for(uint row=0; row < [wifiInterfaces count]; row++ ) {
+ networkInterfaces.insert( qt_mac_NSStringToQString([wifiInterfaces objectAtIndex:row]),"WLAN");
}
- CFRelease(interfaces);
- [autoreleasepool drain];
return true;
}
@@ -589,4 +607,9 @@ QNetworkConfigurationPrivatePointer QCoreWlanEngine::defaultConfiguration()
return QNetworkConfigurationPrivatePointer();
}
+bool QCoreWlanEngine::requiresPolling() const
+{
+ return true;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index e6c871d..a9e78b2 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -142,9 +142,6 @@ static QString qGetInterfaceType(const QString &interface)
QGenericEngine::QGenericEngine(QObject *parent)
: QBearerEngineImpl(parent)
{
- connect(&pollTimer, SIGNAL(timeout()), this, SLOT(doRequestUpdate()));
- pollTimer.setInterval(10000);
- doRequestUpdate();
}
QGenericEngine::~QGenericEngine()
@@ -179,8 +176,7 @@ void QGenericEngine::requestUpdate()
{
QMutexLocker locker(&mutex);
- pollTimer.stop();
- QTimer::singleShot(0, this, SLOT(doRequestUpdate()));
+ doRequestUpdate();
}
void QGenericEngine::doRequestUpdate()
@@ -282,8 +278,6 @@ void QGenericEngine::doRequestUpdate()
emit configurationRemoved(ptr);
}
- pollTimer.start();
-
emit updateCompleted();
}
@@ -328,5 +322,11 @@ QNetworkConfigurationPrivatePointer QGenericEngine::defaultConfiguration()
return QNetworkConfigurationPrivatePointer();
}
+
+bool QGenericEngine::requiresPolling() const
+{
+ return true;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index cd9a976..a1b9167 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -78,12 +78,13 @@ public:
QNetworkConfigurationPrivatePointer defaultConfiguration();
+ bool requiresPolling() const;
+
private Q_SLOTS:
void doRequestUpdate();
private:
QMap<QString, QString> configurationInterface;
- QTimer pollTimer;
};
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
index 206a6fd..5e506ef 100644
--- a/src/plugins/bearer/icd/qicdengine.cpp
+++ b/src/plugins/bearer/icd/qicdengine.cpp
@@ -206,14 +206,11 @@ void QIcdEngine::doRequestUpdate()
QString iap_type = saved_ap.value("type").toString();
if (iap_type.startsWith("WLAN")) {
ssid = saved_ap.value("wlan_ssid").toByteArray();
- if (ssid.isEmpty()) {
- qWarning() << "Cannot get ssid for" << iap_id;
+ if (ssid.isEmpty())
continue;
- }
QString security_method = saved_ap.value("wlan_security").toString();
} else if (iap_type.isEmpty()) {
- qWarning() << "IAP" << iap_id << "network type is not set! Skipping it";
continue;
} else {
#ifdef BEARER_MANAGEMENT_DEBUG
@@ -270,7 +267,9 @@ void QIcdEngine::doRequestUpdate()
scanned,
error);
if (!error.isEmpty()) {
- qWarning() << "Network scanning failed" << error;
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug() << "Network scanning failed" << error;
+#endif
} else {
#ifdef BEARER_MANAGEMENT_DEBUG
if (!scanned.isEmpty())
@@ -379,19 +378,13 @@ void QIcdEngine::deleteConfiguration(const QString &iap_id)
* or read all the IAPs from db because it might take too much power
* (multiple applications would need to scan and read all IAPs from db)
*/
- if (accessPointConfigurations.contains(iap_id)) {
- QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(iap_id);
-
- if (ptr) {
- ptr->isValid = false;
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(iap_id);
+ if (ptr) {
#ifdef BEARER_MANAGEMENT_DEBUG
- qDebug() << "IAP" << iap_id << "was removed from storage.";
+ qDebug() << "IAP" << iap_id << "was removed from storage.";
#endif
- emit configurationRemoved(ptr);
- } else {
- qWarning("Configuration not found for IAP %s", iap_id.toAscii().data());
- }
+ emit configurationRemoved(ptr);
} else {
#ifdef BEARER_MANAGEMENT_DEBUG
qDebug("IAP: %s, already missing from the known list", iap_id.toAscii().data());
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 03624fa..bb81408 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -140,7 +140,9 @@ static DBusHandlerResult signal_handler(DBusConnection *,
DBUS_TYPE_STRING, &network_type,
DBUS_TYPE_STRING, &state,
DBUS_TYPE_INVALID) == FALSE) {
- qWarning() << QString("Failed to parse icd status signal: %1").arg(error.message);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug() << QString("Failed to parse icd status signal: %1").arg(error.message);
+#endif
} else {
QString _iap_id(iap_id);
QString _network_type(network_type);
@@ -166,7 +168,6 @@ void IcdListener::setup(QNetworkSessionPrivateImpl *d)
dbus_connection = get_dbus_conn(&error);
if (dbus_error_is_set(&error)) {
- qWarning() << "Cannot get dbus connection.";
dbus_error_free(&error);
return;
}
@@ -176,7 +177,6 @@ void IcdListener::setup(QNetworkSessionPrivateImpl *d)
dbus_bus_add_match(dbus_connection, ICD_DBUS_MATCH, &error);
if (dbus_error_is_set(&error)) {
- qWarning() << "Cannot add match" << ICD_DBUS_MATCH;
dbus_error_free(&error);
return;
}
@@ -185,7 +185,6 @@ void IcdListener::setup(QNetworkSessionPrivateImpl *d)
ICD_DBUS_PATH,
&icd_vtable,
(void*)this) == FALSE) {
- qWarning() << "Cannot register dbus signal handler, interface"<< ICD_DBUS_INTERFACE << "path" << ICD_DBUS_PATH;
dbus_error_free(&error);
return;
}
@@ -340,8 +339,6 @@ void QNetworkSessionPrivateImpl::updateIdentifier(QString &newId)
} else {
toIcdConfig(privateConfiguration(publicConfig))->network_attrs |= ICD_NW_ATTR_IAPNAME;
if (privateConfiguration(publicConfig)->id != newId) {
- qWarning() << "Your config id changed from" << privateConfiguration(publicConfig)->id
- << "to" << newId;
privateConfiguration(publicConfig)->id = newId;
}
}
@@ -1015,25 +1012,21 @@ void QNetworkSessionPrivateImpl::stop()
void QNetworkSessionPrivateImpl::migrate()
{
- qWarning("This platform does not support roaming (%s).", __FUNCTION__);
}
void QNetworkSessionPrivateImpl::accept()
{
- qWarning("This platform does not support roaming (%s).", __FUNCTION__);
}
void QNetworkSessionPrivateImpl::ignore()
{
- qWarning("This platform does not support roaming (%s).", __FUNCTION__);
}
void QNetworkSessionPrivateImpl::reject()
{
- qWarning("This platform does not support roaming (%s).", __FUNCTION__);
}
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index c8015d8..b6522ad 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -83,8 +83,10 @@ QNativeWifiEngine::QNativeWifiEngine(QObject *parent)
DWORD result = local_WlanOpenHandle(1, 0, &clientVersion, &handle);
if (result != ERROR_SUCCESS) {
+#ifdef BEARER_MANAGEMENT_DEBUG
if (result != ERROR_SERVICE_NOT_ACTIVE)
- qWarning("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result);
+ qDebug("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result);
+#endif
return;
}
@@ -92,13 +94,11 @@ QNativeWifiEngine::QNativeWifiEngine(QObject *parent)
result = local_WlanRegisterNotification(handle, WLAN_NOTIFICATION_SOURCE_ALL, true,
WLAN_NOTIFICATION_CALLBACK(qNotificationCallback),
this, 0, 0);
+#ifdef BEARER_MANAGEMENT_DEBUG
if (result != ERROR_SUCCESS)
- qWarning("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result);
+ qDebug("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result);
+#endif
- // On Windows XP SP2 and SP3 only connection and disconnection notifications are available.
- // We need to poll for changes in available wireless networks.
- connect(&pollTimer, SIGNAL(timeout()), this, SLOT(scanComplete()));
- pollTimer.setInterval(10000);
scanComplete();
}
@@ -111,16 +111,22 @@ void QNativeWifiEngine::scanComplete()
{
QMutexLocker locker(&mutex);
- QStringList previous = accessPointConfigurations.keys();
-
// enumerate interfaces
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#endif
+
+ locker.unlock();
+ emit updateCompleted();
+
return;
}
+ QStringList previous = accessPointConfigurations.keys();
+
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
@@ -128,8 +134,10 @@ void QNativeWifiEngine::scanComplete()
result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
3, 0, &networkList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n",
- __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
+ __FUNCTION__, result);
+#endif
continue;
}
@@ -222,8 +230,6 @@ void QNativeWifiEngine::scanComplete()
emit configurationRemoved(ptr);
}
- pollTimer.start();
-
emit updateCompleted();
}
@@ -235,7 +241,9 @@ QString QNativeWifiEngine::getInterfaceFromId(const QString &id)
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#endif
return QString();
}
@@ -248,8 +256,10 @@ QString QNativeWifiEngine::getInterfaceFromId(const QString &id)
wlan_intf_opcode_current_connection, 0, &dataSize,
reinterpret_cast<PVOID *>(&connectionAttributes), 0);
if (result != ERROR_SUCCESS) {
+#ifdef BEARER_MANAGEMENT_DEBUG
if (result != ERROR_INVALID_STATE)
- qWarning("%s: WlanQueryInterface failed with error %ld\n", __FUNCTION__, result);
+ qDebug("%s: WlanQueryInterface failed with error %ld\n", __FUNCTION__, result);
+#endif
continue;
}
@@ -286,7 +296,9 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id)
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#endif
return false;
}
@@ -297,8 +309,10 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id)
result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
3, 0, &networkList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n",
- __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
+ __FUNCTION__, result);
+#endif
continue;
}
@@ -341,7 +355,9 @@ void QNativeWifiEngine::connectToId(const QString &id)
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#endif
emit connectionError(id, InterfaceLookupError);
return;
}
@@ -355,8 +371,10 @@ void QNativeWifiEngine::connectToId(const QString &id)
result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
3, 0, &networkList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanGetAvailableNetworkList failed with error %ld\n",
- __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
+ __FUNCTION__, result);
+#endif
continue;
}
@@ -384,7 +402,9 @@ void QNativeWifiEngine::connectToId(const QString &id)
DWORD result = local_WlanConnect(handle, &interface.InterfaceGuid, &parameters, 0);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanConnect failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanConnect failed with error %ld\n", __FUNCTION__, result);
+#endif
emit connectionError(id, ConnectError);
break;
}
@@ -423,7 +443,9 @@ void QNativeWifiEngine::disconnectFromId(const QString &id)
DWORD result = local_WlanDisconnect(handle, &guid, 0);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanDisconnect failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanDisconnect failed with error %ld\n", __FUNCTION__, result);
+#endif
emit connectionError(id, DisconnectionError);
return;
}
@@ -437,17 +459,34 @@ void QNativeWifiEngine::requestUpdate()
WLAN_INTERFACE_INFO_LIST *interfaceList;
DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
if (result != ERROR_SUCCESS) {
- qWarning("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
+#endif
+
+ locker.unlock();
+ emit updateCompleted();
+
return;
}
+ bool requested = false;
for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0);
- if (result != ERROR_SUCCESS)
- qWarning("%s: WlanScan failed with error %ld\n", __FUNCTION__, result);
+ if (result != ERROR_SUCCESS) {
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("%s: WlanScan failed with error %ld\n", __FUNCTION__, result);
+#endif
+ } else {
+ requested = true;
+ }
}
local_WlanFreeMemory(interfaceList);
+
+ if (!requested) {
+ locker.unlock();
+ emit updateCompleted();
+ }
}
QNetworkSession::State QNativeWifiEngine::sessionStateForId(const QString &id)
@@ -492,4 +531,11 @@ QNetworkConfigurationPrivatePointer QNativeWifiEngine::defaultConfiguration()
return QNetworkConfigurationPrivatePointer();
}
+bool QNativeWifiEngine::requiresPolling() const
+{
+ // On Windows XP SP2 and SP3 only connection and disconnection notifications are available.
+ // We need to poll for changes in available wireless networks.
+ return true;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h
index a9a9375..56489b6 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.h
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h
@@ -90,12 +90,12 @@ public:
inline bool available() const { return handle != 0; }
+ bool requiresPolling() const;
+
public Q_SLOTS:
void scanComplete();
private:
- QTimer pollTimer;
-
Qt::HANDLE handle;
};
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index c780fbc..d23bb0d 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -199,7 +199,6 @@ QNetworkManagerInterfaceAccessPoint::QNetworkManagerInterfaceAccessPoint(const Q
dbusConnection);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- qWarning() << "Could not find InterfaceAccessPoint";
return;
}
d->valid = true;
@@ -308,7 +307,6 @@ QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &de
dbusConnection);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- qWarning() << "Could not find NetworkManagerInterfaceDevice";
return;
}
d->valid = true;
@@ -400,7 +398,6 @@ QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const Q
dbusConnection, parent);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- qWarning() << "Could not find InterfaceDeviceWired";
return;
}
d->valid = true;
@@ -478,7 +475,6 @@ QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(c
dbusConnection, parent);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- qWarning() << "Could not find InterfaceDeviceWireless";
return;
}
d->valid = true;
@@ -596,7 +592,6 @@ QNetworkManagerSettings::QNetworkManagerSettings(const QString &settingsService,
dbusConnection);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- //qWarning() << "Could not find NetworkManagerSettings";
return;
}
d->valid = true;
@@ -660,7 +655,6 @@ QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection(const QStri
QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION),
dbusConnection, parent);
if (!d->connectionInterface->isValid()) {
- //qWarning() << "Could not find NetworkManagerSettingsConnection";
d->valid = false;
return;
}
@@ -883,7 +877,6 @@ QNetworkManagerConnectionActive::QNetworkManagerConnectionActive( const QString
dbusConnection, parent);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- //qWarning() << "Could not find NetworkManagerSettingsConnection";
return;
}
d->valid = true;
@@ -978,7 +971,6 @@ QNetworkManagerIp4Config::QNetworkManagerIp4Config( const QString &deviceObjectP
dbusConnection, parent);
if (!d->connectionInterface->isValid()) {
d->valid = false;
- //qWarning() << "Could not find NetworkManagerIp4Config";
return;
}
d->valid = true;
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp
index ff334e5..334eb14 100644
--- a/src/plugins/bearer/nla/qnlaengine.cpp
+++ b/src/plugins/bearer/nla/qnlaengine.cpp
@@ -228,8 +228,11 @@ QNlaThread::~QNlaThread()
if (handle) {
/* cancel completion event */
- if (WSALookupServiceEnd(handle) == SOCKET_ERROR)
- qWarning("WSALookupServiceEnd error %d", WSAGetLastError());
+ if (WSALookupServiceEnd(handle) == SOCKET_ERROR) {
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
+#endif
+ }
}
mutex.unlock();
@@ -252,8 +255,11 @@ void QNlaThread::forceUpdate()
if (handle) {
/* cancel completion event */
- if (WSALookupServiceEnd(handle) == SOCKET_ERROR)
- qWarning("WSALookupServiceEnd error %d", WSAGetLastError());
+ if (WSALookupServiceEnd(handle) == SOCKET_ERROR) {
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
+#endif
+ }
handle = 0;
}
mutex.unlock();
@@ -262,10 +268,8 @@ void QNlaThread::forceUpdate()
void QNlaThread::run()
{
WSAEVENT changeEvent = WSACreateEvent();
- if (changeEvent == WSA_INVALID_EVENT) {
- qWarning("WSACreateEvent error %d", WSAGetLastError());
+ if (changeEvent == WSA_INVALID_EVENT)
return;
- }
while (true) {
fetchConfigurations();
@@ -284,10 +288,8 @@ void QNlaThread::run()
int result = WSALookupServiceBegin(&qsRestrictions, LUP_RETURN_ALL, &handle);
mutex.unlock();
- if (result == SOCKET_ERROR) {
- qWarning("%s: WSALookupServiceBegin error %d", __FUNCTION__, WSAGetLastError());
+ if (result == SOCKET_ERROR)
break;
- }
WSACOMPLETION completion;
WSAOVERLAPPED overlapped;
@@ -303,11 +305,8 @@ void QNlaThread::run()
result = WSANSPIoctl(handle, SIO_NSP_NOTIFY_CHANGE, 0, 0, 0, 0,
&bytesReturned, &completion);
if (result == SOCKET_ERROR) {
- int error = WSAGetLastError();
- if (error != WSA_IO_PENDING) {
- qWarning("WSANSPIoctl error %d", error);
+ if (WSAGetLastError() != WSA_IO_PENDING)
break;
- }
}
#ifndef Q_OS_WINCE
@@ -325,7 +324,6 @@ void QNlaThread::run()
if (handle) {
result = WSALookupServiceEnd(handle);
if (result == SOCKET_ERROR) {
- qWarning("WSALookupServiceEnd error %d", WSAGetLastError());
mutex.unlock();
break;
}
@@ -360,7 +358,7 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv
switch (blob->header.type) {
case NLA_RAW_DATA:
#ifdef BEARER_MANAGEMENT_DEBUG
- qWarning("%s: unhandled header type NLA_RAW_DATA", __FUNCTION__);
+ qDebug("%s: unhandled header type NLA_RAW_DATA", __FUNCTION__);
#endif
break;
case NLA_INTERFACE:
@@ -372,7 +370,7 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv
break;
case NLA_802_1X_LOCATION:
#ifdef BEARER_MANAGEMENT_DEBUG
- qWarning("%s: unhandled header type NLA_802_1X_LOCATION", __FUNCTION__);
+ qDebug("%s: unhandled header type NLA_802_1X_LOCATION", __FUNCTION__);
#endif
break;
case NLA_CONNECTIVITY:
@@ -380,18 +378,15 @@ DWORD QNlaThread::parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv
cpPriv->internet = true;
else
cpPriv->internet = false;
-#ifdef BEARER_MANAGEMENT_DEBUG
- qWarning("%s: unhandled header type NLA_CONNECTIVITY", __FUNCTION__);
-#endif
break;
case NLA_ICS:
#ifdef BEARER_MANAGEMENT_DEBUG
- qWarning("%s: unhandled header type NLA_ICS", __FUNCTION__);
+ qDebug("%s: unhandled header type NLA_ICS", __FUNCTION__);
#endif
break;
default:
#ifdef BEARER_MANAGEMENT_DEBUG
- qWarning("%s: unhandled header type %d", __FUNCTION__, blob->header.type);
+ qDebug("%s: unhandled header type %d", __FUNCTION__, blob->header.type);
#endif
;
}
@@ -462,7 +457,6 @@ void QNlaThread::fetchConfigurations()
int result = WSALookupServiceBegin(&qsRestrictions, LUP_RETURN_ALL | LUP_DEEP, &hLookup);
if (result == SOCKET_ERROR) {
- qWarning("%s: WSALookupServiceBegin error %d", __FUNCTION__, WSAGetLastError());
mutex.lock();
fetchedConfigurations.clear();
mutex.unlock();
@@ -474,18 +468,8 @@ void QNlaThread::fetchConfigurations()
result = WSALookupServiceNext(hLookup, LUP_RETURN_ALL,
&bufferLength, reinterpret_cast<WSAQUERYSET *>(buffer));
- if (result == SOCKET_ERROR) {
- int error = WSAGetLastError();
-
- if (error == WSA_E_NO_MORE)
- break;
-
- if (error == WSAEFAULT)
- break;
-
- qWarning("WSALookupServiceNext error %d", WSAGetLastError());
+ if (result == SOCKET_ERROR)
break;
- }
QNetworkConfigurationPrivate *cpPriv =
parseQuerySet(reinterpret_cast<WSAQUERYSET *>(buffer));
@@ -496,7 +480,9 @@ void QNlaThread::fetchConfigurations()
if (hLookup) {
result = WSALookupServiceEnd(hLookup);
if (result == SOCKET_ERROR) {
- qWarning("WSALookupServiceEnd error %d", WSAGetLastError());
+#ifdef BEARER_MANAGEMENT_DEBUG
+ qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
+#endif
}
}
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
index 11585ef..db1759c 100644
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/qnetworksession_impl.cpp
@@ -100,9 +100,6 @@ void QNetworkSessionManagerPrivate::forceSessionClose(const QNetworkConfiguratio
void QNetworkSessionPrivateImpl::syncStateWithInterface()
{
- connect(&manager, SIGNAL(updateCompleted()), this, SLOT(networkConfigurationsChanged()));
- connect(&manager, SIGNAL(configurationChanged(QNetworkConfiguration)),
- this, SLOT(configurationChanged(QNetworkConfiguration)));
connect(sessionManager(), SIGNAL(forcedSessionClose(QNetworkConfiguration)),
this, SLOT(forcedSessionClose(QNetworkConfiguration)));
@@ -119,6 +116,10 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
activeConfig = publicConfig;
engine = getEngineFromId(activeConfig.identifier());
if (engine) {
+ qRegisterMetaType<QNetworkConfigurationPrivatePointer>("QNetworkConfigurationPrivatePointer");
+ connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
+ this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
this, SLOT(connectionError(QString,QBearerEngineImpl::ConnectionError)),
Qt::QueuedConnection);
@@ -203,22 +204,18 @@ void QNetworkSessionPrivateImpl::stop()
void QNetworkSessionPrivateImpl::migrate()
{
- qWarning("This platform does not support roaming (%s).", Q_FUNC_INFO);
}
void QNetworkSessionPrivateImpl::accept()
{
- qWarning("This platform does not support roaming (%s).", Q_FUNC_INFO);
}
void QNetworkSessionPrivateImpl::ignore()
{
- qWarning("This platform does not support roaming (%s).", Q_FUNC_INFO);
}
void QNetworkSessionPrivateImpl::reject()
{
- qWarning("This platform does not support roaming (%s).", Q_FUNC_INFO);
}
QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
@@ -233,13 +230,37 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
return QNetworkInterface::interfaceFromName(interface);
}
-QVariant QNetworkSessionPrivateImpl::sessionProperty(const QString& /*key*/) const
+QVariant QNetworkSessionPrivateImpl::sessionProperty(const QString &key) const
{
+ if (key == QLatin1String("AutoCloseSessionTimeout")) {
+ if (engine && engine->requiresPolling() &&
+ !(engine->capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces)) {
+ if (sessionTimeout >= 0)
+ return sessionTimeout * 10000;
+ else
+ return -1;
+ }
+ }
+
return QVariant();
}
-void QNetworkSessionPrivateImpl::setSessionProperty(const QString& /*key*/, const QVariant& /*value*/)
+void QNetworkSessionPrivateImpl::setSessionProperty(const QString &key, const QVariant &value)
{
+ if (key == QLatin1String("AutoCloseSessionTimeout")) {
+ if (engine && engine->requiresPolling() &&
+ !(engine->capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces)) {
+ int timeout = value.toInt();
+ if (timeout >= 0) {
+ connect(engine, SIGNAL(updateCompleted()),
+ this, SLOT(decrementTimeout()), Qt::UniqueConnection);
+ sessionTimeout = timeout / 10000; // convert to poll intervals
+ } else {
+ disconnect(engine, SIGNAL(updateCompleted()), this, SLOT(decrementTimeout()));
+ sessionTimeout = -1;
+ }
+ }
+ }
}
QString QNetworkSessionPrivateImpl::errorString() const
@@ -364,12 +385,14 @@ void QNetworkSessionPrivateImpl::networkConfigurationsChanged()
startTime = engine->startTime(activeConfig.identifier());
}
-void QNetworkSessionPrivateImpl::configurationChanged(const QNetworkConfiguration &config)
+void QNetworkSessionPrivateImpl::configurationChanged(QNetworkConfigurationPrivatePointer config)
{
- if (serviceConfig.isValid() && (config == serviceConfig || config == activeConfig))
+ if (serviceConfig.isValid() &&
+ (config->id == serviceConfig.identifier() || config->id == activeConfig.identifier())) {
updateStateFromServiceNetwork();
- else if (config == activeConfig)
+ } else if (config->id == activeConfig.identifier()) {
updateStateFromActiveConfig();
+ }
}
void QNetworkSessionPrivateImpl::forcedSessionClose(const QNetworkConfiguration &config)
@@ -406,4 +429,13 @@ void QNetworkSessionPrivateImpl::connectionError(const QString &id,
}
}
+void QNetworkSessionPrivateImpl::decrementTimeout()
+{
+ if (--sessionTimeout <= 0) {
+ disconnect(engine, SIGNAL(updateCompleted()), this, SLOT(decrementTimeout()));
+ sessionTimeout = -1;
+ close();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h
index 7349e77..c644174 100644
--- a/src/plugins/bearer/qnetworksession_impl.h
+++ b/src/plugins/bearer/qnetworksession_impl.h
@@ -69,7 +69,7 @@ class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate
Q_OBJECT
public:
QNetworkSessionPrivateImpl()
- : startTime(0)
+ : startTime(0), sessionTimeout(-1)
{
}
@@ -108,13 +108,12 @@ private:
private Q_SLOTS:
void networkConfigurationsChanged();
- void configurationChanged(const QNetworkConfiguration &config);
+ void configurationChanged(QNetworkConfigurationPrivatePointer config);
void forcedSessionClose(const QNetworkConfiguration &config);
void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error);
+ void decrementTimeout();
private:
- QNetworkConfigurationManager manager;
-
bool opened;
QBearerEngineImpl *engine;
@@ -122,6 +121,8 @@ private:
QNetworkSession::SessionError lastError;
quint64 startTime;
+
+ int sessionTimeout;
};
QT_END_NAMESPACE
diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp
index 5537cf7..3f2eec7 100644
--- a/src/plugins/codecs/cn/qgb18030codec.cpp
+++ b/src/plugins/codecs/cn/qgb18030codec.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
#define Is3rdByte(c) (InRange((c), 0x81, 0xFE))
#define Is4thByte(c) (InRange((c), 0x30, 0x39))
-#define QValidChar(u) ((u) ? QChar((ushort)(u)) : QChar(QChar::ReplacementCharacter))
+#define qValidChar(u) ((u) ? (u) : static_cast<ushort>(QChar::ReplacementCharacter))
/* User-defined areas: UDA 1: 0xAAA1 - 0xAFFE (564/0)
UDA 2: 0xF8A1 - 0xFEFE (658/0)
@@ -160,7 +160,7 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
{
uchar buf[4];
int nbuf = 0;
- QChar replacement = QChar::ReplacementCharacter;
+ ushort replacement = QChar::ReplacementCharacter;
if (state) {
if (state->flags & ConvertInvalidToNull)
replacement = QChar::Null;
@@ -173,6 +173,9 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
int invalid = 0;
QString result;
+ result.resize(len);
+ int unicodeLen = 0;
+ ushort *const resultData = reinterpret_cast<ushort*>(result.data());
//qDebug("QGb18030Decoder::toUnicode(const char* chars, int len = %d)", len);
for (int i = 0; i < len; i++) {
uchar ch = chars[i];
@@ -180,14 +183,16 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
case 0:
if (ch < 0x80) {
// ASCII
- result += QLatin1Char(ch);
+ resultData[unicodeLen] = ch;
+ ++unicodeLen;
} else if (Is1stByte(ch)) {
// GB18030?
buf[0] = ch;
nbuf = 1;
} else {
// Invalid
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
break;
@@ -198,9 +203,11 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
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;
@@ -209,7 +216,8 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
nbuf = 2;
} else {
// Error
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
nbuf = 0;
}
@@ -220,7 +228,8 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
buf[2] = ch;
nbuf = 3;
} else {
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
nbuf = 0;
}
@@ -232,19 +241,24 @@ QString QGb18030Codec::convertToUnicode(const char* chars, int len, ConverterSta
int clen = 4;
uint u = qt_Gb18030ToUnicode(buf, clen);
if (clen == 4) {
- result += QValidChar(u);
+ resultData[unicodeLen] = qValidChar(u);
+ ++unicodeLen;
} else {
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
} else {
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
nbuf = 0;
break;
}
}
+ result.resize(unicodeLen);
+
if (state) {
state->remainingChars = nbuf;
state->state_data[0] = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
@@ -342,7 +356,7 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
int clen = 2;
uint u = qt_Gb18030ToUnicode(buf, clen);
if (clen == 2) {
- result += QValidChar(u);
+ result += qValidChar(u);
} else {
result += replacement;
++invalid;
@@ -445,7 +459,7 @@ QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterStat
{
uchar buf[2];
int nbuf = 0;
- QChar replacement = QChar::ReplacementCharacter;
+ ushort replacement = QChar::ReplacementCharacter;
if (state) {
if (state->flags & ConvertInvalidToNull)
replacement = QChar::Null;
@@ -456,6 +470,9 @@ QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterStat
int invalid = 0;
QString result;
+ result.resize(len);
+ int unicodeLen = 0;
+ ushort *const resultData = reinterpret_cast<ushort*>(result.data());
//qDebug("QGb2312Decoder::toUnicode(const char* chars, int len = %d)", len);
for (int i=0; i<len; i++) {
uchar ch = chars[i];
@@ -463,14 +480,16 @@ QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterStat
case 0:
if (ch < 0x80) {
// ASCII
- result += QLatin1Char(ch);
+ resultData[unicodeLen] = ch;
+ ++unicodeLen;
} else if (IsByteInGb2312(ch)) {
// GB2312 1st byte?
buf[0] = ch;
nbuf = 1;
} else {
// Invalid
- result += replacement;
+ resultData[unicodeLen] = replacement;
+ ++unicodeLen;
++invalid;
}
break;
@@ -481,21 +500,25 @@ QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterStat
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/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 54f4a8a..e4a0135 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -216,12 +216,12 @@ static void initRasterFallbacksMasks(int *warningMask, int *disableMask)
int idx = warning.indexOf(name);
if (idx != -1) {
*warningMask |= operations[i].operation;
- warning.remove(warning.begin() + idx);
+ warning.erase(warning.begin() + idx);
}
idx = disable.indexOf(name);
if (idx != -1) {
*disableMask |= operations[i].operation;
- disable.remove(disable.begin() + idx);
+ disable.erase(disable.begin() + idx);
}
}
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index b5ac67d..4219f6f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -174,6 +174,8 @@ bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img)
bool QDirectFBPixmapData::fromFile(const QString &filename, const char *format,
Qt::ImageConversionFlags flags)
{
+ if (!QFile::exists(filename))
+ return false;
if (flags == Qt::AutoColor) {
if (filename.startsWith(QLatin1Char(':'))) { // resource
QFile file(filename);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index a8bdb65..51969fc 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -61,6 +61,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#endif
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
+ , flushPending(false)
{
#ifdef QT_NO_DIRECTFB_WM
mode = Offscreen;
@@ -80,6 +81,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#endif
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
+ , flushPending(false)
{
SurfaceFlags flags = 0;
if (!widget || widget->window()->windowOpacity() == 0xff)
@@ -299,28 +301,19 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
}
}
-static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
-{
- const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
- surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
- const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy };
- surface->Flip(surface, &region, DSFLIP_BLIT);
-}
-
bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
{
- if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty())
+ if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.rectCount() != 1)
return false;
- dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
- if (region.rectCount() == 1) {
- scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
+ if (flushPending) {
+ dfbSurface->Flip(dfbSurface, 0, DSFLIP_BLIT);
} else {
- const QVector<QRect> rects = region.rects();
- const int n = rects.size();
- for (int i=0; i<n; ++i) {
- scrollSurface(dfbSurface, rects.at(i), dx, dy);
- }
+ flushPending = true;
}
+ dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
+ const QRect r = region.boundingRect();
+ const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+ dfbSurface->Blit(dfbSurface, dfbSurface, &rect, r.x() + dx, r.y() + dy);
return true;
}
@@ -384,6 +377,7 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
timer.restart();
}
#endif
+ flushPending = false;
}
void QDirectFBWindowSurface::beginPaint(const QRegion &)
@@ -391,6 +385,7 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &)
if (!engine) {
engine = new QDirectFBPaintEngine(this);
}
+ flushPending = true;
}
void QDirectFBWindowSurface::endPaint(const QRegion &)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index a6138f6..4370a8f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -114,6 +114,7 @@ private:
DFBSurfaceFlipFlags flipFlags;
bool boundingRectFlip;
+ bool flushPending;
#ifdef QT_DIRECTFB_TIMING
int frames;
QTime timer;
diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
index e78fec1..f5ad70c 100644
--- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
+++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
@@ -2163,6 +2163,9 @@ bool QVNCScreen::connect(const QString &displaySpec)
if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) {
const int id = getDisplayId(dspec);
QScreen *s = qt_get_screen(id, dspec.toLatin1().constData());
+ if (s->pixelFormat() == QImage::Format_Indexed8
+ || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8)
+ qFatal("QVNCScreen: unsupported screen format");
setScreen(s);
} else { // create virtual screen
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 6eed824..abe3ffe 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -766,7 +766,11 @@ bool QJpegHandler::canRead(QIODevice *device)
return false;
}
- return device->peek(2) == "\xFF\xD8";
+ char buffer[2];
+ if (device->peek(buffer, 2) != 2)
+ return false;
+
+ return uchar(buffer[0]) == 0xff && uchar(buffer[1]) == 0xd8;
}
bool QJpegHandler::read(QImage *image)
@@ -793,15 +797,16 @@ bool QJpegHandler::supportsOption(ImageOption option) const
QVariant QJpegHandler::option(ImageOption option) const
{
- if (option == Quality) {
+ switch(option) {
+ case Quality:
return quality;
- } else if (option == ScaledSize) {
+ case ScaledSize:
return scaledSize;
- } else if (option == ScaledClipRect) {
+ case ScaledClipRect:
return scaledClipRect;
- } else if (option == ClipRect) {
+ case ClipRect:
return clipRect;
- } else if (option == Size) {
+ case Size:
if (canRead() && !device()->isSequential()) {
qint64 pos = device()->pos();
int width = 0;
@@ -810,7 +815,8 @@ QVariant QJpegHandler::option(ImageOption option) const
device()->seek(pos);
return QSize(width, height);
}
- } else if (option == ImageFormat) {
+ return QVariant();
+ case ImageFormat:
if (canRead() && !device()->isSequential()) {
qint64 pos = device()->pos();
QImage::Format format = QImage::Format_Invalid;
@@ -819,20 +825,29 @@ QVariant QJpegHandler::option(ImageOption option) const
return format;
}
return QImage::Format_Invalid;
+ default:
+ return QVariant();
}
- return QVariant();
}
void QJpegHandler::setOption(ImageOption option, const QVariant &value)
{
- if (option == Quality)
+ switch(option) {
+ case Quality:
quality = value.toInt();
- else if ( option == ScaledSize )
+ break;
+ case ScaledSize:
scaledSize = value.toSize();
- else if ( option == ScaledClipRect )
+ break;
+ case ScaledClipRect:
scaledClipRect = value.toRect();
- else if ( option == ClipRect )
+ break;
+ case ClipRect:
clipRect = value.toRect();
+ break;
+ default:
+ break;
+ }
}
QByteArray QJpegHandler::name() const
diff --git a/src/plugins/mediaservices/directshow/directshow.pro b/src/plugins/mediaservices/directshow/directshow.pro
index a3080d3..ea133f9 100644
--- a/src/plugins/mediaservices/directshow/directshow.pro
+++ b/src/plugins/mediaservices/directshow/directshow.pro
@@ -9,6 +9,6 @@ SOURCES += dsserviceplugin.cpp
include(mediaplayer/mediaplayer.pri)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mediaservices
-target.path = $$[QT_INSTALL_PLUGINS]/plugins/mediaservices
+target.path = $$[QT_INSTALL_PLUGINS]/mediaservices
INSTALLS += target
diff --git a/src/plugins/mediaservices/gstreamer/gstreamer.pro b/src/plugins/mediaservices/gstreamer/gstreamer.pro
index 22e3c16..d1bfe44 100644
--- a/src/plugins/mediaservices/gstreamer/gstreamer.pro
+++ b/src/plugins/mediaservices/gstreamer/gstreamer.pro
@@ -46,5 +46,5 @@ SOURCES += \
include(mediaplayer/mediaplayer.pri)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mediaservices
-target.path = $$[QT_INSTALL_PLUGINS]/plugins/mediaservices
+target.path = $$[QT_INSTALL_PLUGINS]/mediaservices
INSTALLS += target
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
index 392a7a8..56cdb04 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
@@ -51,6 +51,9 @@
//#define USE_PLAYBIN2
+//#define DEBUG_VO_BIN_DUMP
+//#define DEBUG_PLAYBIN_STATES
+
QT_BEGIN_NAMESPACE
@@ -59,7 +62,9 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
m_state(QMediaPlayer::StoppedState),
m_busHelper(0),
m_playbin(0),
- m_nullVideoOutput(0),
+ m_videoSink(0),
+ m_pendingVideoSink(0),
+ m_nullVideoSink(0),
m_bus(0),
m_renderer(0),
m_volume(100),
@@ -83,6 +88,25 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
m_playbin = gst_element_factory_make("playbin", NULL);
#endif
+ m_videoOutputBin = gst_bin_new("video-output-bin");
+ gst_object_ref(GST_OBJECT(m_videoOutputBin));
+
+ m_videoIdentity = gst_element_factory_make("identity", "identity-vo");
+ m_colorSpace = gst_element_factory_make("ffmpegcolorspace", "ffmpegcolorspace-vo");
+ m_videoScale = gst_element_factory_make("videoscale","videoscale-vo");
+ m_nullVideoSink = gst_element_factory_make("fakesink", NULL);
+ gst_object_ref(GST_OBJECT(m_nullVideoSink));
+ gst_bin_add_many(GST_BIN(m_videoOutputBin), m_videoIdentity, m_colorSpace, m_videoScale, m_nullVideoSink, NULL);
+ gst_element_link_many(m_videoIdentity, m_colorSpace, m_videoScale, m_nullVideoSink, NULL);
+
+ m_videoSink = m_nullVideoSink;
+
+ // add ghostpads
+ GstPad *pad = gst_element_get_static_pad(m_videoIdentity,"sink");
+ gst_element_add_pad(GST_ELEMENT(m_videoOutputBin), gst_ghost_pad_new("videosink", pad));
+ gst_object_unref(GST_OBJECT(pad));
+
+
if (m_playbin != 0) {
// Sort out messages
m_bus = gst_element_get_bus(m_playbin);
@@ -90,9 +114,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
connect(m_busHelper, SIGNAL(message(QGstreamerMessage)), SLOT(busMessage(QGstreamerMessage)));
m_busHelper->installSyncEventFilter(this);
- m_nullVideoOutput = gst_element_factory_make("fakesink", NULL);
- gst_object_ref(GST_OBJECT(m_nullVideoOutput));
- g_object_set(G_OBJECT(m_playbin), "video-sink", m_nullVideoOutput, NULL);
+ g_object_set(G_OBJECT(m_playbin), "video-sink", m_videoOutputBin, NULL);
// Initial volume
double volume = 1.0;
@@ -109,7 +131,8 @@ QGstreamerPlayerSession::~QGstreamerPlayerSession()
delete m_busHelper;
gst_object_unref(GST_OBJECT(m_bus));
gst_object_unref(GST_OBJECT(m_playbin));
- gst_object_unref(GST_OBJECT(m_nullVideoOutput));
+ gst_object_unref(GST_OBJECT(m_nullVideoSink));
+ gst_object_unref(GST_OBJECT(m_videoOutputBin));
}
}
@@ -242,13 +265,141 @@ bool QGstreamerPlayerSession::isAudioAvailable() const
return m_audioAvailable;
}
+static void block_pad_cb(GstPad *pad, gboolean blocked, gpointer user_data)
+{
+ Q_UNUSED(pad);
+ //qDebug() << "block_pad_cb" << blocked;
+
+ if (blocked && user_data) {
+ QGstreamerPlayerSession *session = reinterpret_cast<QGstreamerPlayerSession*>(user_data);
+ QMetaObject::invokeMethod(session, "finishVideoOutputChange", Qt::QueuedConnection);
+ }
+}
+
+#ifdef DEBUG_VO_BIN_DUMP
+ static int dumpNum = 0;
+#endif
+
void QGstreamerPlayerSession::setVideoRenderer(QObject *videoOutput)
{
- m_renderer = qobject_cast<QGstreamerVideoRendererInterface*>(videoOutput);
- if (m_renderer)
- g_object_set(G_OBJECT(m_playbin), "video-sink", m_renderer->videoSink(), NULL);
- else
- g_object_set(G_OBJECT(m_playbin), "video-sink", m_nullVideoOutput, NULL);
+ QGstreamerVideoRendererInterface* renderer = qobject_cast<QGstreamerVideoRendererInterface*>(videoOutput);
+
+ if (m_renderer == renderer)
+ return;
+
+#ifdef DEBUG_VO_BIN_DUMP
+ dumpNum++;
+
+ _gst_debug_bin_to_dot_file(GST_BIN(m_videoOutputBin),
+ GstDebugGraphDetails(GST_DEBUG_GRAPH_SHOW_ALL /* GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS | GST_DEBUG_GRAPH_SHOW_STATES*/),
+ QString("video_output_change_%1_set").arg(dumpNum).toAscii().constData());
+#endif
+
+ m_renderer = renderer;
+
+ GstElement *videoSink = m_renderer ? m_renderer->videoSink() : m_nullVideoSink;
+
+ if (m_state == QMediaPlayer::StoppedState) {
+ m_pendingVideoSink = 0;
+ gst_element_unlink(m_videoScale, m_videoSink);
+
+ gst_bin_remove(GST_BIN(m_videoOutputBin), m_videoSink);
+
+ m_videoSink = videoSink;
+
+ gst_bin_add(GST_BIN(m_videoOutputBin), m_videoSink);
+ gst_element_link(m_videoScale, m_videoSink);
+
+ } else {
+ if (m_pendingVideoSink) {
+ m_pendingVideoSink = videoSink;
+ return;
+ }
+
+ m_pendingVideoSink = videoSink;
+
+ //block pads, async to avoid locking in paused state
+ GstPad *srcPad = gst_element_get_static_pad(m_videoIdentity, "src");
+ gst_pad_set_blocked_async(srcPad, true, &block_pad_cb, this);
+ gst_object_unref(GST_OBJECT(srcPad));
+ }
+}
+
+void QGstreamerPlayerSession::finishVideoOutputChange()
+{
+ if (!m_pendingVideoSink)
+ return;
+
+ GstPad *srcPad = gst_element_get_static_pad(m_videoIdentity, "src");
+
+ if (!gst_pad_is_blocked(srcPad)) {
+ //pad is not blocked, it's possible to swap outputs only in the null state
+ GstState identityElementState = GST_STATE_NULL;
+ gst_element_get_state(m_videoIdentity, &identityElementState, NULL, GST_CLOCK_TIME_NONE);
+ if (identityElementState != GST_STATE_NULL) {
+ gst_object_unref(GST_OBJECT(srcPad));
+ return; //can't change vo yet, received async call from the previous change
+ }
+
+ }
+
+ if (m_pendingVideoSink == m_videoSink) {
+ //video output was change back to the current one,
+ //no need to torment the pipeline, just unblock the pad
+ if (gst_pad_is_blocked(srcPad))
+ gst_pad_set_blocked_async(srcPad, false, &block_pad_cb, 0);
+
+ m_pendingVideoSink = 0;
+ gst_object_unref(GST_OBJECT(srcPad));
+ return;
+ }
+
+ gst_element_set_state(m_colorSpace, GST_STATE_NULL);
+ gst_element_set_state(m_videoScale, GST_STATE_NULL);
+ gst_element_set_state(m_videoSink, GST_STATE_NULL);
+
+ gst_element_unlink(m_videoScale, m_videoSink);
+
+ gst_bin_remove(GST_BIN(m_videoOutputBin), m_videoSink);
+
+ m_videoSink = m_pendingVideoSink;
+ m_pendingVideoSink = 0;
+
+ gst_bin_add(GST_BIN(m_videoOutputBin), m_videoSink);
+ if (!gst_element_link(m_videoScale, m_videoSink))
+ qWarning() << "Linking video output element failed";
+
+ GstState state;
+
+ switch (m_state) {
+ case QMediaPlayer::StoppedState:
+ state = GST_STATE_NULL;
+ break;
+ case QMediaPlayer::PausedState:
+ state = GST_STATE_PAUSED;
+ break;
+ case QMediaPlayer::PlayingState:
+ state = GST_STATE_PLAYING;
+ break;
+ }
+
+ gst_element_set_state(m_colorSpace, state);
+ gst_element_set_state(m_videoScale, state);
+ gst_element_set_state(m_videoSink, state);
+
+ //don't have to wait here, it will unblock eventually
+ if (gst_pad_is_blocked(srcPad))
+ gst_pad_set_blocked_async(srcPad, false, &block_pad_cb, 0);
+ gst_object_unref(GST_OBJECT(srcPad));
+
+#ifdef DEBUG_VO_BIN_DUMP
+ dumpNum++;
+
+ _gst_debug_bin_to_dot_file(GST_BIN(m_videoOutputBin),
+ GstDebugGraphDetails(/*GST_DEBUG_GRAPH_SHOW_ALL */ GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS | GST_DEBUG_GRAPH_SHOW_STATES),
+ QString("video_output_change_%1_finish").arg(dumpNum).toAscii().constData());
+#endif
+
}
bool QGstreamerPlayerSession::isVideoAvailable() const
@@ -298,16 +449,22 @@ void QGstreamerPlayerSession::stop()
if (m_playbin) {
gst_element_set_state(m_playbin, GST_STATE_NULL);
+ QMediaPlayer::State oldState = QMediaPlayer::StoppedState;
+ m_state = QMediaPlayer::StoppedState;
+
+ finishVideoOutputChange();
+
//we have to do it here, since gstreamer will not emit bus messages any more
- if (m_state != QMediaPlayer::StoppedState)
- emit stateChanged(m_state = QMediaPlayer::StoppedState);
+ if (oldState != m_state)
+ emit stateChanged(m_state);
}
}
bool QGstreamerPlayerSession::seek(qint64 ms)
{
- if (m_playbin && m_state != QMediaPlayer::StoppedState) {
- gint64 position = (gint64)ms * 1000000;
+ //seek locks when the video output sink is changing and pad is blocked
+ if (m_playbin && !m_pendingVideoSink && m_state != QMediaPlayer::StoppedState) {
+ gint64 position = qMax(ms,qint64(0)) * 1000000;
return gst_element_seek_simple(m_playbin, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, position);
}
@@ -466,13 +623,15 @@ void QGstreamerPlayerSession::busMessage(const QGstreamerMessage &message)
gst_message_parse_state_changed(gm, &oldState, &newState, &pending);
- /*QStringList states;
+#ifdef DEBUG_PLAYBIN_STATES
+ QStringList states;
states << "GST_STATE_VOID_PENDING" << "GST_STATE_NULL" << "GST_STATE_READY" << "GST_STATE_PAUSED" << "GST_STATE_PLAYING";
qDebug() << QString("state changed: old: %1 new: %2 pending: %3") \
.arg(states[oldState]) \
.arg(states[newState]) \
- .arg(states[pending]);*/
+ .arg(states[pending]);
+#endif
switch (newState) {
case GST_STATE_VOID_PENDING:
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
index edfec5b..867a0e0 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h
@@ -99,7 +99,7 @@ public:
// int activeStream(QMediaStreamsControl::StreamType streamType) const;
// void setActiveStream(QMediaStreamsControl::StreamType streamType, int streamNumber);
- bool processSyncMessage(const QGstreamerMessage &message);
+ bool processSyncMessage(const QGstreamerMessage &message);
public slots:
void load(const QUrl &url);
@@ -133,13 +133,22 @@ private slots:
void busMessage(const QGstreamerMessage &message);
void getStreamsInfo();
void setSeekable(bool);
+ void finishVideoOutputChange();
private:
QUrl m_url;
QMediaPlayer::State m_state;
QGstreamerBusHelper* m_busHelper;
GstElement* m_playbin;
- GstElement* m_nullVideoOutput;
+
+ GstElement* m_videoOutputBin;
+ GstElement* m_videoIdentity;
+ GstElement* m_colorSpace;
+ GstElement* m_videoScale;
+ GstElement* m_videoSink;
+ GstElement* m_pendingVideoSink;
+ GstElement* m_nullVideoSink;
+
GstBus* m_bus;
QGstreamerVideoRendererInterface *m_renderer;
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
index 47fb451..8307aa5 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
@@ -99,9 +99,26 @@ protected:
QGstreamerVideoWidgetControl::QGstreamerVideoWidgetControl(QObject *parent)
: QVideoWidgetControl(parent)
, m_videoSink(0)
- , m_widget(new QGstreamerVideoWidget)
+ , m_widget(0)
, m_fullScreen(false)
+{
+}
+
+QGstreamerVideoWidgetControl::~QGstreamerVideoWidgetControl()
+{
+ if (m_videoSink)
+ gst_object_unref(GST_OBJECT(m_videoSink));
+
+ delete m_widget;
+}
+
+void QGstreamerVideoWidgetControl::createVideoWidget()
{
+ if (m_widget)
+ return;
+
+ m_widget = new QGstreamerVideoWidget;
+
m_widget->installEventFilter(this);
m_windowId = m_widget->winId();
@@ -125,22 +142,15 @@ QGstreamerVideoWidgetControl::QGstreamerVideoWidgetControl(QObject *parent)
gst_object_sink (GST_OBJECT (m_videoSink));
}
-QGstreamerVideoWidgetControl::~QGstreamerVideoWidgetControl()
-{
- if (m_videoSink)
- gst_object_unref(GST_OBJECT(m_videoSink));
-
- delete m_widget;
-}
-
GstElement *QGstreamerVideoWidgetControl::videoSink()
{
+ createVideoWidget();
return m_videoSink;
}
bool QGstreamerVideoWidgetControl::eventFilter(QObject *object, QEvent *e)
{
- if (object == m_widget) {
+ if (m_widget && object == m_widget) {
if (e->type() == QEvent::ParentChange || e->type() == QEvent::Show) {
WId newWId = m_widget->winId();
if (newWId != m_windowId) {
@@ -205,7 +215,8 @@ void QGstreamerVideoWidgetControl::updateNativeVideoSize()
gst_caps_unref(caps);
}
} else {
- m_widget->setNativeSize(QSize());
+ if (m_widget)
+ m_widget->setNativeSize(QSize());
}
}
@@ -218,6 +229,7 @@ void QGstreamerVideoWidgetControl::windowExposed()
QWidget *QGstreamerVideoWidgetControl::videoWidget()
{
+ createVideoWidget();
return m_widget;
}
@@ -252,7 +264,7 @@ int QGstreamerVideoWidgetControl::brightness() const
{
int brightness = 0;
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "brightness"))
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "brightness"))
g_object_get(G_OBJECT(m_videoSink), "brightness", &brightness, NULL);
return brightness / 10;
@@ -260,7 +272,7 @@ int QGstreamerVideoWidgetControl::brightness() const
void QGstreamerVideoWidgetControl::setBrightness(int brightness)
{
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "brightness")) {
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "brightness")) {
g_object_set(G_OBJECT(m_videoSink), "brightness", brightness * 10, NULL);
emit brightnessChanged(brightness);
@@ -271,15 +283,15 @@ int QGstreamerVideoWidgetControl::contrast() const
{
int contrast = 0;
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "contrast"))
- g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, NULL);
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "contrast"))
+ g_object_get(G_OBJECT(m_videoSink), "contrast", &contrast, NULL);
return contrast / 10;
}
void QGstreamerVideoWidgetControl::setContrast(int contrast)
{
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "contrast")) {
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "contrast")) {
g_object_set(G_OBJECT(m_videoSink), "contrast", contrast * 10, NULL);
emit contrastChanged(contrast);
@@ -290,7 +302,7 @@ int QGstreamerVideoWidgetControl::hue() const
{
int hue = 0;
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "hue"))
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "hue"))
g_object_get(G_OBJECT(m_videoSink), "hue", &hue, NULL);
return hue / 10;
@@ -298,7 +310,7 @@ int QGstreamerVideoWidgetControl::hue() const
void QGstreamerVideoWidgetControl::setHue(int hue)
{
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "hue")) {
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "hue")) {
g_object_set(G_OBJECT(m_videoSink), "hue", hue * 10, NULL);
emit hueChanged(hue);
@@ -309,7 +321,7 @@ int QGstreamerVideoWidgetControl::saturation() const
{
int saturation = 0;
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "saturation"))
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "saturation"))
g_object_get(G_OBJECT(m_videoSink), "saturation", &saturation, NULL);
return saturation / 10;
@@ -317,7 +329,7 @@ int QGstreamerVideoWidgetControl::saturation() const
void QGstreamerVideoWidgetControl::setSaturation(int saturation)
{
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "saturation")) {
+ if (m_videoSink && g_object_class_find_property(G_OBJECT_GET_CLASS(m_videoSink), "saturation")) {
g_object_set(G_OBJECT(m_videoSink), "saturation", saturation * 10, NULL);
emit saturationChanged(saturation);
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h
index 7b966b7..6a4c0f3 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h
@@ -93,6 +93,7 @@ public slots:
void updateNativeVideoSize();
private:
+ void createVideoWidget();
void windowExposed();
GstElement *m_videoSink;
diff --git a/src/plugins/mediaservices/qt7/qt7.pro b/src/plugins/mediaservices/qt7/qt7.pro
index 13d14d7..6624d13 100644
--- a/src/plugins/mediaservices/qt7/qt7.pro
+++ b/src/plugins/mediaservices/qt7/qt7.pro
@@ -40,6 +40,6 @@ OBJECTIVE_SOURCES += \
include(mediaplayer/mediaplayer.pri)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mediaservices
-target.path = $$[QT_INSTALL_PLUGINS]/plugins/mediaservices
+target.path = $$[QT_INSTALL_PLUGINS]/mediaservices
INSTALLS += target
diff --git a/src/plugins/s60/3_2/3_2.pro b/src/plugins/s60/3_2/3_2.pro
index 4b28eb9..468197d 100644
--- a/src/plugins/s60/3_2/3_2.pro
+++ b/src/plugins/s60/3_2/3_2.pro
@@ -10,7 +10,7 @@ contains(S60_VERSION, 3.1) {
SOURCES += ../src/qlocale_3_2.cpp \
../src/qdesktopservices_3_2.cpp \
../src/qcoreapplication_3_2.cpp
- LIBS += -ldirectorylocalizer -lefsrv
+ LIBS += -lDirectoryLocalizer -lefsrv
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
}
diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro
index 4cdce12..86e3dc9 100644
--- a/src/plugins/s60/5_0/5_0.pro
+++ b/src/plugins/s60/5_0/5_0.pro
@@ -10,7 +10,7 @@ contains(S60_VERSION, 3.1) {
SOURCES += ../src/qlocale_3_2.cpp \
../src/qdesktopservices_3_2.cpp \
../src/qcoreapplication_3_2.cpp
- LIBS += -ldirectorylocalizer -lefsrv
+ LIBS += -lDirectoryLocalizer -lefsrv
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
}
diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
index a2f30f2..b4ca9a3 100644
--- a/src/plugins/s60/src/qdesktopservices_3_2.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp
@@ -45,7 +45,7 @@
#ifdef Q_WS_S60
#include <e32base.h> // CBase -> Required by cdirectorylocalizer.h
-#include <cdirectorylocalizer.h> // CDirectoryLocalizer
+#include <CDirectoryLocalizer.h> // CDirectoryLocalizer
EXPORT_C QString localizedDirectoryName(QString& rawPath)
{
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index c609a9e..fb31233 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -14,4 +14,6 @@ SOURCES = smain.cpp \
QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
}
+wince*: DEFINES += HAVE_LOCALTIME_S=0
+
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip
index 923cca4..df78644 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip
+++ b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip
Binary files differ
diff --git a/src/qt3support/itemviews/q3listview.cpp b/src/qt3support/itemviews/q3listview.cpp
index 12dad84..4900827 100644
--- a/src/qt3support/itemviews/q3listview.cpp
+++ b/src/qt3support/itemviews/q3listview.cpp
@@ -1324,8 +1324,15 @@ void Q3ListViewItem::sortChildItems(int column, bool ascending)
const int nColumns = (listView() ? listView()->columns() : 0);
// and don't sort if we already have the right sorting order
- if (column > nColumns || childItem == 0 || childItem->siblingItem == 0)
+ if (column > nColumns || childItem == 0)
return;
+
+ // If there is just one child, just sort its children
+ if (childItem->siblingItem == 0) {
+ if (childItem->isOpen())
+ childItem->sortChildItems(column, ascending);
+ return;
+ }
// make an array for qHeapSort()
Q3ListViewPrivate::SortableItem * siblings
diff --git a/src/qt3support/other/q3process_win.cpp b/src/qt3support/other/q3process_win.cpp
index da39bdc..9b69520 100644
--- a/src/qt3support/other/q3process_win.cpp
+++ b/src/qt3support/other/q3process_win.cpp
@@ -384,7 +384,7 @@ bool Q3Process::start( QStringList *env )
return true;
}
-static BOOL CALLBACK qt_terminateApp( HWND hwnd, LPARAM procId )
+static BOOL QT_WIN_CALLBACK qt_terminateApp( HWND hwnd, LPARAM procId )
{
DWORD procId_win;
GetWindowThreadProcessId( hwnd, &procId_win );
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 05d7ae1..ba8d183 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -3437,4 +3437,63 @@ EXPORTS
?staticMetaObject@QDeclarativeDrag@@2UQMetaObject@@B @ 3436 NONAME ; struct QMetaObject const QDeclarativeDrag::staticMetaObject
?staticMetaObject@QDeclarativeDebugClient@@2UQMetaObject@@B @ 3437 NONAME ; struct QMetaObject const QDeclarativeDebugClient::staticMetaObject
?staticMetaObject@QDeclarativeComponent@@2UQMetaObject@@B @ 3438 NONAME ; struct QMetaObject const QDeclarativeComponent::staticMetaObject
+ ??0QDeclarativeAbstractBinding@@QAE@XZ @ 3439 NONAME ; QDeclarativeAbstractBinding::QDeclarativeAbstractBinding(void)
+ ??0QDeclarativeBinding@@QAE@ABVQString@@PAVQObject@@PAVQDeclarativeContext@@1@Z @ 3440 NONAME ; QDeclarativeBinding::QDeclarativeBinding(class QString const &, class QObject *, class QDeclarativeContext *, class QObject *)
+ ??0QDeclarativeBinding@@QAE@PAXPAVQDeclarativeRefCount@@PAVQObject@@PAVQDeclarativeContext@@ABVQString@@H2@Z @ 3441 NONAME ; QDeclarativeBinding::QDeclarativeBinding(void *, class QDeclarativeRefCount *, class QObject *, class QDeclarativeContext *, class QString const &, int, class QObject *)
+ ??0QDeclarativePropertyPrivate@@QAE@ABV0@@Z @ 3442 NONAME ; QDeclarativePropertyPrivate::QDeclarativePropertyPrivate(class QDeclarativePropertyPrivate const &)
+ ??0QDeclarativePropertyPrivate@@QAE@XZ @ 3443 NONAME ; QDeclarativePropertyPrivate::QDeclarativePropertyPrivate(void)
+ ??1QDeclarativeAbstractBinding@@UAE@XZ @ 3444 NONAME ; QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding(void)
+ ??1QDeclarativeBinding@@UAE@XZ @ 3445 NONAME ; QDeclarativeBinding::~QDeclarativeBinding(void)
+ ??1QDeclarativePropertyPrivate@@QAE@XZ @ 3446 NONAME ; QDeclarativePropertyPrivate::~QDeclarativePropertyPrivate(void)
+ ??_EQDeclarativeAbstractBinding@@UAE@I@Z @ 3447 NONAME ; QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding(unsigned int)
+ ??_EQDeclarativeBinding@@UAE@I@Z @ 3448 NONAME ; QDeclarativeBinding::~QDeclarativeBinding(unsigned int)
+ ?addToObject@QDeclarativeAbstractBinding@@QAEXPAVQObject@@@Z @ 3449 NONAME ; void QDeclarativeAbstractBinding::addToObject(class QObject *)
+ ?binding@QDeclarativePropertyPrivate@@SAPAVQDeclarativeAbstractBinding@@ABVQDeclarativeProperty@@@Z @ 3450 NONAME ; class QDeclarativeAbstractBinding * QDeclarativePropertyPrivate::binding(class QDeclarativeProperty const &)
+ ?canConvert@QDeclarativePropertyPrivate@@SA_NPBUQMetaObject@@0@Z @ 3451 NONAME ; bool QDeclarativePropertyPrivate::canConvert(struct QMetaObject const *, struct QMetaObject const *)
+ ?clear@QDeclarativeAbstractBinding@@IAEXXZ @ 3452 NONAME ; void QDeclarativeAbstractBinding::clear(void)
+ ?d_func@QDeclarativeBinding@@AAEPAVQDeclarativeBindingPrivate@@XZ @ 3453 NONAME ; class QDeclarativeBindingPrivate * QDeclarativeBinding::d_func(void)
+ ?d_func@QDeclarativeBinding@@ABEPBVQDeclarativeBindingPrivate@@XZ @ 3454 NONAME ; class QDeclarativeBindingPrivate const * QDeclarativeBinding::d_func(void) const
+ ?destroy@QDeclarativeAbstractBinding@@UAEXXZ @ 3455 NONAME ; void QDeclarativeAbstractBinding::destroy(void)
+ ?enabled@QDeclarativeBinding@@QBE_NXZ @ 3456 NONAME ; bool QDeclarativeBinding::enabled(void) const
+ ?equal@QDeclarativePropertyPrivate@@SA_NPBUQMetaObject@@0@Z @ 3457 NONAME ; bool QDeclarativePropertyPrivate::equal(struct QMetaObject const *, struct QMetaObject const *)
+ ?expression@QDeclarativeAbstractBinding@@UBE?AVQString@@XZ @ 3458 NONAME ; class QString QDeclarativeAbstractBinding::expression(void) const
+ ?expression@QDeclarativeBinding@@UBE?AVQString@@XZ @ 3459 NONAME ; class QString QDeclarativeBinding::expression(void) const
+ ?getStaticMetaObject@QDeclarativeBinding@@SAABUQMetaObject@@XZ @ 3460 NONAME ; struct QMetaObject const & QDeclarativeBinding::getStaticMetaObject(void)
+ ?initDefault@QDeclarativePropertyPrivate@@QAEXPAVQObject@@@Z @ 3461 NONAME ; void QDeclarativePropertyPrivate::initDefault(class QObject *)
+ ?initProperty@QDeclarativePropertyPrivate@@QAEXPAVQObject@@ABVQString@@@Z @ 3462 NONAME ; void QDeclarativePropertyPrivate::initProperty(class QObject *, class QString const &)
+ ?isValueType@QDeclarativePropertyPrivate@@QBE_NXZ @ 3463 NONAME ; bool QDeclarativePropertyPrivate::isValueType(void) const
+ ?metaObject@QDeclarativeBinding@@UBEPBUQMetaObject@@XZ @ 3464 NONAME ; struct QMetaObject const * QDeclarativeBinding::metaObject(void) const
+ ?property@QDeclarativeBinding@@QBE?AVQDeclarativeProperty@@XZ @ 3465 NONAME ; class QDeclarativeProperty QDeclarativeBinding::property(void) const
+ ?propertyIndex@QDeclarativeBinding@@UAEHXZ @ 3466 NONAME ; int QDeclarativeBinding::propertyIndex(void)
+ ?propertyType@QDeclarativePropertyPrivate@@QBEHXZ @ 3467 NONAME ; int QDeclarativePropertyPrivate::propertyType(void) const
+ ?propertyTypeCategory@QDeclarativePropertyPrivate@@QBE?AW4PropertyTypeCategory@QDeclarativeProperty@@XZ @ 3468 NONAME ; enum QDeclarativeProperty::PropertyTypeCategory QDeclarativePropertyPrivate::propertyTypeCategory(void) const
+ ?qt_metacall@QDeclarativeBinding@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3469 NONAME ; int QDeclarativeBinding::qt_metacall(enum QMetaObject::Call, int, void * *)
+ ?qt_metacast@QDeclarativeBinding@@UAEPAXPBD@Z @ 3470 NONAME ; void * QDeclarativeBinding::qt_metacast(char const *)
+ ?rawMetaObjectForType@QDeclarativePropertyPrivate@@SAPBUQMetaObject@@PAVQDeclarativeEnginePrivate@@H@Z @ 3471 NONAME ; struct QMetaObject const * QDeclarativePropertyPrivate::rawMetaObjectForType(class QDeclarativeEnginePrivate *, int)
+ ?readValueProperty@QDeclarativePropertyPrivate@@QAE?AVQVariant@@XZ @ 3472 NONAME ; class QVariant QDeclarativePropertyPrivate::readValueProperty(void)
+ ?removeFromObject@QDeclarativeAbstractBinding@@QAEXXZ @ 3473 NONAME ; void QDeclarativeAbstractBinding::removeFromObject(void)
+ ?restore@QDeclarativePropertyPrivate@@SA?AVQDeclarativeProperty@@ABVQByteArray@@PAVQObject@@PAVQDeclarativeContext@@@Z @ 3474 NONAME ; class QDeclarativeProperty QDeclarativePropertyPrivate::restore(class QByteArray const &, class QObject *, class QDeclarativeContext *)
+ ?saveProperty@QDeclarativePropertyPrivate@@SA?AVQByteArray@@PBUQMetaObject@@H@Z @ 3475 NONAME ; class QByteArray QDeclarativePropertyPrivate::saveProperty(struct QMetaObject const *, int)
+ ?saveValueType@QDeclarativePropertyPrivate@@SA?AVQByteArray@@PBUQMetaObject@@H0H@Z @ 3476 NONAME ; class QByteArray QDeclarativePropertyPrivate::saveValueType(struct QMetaObject const *, int, struct QMetaObject const *, int)
+ ?setBinding@QDeclarativePropertyPrivate@@SAPAVQDeclarativeAbstractBinding@@ABVQDeclarativeProperty@@PAV2@V?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3477 NONAME ; class QDeclarativeAbstractBinding * QDeclarativePropertyPrivate::setBinding(class QDeclarativeProperty const &, class QDeclarativeAbstractBinding *, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?setBinding@QDeclarativePropertyPrivate@@SAPAVQDeclarativeAbstractBinding@@PAVQObject@@ABUData@QDeclarativePropertyCache@@PAV2@V?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3478 NONAME ; class QDeclarativeAbstractBinding * QDeclarativePropertyPrivate::setBinding(class QObject *, struct QDeclarativePropertyCache::Data const &, class QDeclarativeAbstractBinding *, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?setEnabled@QDeclarativeAbstractBinding@@QAEX_N@Z @ 3479 NONAME ; void QDeclarativeAbstractBinding::setEnabled(bool)
+ ?setEnabled@QDeclarativeAbstractBinding@@UAEX_NV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3480 NONAME ; void QDeclarativeAbstractBinding::setEnabled(bool, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?setEnabled@QDeclarativeBinding@@UAEX_NV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3481 NONAME ; void QDeclarativeBinding::setEnabled(bool, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?setSignalExpression@QDeclarativePropertyPrivate@@SAPAVQDeclarativeExpression@@ABVQDeclarativeProperty@@PAV2@@Z @ 3482 NONAME ; class QDeclarativeExpression * QDeclarativePropertyPrivate::setSignalExpression(class QDeclarativeProperty const &, class QDeclarativeExpression *)
+ ?setTarget@QDeclarativeBinding@@QAEXABVQDeclarativeProperty@@@Z @ 3483 NONAME ; void QDeclarativeBinding::setTarget(class QDeclarativeProperty const &)
+ ?signalExpression@QDeclarativePropertyPrivate@@SAPAVQDeclarativeExpression@@ABVQDeclarativeProperty@@@Z @ 3484 NONAME ; class QDeclarativeExpression * QDeclarativePropertyPrivate::signalExpression(class QDeclarativeProperty const &)
+ ?tr@QDeclarativeBinding@@SA?AVQString@@PBD0@Z @ 3485 NONAME ; class QString QDeclarativeBinding::tr(char const *, char const *)
+ ?tr@QDeclarativeBinding@@SA?AVQString@@PBD0H@Z @ 3486 NONAME ; class QString QDeclarativeBinding::tr(char const *, char const *, int)
+ ?trUtf8@QDeclarativeBinding@@SA?AVQString@@PBD0@Z @ 3487 NONAME ; class QString QDeclarativeBinding::trUtf8(char const *, char const *)
+ ?trUtf8@QDeclarativeBinding@@SA?AVQString@@PBD0H@Z @ 3488 NONAME ; class QString QDeclarativeBinding::trUtf8(char const *, char const *, int)
+ ?update@QDeclarativeAbstractBinding@@QAEXXZ @ 3489 NONAME ; void QDeclarativeAbstractBinding::update(void)
+ ?update@QDeclarativeBinding@@QAEXXZ @ 3490 NONAME ; void QDeclarativeBinding::update(void)
+ ?update@QDeclarativeBinding@@UAEXV?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3491 NONAME ; void QDeclarativeBinding::update(class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?valueTypeCoreIndex@QDeclarativePropertyPrivate@@SAHABVQDeclarativeProperty@@@Z @ 3492 NONAME ; int QDeclarativePropertyPrivate::valueTypeCoreIndex(class QDeclarativeProperty const &)
+ ?write@QDeclarativePropertyPrivate@@SA_NABVQDeclarativeProperty@@ABVQVariant@@V?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3493 NONAME ; bool QDeclarativePropertyPrivate::write(class QDeclarativeProperty const &, class QVariant const &, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?write@QDeclarativePropertyPrivate@@SA_NPAVQObject@@ABUData@QDeclarativePropertyCache@@ABVQVariant@@PAVQDeclarativeContext@@V?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3494 NONAME ; bool QDeclarativePropertyPrivate::write(class QObject *, struct QDeclarativePropertyCache::Data const &, class QVariant const &, class QDeclarativeContext *, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?writeEnumProperty@QDeclarativePropertyPrivate@@SA_NABVQMetaProperty@@HPAVQObject@@ABVQVariant@@H@Z @ 3495 NONAME ; bool QDeclarativePropertyPrivate::writeEnumProperty(class QMetaProperty const &, int, class QObject *, class QVariant const &, int)
+ ?writeValueProperty@QDeclarativePropertyPrivate@@QAE_NABVQVariant@@V?$QFlags@W4WriteFlag@QDeclarativePropertyPrivate@@@@@Z @ 3496 NONAME ; bool QDeclarativePropertyPrivate::writeValueProperty(class QVariant const &, class QFlags<enum QDeclarativePropertyPrivate::WriteFlag>)
+ ?staticMetaObject@QDeclarativeBinding@@2UQMetaObject@@B @ 3497 NONAME ; struct QMetaObject const QDeclarativeBinding::staticMetaObject
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 9379163..2feaffd 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -8995,7 +8995,7 @@ EXPORTS
?setFocus@QTextControl@@QAEX_NW4FocusReason@Qt@@@Z @ 8994 NONAME ; void QTextControl::setFocus(bool, enum Qt::FocusReason)
?setFocus@QWidget@@QAEXW4FocusReason@Qt@@@Z @ 8995 NONAME ; void QWidget::setFocus(enum Qt::FocusReason)
?setFocus@QWidget@@QAEXXZ @ 8996 NONAME ; void QWidget::setFocus(void)
- ?setFocusHelper@QGraphicsItemPrivate@@QAEXW4FocusReason@Qt@@_N@Z @ 8997 NONAME ; void QGraphicsItemPrivate::setFocusHelper(enum Qt::FocusReason, bool)
+ ?setFocusHelper@QGraphicsItemPrivate@@QAEXW4FocusReason@Qt@@_N@Z @ 8997 NONAME ABSENT ; void QGraphicsItemPrivate::setFocusHelper(enum Qt::FocusReason, bool)
?setFocusItem@QGraphicsScene@@QAEXPAVQGraphicsItem@@W4FocusReason@Qt@@@Z @ 8998 NONAME ; void QGraphicsScene::setFocusItem(class QGraphicsItem *, enum Qt::FocusReason)
?setFocusPolicy@QGraphicsWidget@@QAEXW4FocusPolicy@Qt@@@Z @ 8999 NONAME ; void QGraphicsWidget::setFocusPolicy(enum Qt::FocusPolicy)
?setFocusPolicy@QWidget@@QAEXW4FocusPolicy@Qt@@@Z @ 9000 NONAME ; void QWidget::setFocusPolicy(enum Qt::FocusPolicy)
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 3708e21..e4fc7a3 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -3476,4 +3476,65 @@ EXPORTS
_ZlsR11QDataStreamRKN29QDeclarativeEngineDebugServer26QDeclarativeObjectPropertyE @ 3475 NONAME
_ZrsR11QDataStreamRN29QDeclarativeEngineDebugServer22QDeclarativeObjectDataE @ 3476 NONAME
_ZrsR11QDataStreamRN29QDeclarativeEngineDebugServer26QDeclarativeObjectPropertyE @ 3477 NONAME
+ _ZN19QDeclarativeBinding10setEnabledEb6QFlagsIN27QDeclarativePropertyPrivate9WriteFlagEE @ 3478 NONAME
+ _ZN19QDeclarativeBinding11qt_metacallEN11QMetaObject4CallEiPPv @ 3479 NONAME
+ _ZN19QDeclarativeBinding11qt_metacastEPKc @ 3480 NONAME
+ _ZN19QDeclarativeBinding13propertyIndexEv @ 3481 NONAME
+ _ZN19QDeclarativeBinding16staticMetaObjectE @ 3482 NONAME DATA 16
+ _ZN19QDeclarativeBinding19getStaticMetaObjectEv @ 3483 NONAME
+ _ZN19QDeclarativeBinding6updateE6QFlagsIN27QDeclarativePropertyPrivate9WriteFlagEE @ 3484 NONAME
+ _ZN19QDeclarativeBinding9setTargetERK20QDeclarativeProperty @ 3485 NONAME
+ _ZN19QDeclarativeBindingC1EPvP20QDeclarativeRefCountP7QObjectP19QDeclarativeContextRK7QStringiS4_ @ 3486 NONAME
+ _ZN19QDeclarativeBindingC1ERK7QStringP7QObjectP19QDeclarativeContextS4_ @ 3487 NONAME
+ _ZN19QDeclarativeBindingC2EPvP20QDeclarativeRefCountP7QObjectP19QDeclarativeContextRK7QStringiS4_ @ 3488 NONAME
+ _ZN19QDeclarativeBindingC2ERK7QStringP7QObjectP19QDeclarativeContextS4_ @ 3489 NONAME
+ _ZN19QDeclarativeBindingD0Ev @ 3490 NONAME
+ _ZN19QDeclarativeBindingD1Ev @ 3491 NONAME
+ _ZN19QDeclarativeBindingD2Ev @ 3492 NONAME
+ _ZN27QDeclarativeAbstractBinding10setEnabledEb6QFlagsIN27QDeclarativePropertyPrivate9WriteFlagEE @ 3493 NONAME
+ _ZN27QDeclarativeAbstractBinding11addToObjectEP7QObject @ 3494 NONAME
+ _ZN27QDeclarativeAbstractBinding16removeFromObjectEv @ 3495 NONAME
+ _ZN27QDeclarativeAbstractBinding5clearEv @ 3496 NONAME
+ _ZN27QDeclarativeAbstractBinding7destroyEv @ 3497 NONAME
+ _ZN27QDeclarativeAbstractBindingC2Ev @ 3498 NONAME
+ _ZN27QDeclarativeAbstractBindingD0Ev @ 3499 NONAME
+ _ZN27QDeclarativeAbstractBindingD1Ev @ 3500 NONAME
+ _ZN27QDeclarativeAbstractBindingD2Ev @ 3501 NONAME
+ _ZN27QDeclarativePropertyPrivate10canConvertEPK11QMetaObjectS2_ @ 3502 NONAME
+ _ZN27QDeclarativePropertyPrivate10setBindingEP7QObjectRKN25QDeclarativePropertyCache4DataEP27QDeclarativeAbstractBinding6QFlagsINS_9WriteFlagEE @ 3503 NONAME
+ _ZN27QDeclarativePropertyPrivate10setBindingERK20QDeclarativePropertyP27QDeclarativeAbstractBinding6QFlagsINS_9WriteFlagEE @ 3504 NONAME
+ _ZN27QDeclarativePropertyPrivate11initDefaultEP7QObject @ 3505 NONAME
+ _ZN27QDeclarativePropertyPrivate12initPropertyEP7QObjectRK7QString @ 3506 NONAME
+ _ZN27QDeclarativePropertyPrivate12savePropertyEPK11QMetaObjecti @ 3507 NONAME
+ _ZN27QDeclarativePropertyPrivate13saveValueTypeEPK11QMetaObjectiS2_i @ 3508 NONAME
+ _ZN27QDeclarativePropertyPrivate16signalExpressionERK20QDeclarativeProperty @ 3509 NONAME
+ _ZN27QDeclarativePropertyPrivate17readValuePropertyEv @ 3510 NONAME
+ _ZN27QDeclarativePropertyPrivate17writeEnumPropertyERK13QMetaPropertyiP7QObjectRK8QVarianti @ 3511 NONAME
+ _ZN27QDeclarativePropertyPrivate18valueTypeCoreIndexERK20QDeclarativeProperty @ 3512 NONAME
+ _ZN27QDeclarativePropertyPrivate18writeValuePropertyERK8QVariant6QFlagsINS_9WriteFlagEE @ 3513 NONAME
+ _ZN27QDeclarativePropertyPrivate19setSignalExpressionERK20QDeclarativePropertyP22QDeclarativeExpression @ 3514 NONAME
+ _ZN27QDeclarativePropertyPrivate20rawMetaObjectForTypeEP25QDeclarativeEnginePrivatei @ 3515 NONAME
+ _ZN27QDeclarativePropertyPrivate5equalEPK11QMetaObjectS2_ @ 3516 NONAME
+ _ZN27QDeclarativePropertyPrivate5writeEP7QObjectRKN25QDeclarativePropertyCache4DataERK8QVariantP19QDeclarativeContext6QFlagsINS_9WriteFlagEE @ 3517 NONAME
+ _ZN27QDeclarativePropertyPrivate5writeERK20QDeclarativePropertyRK8QVariant6QFlagsINS_9WriteFlagEE @ 3518 NONAME
+ _ZN27QDeclarativePropertyPrivate7bindingERK20QDeclarativeProperty @ 3519 NONAME
+ _ZN27QDeclarativePropertyPrivate7restoreERK10QByteArrayP7QObjectP19QDeclarativeContext @ 3520 NONAME
+ _ZNK19QDeclarativeBinding10expressionEv @ 3521 NONAME
+ _ZNK19QDeclarativeBinding10metaObjectEv @ 3522 NONAME
+ _ZNK19QDeclarativeBinding7enabledEv @ 3523 NONAME
+ _ZNK19QDeclarativeBinding8propertyEv @ 3524 NONAME
+ _ZNK27QDeclarativeAbstractBinding10expressionEv @ 3525 NONAME
+ _ZNK27QDeclarativePropertyPrivate11isValueTypeEv @ 3526 NONAME
+ _ZNK27QDeclarativePropertyPrivate12propertyTypeEv @ 3527 NONAME
+ _ZNK27QDeclarativePropertyPrivate20propertyTypeCategoryEv @ 3528 NONAME
+ _ZTI19QDeclarativeBinding @ 3529 NONAME
+ _ZTI27QDeclarativeAbstractBinding @ 3530 NONAME
+ _ZTV19QDeclarativeBinding @ 3531 NONAME
+ _ZTV27QDeclarativeAbstractBinding @ 3532 NONAME
+ _ZThn8_N19QDeclarativeBinding10setEnabledEb6QFlagsIN27QDeclarativePropertyPrivate9WriteFlagEE @ 3533 NONAME
+ _ZThn8_N19QDeclarativeBinding13propertyIndexEv @ 3534 NONAME
+ _ZThn8_N19QDeclarativeBinding6updateE6QFlagsIN27QDeclarativePropertyPrivate9WriteFlagEE @ 3535 NONAME
+ _ZThn8_N19QDeclarativeBindingD0Ev @ 3536 NONAME
+ _ZThn8_N19QDeclarativeBindingD1Ev @ 3537 NONAME
+ _ZThn8_NK19QDeclarativeBinding10expressionEv @ 3538 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b82fe4c..7c91264 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -4663,7 +4663,7 @@ EXPORTS
_ZN20QGraphicsItemPrivate12resolveDepthEv @ 4662 NONAME
_ZN20QGraphicsItemPrivate12setPosHelperERK7QPointF @ 4663 NONAME
_ZN20QGraphicsItemPrivate13clearSubFocusEP13QGraphicsItem @ 4664 NONAME
- _ZN20QGraphicsItemPrivate14setFocusHelperEN2Qt11FocusReasonEb @ 4665 NONAME
+ _ZN20QGraphicsItemPrivate14setFocusHelperEN2Qt11FocusReasonEb @ 4665 NONAME ABSENT
_ZN20QGraphicsItemPrivate15resetFocusProxyEv @ 4666 NONAME
_ZN20QGraphicsItemPrivate16setEnabledHelperEbbb @ 4667 NONAME
_ZN20QGraphicsItemPrivate16setVisibleHelperEbbb @ 4668 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index 724451b..ec019e2 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -3,92 +3,57 @@
#include <bldvariant.hrh>
-// Dependancies for more than one module
-#include <base.iby>
-#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine,
-#include <cone.iby> // QtGui, QtOpenGL
-#include <stdcpp.iby> // for std C++ support
-
-// QtGui dependancies
-#include <bafl.iby>
-#include <store.iby>
-#include <fntstore.iby>
-#include <ecom.iby>
-#include <fontutils.iby>
-#include <fepbase.iby>
-#include <fbserv.iby>
-#include <bitgdi.iby>
-#include <gdi.iby>
-#include <wserv.iby>
-#include <apparc.iby>
-#include <uikon.iby>
-#include <etext.iby>
-#include <emime.iby>
-#include <eikstd.iby>
-#include <mmf.iby>
-#include <avkon.iby>
-#include <commonui.iby>
-#include <platformenv.iby>
-#include <senduiservices.iby>
-#include <aknicon.iby>
-#include <aknskins.iby>
-
-// QtNetwork dependancies
-#include <esock_core.iby>
-#include <insock.iby>
-
-// QtOpenGL dependancies
-///@todo Problem here as we need libegl.dll and libglesv2.dll but they may come from a variety of places
-/// depending on the platform we're on
-
#warning("qt.iby: hack - BINARY_SELECTION_ORDER really needs to be at the baseport/device level as it depends on the device type");
BINARY_SELECTION_ORDER ARMV6,ARMV5 // hack - this really needs to be at the baseport/device level as it depends on the device type
-file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtOpenGL.dll SHARED_LIB_DIR\QtOpenGL.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtOpenVG.dll SHARED_LIB_DIR\QtOpenVG.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtSql.dll SHARED_LIB_DIR\QtSql.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtWebKit.dll SHARED_LIB_DIR\QtWebKit.dll PAGED
-file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll PAGED
-file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll PAGED
+file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll
+file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll
+file=ABI_DIR\BUILD_DIR\QtOpenVG.dll SHARED_LIB_DIR\QtOpenVG.dll
+file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll
+file=ABI_DIR\BUILD_DIR\QtSql.dll SHARED_LIB_DIR\QtSql.dll
+file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll
+file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll
+file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll
+file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll
+file=ABI_DIR\BUILD_DIR\QtWebKit.dll SHARED_LIB_DIR\QtWebKit.dll
+file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll
+file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll
+file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll
+file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll
// imageformats
-file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll PAGED
-file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll PAGED
-file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll PAGED
-file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll PAGED
-file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll PAGED
-file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll PAGED
+file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll
+file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll
+file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll
+file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll
+file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll
+file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll
// codecs
-file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll PAGED
-file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll PAGED
-file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll PAGED
-file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll PAGED
+file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll
+file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll
+file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll
+file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll
// iconengines
-file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll PAGED
+file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll
// Phonon MMF backend
-file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll PAGED
+// This is commented out by default, as normally Helix backend will be used.
+// If the Helix backend is present, it will override MMF backend, so make sure to remove it from
+// image creation in addition to uncommenting the following lines if you want to use MMF backend.
+//file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll
+//data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
// QtMultimedia audio backend
-file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll PAGED
+file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll
// graphicssystems
-file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll PAGED
+file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll
// S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM,
// so don't bother including those plugins
-file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll PAGED
+file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll
S60_APP_RESOURCE(s60main)
@@ -109,8 +74,6 @@ data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resou
// iconengines stubs
data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
-// Phonon MMF backend
-data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
// QtMultimedia audio backend
data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio\qaudio.qtplugin
@@ -123,3 +86,4 @@ data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis
data=ZSYSTEM\install\qtwebkit_stub.sis System\Install\qtwebkit_stub.sis
#endif // __QT_IBY__
+
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 5d5bee9..841fce4 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -78,12 +78,6 @@ symbian: {
DEPLOYMENT += phonon_backend_plugins
}
- contains(QT_CONFIG, audio-backend) {
- qaudio_backend_plugins.sources += qaudio.dll
- qaudio_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/audio
- DEPLOYMENT += qaudio_backend_plugins
- }
-
# Support backup & restore for Qt libraries
qtbackup.sources = backup_registration.xml
qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
@@ -134,5 +128,5 @@ symbian: {
}
BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)"
- BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)"
+ BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)"
}
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index 1d11ede..46c68ed 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -493,6 +493,11 @@ QScriptDeclarativeClass::Value QScriptDeclarativeClass::call(Object *object,
return Value();
}
+bool QScriptDeclarativeClass::compare(Object *o, Object *o2)
+{
+ return o == o2;
+}
+
QStringList QScriptDeclarativeClass::propertyNames(Object *object)
{
Q_UNUSED(object);
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index a0fd6d5..7037e22 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -129,6 +129,7 @@ public:
virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
virtual QScriptValue::PropertyFlags propertyFlags(Object *, const Identifier &);
virtual Value call(Object *, QScriptContext *);
+ virtual bool compare(Object *, Object *);
virtual QStringList propertyNames(Object *);
diff --git a/src/script/bridge/qscriptdeclarativeobject.cpp b/src/script/bridge/qscriptdeclarativeobject.cpp
index c6ab6a7..70bb1bb 100644
--- a/src/script/bridge/qscriptdeclarativeobject.cpp
+++ b/src/script/bridge/qscriptdeclarativeobject.cpp
@@ -198,6 +198,23 @@ bool DeclarativeObjectDelegate::hasInstance(QScriptObject* object, JSC::ExecStat
return QScriptObjectDelegate::hasInstance(object, exec, value, proto);
}
+bool DeclarativeObjectDelegate::compareToObject(QScriptObject *o, JSC::ExecState *exec, JSC::JSObject *o2)
+{
+ if (!o2->inherits(&QScriptObject::info))
+ return false;
+
+ QScriptObject *scriptObject = static_cast<QScriptObject*>(o2);
+ QScriptObjectDelegate *delegate = scriptObject->delegate();
+ if (!delegate || (delegate->type() != QScriptObjectDelegate::DeclarativeClassObject))
+ return false;
+
+ DeclarativeObjectDelegate *other = static_cast<DeclarativeObjectDelegate*>(delegate);
+ if (m_class != other->m_class)
+ return false;
+ else
+ return m_class->compare(m_object, other->m_object);
+}
+
} // namespace QScript
QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptdeclarativeobject_p.h b/src/script/bridge/qscriptdeclarativeobject_p.h
index ec8a43e..878af24 100644
--- a/src/script/bridge/qscriptdeclarativeobject_p.h
+++ b/src/script/bridge/qscriptdeclarativeobject_p.h
@@ -99,6 +99,8 @@ public:
virtual bool hasInstance(QScriptObject*, JSC::ExecState*,
JSC::JSValue value, JSC::JSValue proto);
+ bool compareToObject(QScriptObject *, JSC::ExecState *, JSC::JSObject *);
+
private:
QScriptDeclarativeClass *m_class;
QScriptDeclarativeClass::Object *m_object;
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 91636da..6c401f8 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -163,10 +163,40 @@ static bool isEnumerableMetaProperty(const QMetaProperty &prop,
&& (mo->indexOfProperty(prop.name()) == index);
}
-static inline QByteArray methodName(const QMetaMethod &method)
+/*! \internal
+ Calculates the length of the name of the given \a method by looking
+ for the first '(' character.
+*/
+static inline int methodNameLength(const QMetaMethod &method)
{
- QByteArray signature = method.signature();
- return signature.left(signature.indexOf('('));
+ const char *signature = method.signature();
+ const char *s = signature;
+ while (*s && (*s != '('))
+ ++s;
+ return s - signature;
+}
+
+/*! \internal
+ Makes a deep copy of the first \a nameLength characters of the given
+ method \a signature and returns the copy.
+*/
+static inline QByteArray methodName(const char *signature, int nameLength)
+{
+ return QByteArray(signature, nameLength);
+}
+
+/*! \internal
+
+ Returns true if the name of the given \a method is the same as that
+ specified by the (signature, nameLength) pair, otherwise returns
+ false.
+*/
+static inline bool methodNameEquals(const QMetaMethod &method,
+ const char *signature, int nameLength)
+{
+ const char *otherSignature = method.signature();
+ return !qstrncmp(otherSignature, signature, nameLength)
+ && (otherSignature[nameLength] == '(');
}
static QVariant variantFromValue(JSC::ExecState *exec, int targetType, JSC::JSValue value)
@@ -310,25 +340,16 @@ QList<int> QScript::QtFunction::overloadedIndexes() const
if (!maybeOverloaded())
return QList<int>();
QList<int> result;
- QString name = functionName();
const QMetaObject *meta = metaObject();
+ QMetaMethod method = meta->method(initialIndex());
+ int nameLength = methodNameLength(method);
for (int index = mostGeneralMethod() - 1; index >= 0; --index) {
- QString otherName = QString::fromLatin1(methodName(meta->method(index)));
- if (otherName == name)
+ if (methodNameEquals(meta->method(index), method.signature(), nameLength))
result.append(index);
}
return result;
}
-QString QtFunction::functionName() const
-{
- const QMetaObject *meta = metaObject();
- if (!meta)
- return QString();
- QMetaMethod method = meta->method(initialIndex());
- return QLatin1String(methodName(method));
-}
-
class QScriptMetaType
{
public:
@@ -415,8 +436,8 @@ class QScriptMetaMethod
public:
inline QScriptMetaMethod()
{ }
- inline QScriptMetaMethod(const QByteArray &name, const QVector<QScriptMetaType> &types)
- : m_name(name), m_types(types), m_firstUnresolvedIndex(-1)
+ inline QScriptMetaMethod(const QVector<QScriptMetaType> &types)
+ : m_types(types), m_firstUnresolvedIndex(-1)
{
QVector<QScriptMetaType>::const_iterator it;
for (it = m_types.constBegin(); it != m_types.constEnd(); ++it) {
@@ -429,9 +450,6 @@ public:
inline bool isValid() const
{ return !m_types.isEmpty(); }
- QByteArray name() const
- { return m_name; }
-
inline QScriptMetaType returnType() const
{ return m_types.at(0); }
@@ -460,7 +478,6 @@ public:
{ return m_types; }
private:
- QByteArray m_name;
QVector<QScriptMetaType> m_types;
int m_firstUnresolvedIndex;
};
@@ -497,7 +514,6 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
const QMetaObject *meta, int initialIndex,
bool maybeOverloaded)
{
- QByteArray funName;
QScriptMetaMethod chosenMethod;
int chosenIndex = -1;
QVarLengthArray<QVariant, 9> args;
@@ -506,15 +522,18 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
QVector<int> tooFewArgs;
QVector<int> conversionFailed;
int index;
+ int nameLength = 0;
+ const char *initialMethodSignature = 0;
exec->clearException();
QScriptEnginePrivate *engine = QScript::scriptEngineFromExec(exec);
for (index = initialIndex; index >= 0; --index) {
QMetaMethod method = metaMethod(meta, callType, index);
- if (index == initialIndex)
- funName = methodName(method);
- else {
- if (methodName(method) != funName)
+ if (index == initialIndex) {
+ initialMethodSignature = method.signature();
+ nameLength = methodNameLength(method);
+ } else {
+ if (!methodNameEquals(method, initialMethodSignature, nameLength))
continue;
}
@@ -555,7 +574,7 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
}
}
- QScriptMetaMethod mtd = QScriptMetaMethod(methodName(method), types);
+ QScriptMetaMethod mtd = QScriptMetaMethod(types);
if (int(scriptArgs.size()) < mtd.argumentCount()) {
tooFewArgs.append(index);
@@ -830,9 +849,10 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
//#ifndef Q_SCRIPT_NO_EVENT_NOTIFY
// engine->notifyFunctionEntry(context);
//#endif
+ QString funName = QString::fromLatin1(methodName(initialMethodSignature, nameLength));
if (!conversionFailed.isEmpty()) {
QString message = QString::fromLatin1("incompatible type of argument(s) in call to %0(); candidates were\n")
- .arg(QLatin1String(funName));
+ .arg(funName);
for (int i = 0; i < conversionFailed.size(); ++i) {
if (i > 0)
message += QLatin1String("\n");
@@ -847,7 +867,7 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
QScriptMetaType unresolvedType = argsInstance.method.type(unresolvedIndex);
QString unresolvedTypeName = QString::fromLatin1(unresolvedType.name());
QString message = QString::fromLatin1("cannot call %0(): ")
- .arg(QString::fromLatin1(funName));
+ .arg(funName);
if (unresolvedIndex > 0) {
message.append(QString::fromLatin1("argument %0 has unknown type `%1'").
arg(unresolvedIndex).arg(unresolvedTypeName));
@@ -859,7 +879,7 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
result = JSC::throwError(exec, JSC::TypeError, message);
} else {
QString message = QString::fromLatin1("too few arguments in call to %0(); candidates are\n")
- .arg(QLatin1String(funName));
+ .arg(funName);
for (int i = 0; i < tooFewArgs.size(); ++i) {
if (i > 0)
message += QLatin1String("\n");
@@ -875,6 +895,7 @@ static JSC::JSValue callQtMethod(JSC::ExecState *exec, QMetaMethod::MethodType c
&& (metaArgs.args.count() == candidates.at(1).args.count())
&& (metaArgs.matchDistance == candidates.at(1).matchDistance)) {
// ambiguous call
+ QByteArray funName = methodName(initialMethodSignature, nameLength);
QString message = QString::fromLatin1("ambiguous call of overloaded function %0(); candidates were\n")
.arg(QLatin1String(funName));
for (int i = 0; i < candidates.size(); ++i) {
@@ -1036,14 +1057,7 @@ JSC::JSValue JSC_HOST_CALL QtPropertyFunction::call(
if (!callee->inherits(&QtPropertyFunction::info))
return throwError(exec, JSC::TypeError, "callee is not a QtPropertyFunction object");
QtPropertyFunction *qfun = static_cast<QtPropertyFunction*>(callee);
- QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec);
- JSC::ExecState *previousFrame = eng_p->currentFrame;
- eng_p->currentFrame = exec;
- eng_p->pushContext(exec, thisValue, args, callee);
- JSC::JSValue result = qfun->execute(eng_p->currentFrame, thisValue, args);
- eng_p->popContext();
- eng_p->currentFrame = previousFrame;
- return result;
+ return qfun->execute(exec, thisValue, args);
}
JSC::JSValue QtPropertyFunction::execute(JSC::ExecState *exec,
@@ -1053,12 +1067,15 @@ JSC::JSValue QtPropertyFunction::execute(JSC::ExecState *exec,
JSC::JSValue result = JSC::jsUndefined();
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
- thisValue = engine->toUsableValue(thisValue);
- QObject *qobject = QScriptEnginePrivate::toQObject(exec, thisValue);
+ JSC::ExecState *previousFrame = engine->currentFrame;
+ engine->currentFrame = exec;
+
+ JSC::JSValue qobjectValue = engine->toUsableValue(thisValue);
+ QObject *qobject = QScriptEnginePrivate::toQObject(exec, qobjectValue);
while ((!qobject || (qobject->metaObject() != data->meta))
- && JSC::asObject(thisValue)->prototype().isObject()) {
- thisValue = JSC::asObject(thisValue)->prototype();
- qobject = QScriptEnginePrivate::toQObject(exec, thisValue);
+ && JSC::asObject(qobjectValue)->prototype().isObject()) {
+ qobjectValue = JSC::asObject(qobjectValue)->prototype();
+ qobject = QScriptEnginePrivate::toQObject(exec, qobjectValue);
}
Q_ASSERT_X(qobject, Q_FUNC_INFO, "this-object must be a QObject");
@@ -1070,14 +1087,17 @@ JSC::JSValue QtPropertyFunction::execute(JSC::ExecState *exec,
QScriptable *scriptable = scriptableFromQObject(qobject);
QScriptEngine *oldEngine = 0;
if (scriptable) {
+ engine->pushContext(exec, thisValue, args, this);
oldEngine = QScriptablePrivate::get(scriptable)->engine;
QScriptablePrivate::get(scriptable)->engine = QScriptEnginePrivate::get(engine);
}
QVariant v = prop.read(qobject);
- if (scriptable)
+ if (scriptable) {
QScriptablePrivate::get(scriptable)->engine = oldEngine;
+ engine->popContext();
+ }
result = QScriptEnginePrivate::jscValueFromVariant(exec, v);
}
@@ -1097,17 +1117,21 @@ JSC::JSValue QtPropertyFunction::execute(JSC::ExecState *exec,
QScriptable *scriptable = scriptableFromQObject(qobject);
QScriptEngine *oldEngine = 0;
if (scriptable) {
+ engine->pushContext(exec, thisValue, args, this);
oldEngine = QScriptablePrivate::get(scriptable)->engine;
QScriptablePrivate::get(scriptable)->engine = QScriptEnginePrivate::get(engine);
}
prop.write(qobject, v);
- if (scriptable)
+ if (scriptable) {
QScriptablePrivate::get(scriptable)->engine = oldEngine;
+ engine->popContext();
+ }
result = arg;
}
+ engine->currentFrame = previousFrame;
return result;
}
@@ -1240,7 +1264,7 @@ bool QObjectDelegate::getOwnPropertySlot(QScriptObject *object, JSC::ExecState *
for (index = meta->methodCount() - 1; index >= offset; --index) {
QMetaMethod method = meta->method(index);
if (hasMethodAccess(method, index, opt)
- && (methodName(method) == name)) {
+ && methodNameEquals(method, name.constData(), name.length())) {
QtFunction *fun = new (exec)QtFunction(
object, index, /*maybeOverloaded=*/true,
&exec->globalData(), eng->originalGlobalObject()->functionStructure(),
@@ -1372,7 +1396,7 @@ bool QObjectDelegate::getOwnPropertyDescriptor(QScriptObject *object, JSC::ExecS
for (index = meta->methodCount() - 1; index >= offset; --index) {
QMetaMethod method = meta->method(index);
if (hasMethodAccess(method, index, opt)
- && (methodName(method) == name)) {
+ && methodNameEquals(method, name.constData(), name.length())) {
QtFunction *fun = new (exec)QtFunction(
object, index, /*maybeOverloaded=*/true,
&exec->globalData(), eng->originalGlobalObject()->functionStructure(),
@@ -1486,7 +1510,7 @@ void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec,
for (index = meta->methodCount() - 1; index >= offset; --index) {
QMetaMethod method = meta->method(index);
if (hasMethodAccess(method, index, opt)
- && (methodName(method) == name)) {
+ && methodNameEquals(method, name.constData(), name.length())) {
data->cachedMembers.insert(name, value);
return;
}
@@ -1605,7 +1629,7 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
for (index = meta->methodCount() - 1; index >= offset; --index) {
QMetaMethod method = meta->method(index);
if (hasMethodAccess(method, index, opt)
- && (methodName(method) == name)) {
+ && methodNameEquals(method, name.constData(), name.length())) {
attributes = QObjectMemberAttribute;
if (opt & QScriptEngine::SkipMethodsInEnumeration)
attributes |= JSC::DontEnum;
diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h
index 448fa99..8b05d6b 100644
--- a/src/script/bridge/qscriptqobject_p.h
+++ b/src/script/bridge/qscriptqobject_p.h
@@ -212,7 +212,6 @@ public:
bool maybeOverloaded() const;
int mostGeneralMethod(QMetaMethod *out = 0) const;
QList<int> overloadedIndexes() const;
- QString functionName() const;
private:
Data *data;
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index de2be89..2f0cfdc 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -523,7 +523,7 @@ QVariant::Type qDecodeOCIType(const QString& ocitype, QSql::NumericalPrecisionPo
}
else if (ocitype == QLatin1String("LONG") || ocitype == QLatin1String("NCLOB")
|| ocitype == QLatin1String("CLOB"))
- type = QVariant::String;
+ type = QVariant::ByteArray;
else if (ocitype == QLatin1String("RAW") || ocitype == QLatin1String("LONG RAW")
|| ocitype == QLatin1String("ROWID") || ocitype == QLatin1String("BLOB")
|| ocitype == QLatin1String("CFILE") || ocitype == QLatin1String("BFILE"))
@@ -549,7 +549,6 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis
case SQLT_AVC:
case SQLT_RDD:
case SQLT_LNG:
- case SQLT_CLOB:
#ifdef SQLT_INTERVAL_YM
case SQLT_INTERVAL_YM:
#endif
@@ -587,6 +586,7 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis
case SQLT_LVC:
case SQLT_LVB:
case SQLT_BLOB:
+ case SQLT_CLOB:
case SQLT_FILE:
case SQLT_NTY:
case SQLT_REF:
diff --git a/src/src.pro b/src/src.pro
index 403ffe1..0fbce6b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -102,7 +102,7 @@ src_declarative.target = sub-declarative
src_tools_idc.depends = src_corelib # target defined in tools.pro
src_tools_uic3.depends = src_qt3support src_xml # target defined in tools.pro
src_phonon.depends = src_gui
- src_multimedia.depends = src_gui
+ src_multimedia.depends = src_gui src_opengl
src_tools_activeqt.depends = src_tools_idc src_gui
src_declarative.depends = src_xml src_gui src_script src_network src_svg
src_plugins.depends = src_gui src_sql src_svg src_multimedia
@@ -112,7 +112,7 @@ src_declarative.target = sub-declarative
contains(QT_CONFIG, phonon):src_webkit.depends += src_phonon
contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns
contains(QT_CONFIG, declarative):src_declarative.depends += src_webkit
- src_imports.depends += src_webkit
+ src_imports.depends += src_webkit
#exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore
}
contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index 4a8fc0b..cb9086c 100644
--- a/src/svg/qsvggenerator.cpp
+++ b/src/svg/qsvggenerator.cpp
@@ -310,7 +310,6 @@ public:
{
*d_func()->stream << QLatin1String("fill=\"none\" ");
*d_func()->stream << QLatin1String("stroke=\"black\" ");
- *d_func()->stream << QLatin1String("vector-effect=\"non-scaling-stroke\" ");
*d_func()->stream << QLatin1String("stroke-width=\"1\" ");
*d_func()->stream << QLatin1String("fill-rule=\"evenodd\" ");
*d_func()->stream << QLatin1String("stroke-linecap=\"square\" ");
@@ -380,13 +379,10 @@ public:
break;
}
- if (spen.widthF() == 0) {
- width = QLatin1String("1");
- stream() << "vector-effect=\"non-scaling-stroke\" ";
- }
+ if (spen.widthF() == 0)
+ stream() <<"stroke-width=\"1\" ";
else
- width = QString::number(spen.widthF());
- stream() <<"stroke-width=\""<<width<<"\" ";
+ stream() <<"stroke-width=\"" << spen.widthF() << "\" ";
switch (spen.capStyle()) {
case Qt::FlatCap:
@@ -983,14 +979,11 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p)
{
Q_D(QSvgPaintEngine);
- *d->stream << "<path "
- "fill-rule=";
- if (p.fillRule() == Qt::OddEvenFill)
- *d->stream << "\"evenodd\" ";
- else
- *d->stream << "\"nonzero\" ";
-
- *d->stream << "d=\"";
+ *d->stream << "<path vector-effect=\""
+ << (state->pen().isCosmetic() ? "non-scaling-stroke" : "none")
+ << "\" fill-rule=\""
+ << (p.fillRule() == Qt::OddEvenFill ? "evenodd" : "nonzero")
+ << "\" d=\"";
for (int i=0; i<p.elementCount(); ++i) {
const QPainterPath::Element &e = p.elementAt(i);
@@ -1038,7 +1031,9 @@ void QSvgPaintEngine::drawPolygon(const QPointF *points, int pointCount,
path.lineTo(points[i]);
if (mode == PolylineMode) {
- stream() << "<polyline fill=\"none\" points=\"";
+ stream() << "<polyline fill=\"none\" vector-effect=\""
+ << (state->pen().isCosmetic() ? "non-scaling-stroke" : "none")
+ << "\" points=\"";
for (int i = 0; i < pointCount; ++i) {
const QPointF &pt = points[i];
stream() << pt.x() << ',' << pt.y() << ' ';
diff --git a/src/svg/qsvggraphics.cpp b/src/svg/qsvggraphics.cpp
index cd0e1ac..a29764a 100644
--- a/src/svg/qsvggraphics.cpp
+++ b/src/svg/qsvggraphics.cpp
@@ -78,33 +78,29 @@ void QSvgAnimation::draw(QPainter *, QSvgExtraStates &)
qWarning("<animation> no implemented");
}
-static inline QRectF boundsOnStroke(const QPainterPath &path, qreal width)
+static inline QRectF boundsOnStroke(QPainter *p, const QPainterPath &path, qreal width)
{
QPainterPathStroker stroker;
stroker.setWidth(width);
QPainterPath stroke = stroker.createStroke(path);
- return stroke.boundingRect();
+ return p->transform().map(stroke).boundingRect();
}
-QSvgCircle::QSvgCircle(QSvgNode *parent, const QRectF &rect)
+QSvgEllipse::QSvgEllipse(QSvgNode *parent, const QRectF &rect)
: QSvgNode(parent), m_bounds(rect)
{
}
-QRectF QSvgCircle::bounds() const
+QRectF QSvgEllipse::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_bounds;
- else {
- QPainterPath path;
- path.addRect(m_bounds);
- return boundsOnStroke(path, sw);
- }
+ QPainterPath path;
+ path.addEllipse(m_bounds);
+ qreal sw = strokeWidth(p);
+ return qFuzzyIsNull(sw) ? p->transform().map(path).boundingRect() : boundsOnStroke(p, path, sw);
}
-void QSvgCircle::draw(QPainter *p, QSvgExtraStates &states)
+void QSvgEllipse::draw(QPainter *p, QSvgExtraStates &states)
{
applyStyle(p, states);
QT_SVG_DRAW_SHAPE(p->drawEllipse(m_bounds));
@@ -112,9 +108,8 @@ void QSvgCircle::draw(QPainter *p, QSvgExtraStates &states)
}
QSvgArc::QSvgArc(QSvgNode *parent, const QPainterPath &path)
- : QSvgNode(parent), cubic(path)
+ : QSvgNode(parent), m_path(path)
{
- m_cachedBounds = path.boundingRect();
}
void QSvgArc::draw(QPainter *p, QSvgExtraStates &states)
@@ -123,36 +118,12 @@ void QSvgArc::draw(QPainter *p, QSvgExtraStates &states)
if (p->pen().widthF() != 0) {
qreal oldOpacity = p->opacity();
p->setOpacity(oldOpacity * states.strokeOpacity);
- p->drawPath(cubic);
+ p->drawPath(m_path);
p->setOpacity(oldOpacity);
}
revertStyle(p, states);
}
-QSvgEllipse::QSvgEllipse(QSvgNode *parent, const QRectF &rect)
- : QSvgNode(parent), m_bounds(rect)
-{
-}
-
-QRectF QSvgEllipse::bounds() const
-{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_bounds;
- else {
- QPainterPath path;
- path.addEllipse(m_bounds);
- return boundsOnStroke(path, sw);
- }
-}
-
-void QSvgEllipse::draw(QPainter *p, QSvgExtraStates &states)
-{
- applyStyle(p, states);
- QT_SVG_DRAW_SHAPE(p->drawEllipse(m_bounds));
- revertStyle(p, states);
-}
-
QSvgImage::QSvgImage(QSvgNode *parent, const QImage &image,
const QRect &bounds)
: QSvgNode(parent), m_image(image),
@@ -173,7 +144,7 @@ void QSvgImage::draw(QPainter *p, QSvgExtraStates &states)
QSvgLine::QSvgLine(QSvgNode *parent, const QLineF &line)
- : QSvgNode(parent), m_bounds(line)
+ : QSvgNode(parent), m_line(line)
{
}
@@ -184,7 +155,7 @@ void QSvgLine::draw(QPainter *p, QSvgExtraStates &states)
if (p->pen().widthF() != 0) {
qreal oldOpacity = p->opacity();
p->setOpacity(oldOpacity * states.strokeOpacity);
- p->drawLine(m_bounds);
+ p->drawLine(m_line);
p->setOpacity(oldOpacity);
}
revertStyle(p, states);
@@ -203,19 +174,11 @@ void QSvgPath::draw(QPainter *p, QSvgExtraStates &states)
revertStyle(p, states);
}
-QRectF QSvgPath::bounds() const
+QRectF QSvgPath::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw)) {
- if (m_cachedBounds.isNull())
- //m_cachedBounds = m_path.controlPointRect();
- m_cachedBounds = m_path.boundingRect();
-
- return m_cachedBounds;
- }
- else {
- return boundsOnStroke(m_path, sw);
- }
+ qreal sw = strokeWidth(p);
+ return qFuzzyIsNull(sw) ? p->transform().map(m_path).boundingRect()
+ : boundsOnStroke(p, m_path, sw);
}
QSvgPolygon::QSvgPolygon(QSvgNode *parent, const QPolygonF &poly)
@@ -223,15 +186,15 @@ QSvgPolygon::QSvgPolygon(QSvgNode *parent, const QPolygonF &poly)
{
}
-QRectF QSvgPolygon::bounds() const
+QRectF QSvgPolygon::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_poly.boundingRect();
- else {
+ qreal sw = strokeWidth(p);
+ if (qFuzzyIsNull(sw)) {
+ return p->transform().map(m_poly).boundingRect();
+ } else {
QPainterPath path;
path.addPolygon(m_poly);
- return boundsOnStroke(path, sw);
+ return boundsOnStroke(p, path, sw);
}
}
@@ -274,15 +237,15 @@ QSvgRect::QSvgRect(QSvgNode *node, const QRectF &rect, int rx, int ry)
{
}
-QRectF QSvgRect::bounds() const
+QRectF QSvgRect::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_rect;
- else {
+ qreal sw = strokeWidth(p);
+ if (qFuzzyIsNull(sw)) {
+ return p->transform().mapRect(m_rect);
+ } else {
QPainterPath path;
path.addRect(m_rect);
- return boundsOnStroke(path, sw);
+ return boundsOnStroke(p, path, sw);
}
}
@@ -322,7 +285,7 @@ void QSvgText::setTextArea(const QSizeF &size)
m_type = TEXTAREA;
}
-//QRectF QSvgText::bounds() const {}
+//QRectF QSvgText::bounds(QPainter *p, QSvgExtraStates &) const {}
void QSvgText::draw(QPainter *p, QSvgExtraStates &states)
{
@@ -593,80 +556,57 @@ QSvgNode::Type QSvgVideo::type() const
return VIDEO;
}
-QRectF QSvgUse::bounds() const
-{
- if (m_link && m_bounds.isEmpty()) {
- m_bounds = m_link->bounds();
- m_bounds = QRectF(m_bounds.x()+m_start.x(),
- m_bounds.y()+m_start.y(),
- m_bounds.width(),
- m_bounds.height());
-
- return m_bounds;
- }
- return m_bounds;
-}
-
-QRectF QSvgUse::transformedBounds(const QTransform &transform) const
+QRectF QSvgUse::bounds(QPainter *p, QSvgExtraStates &states) const
{
QRectF bounds;
- QTransform t = transform;
-
- if (m_link) {
- QSvgTransformStyle *transStyle = m_style.transform;
- if (transStyle) {
- t = transStyle->qtransform() * t;
- }
- t.translate(m_start.x(), m_start.y());
-
- bounds = m_link->transformedBounds(t);
-
- return bounds;
+ if (m_link) {
+ p->translate(m_start);
+ bounds = m_link->transformedBounds(p, states);
+ p->translate(-m_start);
}
return bounds;
}
-QRectF QSvgPolyline::bounds() const
+QRectF QSvgPolyline::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_poly.boundingRect();
- else {
+ qreal sw = strokeWidth(p);
+ if (qFuzzyIsNull(sw)) {
+ return p->transform().map(m_poly).boundingRect();
+ } else {
QPainterPath path;
path.addPolygon(m_poly);
- return boundsOnStroke(path, sw);
+ return boundsOnStroke(p, path, sw);
}
}
-QRectF QSvgArc::bounds() const
+QRectF QSvgArc::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
- return m_cachedBounds;
- else {
- return boundsOnStroke(cubic, sw);
- }
+ qreal sw = strokeWidth(p);
+ return qFuzzyIsNull(sw) ? p->transform().map(m_path).boundingRect()
+ : boundsOnStroke(p, m_path, sw);
}
-QRectF QSvgImage::bounds() const
+QRectF QSvgImage::bounds(QPainter *p, QSvgExtraStates &) const
{
- return m_bounds;
+ return p->transform().mapRect(m_bounds);
}
-QRectF QSvgLine::bounds() const
+QRectF QSvgLine::bounds(QPainter *p, QSvgExtraStates &) const
{
- qreal sw = strokeWidth();
+ qreal sw = strokeWidth(p);
if (qFuzzyIsNull(sw)) {
- qreal minX = qMin(m_bounds.x1(), m_bounds.x2());
- qreal minY = qMin(m_bounds.y1(), m_bounds.y2());
- qreal maxX = qMax(m_bounds.x1(), m_bounds.x2());
- qreal maxY = qMax(m_bounds.y1(), m_bounds.y2());
- return QRectF(minX, minY, maxX-minX, maxY-minY);
+ QPointF p1 = p->transform().map(m_line.p1());
+ QPointF p2 = p->transform().map(m_line.p2());
+ qreal minX = qMin(p1.x(), p2.x());
+ qreal minY = qMin(p1.y(), p2.y());
+ qreal maxX = qMax(p1.x(), p2.x());
+ qreal maxY = qMax(p1.y(), p2.y());
+ return QRectF(minX, minY, maxX - minX, maxY - minY);
} else {
QPainterPath path;
- path.moveTo(m_bounds.x1(), m_bounds.y1());
- path.lineTo(m_bounds.x2(), m_bounds.y2());
- return boundsOnStroke(path, sw);
+ path.moveTo(m_line.p1());
+ path.lineTo(m_line.p2());
+ return boundsOnStroke(p, path, sw);
}
}
diff --git a/src/svg/qsvggraphics_p.h b/src/svg/qsvggraphics_p.h
index ca06777..fdc770a 100644
--- a/src/svg/qsvggraphics_p.h
+++ b/src/svg/qsvggraphics_p.h
@@ -80,32 +80,27 @@ public:
QSvgArc(QSvgNode *parent, const QPainterPath &path);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
- QPainterPath cubic;
- QRectF m_cachedBounds;
+ QPainterPath m_path;
};
-class QSvgCircle : public QSvgNode
+class QSvgEllipse : public QSvgNode
{
public:
- QSvgCircle(QSvgNode *parent, const QRectF &rect);
+ QSvgEllipse(QSvgNode *parent, const QRectF &rect);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QRectF m_bounds;
};
-class QSvgEllipse : public QSvgNode
+class QSvgCircle : public QSvgEllipse
{
public:
- QSvgEllipse(QSvgNode *parent, const QRectF &rect);
- virtual void draw(QPainter *p, QSvgExtraStates &states);
+ QSvgCircle(QSvgNode *parent, const QRectF &rect) : QSvgEllipse(parent, rect) { }
virtual Type type() const;
- virtual QRectF bounds() const;
-private:
- QRectF m_bounds;
};
class QSvgImage : public QSvgNode
@@ -115,7 +110,7 @@ public:
const QRect &bounds);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QImage m_image;
QRect m_bounds;
@@ -127,9 +122,9 @@ public:
QSvgLine(QSvgNode *parent, const QLineF &line);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
- QLineF m_bounds;
+ QLineF m_line;
};
class QSvgPath : public QSvgNode
@@ -138,14 +133,13 @@ public:
QSvgPath(QSvgNode *parent, const QPainterPath &qpath);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
QPainterPath *qpath() {
return &m_path;
}
private:
QPainterPath m_path;
- mutable QRectF m_cachedBounds;
};
class QSvgPolygon : public QSvgNode
@@ -154,7 +148,7 @@ public:
QSvgPolygon(QSvgNode *parent, const QPolygonF &poly);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QPolygonF m_poly;
};
@@ -165,7 +159,7 @@ public:
QSvgPolyline(QSvgNode *parent, const QPolygonF &poly);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QPolygonF m_poly;
};
@@ -176,7 +170,7 @@ public:
QSvgRect(QSvgNode *paren, const QRectF &rect, int rx=0, int ry=0);
virtual Type type() const;
virtual void draw(QPainter *p, QSvgExtraStates &states);
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QRectF m_rect;
int m_rx, m_ry;
@@ -205,7 +199,7 @@ public:
void addLineBreak() {m_tspans.append(LINEBREAK);}
void setWhitespaceMode(WhitespaceMode mode) {m_mode = mode;}
- //virtual QRectF bounds() const;
+ //virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
static QSvgTspan * const LINEBREAK;
@@ -248,13 +242,11 @@ public:
QSvgUse(const QPointF &start, QSvgNode *parent, QSvgNode *link);
virtual void draw(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
- virtual QRectF bounds() const;
- virtual QRectF transformedBounds(const QTransform &transform) const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
private:
QSvgNode *m_link;
QPointF m_start;
- mutable QRectF m_bounds;
};
class QSvgVideo : public QSvgNode
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 926b04d..bc4ca76 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -2962,9 +2962,9 @@ static QSvgNode *createRectNode(QSvgNode *parent,
if (nry > bounds.height()/2)
nry = bounds.height()/2;
- if (nrx && !nry)
+ if (!rx.isEmpty() && ry.isEmpty())
nry = nrx;
- else if (nry && !nrx)
+ else if (!ry.isEmpty() && rx.isEmpty())
nrx = nry;
//we draw rounded rect from 0...99
diff --git a/src/svg/qsvgnode.cpp b/src/svg/qsvgnode.cpp
index 86f2af5..f6bc1c0 100644
--- a/src/svg/qsvgnode.cpp
+++ b/src/svg/qsvgnode.cpp
@@ -45,6 +45,7 @@
#ifndef QT_NO_SVG
#include "qdebug.h"
+#include "qstack.h"
QT_BEGIN_NAMESPACE
@@ -114,12 +115,12 @@ void QSvgNode::appendStyleProperty(QSvgStyleProperty *prop, const QString &id)
}
}
-void QSvgNode::applyStyle(QPainter *p, QSvgExtraStates &states)
+void QSvgNode::applyStyle(QPainter *p, QSvgExtraStates &states) const
{
- m_style.apply(p, bounds(), this, states);
+ m_style.apply(p, this, states);
}
-void QSvgNode::revertStyle(QPainter *p, QSvgExtraStates &states)
+void QSvgNode::revertStyle(QPainter *p, QSvgExtraStates &states) const
{
m_style.revert(p, states);
}
@@ -195,11 +196,40 @@ QSvgFillStyleProperty * QSvgNode::styleProperty(const QString &id) const
return doc ? doc->namedStyle(rid) : 0;
}
-QRectF QSvgNode::bounds() const
+QRectF QSvgNode::bounds(QPainter *, QSvgExtraStates &) const
{
return QRectF(0, 0, 0, 0);
}
+QRectF QSvgNode::transformedBounds() const
+{
+ if (!m_cachedBounds.isEmpty())
+ return m_cachedBounds;
+
+ QImage dummy(1, 1, QImage::Format_RGB32);
+ QPainter p(&dummy);
+ QSvgExtraStates states;
+
+ QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ pen.setMiterLimit(4);
+ p.setPen(pen);
+
+ QStack<QSvgNode*> parentApplyStack;
+ QSvgNode *parent = m_parent;
+ while (parent) {
+ parentApplyStack.push(parent);
+ parent = parent->parent();
+ }
+
+ for (int i = parentApplyStack.size() - 1; i >= 0; --i)
+ parentApplyStack[i]->applyStyle(&p, states);
+
+ p.setWorldTransform(QTransform());
+
+ m_cachedBounds = transformedBounds(&p, states);
+ return m_cachedBounds;
+}
+
QSvgTinyDocument * QSvgNode::document() const
{
QSvgTinyDocument *doc = 0;
@@ -274,19 +304,11 @@ void QSvgNode::setVisible(bool visible)
m_visible = visible;
}
-QRectF QSvgNode::transformedBounds(const QTransform &transform) const
+QRectF QSvgNode::transformedBounds(QPainter *p, QSvgExtraStates &states) const
{
- QTransform t = transform;
-
- QSvgTransformStyle *transStyle = m_style.transform;
- if (transStyle) {
- t = transStyle->qtransform() * t;
- }
-
- QRectF rect = bounds();
-
- rect = t.mapRect(rect);
-
+ applyStyle(p, states);
+ QRectF rect = bounds(p, states);
+ revertStyle(p, states);
return rect;
}
@@ -310,15 +332,12 @@ QSvgNode::DisplayMode QSvgNode::displayMode() const
return m_displayMode;
}
-qreal QSvgNode::strokeWidth() const
+qreal QSvgNode::strokeWidth(QPainter *p)
{
- QSvgStrokeStyle *stroke = static_cast<QSvgStrokeStyle*>(
- styleProperty(QSvgStyleProperty::STROKE));
- if (!stroke)
- return 0;
- if (stroke->stroke().brush().style() == Qt::NoBrush)
+ QPen pen = p->pen();
+ if (pen.style() == Qt::NoPen || pen.brush().style() == Qt::NoBrush || pen.isCosmetic())
return 0;
- return stroke->width();
+ return pen.widthF();
}
QT_END_NAMESPACE
diff --git a/src/svg/qsvgnode_p.h b/src/svg/qsvgnode_p.h
index 15466f2..a34c7c0 100644
--- a/src/svg/qsvgnode_p.h
+++ b/src/svg/qsvgnode_p.h
@@ -118,16 +118,17 @@ public:
QSvgNode *parent() const;
void appendStyleProperty(QSvgStyleProperty *prop, const QString &id);
- void applyStyle(QPainter *p, QSvgExtraStates &states);
- void revertStyle(QPainter *p, QSvgExtraStates &states);
+ void applyStyle(QPainter *p, QSvgExtraStates &states) const;
+ void revertStyle(QPainter *p, QSvgExtraStates &states) const;
QSvgStyleProperty *styleProperty(QSvgStyleProperty::Type type) const;
QSvgFillStyleProperty *styleProperty(const QString &id) const;
QSvgTinyDocument *document() const;
virtual Type type() const =0;
- virtual QRectF bounds() const;
- virtual QRectF transformedBounds(const QTransform &transform) const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
+ virtual QRectF transformedBounds(QPainter *p, QSvgExtraStates &states) const;
+ QRectF transformedBounds() const;
void setRequiredFeatures(const QStringList &lst);
const QStringList & requiredFeatures() const;
@@ -156,9 +157,9 @@ public:
QString xmlClass() const;
void setXmlClass(const QString &str);
protected:
- QSvgStyle m_style;
+ mutable QSvgStyle m_style;
- qreal strokeWidth() const;
+ static qreal strokeWidth(QPainter *p);
private:
QSvgNode *m_parent;
@@ -174,6 +175,7 @@ private:
QString m_class;
DisplayMode m_displayMode;
+ mutable QRectF m_cachedBounds;
friend class QSvgTinyDocument;
};
diff --git a/src/svg/qsvgstructure.cpp b/src/svg/qsvgstructure.cpp
index 34426b7..db5cb9e 100644
--- a/src/svg/qsvgstructure.cpp
+++ b/src/svg/qsvgstructure.cpp
@@ -357,15 +357,12 @@ void QSvgSwitch::init()
m_systemLanguagePrefix = m_systemLanguage.mid(0, idx);
}
-QRectF QSvgStructureNode::bounds() const
+QRectF QSvgStructureNode::bounds(QPainter *p, QSvgExtraStates &states) const
{
- if (m_bounds.isEmpty()) {
- foreach(QSvgNode *node, m_renderers) {
- m_bounds |= node->transformedBounds(QTransform());
- }
- }
-
- return m_bounds;
+ QRectF bounds;
+ foreach(QSvgNode *node, m_renderers)
+ bounds |= node->transformedBounds(p, states);
+ return bounds;
}
QSvgNode * QSvgStructureNode::previousSiblingNode(QSvgNode *n) const
diff --git a/src/svg/qsvgstructure_p.h b/src/svg/qsvgstructure_p.h
index fd6eb0a..dd82fc0 100644
--- a/src/svg/qsvgstructure_p.h
+++ b/src/svg/qsvgstructure_p.h
@@ -74,14 +74,13 @@ public:
~QSvgStructureNode();
QSvgNode *scopeNode(const QString &id) const;
void addChild(QSvgNode *child, const QString &id);
- virtual QRectF bounds() const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
QSvgNode *previousSiblingNode(QSvgNode *n) const;
QList<QSvgNode*> renderers() const { return m_renderers; }
protected:
QList<QSvgNode*> m_renderers;
QHash<QString, QSvgNode*> m_scope;
QList<QSvgStructureNode*> m_linkedScopes;
- mutable QRectF m_bounds;
};
class QSvgG : public QSvgStructureNode
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index 2b12c49..0d1bad9 100644
--- a/src/svg/qsvgstyle.cpp
+++ b/src/svg/qsvgstyle.cpp
@@ -73,7 +73,7 @@ QSvgStyleProperty::~QSvgStyleProperty()
{
}
-void QSvgFillStyleProperty::apply(QPainter *, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgFillStyleProperty::apply(QPainter *, const QSvgNode *, QSvgExtraStates &)
{
Q_ASSERT(!"This should not be called!");
}
@@ -89,7 +89,7 @@ QSvgQualityStyle::QSvgQualityStyle(int color)
{
}
-void QSvgQualityStyle::apply(QPainter *, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgQualityStyle::apply(QPainter *, const QSvgNode *, QSvgExtraStates &)
{
}
@@ -136,7 +136,7 @@ void QSvgFillStyle::setBrush(QBrush brush)
m_fillSet = 1;
}
-void QSvgFillStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &states)
+void QSvgFillStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states)
{
m_oldFill = p->brush();
m_oldFillRule = states.fillRule;
@@ -169,7 +169,7 @@ QSvgViewportFillStyle::QSvgViewportFillStyle(const QBrush &brush)
{
}
-void QSvgViewportFillStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgViewportFillStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
{
m_oldFill = p->brush();
p->setBrush(m_viewportFill);
@@ -224,7 +224,7 @@ int QSvgFontStyle::SVGToQtWeight(int weight) {
return QFont::Normal;
}
-void QSvgFontStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &states)
+void QSvgFontStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states)
{
m_oldQFont = p->font();
m_oldSvgFont = states.svgFont;
@@ -292,7 +292,7 @@ QSvgStrokeStyle::QSvgStrokeStyle()
{
}
-void QSvgStrokeStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &states)
+void QSvgStrokeStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states)
{
m_oldStroke = p->pen();
m_oldStrokeOpacity = states.strokeOpacity;
@@ -443,7 +443,7 @@ QSvgTransformStyle::QSvgTransformStyle(const QTransform &trans)
{
}
-void QSvgTransformStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgTransformStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
{
m_oldWorldTransform = p->worldTransform();
p->setWorldTransform(m_transform, true);
@@ -501,7 +501,7 @@ QSvgCompOpStyle::QSvgCompOpStyle(QPainter::CompositionMode mode)
}
-void QSvgCompOpStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgCompOpStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
{
m_oldMode = p->compositionMode();
p->setCompositionMode(m_mode);
@@ -521,34 +521,34 @@ QSvgStyle::~QSvgStyle()
{
}
-void QSvgStyle::apply(QPainter *p, const QRectF &rect, QSvgNode *node, QSvgExtraStates &states)
+void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
{
if (quality) {
- quality->apply(p, rect, node, states);
+ quality->apply(p, node, states);
}
if (fill) {
- fill->apply(p, rect, node, states);
+ fill->apply(p, node, states);
}
if (viewportFill) {
- viewportFill->apply(p, rect, node, states);
+ viewportFill->apply(p, node, states);
}
if (font) {
- font->apply(p, rect, node, states);
+ font->apply(p, node, states);
}
if (stroke) {
- stroke->apply(p, rect, node, states);
+ stroke->apply(p, node, states);
}
if (transform) {
- transform->apply(p, rect, node, states);
+ transform->apply(p, node, states);
}
if (animateColor) {
- animateColor->apply(p, rect, node, states);
+ animateColor->apply(p, node, states);
}
//animated transforms have to be applied
@@ -572,16 +572,16 @@ void QSvgStyle::apply(QPainter *p, const QRectF &rect, QSvgNode *node, QSvgExtra
// Apply the animateTransforms after and including the last one with additive="replace".
for (; itr != animateTransforms.constEnd(); ++itr) {
if ((*itr)->animActive(totalTimeElapsed))
- (*itr)->apply(p, rect, node, states);
+ (*itr)->apply(p, node, states);
}
}
if (opacity) {
- opacity->apply(p, rect, node, states);
+ opacity->apply(p, node, states);
}
if (compop) {
- compop->apply(p, rect, node, states);
+ compop->apply(p, node, states);
}
}
@@ -655,7 +655,7 @@ void QSvgAnimateTransform::setArgs(TransformType type, Additive additive, const
m_count = args.count() / 3;
}
-void QSvgAnimateTransform::apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &)
+void QSvgAnimateTransform::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &)
{
m_oldWorldTransform = p->worldTransform();
resolveMatrix(node);
@@ -669,7 +669,7 @@ void QSvgAnimateTransform::revert(QPainter *p, QSvgExtraStates &)
m_transformApplied = false;
}
-void QSvgAnimateTransform::resolveMatrix(QSvgNode *node)
+void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node)
{
static const qreal deg2rad = qreal(0.017453292519943295769);
qreal totalTimeElapsed = node->document()->currentElapsed();
@@ -834,7 +834,7 @@ void QSvgAnimateColor::setRepeatCount(qreal repeatCount)
m_repeatCount = repeatCount;
}
-void QSvgAnimateColor::apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &)
+void QSvgAnimateColor::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &)
{
qreal totalTimeElapsed = node->document()->currentElapsed();
if (totalTimeElapsed < m_from || m_finished)
@@ -912,7 +912,7 @@ QSvgOpacityStyle::QSvgOpacityStyle(qreal opacity)
}
-void QSvgOpacityStyle::apply(QPainter *p, const QRectF &, QSvgNode *, QSvgExtraStates &)
+void QSvgOpacityStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
{
m_oldOpacity = p->opacity();
p->setOpacity(m_opacity * m_oldOpacity);
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h
index 202de93..af3b4e5 100644
--- a/src/svg/qsvgstyle_p.h
+++ b/src/svg/qsvgstyle_p.h
@@ -172,7 +172,7 @@ public:
};
public:
virtual ~QSvgStyleProperty();
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states) =0;
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states) = 0;
virtual void revert(QPainter *p, QSvgExtraStates &states) =0;
virtual Type type() const=0;
};
@@ -181,7 +181,7 @@ class QSvgFillStyleProperty : public QSvgStyleProperty
{
public:
virtual QBrush brush(QPainter *p, QSvgExtraStates &states) = 0;
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
};
@@ -189,7 +189,7 @@ class QSvgQualityStyle : public QSvgStyleProperty
{
public:
QSvgQualityStyle(int color);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
private:
@@ -221,7 +221,7 @@ class QSvgOpacityStyle : public QSvgStyleProperty
{
public:
QSvgOpacityStyle(qreal opacity);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
private:
@@ -233,7 +233,7 @@ class QSvgFillStyle : public QSvgStyleProperty
{
public:
QSvgFillStyle();
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -306,7 +306,7 @@ class QSvgViewportFillStyle : public QSvgStyleProperty
{
public:
QSvgViewportFillStyle(const QBrush &brush);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -330,7 +330,7 @@ public:
QSvgFontStyle(QSvgFont *font, QSvgTinyDocument *doc);
QSvgFontStyle();
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -410,7 +410,7 @@ class QSvgStrokeStyle : public QSvgStyleProperty
{
public:
QSvgStrokeStyle();
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -617,7 +617,7 @@ class QSvgTransformStyle : public QSvgStyleProperty
{
public:
QSvgTransformStyle(const QTransform &transform);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -654,7 +654,7 @@ public:
void setArgs(TransformType type, Additive additive, const QVector<qreal> &args);
void setFreeze(bool freeze);
void setRepeatCount(qreal repeatCount);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
QSvgAnimateTransform::Additive additiveType() const
@@ -688,7 +688,7 @@ public:
}
protected:
- void resolveMatrix(QSvgNode *node);
+ void resolveMatrix(const QSvgNode *node);
private:
qreal m_from, m_to, m_by;
qreal m_totalRunningTime;
@@ -712,7 +712,7 @@ public:
void setArgs(bool fill, const QList<QColor> &colors);
void setFreeze(bool freeze);
void setRepeatCount(qreal repeatCount);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
private:
@@ -732,7 +732,7 @@ class QSvgCompOpStyle : public QSvgStyleProperty
{
public:
QSvgCompOpStyle(QPainter::CompositionMode mode);
- virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states);
+ virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
virtual void revert(QPainter *p, QSvgExtraStates &states);
virtual Type type() const;
@@ -766,7 +766,7 @@ public:
{}
~QSvgStyle();
- void apply(QPainter *p, const QRectF &rect, QSvgNode *node, QSvgExtraStates &states);
+ void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states);
void revert(QPainter *p, QSvgExtraStates &states);
QSvgRefCounter<QSvgQualityStyle> quality;
QSvgRefCounter<QSvgFillStyle> fill;
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
index 17618f7..b21b99f 100644
--- a/src/svg/qsvgtinydocument.cpp
+++ b/src/svg/qsvgtinydocument.cpp
@@ -277,7 +277,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id,
p->save();
- const QRectF elementBounds = node->transformedBounds(QTransform());
+ const QRectF elementBounds = node->transformedBounds();
mapSourceToTarget(p, bounds, elementBounds);
QTransform originalTransform = p->worldTransform();
@@ -299,7 +299,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id,
for (int i = parentApplyStack.size() - 1; i >= 0; --i)
parentApplyStack[i]->applyStyle(p, m_states);
-
+
// Reset the world transform so that our parents don't affect
// the position
QTransform currentTransform = p->worldTransform();
@@ -432,8 +432,7 @@ QRectF QSvgTinyDocument::boundsOnElement(const QString &id) const
const QSvgNode *node = scopeNode(id);
if (!node)
node = this;
-
- return node->transformedBounds(QTransform());
+ return node->transformedBounds();
}
bool QSvgTinyDocument::elementExists(const QString &id) const
diff --git a/src/svg/qsvgtinydocument_p.h b/src/svg/qsvgtinydocument_p.h
index c03c798..3b40770 100644
--- a/src/svg/qsvgtinydocument_p.h
+++ b/src/svg/qsvgtinydocument_p.h
@@ -173,9 +173,8 @@ inline bool QSvgTinyDocument::heightPercent() const
inline QRectF QSvgTinyDocument::viewBox() const
{
- if (m_viewBox.isNull()) {
- m_viewBox = transformedBounds(QTransform());
- }
+ if (m_viewBox.isNull())
+ m_viewBox = transformedBounds();
return m_viewBox;
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 4590f17..63e22cc 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -980,7 +980,7 @@ static void qParseArgs(int argc, char *argv[])
" -xunitxml : Outputs results as XML XUnit document\n"
" -xml : Outputs results as XML document\n"
" -lightxml : Outputs results as stream of XML tags\n"
- " -flush : Flushes the resutls\n"
+ " -flush : Flushes the results\n"
" -o filename: Writes all output into a file\n"
" -silent : Only outputs warnings and failures\n"
" -v1 : Print enter messages for each testfunction\n"
diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp
index 6ed28af..fd0b95c 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp
@@ -264,16 +264,31 @@ XsdSchemaParser::XsdSchemaParser(const XsdSchemaContext::Ptr &context, const Xsd
setupBuiltinTypeNames();
}
+void XsdSchemaParser::addIncludedSchemas(const NamespaceSet &schemas)
+{
+ m_includedSchemas += schemas;
+}
+
void XsdSchemaParser::setIncludedSchemas(const NamespaceSet &schemas)
{
m_includedSchemas = schemas;
}
+void XsdSchemaParser::addImportedSchemas(const NamespaceSet &schemas)
+{
+ m_importedSchemas += schemas;
+}
+
void XsdSchemaParser::setImportedSchemas(const NamespaceSet &schemas)
{
m_importedSchemas = schemas;
}
+void XsdSchemaParser::addRedefinedSchemas(const NamespaceSet &schemas)
+{
+ m_redefinedSchemas += schemas;
+}
+
void XsdSchemaParser::setRedefinedSchemas(const NamespaceSet &schemas)
{
m_redefinedSchemas = schemas;
@@ -297,6 +312,7 @@ void XsdSchemaParser::setDocumentURI(const QUrl &uri)
// prevent to get included/imported/redefined twice
m_includedSchemas.insert(uri);
m_importedSchemas.insert(uri);
+ m_redefinedSchemas.insert(uri);
}
QUrl XsdSchemaParser::documentURI() const
@@ -594,8 +610,14 @@ void XsdSchemaParser::parseInclude()
parser.setIncludedSchemas(m_includedSchemas);
parser.setImportedSchemas(m_importedSchemas);
parser.setRedefinedSchemas(m_redefinedSchemas);
- if (!parser.parse(XsdSchemaParser::IncludeParser))
+ if (!parser.parse(XsdSchemaParser::IncludeParser)) {
return;
+ } else {
+ // add indirectly loaded schemas to the list of already loaded ones
+ addIncludedSchemas(parser.m_includedSchemas);
+ addImportedSchemas(parser.m_importedSchemas);
+ addRedefinedSchemas(parser.m_redefinedSchemas);
+ }
}
}
@@ -684,8 +706,14 @@ void XsdSchemaParser::parseImport()
parser.setIncludedSchemas(m_includedSchemas);
parser.setImportedSchemas(m_importedSchemas);
parser.setRedefinedSchemas(m_redefinedSchemas);
- if (!parser.parse(XsdSchemaParser::ImportParser))
+ if (!parser.parse(XsdSchemaParser::ImportParser)) {
return;
+ } else {
+ // add indirectly loaded schemas to the list of already loaded ones
+ addIncludedSchemas(parser.m_includedSchemas);
+ addImportedSchemas(parser.m_importedSchemas);
+ addRedefinedSchemas(parser.m_redefinedSchemas);
+ }
}
}
} else {
@@ -702,8 +730,14 @@ void XsdSchemaParser::parseImport()
parser.setIncludedSchemas(m_includedSchemas);
parser.setImportedSchemas(m_importedSchemas);
parser.setRedefinedSchemas(m_redefinedSchemas);
- if (!parser.parse(XsdSchemaParser::ImportParser))
+ if (!parser.parse(XsdSchemaParser::ImportParser)) {
return;
+ } else {
+ // add indirectly loaded schemas to the list of already loaded ones
+ addIncludedSchemas(parser.m_includedSchemas);
+ addImportedSchemas(parser.m_importedSchemas);
+ addRedefinedSchemas(parser.m_redefinedSchemas);
+ }
}
}
} else {
@@ -839,8 +873,14 @@ void XsdSchemaParser::parseRedefine()
parser.setIncludedSchemas(m_includedSchemas);
parser.setImportedSchemas(m_importedSchemas);
parser.setRedefinedSchemas(m_redefinedSchemas);
- if (!parser.parse(XsdSchemaParser::RedefineParser))
+ if (!parser.parse(XsdSchemaParser::RedefineParser)) {
return;
+ } else {
+ // add indirectly loaded schemas to the list of already loaded ones
+ addIncludedSchemas(parser.m_includedSchemas);
+ addImportedSchemas(parser.m_importedSchemas);
+ addRedefinedSchemas(parser.m_redefinedSchemas);
+ }
delete reply;
}
diff --git a/src/xmlpatterns/schema/qxsdschemaparser_p.h b/src/xmlpatterns/schema/qxsdschemaparser_p.h
index ad5e9ce..80d44a5 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser_p.h
+++ b/src/xmlpatterns/schema/qxsdschemaparser_p.h
@@ -120,20 +120,38 @@ namespace QPatternist
typedef QSet<QUrl> NamespaceSet;
/**
+ * Adds @p schemas to the list of already included schemas, so the parser
+ * can detect multiple includes of the same schema.
+ */
+ void addIncludedSchemas(const NamespaceSet &schemas);
+
+ /**
* Sets which @p schemas have been included already, so the parser
- * can detect circular includes.
+ * can detect multiple includes of the same schema.
*/
void setIncludedSchemas(const NamespaceSet &schemas);
/**
+ * Adds @p schemas to the list of already imported schemas, so the parser
+ * can detect multiple imports of the same schema.
+ */
+ void addImportedSchemas(const NamespaceSet &schemas);
+
+ /**
* Sets which @p schemas have been imported already, so the parser
* can detect circular imports.
*/
void setImportedSchemas(const NamespaceSet &schemas);
/**
+ * Adds @p schemas to the list of already redefined schemas, so the parser
+ * can detect multiple redefines of the same schema.
+ */
+ void addRedefinedSchemas(const NamespaceSet &schemas);
+
+ /**
* Sets which @p schemas have been redefined already, so the parser
- * can detect circular redefines.
+ * can detect multiple redefines of the same schema.
*/
void setRedefinedSchemas(const NamespaceSet &schemas);
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index 9d8ba6c..6b7d57f 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -373,7 +373,6 @@ void tst_qdeclarativeanchors::crash1()
QString expect = "QML Text (" + source.toString() + ":4:5" + ") Possible anchor loop detected on fill.";
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
- QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); // XXX ideally, should be one message
QDeclarativeView *view = new QDeclarativeView(source);
qApp->processEvents();
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
index 12b1b7b..5e1891a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
@@ -10,7 +10,7 @@ Rectangle {
width: 100; height: 100
color: Qt.rgba(1,0,0)
Behavior on x {
- NumberAnimation { objectName: "MyAnim"; running: true }
+ NumberAnimation {id: myAnim; objectName: "MyAnim"; running: true }
}
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
index 6419a6b..11b2d3a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -8,8 +8,8 @@ Rectangle {
width: 100; height: 100; color: "green"
Behavior on x {
objectName: "MyBehavior"
- NumberAnimation { duration: 200 }
- NumberAnimation { duration: 1000 }
+ NumberAnimation {id: na1; duration: 200 }
+ NumberAnimation {id: na2; duration: 1000 }
}
}
MouseArea {
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
index c28fa9a..5e72bca 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
@@ -8,7 +8,7 @@ Rectangle {
width: 100; height: 100; color: "green"
Behavior on x {
objectName: "MyBehavior";
- NumberAnimation { duration: 500; }
+ NumberAnimation {id: na; duration: 500; }
}
}
MouseArea {
diff --git a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
index f0117f5..b212820 100644
--- a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
+++ b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
@@ -58,7 +58,7 @@ private slots:
void engineMethod();
void parentContext();
void setContextProperty();
- void addDefaultObject();
+ void setContextObject();
void destruction();
void idAsContextProperty();
@@ -224,24 +224,6 @@ private:
int _c;
};
-class TestObject2 : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int b READ b NOTIFY bChanged)
-
-public:
- TestObject2() : _b(10) {}
-
- int b() const { return _b; }
- void setB(int b) { _b = b; emit bChanged(); }
-
-signals:
- void bChanged();
-
-private:
- int _b;
-};
-
#define TEST_CONTEXT_PROPERTY(ctxt, name, value) \
{ \
QDeclarativeComponent component(&engine); \
@@ -367,35 +349,31 @@ void tst_qdeclarativecontext::setContextProperty()
}
}
-void tst_qdeclarativecontext::addDefaultObject()
+void tst_qdeclarativecontext::setContextObject()
{
QDeclarativeContext ctxt(&engine);
TestObject to;
- TestObject2 to2;
to.setA(2);
to.setB(192);
to.setC(18);
- to2.setB(111999);
- ctxt.addDefaultObject(&to2);
- ctxt.addDefaultObject(&to);
+ ctxt.setContextObject(&to);
ctxt.setContextProperty("c", QVariant(9));
// Static context properties
TEST_CONTEXT_PROPERTY(&ctxt, a, QVariant(2));
- TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(111999));
+ TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(192));
TEST_CONTEXT_PROPERTY(&ctxt, c, QVariant(9));
to.setA(12);
to.setB(100);
to.setC(7);
- to2.setB(1612);
ctxt.setContextProperty("c", QVariant(3));
TEST_CONTEXT_PROPERTY(&ctxt, a, QVariant(12));
- TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(1612));
+ TEST_CONTEXT_PROPERTY(&ctxt, b, QVariant(100));
TEST_CONTEXT_PROPERTY(&ctxt, c, QVariant(3));
// Changes in context properties
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
new file mode 100644
index 0000000..72edf6e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml
@@ -0,0 +1,5 @@
+import Qt 4.6
+
+QtObject {
+ Component.onCompleted: { var a = getObject(); a = null; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
new file mode 100644
index 0000000..5897e2a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml
@@ -0,0 +1,6 @@
+import Qt 4.6
+
+QtObject {
+ property int test: getObjects().length
+ property bool test2: getObjects()[0].trueProperty
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
index 6a04704..ce505f3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp
@@ -74,12 +74,12 @@ private:
void registerTypes()
{
- QML_REGISTER_TYPE(Qt.test, 1,0, MyQmlObject,MyQmlObject);
- QML_REGISTER_TYPE(Qt.test, 1,0, MyDeferredObject,MyDeferredObject);
- QML_REGISTER_TYPE(Qt.test, 1,0, MyQmlContainer,MyQmlContainer);
- QML_REGISTER_EXTENDED_TYPE(Qt.test, 1,0, MyBaseExtendedObject,MyBaseExtendedObject,BaseExtensionObject);
- QML_REGISTER_EXTENDED_TYPE(Qt.test, 1,0, MyExtendedObject,MyExtendedObject,ExtensionObject);
- QML_REGISTER_TYPE(Qt.test, 1,0, MyTypeObject, MyTypeObject);
+ qmlRegisterType<MyQmlObject>("Qt.test", 1,0, "MyQmlObject");
+ qmlRegisterType<MyDeferredObject>("Qt.test", 1,0, "MyDeferredObject");
+ qmlRegisterType<MyQmlContainer>("Qt.test", 1,0, "MyQmlContainer");
+ qmlRegisterExtendedType<MyBaseExtendedObject, BaseExtensionObject>("Qt.test", 1,0, "MyBaseExtendedObject");
+ qmlRegisterExtendedType<MyExtendedObject, ExtensionObject>("Qt.test", 1,0, "MyExtendedObject");
+ qmlRegisterType<MyTypeObject>("Qt.test", 1,0, "MyTypeObject");
}
#include "testtypes.moc"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index a283e3f..78a5e0f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -207,18 +207,10 @@ class MyDefaultObject1 : public QObject
Q_OBJECT
Q_PROPERTY(int horseLegs READ horseLegs CONSTANT);
Q_PROPERTY(int antLegs READ antLegs CONSTANT);
+ Q_PROPERTY(int emuLegs READ emuLegs CONSTANT);
public:
int horseLegs() const { return 4; }
int antLegs() const { return 6; }
-};
-
-class MyDefaultObject2 : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int antLegs READ antLegs CONSTANT);
- Q_PROPERTY(int emuLegs READ emuLegs CONSTANT);
-public:
- int antLegs() const { return 5; } // Had an accident
int emuLegs() const { return 2; }
};
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 4838288..caefdbf 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -126,6 +126,8 @@ private slots:
void attachedPropertyScope();
void scriptConnect();
void scriptDisconnect();
+ void ownership();
+ void qlistqobjectMethods();
void bug1();
@@ -348,7 +350,6 @@ void tst_qdeclarativeecmascript::basicExpressions()
MyQmlObject object2;
MyQmlObject object3;
MyDefaultObject1 default1;
- MyDefaultObject2 default2;
MyDefaultObject3 default3;
object1.setStringProperty("Object1");
object2.setStringProperty("Object2");
@@ -357,13 +358,12 @@ void tst_qdeclarativeecmascript::basicExpressions()
QDeclarativeContext context(engine.rootContext());
QDeclarativeContext nestedContext(&context);
- context.addDefaultObject(&default1);
- context.addDefaultObject(&default2);
+ context.setContextObject(&default1);
context.setContextProperty("a", QVariant(1944));
context.setContextProperty("b", QVariant("Milk"));
context.setContextProperty("object", &object1);
context.setContextProperty("objectOverride", &object2);
- nestedContext.addDefaultObject(&default3);
+ nestedContext.setContextObject(&default3);
nestedContext.setContextProperty("b", QVariant("Cow"));
nestedContext.setContextProperty("objectOverride", &object3);
nestedContext.setContextProperty("millipedeLegs", QVariant(100));
@@ -889,6 +889,7 @@ void tst_qdeclarativeecmascript::dynamicDestruction()
}
QVERIFY(!createdQmlObject);
+ QDeclarativeEngine::setObjectOwnership(object, QDeclarativeEngine::JavaScriptOwnership);
QMetaObject::invokeMethod(object, "killMe");
QVERIFY(object);
QTest::qWait(0);
@@ -1636,7 +1637,7 @@ void tst_qdeclarativeecmascript::listToVariant()
MyQmlContainer container;
QDeclarativeContext context(engine.rootContext());
- context.addDefaultObject(&container);
+ context.setContextObject(&container);
QObject *object = component.create(&context);
QVERIFY(object != 0);
@@ -1890,7 +1891,94 @@ void tst_qdeclarativeecmascript::scriptDisconnect()
delete object;
}
+}
+
+class OwnershipObject : public QObject
+{
+ Q_OBJECT
+public:
+ OwnershipObject() { object = new QObject; }
+
+ QPointer<QObject> object;
+
+public slots:
+ QObject *getObject() { return object; }
+};
+
+void tst_qdeclarativeecmascript::ownership()
+{
+ OwnershipObject own;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextObject(&own);
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("ownership.qml"));
+
+ QVERIFY(own.object != 0);
+
+ QObject *object = component.create(context);
+ QDeclarativeEnginePrivate::getScriptEngine(&engine)->collectGarbage();
+
+ QCoreApplication::processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(own.object == 0);
+
+ delete object;
+ }
+
+ own.object = new QObject(&own);
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("ownership.qml"));
+
+ QVERIFY(own.object != 0);
+
+ QObject *object = component.create(context);
+ QDeclarativeEnginePrivate::getScriptEngine(&engine)->collectGarbage();
+ QCoreApplication::processEvents(QEventLoop::DeferredDeletion);
+
+ QVERIFY(own.object != 0);
+
+ delete object;
+ }
+}
+
+class QListQObjectMethodsObject : public QObject
+{
+ Q_OBJECT
+public:
+ QListQObjectMethodsObject() {
+ m_objects.append(new MyQmlObject());
+ m_objects.append(new MyQmlObject());
+ }
+
+ ~QListQObjectMethodsObject() {
+ qDeleteAll(m_objects);
+ }
+
+public slots:
+ QList<QObject *> getObjects() { return m_objects; }
+
+private:
+ QList<QObject *> m_objects;
+};
+
+// Tests that returning a QList<QObject*> from a method works
+void tst_qdeclarativeecmascript::qlistqobjectMethods()
+{
+ QListQObjectMethodsObject obj;
+ QDeclarativeContext *context = new QDeclarativeContext(engine.rootContext());
+ context->setContextObject(&obj);
+
+ QDeclarativeComponent component(&engine, TEST_FILE("qlistqobjectMethods.qml"));
+
+ QObject *object = component.create(context);
+
+ QCOMPARE(object->property("test").toInt(), 2);
+ QCOMPARE(object->property("test2").toBool(), true);
+
+ delete object;
}
QTEST_MAIN(tst_qdeclarativeecmascript)
diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
index 0c736b4..3ba50be 100644
--- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
+++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
@@ -1,8 +1,9 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
+contains(QT_CONFIG,declarative): QT += declarative gui network
macx:CONFIG -= app_bundle
-SOURCES += tst_qdeclarativefontloader.cpp
+HEADERS += ../shared/testhttpserver.h
+SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
index a9762df..375e801 100644
--- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
+++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp
@@ -43,6 +43,9 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <private/qdeclarativefontloader_p.h>
#include "../../../shared/util.h"
+#include "../shared/testhttpserver.h"
+
+#define SERVER_PORT 14445
class tst_qdeclarativefontloader : public QObject
@@ -57,16 +60,21 @@ private slots:
void localFont();
void failLocalFont();
void webFont();
+ void redirWebFont();
void failWebFont();
private slots:
private:
QDeclarativeEngine engine;
+ TestHTTPServer server;
};
-tst_qdeclarativefontloader::tst_qdeclarativefontloader()
+tst_qdeclarativefontloader::tst_qdeclarativefontloader() :
+ server(SERVER_PORT)
{
+ server.serveDirectory(SRCDIR "/data");
+ Q_ASSERT(server.isValid());
}
void tst_qdeclarativefontloader::noFont()
@@ -126,21 +134,38 @@ void tst_qdeclarativefontloader::failLocalFont()
void tst_qdeclarativefontloader::webFont()
{
- QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://www.princexml.com/fonts/steffmann/Starburst.ttf\" }";
+ QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://localhost:14445/tarzeau_ocr_a.ttf\" }";
+ QDeclarativeComponent component(&engine);
+
+ component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
+
+ QVERIFY(fontObject != 0);
+ QVERIFY(fontObject->source() != QUrl(""));
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
+ QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
+}
+
+void tst_qdeclarativefontloader::redirWebFont()
+{
+ server.addRedirect("olddir/oldname.ttf","../tarzeau_ocr_a.ttf");
+
+ QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://localhost:14445/olddir/oldname.ttf\" }";
QDeclarativeComponent component(&engine);
+
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
QVERIFY(fontObject != 0);
QVERIFY(fontObject->source() != QUrl(""));
- QTRY_COMPARE(fontObject->name(), QString("Starburst"));
+ QTRY_COMPARE(fontObject->name(), QString("OCRA"));
QTRY_VERIFY(fontObject->status() == QDeclarativeFontLoader::Ready);
}
void tst_qdeclarativefontloader::failWebFont()
{
- QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://wrong.address.com/Starburst.ttf\" }";
- QTest::ignoreMessage(QtWarningMsg, "Cannot load font: QUrl( \"http://wrong.address.com/Starburst.ttf\" ) ");
+ QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://localhost:14445/nonexist.ttf\" }";
+ QTest::ignoreMessage(QtWarningMsg, "Cannot load font: QUrl( \"http://localhost:14445/nonexist.ttf\" ) ");
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create());
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
new file mode 100644
index 0000000..e45c4c3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml
@@ -0,0 +1,56 @@
+import Qt 4.6
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+ Component {
+ id: myDelegate
+ Item {
+ id: wrapper
+ objectName: "wrapper"
+ height: 100
+ width: 100
+ Text {
+ text: index
+ }
+ Text {
+ y: 25
+ id: textName
+ objectName: "textName"
+ text: name
+ }
+ Text {
+ y: 50
+ id: textNumber
+ objectName: "textNumber"
+ text: number
+ }
+ Text {
+ y: 75
+ text: wrapper.y
+ }
+ }
+ }
+
+ Component {
+ id: myHighlight
+ Rectangle {
+ color: "lightsteelblue"
+ }
+ }
+
+ GridView {
+ id: grid
+ objectName: "grid"
+ width: 240
+ height: 320
+ model: testModel
+ delegate: myDelegate
+ highlight: myHighlight
+ preferredHighlightBegin: 100
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
+ focus: true
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
index 32833d2..cc3e549 100644
--- a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
+++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml
@@ -1,6 +1,7 @@
import Qt 4.6
Rectangle {
+ property int current: grid.currentIndex
width: 240
height: 320
color: "#ffffff"
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index aeefea1..385d6f5 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -72,6 +72,7 @@ private slots:
void modelChanges();
void positionViewAtIndex();
void resetModel();
+ void enforceRange();
void QTBUG_8456();
private:
@@ -702,6 +703,11 @@ void tst_QDeclarativeGridView::currentIndex()
QCOMPARE(gridview->highlightItem()->x(), hlPosX);
QCOMPARE(gridview->highlightItem()->y(), hlPosY);
+ // insert item before currentIndex
+ gridview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QCOMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
delete canvas;
}
@@ -943,7 +949,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on a currently visible item
- gridview->positionViewAtIndex(4);
+ gridview->positionViewAtIndex(4, QDeclarativeGridView::Beginning);
QCOMPARE(gridview->contentY(), 60.);
// Confirm items positioned correctly
@@ -957,7 +963,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on an item beyond the visible items
- gridview->positionViewAtIndex(21);
+ gridview->positionViewAtIndex(21, QDeclarativeGridView::Beginning);
QCOMPARE(gridview->contentY(), 420.);
// Confirm items positioned correctly
@@ -971,7 +977,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position on an item that would leave empty space if positioned at the top
- gridview->positionViewAtIndex(31);
+ gridview->positionViewAtIndex(31, QDeclarativeGridView::Beginning);
QCOMPARE(gridview->contentY(), 520.);
// Confirm items positioned correctly
@@ -985,7 +991,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
}
// Position at the beginning again
- gridview->positionViewAtIndex(0);
+ gridview->positionViewAtIndex(0, QDeclarativeGridView::Beginning);
QCOMPARE(gridview->contentY(), 0.);
// Confirm items positioned correctly
@@ -998,6 +1004,47 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
QCOMPARE(item->y(), (i/3)*60.);
}
+ // Position at End
+ gridview->positionViewAtIndex(30, QDeclarativeGridView::End);
+ QCOMPARE(gridview->contentY(), 340.);
+
+ // Position in Center
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Center);
+ QCOMPARE(gridview->contentY(), 170.);
+
+ // Ensure at least partially visible
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 170.);
+
+ gridview->setContentY(302);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 302.);
+
+ gridview->setContentY(360);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 300.);
+
+ gridview->setContentY(60);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 60.);
+
+ gridview->setContentY(20);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Visible);
+ QCOMPARE(gridview->contentY(), 100.);
+
+ // Ensure completely visible
+ gridview->setContentY(120);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QCOMPARE(gridview->contentY(), 120.);
+
+ gridview->setContentY(302);
+ gridview->positionViewAtIndex(15, QDeclarativeGridView::Contain);
+ QCOMPARE(gridview->contentY(), 300.);
+
+ gridview->setContentY(60);
+ gridview->positionViewAtIndex(20, QDeclarativeGridView::Contain);
+ QCOMPARE(gridview->contentY(), 100.);
+
delete canvas;
}
@@ -1042,6 +1089,53 @@ void tst_QDeclarativeGridView::resetModel()
}
}
+void tst_QDeclarativeGridView::enforceRange()
+{
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview-enforcerange.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QCOMPARE(gridview->preferredHighlightBegin(), 100.0);
+ QCOMPARE(gridview->preferredHighlightEnd(), 100.0);
+ QCOMPARE(gridview->highlightRangeMode(), QDeclarativeGridView::StrictlyEnforceRange);
+
+ QDeclarativeItem *viewport = gridview->viewport();
+ QVERIFY(viewport != 0);
+
+ // view should be positioned at the top of the range.
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(viewport, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(gridview->contentY(), -100.0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(viewport, "textName", 0);
+ QVERIFY(name != 0);
+ QCOMPARE(name->text(), model.name(0));
+ QDeclarativeText *number = findItem<QDeclarativeText>(viewport, "textNumber", 0);
+ QVERIFY(number != 0);
+ QCOMPARE(number->text(), model.number(0));
+
+ // Check currentIndex is updated when viewport moves
+ gridview->setContentY(0);
+ QCOMPARE(gridview->currentIndex(), 2);
+
+ gridview->setCurrentIndex(5);
+ QTest::qWait(500);
+ QCOMPARE(gridview->contentY(), 100.);
+
+ delete canvas;
+}
+
void tst_QDeclarativeGridView::QTBUG_8456()
{
QDeclarativeView *canvas = createView();
diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
index 636c5e3..5f6d9a4 100644
--- a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
+++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
@@ -93,7 +93,7 @@ void tst_qdeclarativeinstruction::dump()
QDeclarativeInstruction i;
i.line = 2;
i.type = QDeclarativeInstruction::SetId;
- i.setId.value = 0;
+ i.setId.value = data->primitives.count() - 1;
i.setId.index = 0;
data->bytecode << i;
}
@@ -171,17 +171,17 @@ void tst_qdeclarativeinstruction::dump()
i.line = 10;
i.type = QDeclarativeInstruction::StoreString;
i.storeString.propertyIndex = 7;
- i.storeString.value = 1;
+ i.storeString.value = data->primitives.count() - 1;
data->bytecode << i;
}
{
- data->primitives << "http://www.nokia.com";
+ data->urls << QUrl("http://www.nokia.com");
QDeclarativeInstruction i;
i.line = 11;
i.type = QDeclarativeInstruction::StoreUrl;
i.storeUrl.propertyIndex = 8;
- i.storeUrl.value = 2;
+ i.storeUrl.value = data->urls.count() - 1;
data->bytecode << i;
}
@@ -290,7 +290,7 @@ void tst_qdeclarativeinstruction::dump()
i.line = 23;
i.type = QDeclarativeInstruction::StoreVariant;
i.storeString.propertyIndex = 20;
- i.storeString.value = 3;
+ i.storeString.value = data->primitives.count() - 1;
data->bytecode << i;
}
@@ -326,7 +326,7 @@ void tst_qdeclarativeinstruction::dump()
i.line = 27;
i.type = QDeclarativeInstruction::StoreSignal;
i.storeSignal.signalIndex = 2;
- i.storeSignal.value = 4;
+ i.storeSignal.value = data->primitives.count() - 1;
data->bytecode << i;
}
@@ -527,7 +527,7 @@ void tst_qdeclarativeinstruction::dump()
<< "8\t\t8\tSTORE_INTEGER\t\t5\t9"
<< "9\t\t9\tSTORE_BOOL\t\t6\ttrue"
<< "10\t\t10\tSTORE_STRING\t\t7\t1\t\t\"Test String\""
- << "11\t\t11\tSTORE_URL\t\t8\t2\t\t\"http://www.nokia.com\""
+ << "11\t\t11\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") "
<< "12\t\t12\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\""
<< "13\t\t13\tSTORE_DATE\t\t10\t9"
<< "14\t\t14\tSTORE_TIME\t\t11\t33"
@@ -539,11 +539,11 @@ void tst_qdeclarativeinstruction::dump()
<< "20\t\t20\tSTORE_RECT\t\t17\t2"
<< "21\t\t21\tSTORE_RECTF\t\t18\t19"
<< "22\t\t22\tSTORE_VECTOR3D\t\t19\t9"
- << "23\t\t23\tSTORE_VARIANT\t\t20\t3\t\t\"color(1, 1, 1, 1)\""
+ << "23\t\t23\tSTORE_VARIANT\t\t20\t2\t\t\"color(1, 1, 1, 1)\""
<< "24\t\t24\tSTORE_OBJECT\t\t21"
<< "25\t\t25\tSTORE_VARIANT_OBJECT\t22"
<< "26\t\t26\tSTORE_INTERFACE\t\t23"
- << "27\t\t27\tSTORE_SIGNAL\t\t2\t4\t\t\"console.log(1921)\""
+ << "27\t\t27\tSTORE_SIGNAL\t\t2\t3\t\t\"console.log(1921)\""
<< "28\t\t28\tSTORE_SCRIPT\t\t2"
<< "29\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1"
<< "30\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\""
diff --git a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml
new file mode 100644
index 0000000..bf4dd85
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+
+Item {
+ Item {
+ objectName: "item"
+ }
+ Item {
+ objectName: "parentItem"
+ }
+} \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index bbcc86e..45d670f 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -60,6 +60,7 @@ private slots:
void clip();
void mapCoordinates();
void mapCoordinates_data();
+ void propertyChanges();
private:
template<typename T>
@@ -289,7 +290,7 @@ void tst_QDeclarativeItem::smooth()
QDeclarativeComponent component(&engine);
component.setData("import Qt 4.6; Item { smooth: false; }", QUrl::fromLocalFile(""));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
- QSignalSpy spy(item, SIGNAL(smoothChanged()));
+ QSignalSpy spy(item, SIGNAL(smoothChanged(bool)));
QVERIFY(item);
QVERIFY(!item->smooth());
@@ -297,6 +298,10 @@ void tst_QDeclarativeItem::smooth()
item->setSmooth(true);
QVERIFY(item->smooth());
QCOMPARE(spy.count(),1);
+ QList<QVariant> arguments = spy.first();
+ QVERIFY(arguments.count() == 1);
+ QVERIFY(arguments.at(0).toBool() == true);
+
item->setSmooth(true);
QCOMPARE(spy.count(),1);
@@ -314,13 +319,18 @@ void tst_QDeclarativeItem::clip()
QDeclarativeComponent component(&engine);
component.setData("import Qt 4.6\nItem { clip: false\n }", QUrl::fromLocalFile(""));
QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
- QSignalSpy spy(item, SIGNAL(clipChanged()));
+ QSignalSpy spy(item, SIGNAL(clipChanged(bool)));
QVERIFY(item);
QVERIFY(!item->clip());
item->setClip(true);
QVERIFY(item->clip());
+
+ QList<QVariant> arguments = spy.first();
+ QVERIFY(arguments.count() == 1);
+ QVERIFY(arguments.at(0).toBool() == true);
+
QCOMPARE(spy.count(),1);
item->setClip(true);
QCOMPARE(spy.count(),1);
@@ -392,6 +402,84 @@ void tst_QDeclarativeItem::mapCoordinates_data()
QTest::newRow(QTest::toString(i)) << i << i;
}
+void tst_QDeclarativeItem::propertyChanges()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml"));
+ canvas->show();
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item");
+ QDeclarativeItem *parentItem = findItem<QDeclarativeItem>(canvas->rootObject(), "parentItem");
+
+ QVERIFY(item);
+ QVERIFY(parentItem);
+
+ QSignalSpy parentSpy(item, SIGNAL(parentChanged(QDeclarativeItem *)));
+ QSignalSpy widthSpy(item, SIGNAL(widthChanged(qreal)));
+ QSignalSpy heightSpy(item, SIGNAL(heightChanged(qreal)));
+ QSignalSpy baselineOffsetSpy(item, SIGNAL(baselineOffsetChanged(qreal)));
+ QSignalSpy childrenRectSpy(parentItem, SIGNAL(childrenRectChanged(QRectF)));
+ QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
+ QSignalSpy wantsFocusSpy(parentItem, SIGNAL(wantsFocusChanged(bool)));
+
+ item->setParentItem(parentItem);
+ item->setWidth(100.0);
+ item->setHeight(200.0);
+ item->setFocus(true);
+ item->setBaselineOffset(10.0);
+
+ QCOMPARE(item->parentItem(), parentItem);
+ QCOMPARE(parentSpy.count(),1);
+ QList<QVariant> parentArguments = parentSpy.first();
+ QVERIFY(parentArguments.count() == 1);
+ QCOMPARE(item->parentItem(), qvariant_cast<QDeclarativeItem *>(parentArguments.at(0)));
+
+ QCOMPARE(item->width(), 100.0);
+ QCOMPARE(widthSpy.count(),1);
+ QList<QVariant> widthArguments = widthSpy.first();
+ QVERIFY(widthArguments.count() == 1);
+ QCOMPARE(item->width(), widthArguments.at(0).toReal());
+
+ QCOMPARE(item->height(), 200.0);
+ QCOMPARE(heightSpy.count(),1);
+ QList<QVariant> heightArguments = heightSpy.first();
+ QVERIFY(heightArguments.count() == 1);
+ QCOMPARE(item->height(), heightArguments.at(0).toReal());
+
+ QCOMPARE(item->baselineOffset(), 10.0);
+ QCOMPARE(baselineOffsetSpy.count(),1);
+ QList<QVariant> baselineOffsetArguments = baselineOffsetSpy.first();
+ QVERIFY(baselineOffsetArguments.count() == 1);
+ QCOMPARE(item->baselineOffset(), baselineOffsetArguments.at(0).toReal());
+
+ QCOMPARE(parentItem->childrenRect(), QRectF(0.0,0.0,100.0,200.0));
+ QCOMPARE(childrenRectSpy.count(),2);
+ QList<QVariant> childrenRectArguments = childrenRectSpy.at(1);
+ QVERIFY(childrenRectArguments.count() == 1);
+ QCOMPARE(parentItem->childrenRect(), childrenRectArguments.at(0).toRectF());
+
+ QCOMPARE(item->hasFocus(), true);
+ QCOMPARE(focusSpy.count(),1);
+ QList<QVariant> focusArguments = focusSpy.first();
+ QVERIFY(focusArguments.count() == 1);
+ QCOMPARE(focusArguments.at(0).toBool(), true);
+
+ QCOMPARE(parentItem->hasFocus(), false);
+ QCOMPARE(parentItem->wantsFocus(), true);
+ QCOMPARE(wantsFocusSpy.count(),1);
+ QList<QVariant> wantsFocusArguments = wantsFocusSpy.first();
+ QVERIFY(wantsFocusArguments.count() == 1);
+ QCOMPARE(wantsFocusArguments.at(0).toBool(), true);
+
+ delete canvas;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
{
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir
index b32f82b..303c5c8 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir
@@ -1,3 +1,3 @@
-Test 0.0 Test.qml
-TestSubDir 0.0 TestSubDir.qml
-TestLocal 0.0 TestLocal.qml
+Test Test.qml
+TestSubDir TestSubDir.qml
+TestLocal TestLocal.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir
index f7016c7..a54f7df 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir
+++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/qmldir
@@ -1 +1 @@
-SubTest 0.0 SubTest.qml
+SubTest SubTest.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp
index 9ffe28a..6efe755 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp
@@ -42,15 +42,15 @@
void registerTypes()
{
- QML_REGISTER_INTERFACE(MyInterface);
- QML_REGISTER_TYPE(Test,1,0,MyQmlObject,MyQmlObject);
- QML_REGISTER_TYPE(Test,1,0,MyTypeObject,MyTypeObject);
- QML_REGISTER_TYPE(Test,1,0,MyContainer,MyContainer);
- QML_REGISTER_TYPE(Test,1,0,MyPropertyValueSource,MyPropertyValueSource);
- QML_REGISTER_TYPE(Test,1,0,MyDotPropertyObject,MyDotPropertyObject);
- QML_REGISTER_TYPE(Test,1,0,MyNamespacedType,MyNamespace::MyNamespacedType);
- QML_REGISTER_TYPE(Test,1,0,MySecondNamespacedType,MyNamespace::MySecondNamespacedType);
- QML_REGISTER_NOCREATE_TYPE(MyGroupedObject);
+ qmlRegisterInterface<MyInterface>("MyInterface");
+ qmlRegisterType<MyQmlObject>("Test",1,0,"MyQmlObject");
+ qmlRegisterType<MyTypeObject>("Test",1,0,"MyTypeObject");
+ qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
+ qmlRegisterType<MyPropertyValueSource>("Test",1,0,"MyPropertyValueSource");
+ qmlRegisterType<MyDotPropertyObject>("Test",1,0,"MyDotPropertyObject");
+ qmlRegisterType<MyNamespace::MyNamespacedType>("Test",1,0,"MyNamespacedType");
+ qmlRegisterType<MyNamespace::MySecondNamespacedType>("Test",1,0,"MySecondNamespacedType");
+ qmlRegisterType<MyGroupedObject>();
}
QVariant myCustomVariantTypeConverter(const QString &data)
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 083c551..6b564d4 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -1418,12 +1418,12 @@ void tst_qdeclarativelanguage::initTestCase()
{
registerTypes();
- QML_REGISTER_TYPE(com.nokia.Test, 0, 0, TestTP, TestType);
- QML_REGISTER_TYPE(com.nokia.Test, 1, 0, Test, TestType);
- QML_REGISTER_TYPE(com.nokia.Test, 1, 5, Test, TestType);
- QML_REGISTER_TYPE(com.nokia.Test, 1, 8, Test, TestType2);
- QML_REGISTER_TYPE(com.nokia.Test, 1, 9, OldTest, TestType);
- QML_REGISTER_TYPE(com.nokia.Test, 1, 12, Test, TestType2);
+ qmlRegisterType<TestType>("com.nokia.Test", 0, 0, "TestTP");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 0, "Test");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 5, "Test");
+ qmlRegisterType<TestType2>("com.nokia.Test", 1, 8, "Test");
+ qmlRegisterType<TestType>("com.nokia.Test", 1, 9, "OldTest");
+ qmlRegisterType<TestType2>("com.nokia.Test", 1, 12, "Test");
// Create locale-specific file
// For POSIX, this will just be data/I18nType.qml, since POSIX is 7-bit
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 29323a7..95ac2c0 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -269,9 +269,8 @@ void tst_QDeclarativeListModel::dynamic()
QDeclarativeEngine engine;
QDeclarativeListModel model;
- QDeclarativeEngine::setContextForObject(&model, engine.rootContext());
- engine.rootContext()->addDefaultObject(&model);
-
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
QDeclarativeExpression e(engine.rootContext(), script, &model);
if (!warning.isEmpty())
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
index 1b7af19..f3c72d1 100644
--- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
+++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
@@ -106,7 +106,7 @@ QML_DECLARE_TYPE(TestType);
void tst_qdeclarativelistreference::initTestCase()
{
- QML_REGISTER_NOCREATE_TYPE(TestType);
+ qmlRegisterType<TestType>();
}
void tst_qdeclarativelistreference::qmllistreference()
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
index 74f5ef4..a6d7610 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml
@@ -1,6 +1,7 @@
import Qt 4.6
Rectangle {
+ property int current: list.currentIndex
width: 240
height: 320
color: "#ffffff"
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 75fbbf8..5b57487 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -925,6 +925,7 @@ void tst_QDeclarativeListView::sections()
// Remove section boundary
model.removeItem(5);
+ QTest::qWait(100);
// New section header created
QDeclarativeItem *item = findItem<QDeclarativeItem>(viewport, "wrapper", 5);
@@ -932,6 +933,7 @@ void tst_QDeclarativeListView::sections()
QCOMPARE(item->height(), 40.0);
model.insertItem(3, "New Item", "0");
+ QTest::qWait(100);
// Section header moved
item = findItem<QDeclarativeItem>(viewport, "wrapper", 5);
@@ -944,6 +946,7 @@ void tst_QDeclarativeListView::sections()
// insert item which will become a section header
model.insertItem(6, "Replace header", "1");
+ QTest::qWait(100);
item = findItem<QDeclarativeItem>(viewport, "wrapper", 6);
QVERIFY(item);
@@ -1056,6 +1059,11 @@ void tst_QDeclarativeListView::currentIndex()
QTest::qWait(500);
QCOMPARE(listview->highlightItem()->y(), hlPos);
+ // insert item before currentIndex
+ listview->setCurrentIndex(28);
+ model.insertItem(0, "Foo", "1111");
+ QCOMPARE(canvas->rootObject()->property("current").toInt(), 29);
+
delete canvas;
}
@@ -1185,7 +1193,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on a currently visible item
- listview->positionViewAtIndex(3);
+ listview->positionViewAtIndex(3, QDeclarativeListView::Beginning);
QCOMPARE(listview->contentY(), 60.);
// Confirm items positioned correctly
@@ -1198,7 +1206,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on an item beyond the visible items
- listview->positionViewAtIndex(22);
+ listview->positionViewAtIndex(22, QDeclarativeListView::Beginning);
QCOMPARE(listview->contentY(), 440.);
// Confirm items positioned correctly
@@ -1211,7 +1219,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position on an item that would leave empty space if positioned at the top
- listview->positionViewAtIndex(28);
+ listview->positionViewAtIndex(28, QDeclarativeListView::Beginning);
QCOMPARE(listview->contentY(), 480.);
// Confirm items positioned correctly
@@ -1224,7 +1232,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
}
// Position at the beginning again
- listview->positionViewAtIndex(0);
+ listview->positionViewAtIndex(0, QDeclarativeListView::Beginning);
QCOMPARE(listview->contentY(), 0.);
// Confirm items positioned correctly
@@ -1236,6 +1244,47 @@ void tst_QDeclarativeListView::positionViewAtIndex()
QCOMPARE(item->y(), i*20.);
}
+ // Position at End
+ listview->positionViewAtIndex(20, QDeclarativeListView::End);
+ QCOMPARE(listview->contentY(), 100.);
+
+ // Position in Center
+ listview->positionViewAtIndex(15, QDeclarativeListView::Center);
+ QCOMPARE(listview->contentY(), 150.);
+
+ // Ensure at least partially visible
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QCOMPARE(listview->contentY(), 150.);
+
+ listview->setContentY(302);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QCOMPARE(listview->contentY(), 302.);
+
+ listview->setContentY(320);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Visible);
+ QCOMPARE(listview->contentY(), 300.);
+
+ listview->setContentY(85);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ QCOMPARE(listview->contentY(), 85.);
+
+ listview->setContentY(75);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Visible);
+ QCOMPARE(listview->contentY(), 100.);
+
+ // Ensure completely visible
+ listview->setContentY(120);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ QCOMPARE(listview->contentY(), 120.);
+
+ listview->setContentY(302);
+ listview->positionViewAtIndex(15, QDeclarativeListView::Contain);
+ QCOMPARE(listview->contentY(), 300.);
+
+ listview->setContentY(85);
+ listview->positionViewAtIndex(20, QDeclarativeListView::Contain);
+ QCOMPARE(listview->contentY(), 100.);
+
delete canvas;
}
diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
index 818f108..279a9b7 100644
--- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
+++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
@@ -132,10 +132,10 @@ QML_DECLARE_TYPE(ValueInterceptorTestType);
void tst_qdeclarativemetatype::initTestCase()
{
- QML_REGISTER_TYPE(Test, 1, 0, TestType, TestType);
- QML_REGISTER_TYPE(Test, 1, 0, ParserStatusTestType, ParserStatusTestType);
- QML_REGISTER_TYPE(Test, 1, 0, ValueSourceTestType, ValueSourceTestType);
- QML_REGISTER_TYPE(Test, 1, 0, ValueInterceptorTestType, ValueInterceptorTestType);
+ qmlRegisterType<TestType>("Test", 1, 0, "TestType");
+ qmlRegisterType<ParserStatusTestType>("Test", 1, 0, "ParserStatusTestType");
+ qmlRegisterType<ValueSourceTestType>("Test", 1, 0, "ValueSourceTestType");
+ qmlRegisterType<ValueInterceptorTestType>("Test", 1, 0, "ValueInterceptorTestType");
}
void tst_qdeclarativemetatype::copy()
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml
index ace61fe..f1e4909 100644
--- a/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml
+++ b/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml
@@ -1,10 +1,12 @@
import Qt 4.6
+import Qt.labs.particles 1.0
+
Rectangle {
width: 240
height: 320
color: "black"
Particles {
- objectName: "particles"
+ objectName: "particles"
anchors.fill: parent
width: 1
height: 1
@@ -30,4 +32,4 @@ Rectangle {
pace: 100
}
]
-} \ No newline at end of file
+}
diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particles.qml b/tests/auto/declarative/qdeclarativeparticles/data/particles.qml
index 0d42645..4f168a9 100644
--- a/tests/auto/declarative/qdeclarativeparticles/data/particles.qml
+++ b/tests/auto/declarative/qdeclarativeparticles/data/particles.qml
@@ -1,4 +1,6 @@
import Qt 4.6
+import Qt.labs.particles 1.0
+
Rectangle{
width: 100
height: 100
@@ -7,7 +9,7 @@ Rectangle{
Particles { id: particles
objectName: "particles"
width:1; height:1; anchors.centerIn: parent; opacity: 1
- lifeSpan: 100; lifeSpanDeviation: 20; count:1000;
+ lifeSpan: 100; lifeSpanDeviation: 20; count:1000;
fadeInDuration: 20; fadeOutDuration: 20; emissionRate: 1000
angle: 0; angleDeviation: 360; velocity: 500; velocityDeviation:30
source: "particle.png"
diff --git a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
index 6090a07..f4e9a27 100644
--- a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
+++ b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp
@@ -41,7 +41,7 @@
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
#include <qdeclarativeview.h>
-#include <private/qdeclarativeparticles_p.h>
+#include <QGraphicsObject>
class tst_QDeclarativeParticles : public QObject
{
@@ -67,73 +67,75 @@ void tst_QDeclarativeParticles::properties()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/particles.qml");
QVERIFY(canvas->rootObject());
- QDeclarativeParticles* particles = canvas->rootObject()->findChild<QDeclarativeParticles*>("particles");
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
QVERIFY(particles);
- particles->setSource(QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
- QCOMPARE(particles->source(), QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
+ particles->setProperty("source", QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
+ QCOMPARE(particles->property("source").toUrl(), QUrl::fromLocalFile(SRCDIR "/data/particle.png"));
- particles->setLifeSpanDeviation(1000);
- QCOMPARE(particles->lifeSpanDeviation(), 1000);
+ particles->setProperty("lifeSpanDeviation", (1000));
+ QCOMPARE(particles->property("lifeSpanDeviation").toInt(), 1000);
- particles->setFadeInDuration(1000);
- QCOMPARE(particles->fadeInDuration(), 1000);
+ particles->setProperty("fadeInDuration", 1000);
+ QCOMPARE(particles->property("fadeInDuration").toInt(), 1000);
- particles->setFadeOutDuration(1000);
- QCOMPARE(particles->fadeOutDuration(), 1000);
+ particles->setProperty("fadeOutDuration", 1000);
+ QCOMPARE(particles->property("fadeOutDuration").toInt(), 1000);
- particles->setAngle(100.0);
- QCOMPARE(particles->angle(), 100.0);
+ particles->setProperty("angle", 100.0);
+ QCOMPARE(particles->property("angle").toDouble(), 100.0);
- particles->setAngleDeviation(100.0);
- QCOMPARE(particles->angleDeviation(), 100.0);
+ particles->setProperty("angleDeviation", 100.0);
+ QCOMPARE(particles->property("angleDeviation").toDouble(), 100.0);
- particles->setVelocity(100.0);
- QCOMPARE(particles->velocity(), 100.0);
+ particles->setProperty("velocity", 100.0);
+ QCOMPARE(particles->property("velocity").toDouble(), 100.0);
- particles->setVelocityDeviation(100.0);
- QCOMPARE(particles->velocityDeviation(), 100.0);
+ particles->setProperty("velocityDeviation", 100.0);
+ QCOMPARE(particles->property("velocityDeviation").toDouble(), 100.0);
- particles->setEmissionVariance(0.5);
- QCOMPARE(particles->emissionVariance(),0.5);
+ particles->setProperty("emissionVariance", 0.5);
+ QCOMPARE(particles->property("emissionVariance").toDouble(),0.5);
- particles->setEmissionRate(12);
- QCOMPARE(particles->emissionRate(), 12);
+ particles->setProperty("emissionRate", 12);
+ QCOMPARE(particles->property("emissionRate").toInt(), 12);
}
void tst_QDeclarativeParticles::motionGravity()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotion.qml");
QVERIFY(canvas->rootObject());
- QDeclarativeParticles* particles = canvas->rootObject()->findChild<QDeclarativeParticles*>("particles");
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
QVERIFY(particles);
- QDeclarativeParticleMotionGravity* motionGravity = canvas->rootObject()->findChild<QDeclarativeParticleMotionGravity*>("motionGravity");
- QCOMPARE(particles->motion(), motionGravity);
+ QObject* motionGravity = canvas->rootObject()->findChild<QObject*>("motionGravity");
+ //QCOMPARE(qvariant_cast<QObject*>(particles->property("motion")), motionGravity);
QSignalSpy xattractorSpy(motionGravity, SIGNAL(xattractorChanged()));
QSignalSpy yattractorSpy(motionGravity, SIGNAL(yattractorChanged()));
QSignalSpy accelerationSpy(motionGravity, SIGNAL(accelerationChanged()));
- QCOMPARE(motionGravity->xAttractor(), 0.0);
- QCOMPARE(motionGravity->yAttractor(), 1000.0);
- QCOMPARE(motionGravity->acceleration(), 25.0);
+ QCOMPARE(motionGravity->property("xattractor").toDouble(), 0.0);
+ QCOMPARE(motionGravity->property("yattractor").toDouble(), 1000.0);
+ QCOMPARE(motionGravity->property("acceleration").toDouble(), 25.0);
- motionGravity->setXAttractor(20.0);
- motionGravity->setYAttractor(10.0);
- motionGravity->setAcceleration(10.0);
+ motionGravity->setProperty("xattractor", 20.0);
+ motionGravity->setProperty("yattractor", 10.0);
+ motionGravity->setProperty("acceleration", 10.0);
- QCOMPARE(motionGravity->xAttractor(), 20.0);
- QCOMPARE(motionGravity->yAttractor(), 10.0);
- QCOMPARE(motionGravity->acceleration(), 10.0);
+ QCOMPARE(motionGravity->property("xattractor").toDouble(), 20.0);
+ QCOMPARE(motionGravity->property("yattractor").toDouble(), 10.0);
+ QCOMPARE(motionGravity->property("acceleration").toDouble(), 10.0);
QCOMPARE(xattractorSpy.count(), 1);
QCOMPARE(yattractorSpy.count(), 1);
QCOMPARE(accelerationSpy.count(), 1);
- motionGravity->setXAttractor(20.0);
- motionGravity->setYAttractor(10.0);
- motionGravity->setAcceleration(10.0);
+ motionGravity->setProperty("xattractor", 20.0);
+ motionGravity->setProperty("yattractor", 10.0);
+ motionGravity->setProperty("acceleration", 10.0);
QCOMPARE(xattractorSpy.count(), 1);
QCOMPARE(yattractorSpy.count(), 1);
@@ -144,42 +146,44 @@ void tst_QDeclarativeParticles::motionWander()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotion.qml");
QVERIFY(canvas->rootObject());
- QDeclarativeParticles* particles = canvas->rootObject()->findChild<QDeclarativeParticles*>("particles");
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
QVERIFY(particles);
-
+
QSignalSpy motionSpy(particles, SIGNAL(motionChanged()));
- QDeclarativeParticleMotionWander* motionWander = canvas->rootObject()->findChild<QDeclarativeParticleMotionWander*>("motionWander");
-
- particles->setMotion(motionWander);
- QCOMPARE(particles->motion(),motionWander);
- QCOMPARE(motionSpy.count(), 1);
-
- particles->setMotion(motionWander);
- QCOMPARE(motionSpy.count(), 1);
+ QObject* motionWander = canvas->rootObject()->findChild<QObject*>("motionWander");
+
+ QCOMPARE(motionSpy.count(), 0);
+ particles->setProperty("motion", QVariant::fromValue(motionWander));
+ //QCOMPARE(particles->property("motion"), QVariant::fromValue(motionWander));
+ //QCOMPARE(motionSpy.count(), 1);
+
+ particles->setProperty("motion", QVariant::fromValue(motionWander));
+ //QCOMPARE(motionSpy.count(), 1);
QSignalSpy xvarianceSpy(motionWander, SIGNAL(xvarianceChanged()));
QSignalSpy yvarianceSpy(motionWander, SIGNAL(yvarianceChanged()));
QSignalSpy paceSpy(motionWander, SIGNAL(paceChanged()));
- QCOMPARE(motionWander->xVariance(), 30.0);
- QCOMPARE(motionWander->yVariance(), 30.0);
- QCOMPARE(motionWander->pace(), 100.0);
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 30.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 30.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 100.0);
- motionWander->setXVariance(20.0);
- motionWander->setYVariance(10.0);
- motionWander->setPace(10.0);
+ motionWander->setProperty("xvariance", 20.0);
+ motionWander->setProperty("yvariance", 10.0);
+ motionWander->setProperty("pace", 10.0);
- QCOMPARE(motionWander->xVariance(), 20.0);
- QCOMPARE(motionWander->yVariance(), 10.0);
- QCOMPARE(motionWander->pace(), 10.0);
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 20.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 10.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 10.0);
QCOMPARE(xvarianceSpy.count(), 1);
QCOMPARE(yvarianceSpy.count(), 1);
QCOMPARE(paceSpy.count(), 1);
- motionWander->setXVariance(20.0);
- motionWander->setYVariance(10.0);
- motionWander->setPace(10.0);
+ QCOMPARE(motionWander->property("xvariance").toDouble(), 20.0);
+ QCOMPARE(motionWander->property("yvariance").toDouble(), 10.0);
+ QCOMPARE(motionWander->property("pace").toDouble(), 10.0);
QCOMPARE(xvarianceSpy.count(), 1);
QCOMPARE(yvarianceSpy.count(), 1);
@@ -190,7 +194,8 @@ void tst_QDeclarativeParticles::runs()
{
QDeclarativeView *canvas = createView(SRCDIR "/data/particles.qml");
QVERIFY(canvas->rootObject());
- QDeclarativeParticles* particles = canvas->rootObject()->findChild<QDeclarativeParticles*>("particles");
+
+ QObject* particles = canvas->rootObject()->findChild<QObject*>("particles");
QVERIFY(particles);
QTest::qWait(1000);//Run for one second. Test passes if it doesn't crash.
}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
index f8ed29f..70cfbcd 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
@@ -2,7 +2,7 @@ import Qt 4.6
PathView {
id: photoPathView
- y: 100; width: 800; height: 330; pathItemCount: 4; offset: 10
+ y: 100; width: 800; height: 330; pathItemCount: 4; offset: 0.1
dragMargin: 24; snapPosition: 0.50
path: Path {
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 62eb8c3..cc1a8d5 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -262,7 +262,7 @@ void tst_QDeclarativePathView::pathview3()
QVERIFY(obj->delegate() != 0);
QVERIFY(obj->model() != QVariant());
QCOMPARE(obj->currentIndex(), 0);
- QCOMPARE(obj->offset(), 50.); // ???
+ QCOMPARE(obj->offset(), 0.5); // ???
QCOMPARE(obj->snapPosition(), 0.5); // ???
QCOMPARE(obj->dragMargin(), 24.);
QCOMPARE(obj->count(), 8);
@@ -422,14 +422,14 @@ void tst_QDeclarativePathView::pathMoved()
offset.setX(firstItem->width()/2);
offset.setY(firstItem->height()/2);
QCOMPARE(firstItem->pos() + offset, start);
- pathview->setOffset(10);
+ pathview->setOffset(0.1);
for(int i=0; i<model.count(); i++){
QDeclarativeRectangle *curItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", i);
QCOMPARE(curItem->pos() + offset, path->pointAt(0.1 + i*0.25));
}
- pathview->setOffset(100);
+ pathview->setOffset(1.0);
QCOMPARE(firstItem->pos() + offset, start);
delete canvas;
diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp
index 9b8a643..76c5403 100644
--- a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp
+++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp
@@ -1348,9 +1348,9 @@ void tst_qdeclarativeproperty::copy()
void tst_qdeclarativeproperty::initTestCase()
{
- QML_REGISTER_TYPE(Test,1,0,MyQmlObject,MyQmlObject);
- QML_REGISTER_TYPE(Test,1,0,PropertyObject,PropertyObject);
- QML_REGISTER_TYPE(Test,1,0,MyContainer,MyContainer);
+ qmlRegisterType<MyQmlObject>("Test",1,0,"MyQmlObject");
+ qmlRegisterType<PropertyObject>("Test",1,0,"PropertyObject");
+ qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/closestangle.qml b/tests/auto/declarative/qdeclarativeqt/data/closestangle.qml
deleted file mode 100644
index b5f7fc6..0000000
--- a/tests/auto/declarative/qdeclarativeqt/data/closestangle.qml
+++ /dev/null
@@ -1,12 +0,0 @@
-import Qt 4.6
-
-QtObject {
- property var testSame: Qt.closestAngle(0,1)
- property var testLess: Qt.closestAngle(0,-359)
- property var testMore: Qt.closestAngle(0,361)
- property var testFail: Qt.closestAngle(0)
- property var test5: Qt.closestAngle(0,1,2)
- property var test6: Qt.closestAngle(123.45465768,1.11)
- property var test7: Qt.closestAngle(-3.1415,1.11)
-}
-
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index b70011b..debec02 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -66,7 +66,6 @@ private slots:
void lighter();
void darker();
void tint();
- void closestAngle();
void openUrlExternally();
void md5();
void createComponent();
@@ -262,23 +261,6 @@ void tst_qdeclarativeqt::tint()
delete object;
}
-void tst_qdeclarativeqt::closestAngle()
-{
- QDeclarativeComponent component(&engine, TEST_FILE("closestangle.qml"));
- QObject *object = component.create();
- QVERIFY(object != 0);
-
- QCOMPARE(qvariant_cast<qreal>(object->property("testSame")), 1.0);
- QCOMPARE(qvariant_cast<qreal>(object->property("testLess")), 1.0);
- QCOMPARE(qvariant_cast<qreal>(object->property("testMore")), 1.0);
- QCOMPARE(qvariant_cast<qreal>(object->property("testFail")), 0.0);
- QCOMPARE(qvariant_cast<qreal>(object->property("test5")), 1.0);
- QCOMPARE(qvariant_cast<qreal>(object->property("test6")), 1.11);
- QCOMPARE(qvariant_cast<qreal>(object->property("test7")), 1.11);
-
- delete object;
-}
-
void tst_qdeclarativeqt::openUrlExternally()
{
QEXPECT_FAIL("", "How do we test this?", Abort);
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
index 7a97e60..7da9454 100644
--- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
+++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -109,7 +109,7 @@ public:
setRoleNames(roles);
}
- int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); }
+ int rowCount(const QModelIndex &parent=QModelIndex()) const { Q_UNUSED(parent); return list.count(); }
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const {
QVariant rv;
if (role == Name)
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 8d3ca7a..eb0e2bd 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -110,7 +110,7 @@ private slots:
void tst_qdeclarativestates::initTestCase()
{
- QML_REGISTER_TYPE(Qt.test, 1, 0, MyRectangle,MyRect);
+ qmlRegisterType<MyRect>("Qt.test", 1, 0, "MyRectangle");
}
QByteArray tst_qdeclarativestates::fullDataPath(const QString &path)
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
new file mode 100644
index 0000000..2697bb5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml
@@ -0,0 +1,42 @@
+import Qt 4.6
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font.pixelSize: myPixelSize
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font: other.font
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
new file mode 100644
index 0000000..478104e1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml
@@ -0,0 +1,42 @@
+import Qt 4.6
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font: other.font
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font.pixelSize: myPixelSize
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
new file mode 100644
index 0000000..d35c72e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml
@@ -0,0 +1,42 @@
+import Qt 4.6
+
+Rectangle {
+ id: root
+
+ width: 800
+ height: 600
+
+ property alias font: myText.font
+
+ property int myPixelSize: 12
+ property int myPixelSize2: 24
+
+ Text {
+ id: other
+ font.pixelSize: 6
+ }
+
+ Text {
+ id: myText
+
+ text: "Hello world!"
+ font.pixelSize: myPixelSize
+ }
+
+ states: State {
+ name: "Swapped"
+ PropertyChanges {
+ target: myText
+ font.pixelSize: myPixelSize2
+ }
+ }
+
+ function toggle() {
+ if (root.state == "") root.state = "Swapped"; else root.state = "";
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp
index aa8bd6e..e30a319 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp
@@ -42,7 +42,7 @@
void registerTypes()
{
- QML_REGISTER_TYPE(Test, 1, 0, MyTypeObject, MyTypeObject);
- QML_REGISTER_TYPE(Test, 1, 0, MyConstantValueSource, MyConstantValueSource);
- QML_REGISTER_TYPE(Test, 1, 0, MyOffsetValueInterceptor, MyOffsetValueInterceptor);
+ qmlRegisterType<MyTypeObject>("Test", 1, 0, "MyTypeObject");
+ qmlRegisterType<MyConstantValueSource>("Test", 1, 0, "MyConstantValueSource");
+ qmlRegisterType<MyOffsetValueInterceptor>("Test", 1, 0, "MyOffsetValueInterceptor");
}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
index 51f9a07..a5cb16f 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
+++ b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
@@ -77,6 +77,7 @@ private slots:
void scriptVariantCopy();
void cppClasses();
void enums();
+ void conflictingBindings();
private:
QDeclarativeEngine engine;
@@ -314,8 +315,17 @@ void tst_qdeclarativevaluetypes::font()
font.setLetterSpacing(QFont::AbsoluteSpacing, 9.7);
font.setWordSpacing(11.2);
- QEXPECT_FAIL("", "QT-2920", Continue);
- QCOMPARE(object->font(), font);
+ QFont f = object->font();
+ QCOMPARE(f.family(), font.family());
+ QCOMPARE(f.bold(), font.bold());
+ QCOMPARE(f.weight(), font.weight());
+ QCOMPARE(f.italic(), font.italic());
+ QCOMPARE(f.underline(), font.underline());
+ QCOMPARE(f.strikeOut(), font.strikeOut());
+ QCOMPARE(f.pointSize(), font.pointSize());
+ QCOMPARE(f.capitalization(), font.capitalization());
+ QCOMPARE(f.letterSpacing(), font.letterSpacing());
+ QCOMPARE(f.wordSpacing(), font.wordSpacing());
delete object;
}
@@ -422,12 +432,13 @@ void tst_qdeclarativevaluetypes::autoBindingRemoval()
object->setProperty("value", QVariant(92));
- QEXPECT_FAIL("", "QT-2920", Continue);
+ //QEXPECT_FAIL("", "QT-2920", Continue);
QCOMPARE(object->rect().x(), 42);
delete object;
}
+ /*
{
QDeclarativeComponent component(&engine, TEST_FILE("autoBindingRemoval.2.qml"));
MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
@@ -465,12 +476,11 @@ void tst_qdeclarativevaluetypes::autoBindingRemoval()
object->setProperty("value", QVariant(QRect(19, 3, 4, 8)));
- QEXPECT_FAIL("", "QT-2920", Continue);
QCOMPARE(object->rect(), QRect(44, 22, 33, 44));
delete object;
}
-
+*/
}
// Test that property value sources assign to value types
@@ -626,6 +636,65 @@ void tst_qdeclarativevaluetypes::enums()
}
}
+// Tests switching between "conflicting" bindings (eg. a binding on the core
+// property, to a binding on the value-type sub-property)
+void tst_qdeclarativevaluetypes::conflictingBindings()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 6);
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("conflicting.3.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 24);
+
+ QMetaObject::invokeMethod(object, "toggle");
+
+ QCOMPARE(qvariant_cast<QFont>(object->property("font")).pixelSize(), 12);
+
+ delete object;
+ }
+}
+
QTEST_MAIN(tst_qdeclarativevaluetypes)
#include "tst_qdeclarativevaluetypes.moc"
diff --git a/tests/auto/declarative/visual/animation/parentAnimation/parentAnimation.qml b/tests/auto/declarative/visual/animation/parentAnimation/parentAnimation.qml
index 1833cf0..5db2cc6 100644
--- a/tests/auto/declarative/visual/animation/parentAnimation/parentAnimation.qml
+++ b/tests/auto/declarative/visual/animation/parentAnimation/parentAnimation.qml
@@ -10,7 +10,7 @@ Rectangle {
width: 100; height: 100
}
- MouseRegion {
+ MouseArea {
id: mouser
anchors.fill: parent
}
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png
index c7bbf38..454f6c1 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png
index 612500b..9dde537 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png
index c7bbf38..454f6c1 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png
index c7bbf38..454f6c1 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png
index 1910eb4..043b487 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png
index 3b8eebd..79c791d 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png
index c7bbf38..454f6c1 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png
index c7bbf38..454f6c1 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png
index 960be31..a7d6674 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml
index 0f58de5..a130b75 100644
--- a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml
+++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml
@@ -386,115 +386,115 @@ VisualTest {
}
Frame {
msec: 1472
- hash: "c2d6dd91f3e9cdcacbadcb449c8a9896"
+ hash: "eb3eeb37ab7b26692cbf100adfaf3772"
}
Frame {
msec: 1488
- hash: "1098ea19aecebd71208e101d522c1981"
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
}
Frame {
msec: 1504
- hash: "8cc59c20d796c073038518d2855fb6f0"
+ hash: "44fc52479251327d0612de17ddb056eb"
}
Frame {
msec: 1520
- hash: "914a89d0cfdc68145024ce2305a5e76e"
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
}
Frame {
msec: 1536
- hash: "7a2e3ca2660df24d9a6ec49a7422ebe1"
+ hash: "66d205a02e35221e7684ab995acc1312"
}
Frame {
msec: 1552
- hash: "b71496d986d5f0aa76b4f1663627f1f7"
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
}
Frame {
msec: 1568
- hash: "41b29a523db919bc0a4e0a9a88bfc873"
+ hash: "9b2582fccffa34fe389ba427ce47619a"
}
Frame {
msec: 1584
- hash: "97632a0de766b9ffbf71f21eeb0ff9a2"
+ hash: "e6f15478bda9995f82976b9e16659c8e"
}
Frame {
msec: 1600
- hash: "94cc196e62c150008461ff9996b4cae8"
+ hash: "f08df0885fff04819ada6c10b25dd489"
}
Frame {
msec: 1616
- hash: "32e96ad2d15fa2386d365ab249ddf4f4"
+ hash: "0f57c152306747cfa27171f1947ca65d"
}
Frame {
msec: 1632
- hash: "209394314f971b12fbc61ca45010cc62"
+ hash: "89d9c988abd55063e210b81193c6a8f0"
}
Frame {
msec: 1648
- hash: "b917c2684dda8af00278b34ababdcf5c"
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
}
Frame {
msec: 1664
- hash: "92b506860c1c5dc52f87c24c89921b05"
+ hash: "267874fdc09459b3e854c06d9ae99a54"
}
Frame {
msec: 1680
- hash: "7b7e96113fa9359954be9b3ac87943c3"
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
}
Frame {
msec: 1696
- hash: "42bc69db42c5df902038cec414246ec5"
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
}
Frame {
msec: 1712
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1728
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1744
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1760
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1776
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1792
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1808
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1824
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1840
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1856
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1872
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1888
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1904
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1920
@@ -502,47 +502,47 @@ VisualTest {
}
Frame {
msec: 1936
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1952
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1968
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 1984
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2000
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2016
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2032
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2048
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2064
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2080
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2096
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 2
@@ -554,31 +554,31 @@ VisualTest {
}
Frame {
msec: 2112
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2128
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2144
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2160
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2176
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2192
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2208
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 3
@@ -590,67 +590,67 @@ VisualTest {
}
Frame {
msec: 2224
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 2240
- hash: "2d1aa011f2008a6147ba593e3cf272d7"
+ hash: "8ceca291e28f52368346f171c2f31664"
}
Frame {
msec: 2256
- hash: "206699ea84ce9fd60c1603b7a48a5134"
+ hash: "903877286f3ef112e6a661abde5c17bd"
}
Frame {
msec: 2272
- hash: "68eb6df93a2b6db7023f7c3cc71d5b5f"
+ hash: "cc2d15c96571f9328b929f96849c8f9e"
}
Frame {
msec: 2288
- hash: "5a4cd0620959dde92eeeaaa4dcd13091"
+ hash: "26e6c03b1b91b725d6e0fe9216a7413e"
}
Frame {
msec: 2304
- hash: "17b763187a777253b25b22f5dd7253ae"
+ hash: "213e8e9905bea32ddb97d38b75cd19cc"
}
Frame {
msec: 2320
- hash: "1de9dcf4d385266f4482e2d0967d9119"
+ hash: "17d5726a282d42fcde7796be84606fcd"
}
Frame {
msec: 2336
- hash: "833496add6dbc3103a28a47e453a738b"
+ hash: "f4629bf9f5837f687ae49008c9d28d02"
}
Frame {
msec: 2352
- hash: "b3bab2e9c56db60cd54e68369e6b790d"
+ hash: "fbc927cb136d8d29b2578e78c4793e41"
}
Frame {
msec: 2368
- hash: "ee91c6cd909bec401a1a7eebd10b8b02"
+ hash: "c7099e732490dd2f3205986a7c43a165"
}
Frame {
msec: 2384
- hash: "0ed679ad0ab7bd3544947bccda88647b"
+ hash: "b3b464a8e67fab05109b49604f1ce705"
}
Frame {
msec: 2400
- hash: "d7dfcdc8a4233821919f1732d8c39712"
+ hash: "7629b2a77f9f87aa0ef2535aa9b8d390"
}
Frame {
msec: 2416
- hash: "c52829ee689e4c312a9dff8dbd4a79f9"
+ hash: "6a329c289236782e095cfa6f15409726"
}
Frame {
msec: 2432
- hash: "7962badda0e80a61b67943d3b31f892d"
+ hash: "1cfbf6f4c292e1520b44d84dd59b93a8"
}
Frame {
msec: 2448
- hash: "fc5f2c24e3d8743ab5b20aaa122bacc2"
+ hash: "a8d3d838bffb39053eb705aefcb39c46"
}
Frame {
msec: 2464
- hash: "201b9ee6c9ac6208ef812fe2e95020ef"
+ hash: "a56ad66a949e07e3174a58c80145c85e"
}
Frame {
msec: 2480
@@ -774,123 +774,123 @@ VisualTest {
}
Frame {
msec: 2896
- hash: "c2d6dd91f3e9cdcacbadcb449c8a9896"
+ hash: "eb3eeb37ab7b26692cbf100adfaf3772"
}
Frame {
msec: 2912
- hash: "1098ea19aecebd71208e101d522c1981"
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
}
Frame {
msec: 2928
- hash: "8cc59c20d796c073038518d2855fb6f0"
+ hash: "44fc52479251327d0612de17ddb056eb"
}
Frame {
msec: 2944
- hash: "914a89d0cfdc68145024ce2305a5e76e"
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
}
Frame {
msec: 2960
- hash: "7a2e3ca2660df24d9a6ec49a7422ebe1"
+ hash: "66d205a02e35221e7684ab995acc1312"
}
Frame {
msec: 2976
- hash: "b71496d986d5f0aa76b4f1663627f1f7"
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
}
Frame {
msec: 2992
- hash: "41b29a523db919bc0a4e0a9a88bfc873"
+ hash: "9b2582fccffa34fe389ba427ce47619a"
}
Frame {
msec: 3008
- hash: "97632a0de766b9ffbf71f21eeb0ff9a2"
+ hash: "e6f15478bda9995f82976b9e16659c8e"
}
Frame {
msec: 3024
- hash: "94cc196e62c150008461ff9996b4cae8"
+ hash: "f08df0885fff04819ada6c10b25dd489"
}
Frame {
msec: 3040
- hash: "32e96ad2d15fa2386d365ab249ddf4f4"
+ hash: "0f57c152306747cfa27171f1947ca65d"
}
Frame {
msec: 3056
- hash: "209394314f971b12fbc61ca45010cc62"
+ hash: "89d9c988abd55063e210b81193c6a8f0"
}
Frame {
msec: 3072
- hash: "b917c2684dda8af00278b34ababdcf5c"
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
}
Frame {
msec: 3088
- hash: "92b506860c1c5dc52f87c24c89921b05"
+ hash: "267874fdc09459b3e854c06d9ae99a54"
}
Frame {
msec: 3104
- hash: "7b7e96113fa9359954be9b3ac87943c3"
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
}
Frame {
msec: 3120
- hash: "42bc69db42c5df902038cec414246ec5"
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
}
Frame {
msec: 3136
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3152
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3168
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3184
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3200
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3216
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3232
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3248
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3264
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3280
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3296
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3312
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3328
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3344
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3360
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 2
@@ -902,31 +902,31 @@ VisualTest {
}
Frame {
msec: 3376
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3392
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3408
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3424
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3440
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3456
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3472
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 3
@@ -938,67 +938,67 @@ VisualTest {
}
Frame {
msec: 3488
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 3504
- hash: "2d1aa011f2008a6147ba593e3cf272d7"
+ hash: "8ceca291e28f52368346f171c2f31664"
}
Frame {
msec: 3520
- hash: "206699ea84ce9fd60c1603b7a48a5134"
+ hash: "903877286f3ef112e6a661abde5c17bd"
}
Frame {
msec: 3536
- hash: "68eb6df93a2b6db7023f7c3cc71d5b5f"
+ hash: "cc2d15c96571f9328b929f96849c8f9e"
}
Frame {
msec: 3552
- hash: "5a4cd0620959dde92eeeaaa4dcd13091"
+ hash: "26e6c03b1b91b725d6e0fe9216a7413e"
}
Frame {
msec: 3568
- hash: "17b763187a777253b25b22f5dd7253ae"
+ hash: "213e8e9905bea32ddb97d38b75cd19cc"
}
Frame {
msec: 3584
- hash: "1de9dcf4d385266f4482e2d0967d9119"
+ hash: "17d5726a282d42fcde7796be84606fcd"
}
Frame {
msec: 3600
- hash: "833496add6dbc3103a28a47e453a738b"
+ hash: "f4629bf9f5837f687ae49008c9d28d02"
}
Frame {
msec: 3616
- hash: "b3bab2e9c56db60cd54e68369e6b790d"
+ hash: "fbc927cb136d8d29b2578e78c4793e41"
}
Frame {
msec: 3632
- hash: "ee91c6cd909bec401a1a7eebd10b8b02"
+ hash: "c7099e732490dd2f3205986a7c43a165"
}
Frame {
msec: 3648
- hash: "0ed679ad0ab7bd3544947bccda88647b"
+ hash: "b3b464a8e67fab05109b49604f1ce705"
}
Frame {
msec: 3664
- hash: "d7dfcdc8a4233821919f1732d8c39712"
+ hash: "7629b2a77f9f87aa0ef2535aa9b8d390"
}
Frame {
msec: 3680
- hash: "c52829ee689e4c312a9dff8dbd4a79f9"
+ hash: "6a329c289236782e095cfa6f15409726"
}
Frame {
msec: 3696
- hash: "7962badda0e80a61b67943d3b31f892d"
+ hash: "1cfbf6f4c292e1520b44d84dd59b93a8"
}
Frame {
msec: 3712
- hash: "fc5f2c24e3d8743ab5b20aaa122bacc2"
+ hash: "a8d3d838bffb39053eb705aefcb39c46"
}
Frame {
msec: 3728
- hash: "201b9ee6c9ac6208ef812fe2e95020ef"
+ hash: "a56ad66a949e07e3174a58c80145c85e"
}
Frame {
msec: 3744
@@ -2038,183 +2038,183 @@ VisualTest {
}
Frame {
msec: 7696
- hash: "c2d6dd91f3e9cdcacbadcb449c8a9896"
+ hash: "eb3eeb37ab7b26692cbf100adfaf3772"
}
Frame {
msec: 7712
- hash: "1098ea19aecebd71208e101d522c1981"
+ hash: "e1a8cdcb1f3ec097a968b3b20964c6e8"
}
Frame {
msec: 7728
- hash: "8cc59c20d796c073038518d2855fb6f0"
+ hash: "44fc52479251327d0612de17ddb056eb"
}
Frame {
msec: 7744
- hash: "914a89d0cfdc68145024ce2305a5e76e"
+ hash: "fa7e4a910aa60500575a34852c0c7cb8"
}
Frame {
msec: 7760
- hash: "7a2e3ca2660df24d9a6ec49a7422ebe1"
+ hash: "66d205a02e35221e7684ab995acc1312"
}
Frame {
msec: 7776
- hash: "b71496d986d5f0aa76b4f1663627f1f7"
+ hash: "4ebe8dba6d9f3179b610b2298a7484a2"
}
Frame {
msec: 7792
- hash: "41b29a523db919bc0a4e0a9a88bfc873"
+ hash: "9b2582fccffa34fe389ba427ce47619a"
}
Frame {
msec: 7808
- hash: "97632a0de766b9ffbf71f21eeb0ff9a2"
+ hash: "e6f15478bda9995f82976b9e16659c8e"
}
Frame {
msec: 7824
- hash: "94cc196e62c150008461ff9996b4cae8"
+ hash: "f08df0885fff04819ada6c10b25dd489"
}
Frame {
msec: 7840
- hash: "32e96ad2d15fa2386d365ab249ddf4f4"
+ hash: "0f57c152306747cfa27171f1947ca65d"
}
Frame {
msec: 7856
- hash: "209394314f971b12fbc61ca45010cc62"
+ hash: "89d9c988abd55063e210b81193c6a8f0"
}
Frame {
msec: 7872
- hash: "b917c2684dda8af00278b34ababdcf5c"
+ hash: "91e0d0a5d57210c790c2d2399d1f7022"
}
Frame {
msec: 7888
- hash: "92b506860c1c5dc52f87c24c89921b05"
+ hash: "267874fdc09459b3e854c06d9ae99a54"
}
Frame {
msec: 7904
- hash: "7b7e96113fa9359954be9b3ac87943c3"
+ hash: "2f58a508f439c40c6f2bd7da1f30deff"
}
Frame {
msec: 7920
- hash: "42bc69db42c5df902038cec414246ec5"
+ hash: "1451548d9f0002a6c4765cb616ab7f59"
}
Frame {
msec: 7936
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 7952
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 7968
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 7984
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8000
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8016
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8032
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8048
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8064
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8080
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8096
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8112
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8128
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8144
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8160
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8176
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8192
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8208
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8224
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8240
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8256
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8272
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8288
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8304
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8320
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8336
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8352
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8368
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8384
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8400
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 2
@@ -2226,31 +2226,31 @@ VisualTest {
}
Frame {
msec: 8416
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8432
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8448
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8464
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8480
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8496
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8512
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Mouse {
type: 3
@@ -2262,31 +2262,31 @@ VisualTest {
}
Frame {
msec: 8528
- hash: "7eb4027421fd6aa7d668a704e40a6e61"
+ hash: "ad3837dcf3e69274ac2918d796974f29"
}
Frame {
msec: 8544
- hash: "b4f30663a9b21e42375645e970f57d0b"
+ hash: "49a6ed64f80094b41348eda19fa5a55e"
}
Frame {
msec: 8560
- hash: "6c12dbf4af8801573515b61123d4b1d7"
+ hash: "3ee42fb431d7824c1cd6ddf95af91d10"
}
Frame {
msec: 8576
- hash: "facc61397c734bb4409d5664dc059a14"
+ hash: "d807890cc0670eda9fac267769366771"
}
Frame {
msec: 8592
- hash: "897e15e37276454d11fac6a528e967a6"
+ hash: "50cb68de9ca0c3a8db1df58d7cbb0d21"
}
Frame {
msec: 8608
- hash: "cf8173519f1e042c227ff61c62308640"
+ hash: "0af06233156b3a469ce9e7d80a5767c0"
}
Frame {
msec: 8624
- hash: "d0fcda14ea4bcfebf04ccf99e292ac6a"
+ hash: "9b2c77f004e480fd485e092c08feaf81"
}
Frame {
msec: 8640
@@ -2294,35 +2294,35 @@ VisualTest {
}
Frame {
msec: 8656
- hash: "74b4ababa97def538f5340e88a4419a4"
+ hash: "6ed9b6118a0dc81c22af9fee108b7432"
}
Frame {
msec: 8672
- hash: "b96b5b64505b1814ddd42a52569d7fd9"
+ hash: "4d3aa8219edffe6fda316482821d4a64"
}
Frame {
msec: 8688
- hash: "0e3e07aad030b2075c4bc61b02ebe49e"
+ hash: "ea8a7104840254ac2706ca2635b8a95f"
}
Frame {
msec: 8704
- hash: "c5eebc652c58e3a44d5ed481100ef242"
+ hash: "a8569ef3287da9699809a2ad107b87b1"
}
Frame {
msec: 8720
- hash: "d4a74185304c126739af728ddda40e0c"
+ hash: "91d09653dbced4ecb3d711737cb89ca1"
}
Frame {
msec: 8736
- hash: "448572d3c1060b8311952429a7f9430d"
+ hash: "d5391f3b40f2dfada0336d889d438d69"
}
Frame {
msec: 8752
- hash: "00f64c09657a8afd6caa186efb6ad860"
+ hash: "27cd9690607f97cc84c2a0a4455feccb"
}
Frame {
msec: 8768
- hash: "2a360e6feaaf303e9ee63145085796e6"
+ hash: "f885588779a5de5d7d47f48bf9a2a6ee"
}
Frame {
msec: 8784
@@ -2419,7 +2419,7 @@ VisualTest {
Key {
type: 6
key: 16777249
- modifiers: 67108864
+ modifiers: 0
text: ""
autorep: false
count: 1
diff --git a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
index d80631f..e41a254 100644
--- a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
+++ b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml
@@ -52,7 +52,7 @@ Rectangle {
}]
transitions: Transition {
- NumberAnimation { properties: "x,y,width,height" }
+ AnchorAnimation { }
}
MouseArea {
diff --git a/tests/auto/mediaobject/media/test.sdp b/tests/auto/mediaobject/media/test.sdp
new file mode 100644
index 0000000..0d8706c
--- /dev/null
+++ b/tests/auto/mediaobject/media/test.sdp
@@ -0,0 +1,32 @@
+v=0
+o=- 3476526279 2351211129 IN IP4 XXX.XXX.XXX.XXX
+s=SOME STRING
+e=support@localhost
+c=IN IP4 XXX.XXX.XXX.XXX
+t=0 0
+a=range:npt=now-
+a=random_access_denied
+a=control:rtsp://link
+m=video 0 RTP/AVP 96
+b=AS:100
+b=RR:2500
+b=RS:2500
+a=control:rtsp://link
+a=rtpmap:96 MP4V-ES/90000
+a=3GPP-Adaptation-Support:1
+a=cliprect:0,0,144,176
+a=mpeg4-esid:201
+a=x-envivio-verid:00022B15
+a=fmtp:96 profile-level-id=2;config=000001b002000001b50ea020202f000001000000012000c788ba9850584121463f
+a=framerate:15.0
+m=audio 0 RTP/AVP 97
+b=AS:14
+b=RR:350
+b=RS:350
+a=control:rtsp://link
+a=rtpmap:97 AMR/8000
+a=3GPP-Adaptation-Support:1
+a=mpeg4-esid:101
+a=x-envivio-verid:00022B15
+a=fmtp:97 octet-align=1
+a=maxptime:200
diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro
index 5d4a098..bef2fe9 100755
--- a/tests/auto/mediaobject/mediaobject.pro
+++ b/tests/auto/mediaobject/mediaobject.pro
@@ -14,3 +14,9 @@ wince*{
DEFINES += tst_MediaObject=tst_MediaObject_waveout
}
+symbian*:{
+ addFiles.sources = media/test.sdp
+ addFiles.path = media
+ DEPLOYMENT += addFiles
+}
+
diff --git a/tests/auto/mediaobject/mediaobject.qrc b/tests/auto/mediaobject/mediaobject.qrc
index 4f46213..77954f4 100644
--- a/tests/auto/mediaobject/mediaobject.qrc
+++ b/tests/auto/mediaobject/mediaobject.qrc
@@ -3,5 +3,6 @@
<file>media/sax.wav</file>
<file>media/sax.ogg</file>
<file>media/sax.mp3</file>
+<file>media/test.sdp</file>
</qresource>
</RCC>
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index 5ae80b9..5b0943e 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -139,6 +139,7 @@ class tst_MediaObject : public QObject
void pauseToPause();
void pauseToPlay();
void pauseToStop();
+ void playSDP();
void testPrefinishMark();
void testSeek();
@@ -160,6 +161,11 @@ class tst_MediaObject : public QObject
Phonon::MediaObject *m_media;
QSignalSpy *m_stateChangedSignalSpy;
QString m_tmpFileName;
+
+ static void copyMediaFile(const QString &original,
+ const QString &name,
+ QString &resultFilePath,
+ QUrl *const asURL = 0);
#endif //QT_NO_PHONON
bool m_success;
};
@@ -352,6 +358,24 @@ void tst_MediaObject::_pausePlayback()
m_success = true;
}
+/*!
+ Copies the file \a name to the testing area. The resulting file name path is
+ returned in resultFilePath, and also set as a URL in \a asURL.
+ */
+void tst_MediaObject::copyMediaFile(const QString &original,
+ const QString &name,
+ QString &resultFilePath,
+ QUrl *const asURL)
+{
+ resultFilePath = QDir::toNativeSeparators(QDir::tempPath() + name);
+ if (asURL)
+ *asURL = QUrl::fromLocalFile(resultFilePath);
+
+ QFile::remove(resultFilePath);
+ QVERIFY(QFile::copy(original, resultFilePath));
+ QFile::setPermissions(resultFilePath, QFile::permissions(resultFilePath) | QFile::WriteOther);
+}
+
void tst_MediaObject::initTestCase()
{
QCoreApplication::setApplicationName("tst_MediaObject");
@@ -375,14 +399,8 @@ void tst_MediaObject::initTestCase()
QVERIFY(m_stateChangedSignalSpy->isValid());
m_stateChangedSignalSpy->clear();
- if (m_url.isEmpty()) {
- m_tmpFileName = QDir::toNativeSeparators(QDir::tempPath() + MEDIA_FILE);
- QFile::remove(m_tmpFileName);
- QVERIFY(QFile::copy(MEDIA_FILEPATH, m_tmpFileName));
- QFile::Permissions p = QFile::permissions(m_tmpFileName);
- QFile::setPermissions(m_tmpFileName, p | QFile::WriteOther);
- m_url = QUrl::fromLocalFile(m_tmpFileName);
- }
+ if (m_url.isEmpty())
+ copyMediaFile(MEDIA_FILEPATH, MEDIA_FILE, m_tmpFileName, &m_url);
qDebug() << "Using url:" << m_url.toString();
@@ -533,6 +551,47 @@ void tst_MediaObject::pauseToStop()
stopPlayback(Phonon::PausedState);
}
+/*!
+
+ We attempt to play a SDP file. An SDP file essentially describes different
+ media streams and is hence a layer in front of the actual media(s).
+ Sometimes the backend handles the SDP file, in other cases not.
+
+ Some Phonon backends doesn't support SDP at all, ifdef appropriately. Real
+ Player and Helix, the two backends for Symbian, are known to support SDP.
+ */
+void tst_MediaObject::playSDP()
+{
+#ifdef Q_OS_SYMBIAN
+ QString sdpFile;
+ copyMediaFile(QLatin1String(":/media/test.sdp"), QLatin1String("test.sdp"), sdpFile);
+
+ // Let's verify our test setup.
+ QVERIFY(QFileInfo(sdpFile).isReadable());
+
+ // We need a window in order to setup the video.
+ QWidget widget;
+ widget.show();
+
+ const MediaSource oldSource(m_media->currentSource());
+ const MediaSource sdpSource(sdpFile);
+ m_media->setCurrentSource(sdpSource);
+ if (m_media->state() != Phonon::StoppedState)
+ QTest::waitForSignal(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000);
+
+ // At this point we're in error state due to absent media, but it has now loaded the SDP:
+ QCOMPARE(m_media->errorString(), QString::fromLatin1("Buffering clip failed: Unknown error (-39)"));
+
+ // We cannot play the SDP, we can neither attempt to play it, because we
+ // won't get a state change from ErrorState to ErrorState, and hence block
+ // on a never occuring signal.
+ m_media->setCurrentSource(oldSource);
+
+#else
+ QSKIP("Unsupported on this platform.", SkipAll);
+#endif
+}
+
void tst_MediaObject::testPrefinishMark()
{
const qint32 requestedPrefinishMarkTime = 2000;
diff --git a/tests/auto/multimedia.pro b/tests/auto/multimedia.pro
index 9cfae84..f55d6e4 100644
--- a/tests/auto/multimedia.pro
+++ b/tests/auto/multimedia.pro
@@ -6,6 +6,7 @@ SUBDIRS=\
qaudioformat \
qaudioinput \
qaudiooutput \
+ qsoundeffect \
qdeclarativeaudio \
qdeclarativevideo \
qgraphicsvideoitem \
diff --git a/tests/auto/q3listview/tst_q3listview.cpp b/tests/auto/q3listview/tst_q3listview.cpp
index 4de6f95..56fa25f 100644
--- a/tests/auto/q3listview/tst_q3listview.cpp
+++ b/tests/auto/q3listview/tst_q3listview.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <iostream>
#include <QtTest/QtTest>
@@ -87,6 +88,8 @@ public slots:
private slots:
void getSetCheck();
void sortchild();
+ void sortchild2(); // item -> item -> 3 items
+ void sortchild3(); // item -> 3 items
void takeItem_data();
void takeItem();
void selections_mouseClick_data();
@@ -262,7 +265,7 @@ void tst_Q3ListView::sortchild()
QVERIFY( item == item1 );
listview->setSorting( 0, FALSE );
-
+
item = listview->firstChild();
QVERIFY( item == item1 );
item = item->itemBelow();
@@ -291,6 +294,127 @@ void tst_Q3ListView::sortchild()
delete listview;
}
+void tst_Q3ListView::sortchild2()
+{
+ Q3ListView* listview = new Q3ListView( 0 );
+
+ listview->addColumn( "" );
+
+ Q3ListViewItem* item1 = new Q3ListViewItem( listview, "zzz" );
+ Q3ListViewItem* item2 = new Q3ListViewItem( listview, "hhh" );
+ Q3ListViewItem* item3 = new Q3ListViewItem( listview, "bbb" );
+ Q3ListViewItem* item4 = new Q3ListViewItem( listview, "jjj" );
+ Q3ListViewItem* item5 = new Q3ListViewItem( listview, "ddd" );
+ Q3ListViewItem* item6 = new Q3ListViewItem( listview, "lll" );
+
+ Q3ListViewItem* item31 = new Q3ListViewItem( item3, "bbb-level2" );
+
+ Q3ListViewItem* item31b = new Q3ListViewItem( item31, "234" );
+ Q3ListViewItem* item31c = new Q3ListViewItem( item31, "345" );
+ Q3ListViewItem* item31a = new Q3ListViewItem( item31, "123" );
+
+ listview->setOpen( item3, TRUE );
+ listview->setOpen( item31, TRUE );
+
+ listview->setSorting( 0, TRUE );
+ listview->show();
+
+ Q3ListViewItem *item = listview->firstChild();
+ QVERIFY( item == item3 );
+ item = item->itemBelow();
+ QVERIFY( item == item31 );
+ item = item->itemBelow();
+ QVERIFY( item == item31a );
+ item = item->itemBelow();
+ QVERIFY( item == item31b );
+ item = item->itemBelow();
+ QVERIFY( item == item31c );
+ item = item->itemBelow();
+ QVERIFY( item == item5 );
+ item = item->itemBelow();
+ QVERIFY( item == item2 );
+ item = item->itemBelow();
+ QVERIFY( item == item4 );
+ item = item->itemBelow();
+ QVERIFY( item == item6 );
+ item = item->itemBelow();
+ QVERIFY( item == item1 );
+
+ listview->setSorting( 0, FALSE );
+
+ item = listview->firstChild();
+ QVERIFY( item == item1 );
+ item = item->itemBelow();
+ QVERIFY( item == item6 );
+ item = item->itemBelow();
+ QVERIFY( item == item4 );
+ item = item->itemBelow();
+ QVERIFY( item == item2 );
+ item = item->itemBelow();
+ QVERIFY( item == item5 );
+ item = item->itemBelow();
+ QVERIFY( item == item3 );
+ item = item->itemBelow();
+ QVERIFY( item == item31 );
+ item = item->itemBelow();
+ QVERIFY( item == item31c );
+ item = item->itemBelow();
+ QVERIFY( item == item31b );
+ item = item->itemBelow();
+ QVERIFY( item == item31a );
+
+ item = listview->firstChild();
+ item->moveItem( item->itemBelow() );
+
+ listview->setSorting( 0, FALSE );
+ QVERIFY( item == listview->firstChild() );
+
+ delete listview;
+}
+
+void tst_Q3ListView::sortchild3()
+{
+ Q3ListView* listview = new Q3ListView( 0 );
+
+ listview->addColumn( "" );
+
+ Q3ListViewItem* item3 = new Q3ListViewItem( listview, "bbb" );
+
+
+ Q3ListViewItem* item31b = new Q3ListViewItem( item3, "234" );
+ Q3ListViewItem* item31c = new Q3ListViewItem( item3, "345" );
+ Q3ListViewItem* item31a = new Q3ListViewItem( item3, "123" );
+
+ listview->setOpen( item3, TRUE );
+
+ listview->setSorting( 0, TRUE );
+ listview->show();
+
+ Q3ListViewItem *item = listview->firstChild();
+ QVERIFY( item == item3 );
+ item = item->itemBelow();
+ QVERIFY( item == item31a );
+ item = item->itemBelow();
+ QVERIFY( item == item31b );
+ item = item->itemBelow();
+ QVERIFY( item == item31c );
+ item = item->itemBelow();
+
+ listview->setSorting( 0, FALSE );
+
+ item = listview->firstChild();
+ QVERIFY( item == item3 );
+ item = item->itemBelow();
+ QVERIFY( item == item31c );
+ item = item->itemBelow();
+ QVERIFY( item == item31b );
+ item = item->itemBelow();
+ QVERIFY( item == item31a );
+
+ delete listview;
+}
+
+
void tst_Q3ListView::takeItem_data()
{
QTest::addColumn<Q3ListView::SelectionMode>("selectionMode");
diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
index 874eb7b..f837564 100644
--- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
+++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
@@ -48,6 +48,7 @@
#include "../qsqldatabase/tst_databases.h"
+const QString qtest(qTableName( "qtest", __FILE__ ));
//TESTED_FILES=
@@ -142,26 +143,26 @@ void tst_Q3SqlCursor::createTestTables( QSqlDatabase db )
// please never ever change this table; otherwise fix all tests ;)
if ( tst_Databases::isMSAccess( db ) ) {
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest" ) + " ( id int not null, t_varchar varchar(40) not null,"
+ QVERIFY_SQL(q, exec( "create table " + qtest + " ( id int not null, t_varchar varchar(40) not null,"
"t_char char(40), t_numeric number, primary key (id, t_varchar) )" ));
} else {
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest" ) + " ( id int not null, t_varchar varchar(40) not null,"
+ QVERIFY_SQL(q, exec( "create table " + qtest + " ( id int not null, t_varchar varchar(40) not null,"
"t_char char(40), t_numeric numeric(6, 3), primary key (id, t_varchar) )" ));
}
if ( tst_Databases::isSqlServer( db ) ) {
//workaround for SQL SERVER since he can store unicode only in nvarchar fields
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_unicode") + " (id int not null, "
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_unicode", __FILE__) + " (id int not null, "
"t_varchar nvarchar(80) not null, t_char nchar(80) )" ));
} else {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_unicode") + " (id int not null, "
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_unicode", __FILE__) + " (id int not null, "
"t_varchar varchar(100) not null," "t_char char(100))" ));
}
if (tst_Databases::isMSAccess(db)) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 number)"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision", __FILE__) + " (col1 number)"));
} else {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision", __FILE__) + " (col1 numeric(15, 14))"));
}
}
@@ -170,12 +171,12 @@ void tst_Q3SqlCursor::dropTestTables( QSqlDatabase db )
if ( !db.isValid() )
return;
QStringList tableNames;
- tableNames << qTableName( "qtest" )
- << qTableName( "qtest_unicode" )
- << qTableName( "qtest_precision" )
- << qTableName( "qtest_ovchar" )
- << qTableName( "qtest_onvchar" )
- << qTableName( "qtestPK" );
+ tableNames << qtest
+ << qTableName( "qtest_unicode", __FILE__ )
+ << qTableName( "qtest_precision", __FILE__ )
+ << qTableName( "qtest_ovchar", __FILE__ )
+ << qTableName( "qtest_onvchar", __FILE__ )
+ << qTableName( "qtestPK", __FILE__ );
tst_Databases::safeDropTables( db, tableNames );
}
@@ -185,8 +186,8 @@ void tst_Q3SqlCursor::populateTestTables( QSqlDatabase db )
return;
QSqlQuery q( db );
- q.exec( "delete from " + qTableName( "qtest" ) ); //not fatal
- QVERIFY_SQL(q, prepare("insert into " + qTableName( "qtest" ) + " (id, t_varchar, t_char, t_numeric) values (?, ?, ?, ?)"));
+ q.exec( "delete from " + qtest ); //not fatal
+ QVERIFY_SQL(q, prepare("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (?, ?, ?, ?)"));
q.addBindValue(QVariantList() << 0 << 1 << 2 << 3);
q.addBindValue(QVariantList() << "VarChar0" << "VarChar1" << "VarChar2" << "VarChar3");
q.addBindValue(QVariantList() << "Char0" << "Char1" << "Char2" << "Char3");
@@ -243,7 +244,7 @@ void tst_Q3SqlCursor::copyConstructor()
Q3SqlCursor cur2;
{
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QVERIFY_SQL(cur, select( cur.index( QString("id") ) ));
cur2 = Q3SqlCursor( cur );
// let "cur" run out of scope...
@@ -266,7 +267,7 @@ void tst_Q3SqlCursor::value()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QVERIFY_SQL(cur, select( cur.index( QString("id") ) ));
int i = 0;
while ( cur.next() ) {
@@ -281,7 +282,7 @@ void tst_Q3SqlCursor::primaryIndex()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QSqlIndex index = cur.primaryIndex();
if ( tst_Databases::isMSAccess( db ) ) {
QCOMPARE( index.fieldName(1).upper(), QString( "ID" ) );
@@ -300,7 +301,7 @@ void tst_Q3SqlCursor::insert()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QSqlRecord* irec = cur.primeInsert();
QVERIFY( irec != 0 );
@@ -338,7 +339,7 @@ void tst_Q3SqlCursor::insertSpecial()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QSqlRecord* irec = cur.primeInsert();
QVERIFY( irec != 0 );
@@ -386,9 +387,9 @@ void tst_Q3SqlCursor::batchInsert()
CHECK_DATABASE( db );
QSqlQuery q( db );
- q.exec( "delete from " + qTableName( "qtest" ) );
+ q.exec( "delete from " + qtest );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
int i = 0;
for ( ; i < 100; ++i ) {
@@ -420,7 +421,7 @@ void tst_Q3SqlCursor::batchInsert()
}
i = 0;
- QVERIFY_SQL(q, exec( "select * from " + qTableName( "qtest" ) + " order by id" ));
+ QVERIFY_SQL(q, exec( "select * from " + qtest + " order by id" ));
while ( q.next() ) {
QCOMPARE( q.value( 0 ).toInt(), i );
i++;
@@ -452,11 +453,11 @@ void tst_Q3SqlCursor::insertORA()
/****** CHARSET TEST ******/
QSqlQuery q( db );
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest_ovchar" ) + " ( id int primary key, t_char varchar(40) )" ));
+ QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest_ovchar", __FILE__ ) + " ( id int primary key, t_char varchar(40) )" ));
static const QString val1( "blah1" );
- Q3SqlCursor cur ( qTableName( "qtest_ovchar" ), true, db );
+ Q3SqlCursor cur ( qTableName( "qtest_ovchar", __FILE__ ), true, db );
QSqlRecord* irec = cur.primeInsert();
irec->setValue( "id", 1 );
irec->setValue( "t_char", val1 );
@@ -486,9 +487,9 @@ void tst_Q3SqlCursor::insertORA()
/****** NCHARSET TEST ********/
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest_onvchar" ) + " ( id int primary key, t_nchar nvarchar2(40) )" ));
+ QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest_onvchar", __FILE__ ) + " ( id int primary key, t_nchar nvarchar2(40) )" ));
- Q3SqlCursor cur2 ( qTableName( "qtest_onvchar" ), true, db );
+ Q3SqlCursor cur2 ( qTableName( "qtest_onvchar", __FILE__ ), true, db );
irec = cur2.primeInsert();
irec->setValue( "id", 1 );
irec->setValue( "t_nchar", val1 );
@@ -529,7 +530,7 @@ void tst_Q3SqlCursor::unicode()
if(db.driverName().startsWith("QIBASE") && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb"))
QSKIP("Can't transliterate extended unicode to ascii", SkipSingle);
- Q3SqlCursor cur( qTableName( "qtest_unicode" ), true, db );
+ Q3SqlCursor cur( qTableName( "qtest_unicode", __FILE__ ), true, db );
QSqlRecord* irec = cur.primeInsert();
irec->setValue( 0, 500 );
irec->setValue( 1, utf8str );
@@ -566,7 +567,7 @@ void tst_Q3SqlCursor::precision()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest_precision" ), true, db );
+ Q3SqlCursor cur( qTableName( "qtest_precision", __FILE__ ), true, db );
cur.setTrimmed( "col1", true );
QSqlRecord* irec = cur.primeInsert();
irec->setValue( 0, precStr );
@@ -589,7 +590,7 @@ void tst_Q3SqlCursor::setFilter()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
cur.setFilter( "id = 2" );
QVERIFY_SQL(cur, select());
@@ -619,23 +620,23 @@ void tst_Q3SqlCursor::select()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor cur( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur( qtest, true, db );
QVERIFY_SQL(cur, select());
QVERIFY( cur.next() );
QVERIFY( cur.next() );
- Q3SqlCursor cur2( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur2( qtest, true, db );
QVERIFY_SQL(cur2, select( "id = 1" ));
QVERIFY( cur2.next() );
QCOMPARE( cur2.value( 0 ).toInt(), 1 );
- Q3SqlCursor cur3( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur3( qtest, true, db );
QVERIFY_SQL(cur3, select( cur3.primaryIndex( false ) ));
QVERIFY( cur3.next() );
QVERIFY( cur3.next() );
QCOMPARE( cur3.value( 0 ).toInt(), 1 );
- Q3SqlCursor cur4( qTableName( "qtest" ), true, db );
+ Q3SqlCursor cur4( qtest, true, db );
QSqlIndex idx = cur4.primaryIndex( false );
QCOMPARE( (int)idx.count(), 2 );
if ( tst_Databases::isMSAccess( db ) ) {
@@ -667,17 +668,17 @@ void tst_Q3SqlCursor::setName()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlCursor c2( qTableName( "qtest" ), true, db );
- QCOMPARE( c2.name(), qTableName( "qtest" ) );
+ Q3SqlCursor c2( qtest, true, db );
+ QCOMPARE( c2.name(), qtest );
QCOMPARE( c2.fieldName( 0 ).lower(), QString( "id" ) );
Q3SqlCursor c( QString(), true, db );
- c.setName( qTableName( "qtest" ) );
- QCOMPARE( c.name(), qTableName( "qtest" ) );
+ c.setName( qtest );
+ QCOMPARE( c.name(), qtest );
QCOMPARE( c.fieldName( 0 ).lower(), QString( "id" ) );
- c.setName( qTableName( "qtest_precision" ) );
- QCOMPARE( c.name(), qTableName( "qtest_precision" ) );
+ c.setName( qTableName( "qtest_precision", __FILE__ ) );
+ QCOMPARE( c.name(), qTableName( "qtest_precision", __FILE__ ) );
QCOMPARE( c.fieldName( 0 ).lower(), QString( "col1" ) );
}
@@ -689,9 +690,9 @@ void tst_Q3SqlCursor::updateNoPK()
CHECK_DATABASE( db );
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("create table " + qTableName( "qtestPK" ) + " (id int, name varchar(20), num numeric)"));
+ QVERIFY_SQL(q, exec("create table " + qTableName( "qtestPK", __FILE__ ) + " (id int, name varchar(20), num numeric)"));
- Q3SqlCursor cur(qTableName("qtestPK"), true, db);
+ Q3SqlCursor cur(qTableName("qtestPK", __FILE__), true, db);
QSqlRecord* rec = cur.primeInsert();
Q_ASSERT(rec);
rec->setNull(0);
@@ -705,14 +706,14 @@ void tst_Q3SqlCursor::updateNoPK()
db.driverName().startsWith("QMYSQL") ||
db.driverName().startsWith("QODBC") ||
db.driverName().startsWith("QOCI")) {
- QString query = QString::fromLatin1("insert into " + qTableName("qtestPK") +
+ QString query = QString::fromLatin1("insert into " + qTableName("qtestPK", __FILE__) +
" (" + db.driver()->escapeIdentifier("id", QSqlDriver::FieldName) + ','
+ db.driver()->escapeIdentifier("name", QSqlDriver::FieldName) + ','
+ db.driver()->escapeIdentifier("num", QSqlDriver::FieldName) + ')'
+ " values (NULL,NULL,NULL)");
QCOMPARE(cur.lastQuery(), query);
} else {
- QCOMPARE(cur.lastQuery(), QString::fromLatin1("insert into " + qTableName("qtestPK") +
+ QCOMPARE(cur.lastQuery(), QString::fromLatin1("insert into " + qTableName("qtestPK", __FILE__) +
" (\"id\",\"name\",\"num\") values (NULL,NULL,NULL)"));
}
}
@@ -724,12 +725,12 @@ void tst_Q3SqlCursor::updateNoPK()
rec->setNull(2);
// Sqlite returns 2, don't ask why.
QVERIFY(cur.update() != 0);
- QString expect = "update " + qTableName("qtestPK") +
+ QString expect = "update " + qTableName("qtestPK", __FILE__) +
" set "+db.driver()->escapeIdentifier("id", QSqlDriver::FieldName)+" = 1 , "
+db.driver()->escapeIdentifier("name", QSqlDriver::FieldName)+" = NULL , "
- +db.driver()->escapeIdentifier("num", QSqlDriver::FieldName)+" = NULL where " + qTableName("qtestPK") + ".id"
- " IS NULL and " + qTableName("qtestPK") + ".name IS NULL and " +
- qTableName("qtestPK") + ".num IS NULL";
+ +db.driver()->escapeIdentifier("num", QSqlDriver::FieldName)+" = NULL where " + qTableName("qtestPK", __FILE__) + ".id"
+ " IS NULL and " + qTableName("qtestPK", __FILE__) + ".name IS NULL and " +
+ qTableName("qtestPK", __FILE__) + ".num IS NULL";
if (!db.driver()->hasFeature(QSqlDriver::PreparedQueries)) {
if (!db.driverName().startsWith("QSQLITE")) {
QCOMPARE(cur.lastQuery(), expect);
@@ -760,7 +761,7 @@ void tst_Q3SqlCursor::insertFieldNameContainsWS() {
return;
}
- QString tableName = qTableName("qtestws");
+ QString tableName = qTableName("qtestws", __FILE__);
QSqlQuery q(db);
tst_Databases::safeDropTable(db, tableName);
diff --git a/tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp b/tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp
index c19f9fd..b69ae79 100644
--- a/tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp
+++ b/tests/auto/q3sqlselectcursor/tst_q3sqlselectcursor.cpp
@@ -111,16 +111,16 @@ void tst_Q3SqlSelectCursor::createTestTables( QSqlDatabase db )
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
// please never ever change this table; otherwise fix all tests ;)
if (tst_Databases::isMSAccess(db))
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest" ) + " ( id int not null, t_varchar varchar(40) not null,"
+ QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest", __FILE__ ) + " ( id int not null, t_varchar varchar(40) not null,"
"t_char char(40), t_numeric number, primary key (id, t_varchar) )" ));
else
- QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest" ) + " ( id int not null, t_varchar varchar(40) not null,"
+ QVERIFY_SQL(q, exec( "create table " + qTableName( "qtest", __FILE__ ) + " ( id int not null, t_varchar varchar(40) not null,"
"t_char char(40), t_numeric numeric(6, 3), primary key (id, t_varchar) )" ));
}
void tst_Q3SqlSelectCursor::dropTestTables( QSqlDatabase db )
{
- tst_Databases::safeDropTable( db, qTableName( "qtest" ) );
+ tst_Databases::safeDropTable( db, qTableName( "qtest", __FILE__ ) );
}
void tst_Q3SqlSelectCursor::populateTestTables( QSqlDatabase db )
@@ -129,11 +129,11 @@ void tst_Q3SqlSelectCursor::populateTestTables( QSqlDatabase db )
return;
QSqlQuery q( db );
- q.exec( "delete from " + qTableName( "qtest" ) ); //non-fatal
- QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest" ) + " (id, t_varchar, t_char, t_numeric) values ( 0, 'VarChar0', 'Char0', 1.1 )" ));
- QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest" ) + " (id, t_varchar, t_char, t_numeric) values ( 1, 'VarChar1', 'Char1', 2.2 )" ));
- QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest" ) + " (id, t_varchar, t_char, t_numeric) values ( 2, 'VarChar2', 'Char2', 3.3 )" ));
- QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest" ) + " (id, t_varchar, t_char, t_numeric) values ( 3, 'VarChar3', 'Char3', 4.4 )" ));
+ q.exec( "delete from " + qTableName( "qtest", __FILE__ ) ); //non-fatal
+ QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest", __FILE__ ) + " (id, t_varchar, t_char, t_numeric) values ( 0, 'VarChar0', 'Char0', 1.1 )" ));
+ QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest", __FILE__ ) + " (id, t_varchar, t_char, t_numeric) values ( 1, 'VarChar1', 'Char1', 2.2 )" ));
+ QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest", __FILE__ ) + " (id, t_varchar, t_char, t_numeric) values ( 2, 'VarChar2', 'Char2', 3.3 )" ));
+ QVERIFY_SQL(q, exec( "insert into " + qTableName( "qtest", __FILE__ ) + " (id, t_varchar, t_char, t_numeric) values ( 3, 'VarChar3', 'Char3', 4.4 )" ));
}
void tst_Q3SqlSelectCursor::initTestCase()
@@ -184,7 +184,7 @@ void tst_Q3SqlSelectCursor::value()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
- Q3SqlSelectCursor cur( "select * from " + qTableName( "qtest" ) + " order by id", db );
+ Q3SqlSelectCursor cur( "select * from " + qTableName( "qtest", __FILE__ ) + " order by id", db );
QVERIFY( cur.select() );
QVERIFY_SQL(cur, isActive());
int i = 0;
@@ -203,7 +203,7 @@ void tst_Q3SqlSelectCursor::_exec()
Q3SqlSelectCursor cur( QString(), db );
QVERIFY_SQL(cur, isActive() == false);
- cur.exec( "select * from " + qTableName( "qtest" ) ); //nothing should happen
+ cur.exec( "select * from " + qTableName( "qtest", __FILE__ ) ); //nothing should happen
QVERIFY_SQL(cur, isActive());
int i = 0;
while ( cur.next() ) {
diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp
index 547147c..6227c2e 100644
--- a/tests/auto/qchar/tst_qchar.cpp
+++ b/tests/auto/qchar/tst_qchar.cpp
@@ -72,6 +72,7 @@ private slots:
void toLower();
void toTitle();
void toCaseFolded();
+ void isPrint();
void isUpper();
void isLower();
void category();
@@ -218,6 +219,12 @@ void tst_QChar::toCaseFolded()
QVERIFY(QChar::toCaseFolded((ushort)0xb5) == 0x3bc);
}
+void tst_QChar::isPrint()
+{
+ QVERIFY(QChar('A').isPrint());
+ QVERIFY(!QChar(0x1aff).isPrint()); // General_Gategory =Cn
+}
+
void tst_QChar::isUpper()
{
QVERIFY(QChar('A').isUpper());
@@ -259,6 +266,12 @@ void tst_QChar::category()
QVERIFY(QChar::category(0xd900u) == QChar::Other_Surrogate);
QVERIFY(QChar::category(0xdc00u) == QChar::Other_Surrogate);
QVERIFY(QChar::category(0xdc01u) == QChar::Other_Surrogate);
+
+ QVERIFY(QChar::category((uint)0x10fffdu) == QChar::Other_PrivateUse);
+ QVERIFY(QChar::category((uint)0x110000u) == QChar::NoCategory);
+
+ QVERIFY(QChar::category((uint)0x1aff) == QChar::Other_NotAssigned);
+ QVERIFY(QChar::category((uint)0x10ffffu) == QChar::Other_NotAssigned);
}
void tst_QChar::direction()
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index d89e463..8ee494f 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -227,12 +227,12 @@ void tst_QGL::getSetCheck()
QCOMPARE(false, obj1.alpha());
QVERIFY(!obj1.testOption(QGL::AlphaChannel));
QVERIFY(obj1.testOption(QGL::NoAlphaChannel));
- obj1.setAlphaBufferSize(0);
+ obj1.setAlphaBufferSize(1);
QCOMPARE(true, obj1.alpha()); // setAlphaBufferSize() enables alpha.
- QCOMPARE(0, obj1.alphaBufferSize());
+ QCOMPARE(1, obj1.alphaBufferSize());
QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size -2147483648");
obj1.setAlphaBufferSize(TEST_INT_MIN);
- QCOMPARE(0, obj1.alphaBufferSize()); // Makes no sense with a negative buffer size
+ QCOMPARE(1, obj1.alphaBufferSize()); // Makes no sense with a negative buffer size
obj1.setAlphaBufferSize(3);
QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size -1");
obj1.setAlphaBufferSize(-1);
@@ -243,11 +243,11 @@ void tst_QGL::getSetCheck()
// int QGLFormat::stencilBufferSize()
// void QGLFormat::setStencilBufferSize(int)
QCOMPARE(-1, obj1.stencilBufferSize());
- obj1.setStencilBufferSize(0);
- QCOMPARE(0, obj1.stencilBufferSize());
+ obj1.setStencilBufferSize(1);
+ QCOMPARE(1, obj1.stencilBufferSize());
QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setStencilBufferSize: Cannot set negative stencil buffer size -2147483648");
obj1.setStencilBufferSize(TEST_INT_MIN);
- QCOMPARE(0, obj1.stencilBufferSize()); // Makes no sense with a negative buffer size
+ QCOMPARE(1, obj1.stencilBufferSize()); // Makes no sense with a negative buffer size
obj1.setStencilBufferSize(3);
QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setStencilBufferSize: Cannot set negative stencil buffer size -1");
obj1.setStencilBufferSize(-1);
@@ -352,6 +352,7 @@ void tst_QGL::getSetCheck()
// bool QGLFormat::accum()
// void QGLFormat::setAccum(bool)
+ obj1.setAccumBufferSize(0);
QCOMPARE(false, obj1.accum());
QVERIFY(!obj1.testOption(QGL::AccumBuffer));
QVERIFY(obj1.testOption(QGL::NoAccumBuffer));
@@ -1401,8 +1402,8 @@ void tst_QGL::glWidgetRenderPixmap()
QImage reference(fb.size(), QImage::Format_RGB32);
reference.fill(0xffff0000);
-#ifdef QGL_EGL
- QSKIP("renderPixmap() not yet supported under EGL", SkipAll);
+#if defined(QGL_EGL) && !defined(Q_WS_X11)
+ QSKIP("renderPixmap() not yet supported under EGL on your platform", SkipAll);
#endif
QFUZZY_COMPARE_IMAGES(fb, reference);
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index 58b1a48..4b56f77 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -85,6 +85,9 @@ private slots:
void sessionOpenCloseStop_data();
void sessionOpenCloseStop();
+ void sessionAutoClose_data();
+ void sessionAutoClose();
+
private:
QNetworkConfigurationManager manager;
@@ -1202,7 +1205,67 @@ bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration) {
return true;
}
+void tst_QNetworkSession::sessionAutoClose_data()
+{
+ QTest::addColumn<QNetworkConfiguration>("configuration");
+
+ bool testData = false;
+ foreach (const QNetworkConfiguration &config,
+ manager.allConfigurations(QNetworkConfiguration::Discovered)) {
+ QNetworkSession session(config);
+ if (!session.sessionProperty(QLatin1String("AutoCloseSessionTimeout")).isValid())
+ continue;
+
+ testData = true;
+
+ const QString name = config.name().isEmpty() ? QString("<Hidden>") : config.name();
+ QTest::newRow(name.toLocal8Bit().constData()) << config;
+ }
+
+ if (!testData)
+ QSKIP("No applicable configurations to test", SkipAll);
+}
+
+void tst_QNetworkSession::sessionAutoClose()
+{
+ QFETCH(QNetworkConfiguration, configuration);
+
+ QNetworkSession session(configuration);
+
+ QVERIFY(session.configuration() == configuration);
+ QVariant autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
+
+ QVERIFY(autoCloseSession.isValid());
+
+ // property defaults to false
+ QCOMPARE(autoCloseSession.toInt(), -1);
+
+ QSignalSpy closeSpy(&session, SIGNAL(closed()));
+
+ session.open();
+ session.waitForOpened();
+
+ if (!session.isOpen())
+ QSKIP("Session not open", SkipSingle);
+
+ // set session to auto close at next polling interval.
+ session.setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), 0);
+
+ QTRY_VERIFY(!closeSpy.isEmpty());
+
+ QCOMPARE(session.state(), QNetworkSession::Connected);
+
+ QVERIFY(!session.isOpen());
+
+ QVERIFY(session.configuration() == configuration);
+
+ autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
+
+ QVERIFY(autoCloseSession.isValid());
+
+ QCOMPARE(autoCloseSession.toInt(), -1);
+}
QTEST_MAIN(tst_QNetworkSession)
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index a03b2c7..701dc2e 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -999,10 +999,10 @@ void tst_QPainter::drawPixmapFragments()
{
QPixmap origPixmap(20, 20);
QPixmap resPixmap(20, 20);
- QPainter::Fragment fragments[4] = { {15, 15, 0, 0, 10, 10, 1, 1, 0, 1},
- { 5, 15, 10, 0, 10, 10, 1, 1, 0, 1},
- {15, 5, 0, 10, 10, 10, 1, 1, 0, 1},
- { 5, 5, 10, 10, 10, 10, 1, 1, 0, 1} };
+ QPainter::PixmapFragment fragments[4] = { {15, 15, 0, 0, 10, 10, 1, 1, 0, 1},
+ { 5, 15, 10, 0, 10, 10, 1, 1, 0, 1},
+ {15, 5, 0, 10, 10, 10, 1, 1, 0, 1},
+ { 5, 5, 10, 10, 10, 10, 1, 1, 0, 1} };
{
QPainter p(&origPixmap);
p.fillRect(0, 0, 10, 10, Qt::red);
@@ -1025,7 +1025,7 @@ void tst_QPainter::drawPixmapFragments()
QVERIFY(resImage.pixel(15, 15) == origImage.pixel(5, 5));
- QPainter::Fragment fragment = QPainter::Fragment::create(QPointF(20, 20), QRectF(30, 30, 2, 2));
+ QPainter::PixmapFragment fragment = QPainter::PixmapFragment::create(QPointF(20, 20), QRectF(30, 30, 2, 2));
QVERIFY(fragment.x == 20);
QVERIFY(fragment.y == 20);
QVERIFY(fragment.sourceLeft == 30);
diff --git a/tests/auto/qsoundeffect/qsoundeffect.pro b/tests/auto/qsoundeffect/qsoundeffect.pro
new file mode 100644
index 0000000..eaa35b2
--- /dev/null
+++ b/tests/auto/qsoundeffect/qsoundeffect.pro
@@ -0,0 +1,20 @@
+load(qttest_p4)
+
+SOURCES += tst_qsoundeffect.cpp
+
+QT = core multimedia
+
+wince* {
+ deploy.sources += 4.wav
+ DEPLOYMENT = deploy
+ DEFINES += SRCDIR=\\\"\\\"
+ QT += gui
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+unix:!mac {
+ !contains(QT_CONFIG, pulseaudio) {
+ DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER
+ }
+}
diff --git a/tests/auto/qsoundeffect/test.wav b/tests/auto/qsoundeffect/test.wav
new file mode 100644
index 0000000..e4088a9
--- /dev/null
+++ b/tests/auto/qsoundeffect/test.wav
Binary files differ
diff --git a/tests/auto/qsoundeffect/tst_qsoundeffect.cpp b/tests/auto/qsoundeffect/tst_qsoundeffect.cpp
new file mode 100644
index 0000000..b918816
--- /dev/null
+++ b/tests/auto/qsoundeffect/tst_qsoundeffect.cpp
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+
+#include <QtTest/QtTest>
+#include <QtCore/qlocale.h>
+#include <qaudiooutput.h>
+#include <qaudiodeviceinfo.h>
+#include <qaudio.h>
+#include <private/qsoundeffect_p.h>
+
+
+class tst_QSoundEffect : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QSoundEffect(QObject* parent=0) : QObject(parent) {}
+
+private slots:
+ void initTestCase();
+ void testSource();
+ void testLooping();
+ void testVolume();
+ void testMuting();
+
+private:
+ QSoundEffect* sound;
+};
+
+void tst_QSoundEffect::initTestCase()
+{
+#ifndef QT_MULTIMEDIA_QMEDIAPLAYER
+ sound = new QSoundEffect;
+
+ QVERIFY(sound->source().isEmpty());
+ QVERIFY(sound->loopCount() == 1);
+ QVERIFY(sound->volume() == 100);
+ QVERIFY(sound->isMuted() == false);
+#endif
+}
+
+void tst_QSoundEffect::testSource()
+{
+#ifndef QT_MULTIMEDIA_QMEDIAPLAYER
+ QSignalSpy readSignal(sound, SIGNAL(sourceChanged()));
+
+ QUrl url = QUrl::fromLocalFile(QString("%1%2").arg(SRCDIR).arg("test.wav"));
+ sound->setSource(url);
+
+ QCOMPARE(sound->source(),url);
+ QCOMPARE(readSignal.count(),1);
+
+ QTestEventLoop::instance().enterLoop(1);
+ sound->play();
+
+ QTest::qWait(3000);
+#endif
+}
+
+void tst_QSoundEffect::testLooping()
+{
+#ifndef QT_MULTIMEDIA_QMEDIAPLAYER
+ QSignalSpy readSignal(sound, SIGNAL(loopCountChanged()));
+
+ sound->setLoopCount(5);
+ QCOMPARE(sound->loopCount(),5);
+
+ sound->play();
+
+ // test.wav is about 200ms, wait until it has finished playing 5 times
+ QTest::qWait(3000);
+#endif
+}
+
+void tst_QSoundEffect::testVolume()
+{
+#ifndef QT_MULTIMEDIA_QMEDIAPLAYER
+ QSignalSpy readSignal(sound, SIGNAL(volumeChanged()));
+
+ sound->setVolume(50);
+ QCOMPARE(sound->volume(),50);
+
+ QTest::qWait(20);
+ QCOMPARE(readSignal.count(),1);
+#endif
+}
+
+void tst_QSoundEffect::testMuting()
+{
+#ifndef QT_MULTIMEDIA_QMEDIAPLAYER
+ QSignalSpy readSignal(sound, SIGNAL(mutedChanged()));
+
+ sound->setMuted(true);
+ QCOMPARE(sound->isMuted(),true);
+
+ QTest::qWait(20);
+ QCOMPARE(readSignal.count(),1);
+
+ delete sound;
+#endif
+}
+
+QTEST_MAIN(tst_QSoundEffect)
+
+#include "tst_qsoundeffect.moc"
diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h
index 4e99f18..5837719 100644
--- a/tests/auto/qsqldatabase/tst_databases.h
+++ b/tests/auto/qsqldatabase/tst_databases.h
@@ -95,12 +95,14 @@ static QString qGetHostName()
// to prevent nameclashes on our database server, each machine
// will use its own set of table names. Call this function to get
// "tablename_hostname"
-inline static QString qTableName( const QString& prefix, QSqlDriver* driver = 0 )
+inline static QString qTableName( const QString& prefix, const char *sourceFileName )
{
- if ( !driver )
- return prefix + "_" + qGetHostName().replace( "-", "_" );
- else
- return driver->escapeIdentifier( prefix + "_" + qGetHostName(), QSqlDriver::TableName );
+ return QLatin1String("dbtst")+QString::number(qHash(QLatin1String(sourceFileName) + "_" + qGetHostName().replace( "-", "_" )), 16)+"_"+prefix;
+}
+
+inline static QString qTableName( const QString& prefix, QSqlDriver* driver )
+{
+ return driver->escapeIdentifier( prefix + "_" + qGetHostName(), QSqlDriver::TableName );
}
inline static bool testWhiteSpaceNames( const QString &name )
@@ -250,8 +252,8 @@ public:
// addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=iceblink.nokia.troll.no\\ICEBLINK", "troll", "trond", "" );
// addDb( "QODBC3", "DRIVER={SQL Native Client};SERVER=silence.nokia.troll.no\\SQLEXPRESS", "troll", "trond", "" );
-// addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=mysql5-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
-// addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=mysql4-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
+// addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=bq-mysql50.apac.nokia.com;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
+// addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=bq-mysql51.apac.nokia.com;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=horsehead.nokia.troll.no;DATABASE=testdb;PORT=4101;UID=troll;PWD=trondk", "troll", "trondk", "" );
// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=silence.nokia.troll.no;DATABASE=testdb;PORT=2392;UID=troll;PWD=trond", "troll", "trond", "" );
// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=bq-winserv2003-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433;UID=testuser;PWD=Ee4Gabf6_;TDS_Version=8.0", "", "", "" );
@@ -261,7 +263,7 @@ public:
// addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=bq-winserv2003-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433", "testuser", "Ee4Gabf6_", "" );
// addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=bq-winserv2008-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433", "testuser", "Ee4Gabf6_", "" );
// addDb( "QODBC", "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\dbs\\access\\testdb.mdb", "", "", "" );
-// addDb( "QODBC", "DRIVER={Postgresql};SERVER=postgres81-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
+// addDb( "QODBC", "DRIVER={Postgresql};SERVER=bq-pgsql84.apac.nokia.com;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
}
void open()
@@ -338,7 +340,7 @@ public:
foreach(const QString &table2, dbtables.filter(table, Qt::CaseInsensitive)) {
if(table2.compare(table.section('.', -1, -1), Qt::CaseInsensitive) == 0) {
table=db.driver()->escapeIdentifier(table2, QSqlDriver::TableName);
- if(db.driverName().startsWith( "QPSQL" ))
+ if(isPostgreSQL(db))
wasDropped = q.exec( "drop table " + table + " cascade");
else
wasDropped = q.exec( "drop table " + table);
@@ -483,16 +485,16 @@ public:
static bool isPostgreSQL( QSqlDatabase db )
{
- return db.driverName().startsWith("QPSQL") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("PostgreSQL") );
+ return db.driverName().startsWith("QPSQL") || (db.driverName().startsWith("QODBC") && ( db.databaseName().contains("PostgreSQL", Qt::CaseInsensitive) || db.databaseName().contains("pgsql", Qt::CaseInsensitive) ) );
}
static bool isMySQL( QSqlDatabase db )
{
- return db.driverName().startsWith("QMYSQL") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("MySQL") );
+ return db.driverName().startsWith("QMYSQL") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("MySQL", Qt::CaseInsensitive) );
}
static bool isDB2( QSqlDatabase db )
{
- return db.driverName().startsWith("QDB2") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("db2") );
+ return db.driverName().startsWith("QDB2") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("db2", Qt::CaseInsensitive) );
}
// -1 on fail, else Oracle version
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index fe084fa..b2b592b 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -259,10 +259,10 @@ struct FieldDef {
// excluding the primary key field
static int createFieldTable(const FieldDef fieldDefs[], QSqlDatabase db)
{
- tst_Databases::safeDropTable(db, qTableName("qtestfields"));
+ tst_Databases::safeDropTable(db, qTableName("qtestfields", __FILE__));
QSqlQuery q(db);
// construct a create table statement consisting of all fieldtypes
- QString qs = "create table " + qTableName("qtestfields");
+ QString qs = "create table " + qTableName("qtestfields", __FILE__);
QString autoName = tst_Databases::autoFieldName(db);
if (tst_Databases::isMSAccess(db))
qs.append(" (id int not null");
@@ -316,18 +316,18 @@ void tst_QSqlDatabase::createTestTables(QSqlDatabase db)
// please never ever change this table; otherwise fix all tests ;)
if (tst_Databases::isMSAccess(db)) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest") +
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest", __FILE__) +
" (id int not null, t_varchar varchar(40) not null, t_char char(40), "
"t_numeric number, primary key (id, t_varchar))"));
} else {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest") +
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest", __FILE__) +
" (id integer not null, t_varchar varchar(40) not null, "
"t_char char(40), t_numeric numeric(6, 3), primary key (id, t_varchar))"));
}
if (testWhiteSpaceNames(db.driverName())) {
QString qry = "create table "
- + db.driver()->escapeIdentifier(qTableName("qtest") + " test", QSqlDriver::TableName)
+ + db.driver()->escapeIdentifier(qTableName("qtest", __FILE__) + " test", QSqlDriver::TableName)
+ '('
+ db.driver()->escapeIdentifier(QLatin1String("test test"), QSqlDriver::FieldName)
+ " int not null primary key)";
@@ -346,45 +346,45 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db)
}
// drop the view first, otherwise we'll get dependency problems
- tst_Databases::safeDropViews(db, QStringList() << qTableName("qtest_view") << qTableName("qtest_view2"));
+ tst_Databases::safeDropViews(db, QStringList() << qTableName("qtest_view", __FILE__) << qTableName("qtest_view2", __FILE__));
QStringList tableNames;
- tableNames << qTableName("qtest")
- << qTableName("qtestfields")
- << qTableName("qtestalter")
- << qTableName("qtest_temp")
- << qTableName("qtest_bigint")
- << qTableName("qtest_xmltype")
- << qTableName("latin1table")
- << qTableName("qtest_sqlguid")
- << qTableName("batable")
- << qTableName("qtest_prec")
- << qTableName("uint")
- << qTableName("strings")
- << qTableName("numericfields")
- << qTableName("qtest_ibaseblobs")
- << qTableName("qtestBindBool")
- << qTableName("testqGetString")
- << qTableName("qtest_sqlguid")
- << qTableName("uint_table")
- << qTableName("uint_test")
- << qTableName("bug_249059");
+ tableNames << qTableName("qtest", __FILE__)
+ << qTableName("qtestfields", __FILE__)
+ << qTableName("qtestalter", __FILE__)
+ << qTableName("qtest_temp", __FILE__)
+ << qTableName("qtest_bigint", __FILE__)
+ << qTableName("qtest_xmltype", __FILE__)
+ << qTableName("latin1table", __FILE__)
+ << qTableName("qtest_sqlguid", __FILE__)
+ << qTableName("batable", __FILE__)
+ << qTableName("qtest_prec", __FILE__)
+ << qTableName("uint", __FILE__)
+ << qTableName("strings", __FILE__)
+ << qTableName("numericfields", __FILE__)
+ << qTableName("qtest_ibaseblobs", __FILE__)
+ << qTableName("qtestBindBool", __FILE__)
+ << qTableName("testqGetString", __FILE__)
+ << qTableName("qtest_sqlguid", __FILE__)
+ << qTableName("uint_table", __FILE__)
+ << qTableName("uint_test", __FILE__)
+ << qTableName("bug_249059", __FILE__);
QSqlQuery q(0, db);
if (db.driverName().startsWith("QPSQL")) {
- q.exec("drop schema " + qTableName("qtestschema") + " cascade");
- q.exec("drop schema " + qTableName("qtestScHeMa") + " cascade");
+ q.exec("drop schema " + qTableName("qtestschema", __FILE__) + " cascade");
+ q.exec("drop schema " + qTableName("qtestScHeMa", __FILE__) + " cascade");
}
if (testWhiteSpaceNames(db.driverName()))
- tableNames << db.driver()->escapeIdentifier(qTableName("qtest") + " test", QSqlDriver::TableName);
+ tableNames << db.driver()->escapeIdentifier(qTableName("qtest", __FILE__) + " test", QSqlDriver::TableName);
tst_Databases::safeDropTables(db, tableNames);
if (db.driverName().startsWith("QOCI")) {
- q.exec("drop user "+qTableName("CREATOR")+" cascade");
- q.exec("drop user "+qTableName("APPUSER")+" cascade");
- q.exec("DROP TABLE system."+qTableName("mypassword"));
+ q.exec("drop user "+qTableName("CREATOR", __FILE__)+" cascade");
+ q.exec("drop user "+qTableName("APPUSER", __FILE__)+" cascade");
+ q.exec("DROP TABLE system."+qTableName("mypassword", __FILE__));
}
}
@@ -394,13 +394,14 @@ void tst_QSqlDatabase::populateTestTables(QSqlDatabase db)
if (!db.isValid())
return;
QSqlQuery q(db);
+ const QString qtest(qTableName("qtest", __FILE__));
- q.exec("delete from " + qTableName("qtest")); //non-fatal
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " (id, t_varchar, t_char, t_numeric) values (0, 'VarChar0', 'Char0', 1.1)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " (id, t_varchar, t_char, t_numeric) values (1, 'VarChar1', 'Char1', 2.2)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " (id, t_varchar, t_char, t_numeric) values (2, 'VarChar2', 'Char2', 3.3)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " (id, t_varchar, t_char, t_numeric) values (3, 'VarChar3', 'Char3', 4.4)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " (id, t_varchar, t_char, t_numeric) values (4, 'VarChar4', NULL, NULL)"));
+ q.exec("delete from " + qtest); //non-fatal
+ QVERIFY_SQL(q, exec("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (0, 'VarChar0', 'Char0', 1.1)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (1, 'VarChar1', 'Char1', 2.2)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (2, 'VarChar2', 'Char2', 3.3)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (3, 'VarChar3', 'Char3', 4.4)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " (id, t_varchar, t_char, t_numeric) values (4, 'VarChar4', NULL, NULL)"));
}
void tst_QSqlDatabase::initTestCase()
@@ -496,7 +497,7 @@ void tst_QSqlDatabase::recordNonSelect()
Q3SqlRecordInfo rInf = db.recordInfo(q);
QVERIFY(rInf.isEmpty());
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_temp") + " (id int)"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_temp", __FILE__) + " (id int)"));
// query without result set should return empty record
rec = db.record(q);
@@ -512,6 +513,8 @@ void tst_QSqlDatabase::tables()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString qtest(qTableName("qtest", __FILE__)), qtest_view(qTableName("qtest_view", __FILE__)), temp_tab(qTableName("test_tab", __FILE__));
+
bool views = true;
bool tempTables = false;
@@ -520,50 +523,50 @@ void tst_QSqlDatabase::tables()
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
- if (!q.exec("CREATE VIEW " + qTableName("qtest_view") + " as select * from " + qTableName("qtest"))) {
+ if (!q.exec("CREATE VIEW " + qtest_view + " as select * from " + qtest)) {
qDebug(QString("DBMS '%1' cannot handle VIEWs: %2").arg(
tst_Databases::dbToString(db)).arg(QString(tst_Databases::printError(q.lastError()))).toLatin1());
views = false;
}
if (db.driverName().startsWith("QSQLITE3")) {
- QVERIFY_SQL(q, exec("CREATE TEMPORARY TABLE " + qTableName("temp_tab") + " (id int)"));
+ QVERIFY_SQL(q, exec("CREATE TEMPORARY TABLE " + temp_tab + " (id int)"));
tempTables = true;
}
QStringList tables = db.tables(QSql::Tables);
- QVERIFY(tables.contains(qTableName("qtest"), Qt::CaseInsensitive));
+ QVERIFY(tables.contains(qtest, Qt::CaseInsensitive));
QVERIFY(!tables.contains("sql_features", Qt::CaseInsensitive)); //check for postgres 7.4 internal tables
if (views) {
- QVERIFY(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(qtest_view, Qt::CaseInsensitive));
}
if (tempTables)
- QVERIFY(tables.contains(qTableName("temp_tab"), Qt::CaseInsensitive));
+ QVERIFY(tables.contains(temp_tab, Qt::CaseInsensitive));
tables = db.tables(QSql::Views);
if (views) {
- if(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive))
- qDebug() << "failed to find" << qTableName("qtest_view") << "in" << tables;
- QVERIFY(tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive));
+ if(!tables.contains(qtest_view, Qt::CaseInsensitive))
+ qDebug() << "failed to find" << qtest_view << "in" << tables;
+ QVERIFY(tables.contains(qtest_view, Qt::CaseInsensitive));
}
if (tempTables)
- QVERIFY(!tables.contains(qTableName("temp_tab"), Qt::CaseInsensitive));
- QVERIFY(!tables.contains(qTableName("qtest"), Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(temp_tab, Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(qtest, Qt::CaseInsensitive));
tables = db.tables(QSql::SystemTables);
- QVERIFY(!tables.contains(qTableName("qtest"), Qt::CaseInsensitive));
- QVERIFY(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive));
- QVERIFY(!tables.contains(qTableName("temp_tab"), Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(qtest, Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(qtest_view, Qt::CaseInsensitive));
+ QVERIFY(!tables.contains(temp_tab, Qt::CaseInsensitive));
tables = db.tables(QSql::AllTables);
if (views)
- QVERIFY(tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive));
+ QVERIFY(tables.contains(qtest_view, Qt::CaseInsensitive));
if (tempTables)
- QVERIFY(tables.contains(qTableName("temp_tab"), Qt::CaseInsensitive));
- QVERIFY(tables.contains(qTableName("qtest"), Qt::CaseInsensitive));
+ QVERIFY(tables.contains(temp_tab, Qt::CaseInsensitive));
+ QVERIFY(tables.contains(qtest, Qt::CaseInsensitive));
if (db.driverName().startsWith("QPSQL")) {
- QVERIFY(tables.contains(qTableName("qtest") + " test"));
+ QVERIFY(tables.contains(qtest + " test"));
}
}
@@ -574,7 +577,7 @@ void tst_QSqlDatabase::whitespaceInIdentifiers()
CHECK_DATABASE(db);
if (testWhiteSpaceNames(db.driverName())) {
- QString tableName = qTableName("qtest") + " test";
+ const QString tableName(qTableName("qtest", __FILE__) + " test");
QVERIFY(db.tables().contains(tableName, Qt::CaseInsensitive));
QSqlRecord rec = db.record(db.driver()->escapeIdentifier(tableName, QSqlDriver::TableName));
@@ -602,14 +605,15 @@ void tst_QSqlDatabase::alterTable()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString qtestalter(qTableName("qtestalter", __FILE__));
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("create table " + qTableName("qtestalter") + " (F1 char(20), F2 char(20), F3 char(20))"));
- QSqlRecord rec = db.record(qTableName("qtestalter"));
+ QVERIFY_SQL(q, exec("create table " + qtestalter + " (F1 char(20), F2 char(20), F3 char(20))"));
+ QSqlRecord rec = db.record(qtestalter);
QCOMPARE((int)rec.count(), 3);
#ifdef QT3_SUPPORT
- Q3SqlRecordInfo rinf = db.recordInfo(qTableName("qtestalter"));
+ Q3SqlRecordInfo rinf = db.recordInfo(qtestalter);
QCOMPARE((int)rinf.count(), 3);
#endif
@@ -622,13 +626,13 @@ void tst_QSqlDatabase::alterTable()
#endif
}
- if (!q.exec("alter table " + qTableName("qtestalter") + " drop column F2")) {
+ if (!q.exec("alter table " + qtestalter + " drop column F2")) {
QSKIP("DBMS doesn't support dropping columns in ALTER TABLE statement", SkipSingle);
}
- rec = db.record(qTableName("qtestalter"));
+ rec = db.record(qtestalter);
#ifdef QT3_SUPPORT
- rinf = db.recordInfo(qTableName("qtestalter"));
+ rinf = db.recordInfo(qtestalter);
#endif
QCOMPARE((int)rec.count(), 2);
@@ -643,7 +647,7 @@ void tst_QSqlDatabase::alterTable()
QCOMPARE(rinf[ 1 ].name().upper(), QString("F3"));
#endif
- q.exec("select * from " + qTableName("qtestalter"));
+ q.exec("select * from " + qtestalter);
#ifdef QT3_SUPPORT
rec = db.record(q);
@@ -730,17 +734,17 @@ void tst_QSqlDatabase::commonFieldTest(const FieldDef fieldDefs[], QSqlDatabase
// check whether recordInfo returns the right types
#ifdef QT3_SUPPORT
- Q3SqlRecordInfo inf = db.recordInfo(qTableName("qtestfields"));
+ Q3SqlRecordInfo inf = db.recordInfo(qTableName("qtestfields", __FILE__));
QCOMPARE((int)inf.count(), fieldCount+1);
testRecordInfo(fieldDefs, inf);
#endif
- QSqlRecord rec = db.record(qTableName("qtestfields"));
+ QSqlRecord rec = db.record(qTableName("qtestfields", __FILE__));
QCOMPARE((int)rec.count(), fieldCount+1);
testRecord(fieldDefs, rec, db);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtestfields")));
+ QVERIFY_SQL(q, exec("select * from " + qTableName("qtestfields", __FILE__)));
#ifdef QT3_SUPPORT
inf = db.recordInfo(q);
@@ -760,7 +764,7 @@ void tst_QSqlDatabase::checkValues(const FieldDef fieldDefs[], QSqlDatabase db)
#ifdef QT3_SUPPORT
CHECK_DATABASE(db);
- Q3SqlCursor cur(qTableName("qtestfields"), true, db);
+ Q3SqlCursor cur(qTableName("qtestfields", __FILE__), true, db);
QVERIFY_SQL(cur, select());
QSqlRecord* rec = cur.primeInsert();
Q_ASSERT(rec);
@@ -821,7 +825,7 @@ void tst_QSqlDatabase::checkNullValues(const FieldDef fieldDefs[], QSqlDatabase
#ifdef QT3_SUPPORT
CHECK_DATABASE(db);
- Q3SqlCursor cur(qTableName("qtestfields"), true, db);
+ Q3SqlCursor cur(qTableName("qtestfields", __FILE__), true, db);
QVERIFY_SQL(cur, select());
QSqlRecord* rec = cur.primeInsert();
Q_ASSERT(rec);
@@ -955,12 +959,12 @@ void tst_QSqlDatabase::recordOCI()
checkValues(fieldDefs, db);
// some additional tests
- QSqlRecord rec = db.record(qTableName("qtestfields"));
+ QSqlRecord rec = db.record(qTableName("qtestfields", __FILE__));
QCOMPARE(rec.field("T_NUMBER").length(), 10);
QCOMPARE(rec.field("T_NUMBER").precision(), 5);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("SELECT * FROM " + qTableName("qtestfields")));
+ QVERIFY_SQL(q, exec("SELECT * FROM " + qTableName("qtestfields", __FILE__)));
rec = q.record();
QCOMPARE(rec.field("T_NUMBER").length(), 10);
QCOMPARE(rec.field("T_NUMBER").precision(), 5);
@@ -1024,11 +1028,11 @@ void tst_QSqlDatabase::recordPSQL()
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- q.exec("drop sequence " + qTableName("qtestfields") + "_t_bigserial_seq");
- q.exec("drop sequence " + qTableName("qtestfields") + "_t_serial_seq");
+ q.exec("drop sequence " + qTableName("qtestfields", __FILE__) + "_t_bigserial_seq");
+ q.exec("drop sequence " + qTableName("qtestfields", __FILE__) + "_t_serial_seq");
// older psql cut off the table name
- q.exec("drop sequence " + qTableName("qtestfields").left(15) + "_t_bigserial_seq");
- q.exec("drop sequence " + qTableName("qtestfields").left(18) + "_t_serial_seq");
+ q.exec("drop sequence " + qTableName("qtestfields", __FILE__).left(15) + "_t_bigserial_seq");
+ q.exec("drop sequence " + qTableName("qtestfields", __FILE__).left(18) + "_t_serial_seq");
const int fieldCount = createFieldTable(fieldDefs, db);
QVERIFY(fieldCount > 0);
@@ -1325,6 +1329,7 @@ void tst_QSqlDatabase::transaction()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString qtest(qTableName("qtest", __FILE__));
if (!db.driver()->hasFeature(QSqlDriver::Transactions)) {
QSKIP("DBMS not transaction capable", SkipSingle);
@@ -1333,8 +1338,8 @@ void tst_QSqlDatabase::transaction()
QVERIFY(db.transaction());
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " values (40, 'VarChar40', 'Char40', 40.40)"));
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtest") + " where id = 40"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " values (40, 'VarChar40', 'Char40', 40.40)"));
+ QVERIFY_SQL(q, exec("select * from " + qtest + " where id = 40"));
QVERIFY(q.next());
QCOMPARE(q.value(0).toInt(), 40);
q.clear();
@@ -1342,15 +1347,15 @@ void tst_QSqlDatabase::transaction()
QVERIFY(db.commit());
QVERIFY(db.transaction());
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtest") + " where id = 40"));
+ QVERIFY_SQL(q, exec("select * from " + qtest + " where id = 40"));
QVERIFY(q.next());
QCOMPARE(q.value(0).toInt(), 40);
q.clear();
QVERIFY(db.commit());
QVERIFY(db.transaction());
- QVERIFY_SQL(q, exec("insert into " + qTableName("qtest") + " values (41, 'VarChar41', 'Char41', 41.41)"));
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtest") + " where id = 41"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " values (41, 'VarChar41', 'Char41', 41.41)"));
+ QVERIFY_SQL(q, exec("select * from " + qtest + " where id = 41"));
QVERIFY(q.next());
QCOMPARE(q.value(0).toInt(), 41);
q.clear(); // for SQLite which does not allow any references on rows that shall be rolled back
@@ -1363,7 +1368,7 @@ void tst_QSqlDatabase::transaction()
}
}
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtest") + " where id = 41"));
+ QVERIFY_SQL(q, exec("select * from " + qtest + " where id = 41"));
if(db.driverName().startsWith("QODBC") && dbName.contains("MySQL"))
QEXPECT_FAIL("", "Some odbc drivers don't actually roll back despite telling us they do, especially the mysql driver", Continue);
QVERIFY(!q.next());
@@ -1377,6 +1382,7 @@ void tst_QSqlDatabase::bigIntField()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QString drvName = db.driverName();
+ const QString qtest_bigint(qTableName("qtest_bigint", __FILE__));
QSqlQuery q(db);
q.setForwardOnly(true);
@@ -1384,19 +1390,19 @@ void tst_QSqlDatabase::bigIntField()
q.setNumericalPrecisionPolicy(QSql::LowPrecisionInt64);
if (drvName.startsWith("QMYSQL")) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit bigint, t_u64bit bigint unsigned)"));
+ QVERIFY_SQL(q, exec("create table " + qtest_bigint + " (id int, t_s64bit bigint, t_u64bit bigint unsigned)"));
} else if (drvName.startsWith("QPSQL")
|| drvName.startsWith("QDB2")
|| tst_Databases::isSqlServer(db)) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + "(id int, t_s64bit bigint, t_u64bit bigint)"));
+ QVERIFY_SQL(q, exec("create table " + qtest_bigint + "(id int, t_s64bit bigint, t_u64bit bigint)"));
} else if (drvName.startsWith("QOCI")) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit int, t_u64bit int)"));
+ QVERIFY_SQL(q, exec("create table " + qtest_bigint + " (id int, t_s64bit int, t_u64bit int)"));
//} else if (drvName.startsWith("QIBASE")) {
- // QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit int64, t_u64bit int64)"));
+ // QVERIFY_SQL(q, exec("create table " + qtest_bigint + " (id int, t_s64bit int64, t_u64bit int64)"));
} else {
QSKIP("no 64 bit integer support", SkipAll);
}
- QVERIFY(q.prepare("insert into " + qTableName("qtest_bigint") + " values (?, ?, ?)"));
+ QVERIFY(q.prepare("insert into " + qtest_bigint + " values (?, ?, ?)"));
qlonglong ll = Q_INT64_C(9223372036854775807);
qulonglong ull = Q_UINT64_C(18446744073709551615);
@@ -1420,7 +1426,7 @@ void tst_QSqlDatabase::bigIntField()
q.bindValue(2, (qlonglong) ull);
QVERIFY_SQL(q, exec());
}
- QVERIFY(q.exec("select * from " + qTableName("qtest_bigint") + " order by id"));
+ QVERIFY(q.exec("select * from " + qtest_bigint + " order by id"));
QVERIFY(q.next());
QCOMPARE(q.value(1).toDouble(), (double)ll);
QCOMPARE(q.value(1).toLongLong(), ll);
@@ -1447,32 +1453,32 @@ void tst_QSqlDatabase::caseSensivity()
|| db.driverName().startsWith("QODBC"))
cs = true;
- QSqlRecord rec = db.record(qTableName("qtest"));
+ QSqlRecord rec = db.record(qTableName("qtest", __FILE__));
QVERIFY((int)rec.count() > 0);
if (!cs) {
- rec = db.record(qTableName("QTEST").toUpper());
+ rec = db.record(qTableName("QTEST", __FILE__).toUpper());
QVERIFY((int)rec.count() > 0);
- rec = db.record(qTableName("qTesT"));
+ rec = db.record(qTableName("qTesT", __FILE__));
QVERIFY((int)rec.count() > 0);
}
#ifdef QT3_SUPPORT
- Q3SqlRecordInfo rInf = db.recordInfo(qTableName("qtest"));
+ Q3SqlRecordInfo rInf = db.recordInfo(qTableName("qtest", __FILE__));
QVERIFY((int)rInf.count() > 0);
if (!cs) {
- rInf = db.recordInfo(qTableName("QTEST").upper());
+ rInf = db.recordInfo(qTableName("QTEST", __FILE__).upper());
QVERIFY((int)rInf.count() > 0);
- rInf = db.recordInfo(qTableName("qTesT"));
+ rInf = db.recordInfo(qTableName("qTesT", __FILE__));
QVERIFY((int)rInf.count() > 0);
}
#endif
- rec = db.primaryIndex(qTableName("qtest"));
+ rec = db.primaryIndex(qTableName("qtest", __FILE__));
QVERIFY((int)rec.count() > 0);
if (!cs) {
- rec = db.primaryIndex(qTableName("QTEST").toUpper());
+ rec = db.primaryIndex(qTableName("QTEST", __FILE__).toUpper());
QVERIFY((int)rec.count() > 0);
- rec = db.primaryIndex(qTableName("qTesT"));
+ rec = db.primaryIndex(qTableName("qTesT", __FILE__));
QVERIFY((int)rec.count() > 0);
}
}
@@ -1488,7 +1494,7 @@ void tst_QSqlDatabase::noEscapedFieldNamesInRecord()
fieldname = fieldname.toUpper();
QSqlQuery q(db);
- QString query = "SELECT " + db.driver()->escapeIdentifier(fieldname, QSqlDriver::FieldName) + " FROM " + qTableName("qtest");
+ QString query = "SELECT " + db.driver()->escapeIdentifier(fieldname, QSqlDriver::FieldName) + " FROM " + qTableName("qtest", __FILE__);
QVERIFY_SQL(q, exec(query));
QCOMPARE(q.record().fieldName(0), fieldname);
}
@@ -1508,9 +1514,9 @@ void tst_QSqlDatabase::psql_schemas()
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
}
- QVERIFY_SQL(q, exec("CREATE SCHEMA " + qTableName("qtestschema")));
+ QVERIFY_SQL(q, exec("CREATE SCHEMA " + qTableName("qtestschema", __FILE__)));
- QString table = qTableName("qtestschema") + '.' + qTableName("qtesttable");
+ QString table = qTableName("qtestschema", __FILE__) + '.' + qTableName("qtesttable", __FILE__);
QVERIFY_SQL(q, exec("CREATE TABLE " + table + " (id int primary key, name varchar(20))"));
QVERIFY(db.tables().contains(table));
@@ -1546,10 +1552,10 @@ void tst_QSqlDatabase::psql_escapedIdentifiers()
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- QString schemaName = qTableName("qtestScHeMa");
- QString tableName = qTableName("qtest");
- QString field1Name = QString("fIeLdNaMe");
- QString field2Name = QString("ZuLu");
+ const QString schemaName(qTableName("qtestScHeMa", __FILE__)),
+ tableName(qTableName("qtest", __FILE__)),
+ field1Name(QLatin1String("fIeLdNaMe")),
+ field2Name(QLatin1String("ZuLu"));
q.exec(QString("DROP SCHEMA \"%1\" CASCADE").arg(schemaName));
QString createSchema = QString("CREATE SCHEMA \"%1\"").arg(schemaName);
@@ -1576,7 +1582,6 @@ void tst_QSqlDatabase::psql_escapedIdentifiers()
q.exec(QString("DROP SCHEMA \"%1\" CASCADE").arg(schemaName));
}
-
void tst_QSqlDatabase::psql_escapeBytea()
{
QFETCH(QString, dbName);
@@ -1587,7 +1592,7 @@ void tst_QSqlDatabase::psql_escapeBytea()
QByteArray ba(dta, 4);
QSqlQuery q(db);
- QString tableName = qTableName("batable");
+ const QString tableName(qTableName("batable", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (ba bytea)").arg(tableName)));
QSqlQuery iq(db);
@@ -1620,7 +1625,7 @@ void tst_QSqlDatabase::bug_249059()
QSKIP("Test requires PostgreSQL >= 7.3", SkipSingle);
QSqlQuery q(db);
- QString tableName = qTableName("bug_249059");
+ const QString tableName(qTableName("bug_249059", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (dt timestamp, t time)").arg(tableName)));
QSqlQuery iq(db);
@@ -1655,7 +1660,7 @@ void tst_QSqlDatabase::precisionPolicy()
// DBMS_SPECIFIC(db, "QPSQL");
QSqlQuery q(db);
- QString tableName = qTableName("qtest_prec");
+ const QString tableName(qTableName("qtest_prec", __FILE__));
if(!db.driver()->hasFeature(QSqlDriver::LowPrecisionNumbers))
QSKIP("Driver or database doesn't support setting precision policy", SkipSingle);
@@ -1752,7 +1757,7 @@ void tst_QSqlDatabase::mysqlOdbc_unsignedIntegers()
}
QSqlQuery q(db);
- QString tableName = qTableName("uint");
+ const QString tableName(qTableName("uint", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (foo integer(10) unsigned, bar integer(10))").arg(tableName)));
QVERIFY_SQL(q, exec(QString("INSERT INTO %1 VALUES (-4000000000, -4000000000)").arg(tableName)));
QVERIFY_SQL(q, exec(QString("INSERT INTO %1 VALUES (4000000000, 4000000000)").arg(tableName)));
@@ -1778,7 +1783,7 @@ void tst_QSqlDatabase::accessOdbc_strings()
}
QSqlQuery q(db);
- QString tableName = qTableName("strings");
+ const QString tableName(qTableName("strings", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (aStr memo, bStr memo, cStr memo, dStr memo"
", eStr memo, fStr memo, gStr memo, hStr memo)").arg(tableName)));
@@ -1816,7 +1821,7 @@ void tst_QSqlDatabase::ibase_numericFields()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QString tableName = qTableName("numericfields");
+ const QString tableName(qTableName("numericfields", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (id int not null, num1 NUMERIC(2,1), "
"num2 NUMERIC(5,2), num3 NUMERIC(10,3), "
"num4 NUMERIC(18,4))").arg(tableName)));
@@ -1888,7 +1893,7 @@ void tst_QSqlDatabase::ibase_fetchBlobs()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tableName = qTableName("qtest_ibaseblobs");
+ const QString tableName(qTableName("qtest_ibaseblobs", __FILE__));
QSqlQuery q(db);
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (blob1 BLOB segment size 256)").arg(tableName)));
@@ -1921,7 +1926,7 @@ void tst_QSqlDatabase::ibase_procWithoutReturnValues()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QString procName = qTableName("qtest_proc1");
+ const QString procName(qTableName("qtest_proc1", __FILE__));
q.exec(QString("drop procedure %1").arg(procName));
QVERIFY_SQL(q, exec("CREATE PROCEDURE " + procName + " (str VARCHAR(10))\nAS BEGIN\nstr='test';\nEND;"));
QVERIFY_SQL(q, exec(QString("execute procedure %1('qtest')").arg(procName)));
@@ -1939,7 +1944,7 @@ void tst_QSqlDatabase::ibase_procWithReturnValues()
return;
}
- QString procName = qTableName("qtest_proc2");
+ const QString procName(qTableName("qtest_proc2", __FILE__));
QSqlQuery q(db);
q.exec(QString("drop procedure %1").arg(procName));
@@ -1981,11 +1986,11 @@ void tst_QSqlDatabase::formatValueTrimStrings()
QSqlQuery q(db);
- QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (50, 'Trim Test ', 'Trim Test 2 ')").arg(qTableName("qtest"))));
- QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (51, 'TrimTest', 'Trim Test 2')").arg(qTableName("qtest"))));
- QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (52, ' ', ' ')").arg(qTableName("qtest"))));
+ QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (50, 'Trim Test ', 'Trim Test 2 ')").arg(qTableName("qtest", __FILE__))));
+ QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (51, 'TrimTest', 'Trim Test 2')").arg(qTableName("qtest", __FILE__))));
+ QVERIFY_SQL(q, exec(QString("INSERT INTO %1 (id, t_varchar, t_char) values (52, ' ', ' ')").arg(qTableName("qtest", __FILE__))));
- QVERIFY_SQL(q, exec(QString("SELECT t_varchar, t_char FROM %1 WHERE id >= 50 AND id <= 52 ORDER BY id").arg(qTableName("qtest"))));
+ QVERIFY_SQL(q, exec(QString("SELECT t_varchar, t_char FROM %1 WHERE id >= 50 AND id <= 52 ORDER BY id").arg(qTableName("qtest", __FILE__))));
QVERIFY_SQL(q, next());
@@ -2009,10 +2014,10 @@ void tst_QSqlDatabase::odbc_reopenDatabase()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("SELECT * from " + qTableName("qtest")));
+ QVERIFY_SQL(q, exec("SELECT * from " + qTableName("qtest", __FILE__)));
QVERIFY_SQL(q, next());
db.open();
- QVERIFY_SQL(q, exec("SELECT * from " + qTableName("qtest")));
+ QVERIFY_SQL(q, exec("SELECT * from " + qTableName("qtest", __FILE__)));
QVERIFY_SQL(q, next());
db.open();
}
@@ -2029,10 +2034,10 @@ void tst_QSqlDatabase::odbc_bindBoolean()
}
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("qtestBindBool") + "(id int, boolvalue bit)"));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("qtestBindBool", __FILE__) + "(id int, boolvalue bit)"));
// Bind and insert
- QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("qtestBindBool") + " VALUES(?, ?)"));
+ QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("qtestBindBool", __FILE__) + " VALUES(?, ?)"));
q.bindValue(0, 1);
q.bindValue(1, true);
QVERIFY_SQL(q, exec());
@@ -2041,7 +2046,7 @@ void tst_QSqlDatabase::odbc_bindBoolean()
QVERIFY_SQL(q, exec());
// Retrive
- QVERIFY_SQL(q, exec("SELECT id, boolvalue FROM " + qTableName("qtestBindBool") + " ORDER BY id"));
+ QVERIFY_SQL(q, exec("SELECT id, boolvalue FROM " + qTableName("qtestBindBool", __FILE__) + " ORDER BY id"));
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 1);
QCOMPARE(q.value(1).toBool(), true);
@@ -2055,20 +2060,21 @@ void tst_QSqlDatabase::odbc_testqGetString()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString testqGetString(qTableName("testqGetString", __FILE__));
QSqlQuery q(db);
if (tst_Databases::isSqlServer(db))
- QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(MAX))"));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + testqGetString + "(id int, vcvalue varchar(MAX))"));
else if(tst_Databases::isMSAccess(db))
- QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue memo)"));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + testqGetString + "(id int, vcvalue memo)"));
else
- QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))"));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + testqGetString + "(id int, vcvalue varchar(65538))"));
QString largeString;
largeString.fill('A', 65536);
// Bind and insert
- QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("testqGetString") + " VALUES(?, ?)"));
+ QVERIFY_SQL(q, prepare("INSERT INTO " + testqGetString + " VALUES(?, ?)"));
q.bindValue(0, 1);
q.bindValue(1, largeString);
QVERIFY_SQL(q, exec());
@@ -2080,7 +2086,7 @@ void tst_QSqlDatabase::odbc_testqGetString()
QVERIFY_SQL(q, exec());
// Retrive
- QVERIFY_SQL(q, exec("SELECT id, vcvalue FROM " + qTableName("testqGetString") + " ORDER BY id"));
+ QVERIFY_SQL(q, exec("SELECT id, vcvalue FROM " + testqGetString + " ORDER BY id"));
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 1);
QCOMPARE(q.value(1).toString().length(), 65536);
@@ -2098,6 +2104,7 @@ void tst_QSqlDatabase::mysql_multiselect()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString qtest(qTableName("qtest", __FILE__));
QSqlQuery q(db);
QString version=tst_Databases::getMySqlVersion( db );
@@ -2105,11 +2112,11 @@ void tst_QSqlDatabase::mysql_multiselect()
if (ver < 4.1)
QSKIP("Test requires MySQL >= 4.1", SkipSingle);
- QVERIFY_SQL(q, exec("SELECT * FROM " + qTableName("qtest") + "; SELECT * FROM " + qTableName("qtest")));
+ QVERIFY_SQL(q, exec("SELECT * FROM " + qtest + "; SELECT * FROM " + qtest));
QVERIFY_SQL(q, next());
- QVERIFY_SQL(q, exec("SELECT * FROM " + qTableName("qtest") + "; SELECT * FROM " + qTableName("qtest")));
+ QVERIFY_SQL(q, exec("SELECT * FROM " + qtest + "; SELECT * FROM " + qtest));
QVERIFY_SQL(q, next());
- QVERIFY_SQL(q, exec("SELECT * FROM " + qTableName("qtest")));
+ QVERIFY_SQL(q, exec("SELECT * FROM " + qtest));
}
void tst_QSqlDatabase::ibase_useCustomCharset()
@@ -2123,7 +2130,7 @@ void tst_QSqlDatabase::ibase_useCustomCharset()
db.setConnectOptions("ISC_DPB_LC_CTYPE=Latin1");
db.open();
- QString tableName = qTableName("latin1table");
+ const QString tableName(qTableName("latin1table", __FILE__));
QSqlQuery q(db);
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1(text VARCHAR(6) CHARACTER SET Latin1)").arg(tableName)));
@@ -2161,7 +2168,7 @@ void tst_QSqlDatabase::oci_xmltypeSupport()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tableName = qTableName("qtest_xmltype");
+ const QString tableName(qTableName("qtest_xmltype", __FILE__));
QString xml("<?xml version=\"1.0\"?><TABLE_NAME>MY_TABLE</TABLE_NAME>");
QSqlQuery q(db);
@@ -2189,7 +2196,7 @@ void tst_QSqlDatabase::oci_fieldLength()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tableName = qTableName("qtest");
+ const QString tableName(qTableName("qtest", __FILE__));
QSqlQuery q(db);
QVERIFY_SQL(q, exec(QString("SELECT t_varchar, t_char FROM %1").arg(tableName)));
@@ -2205,7 +2212,7 @@ void tst_QSqlDatabase::oci_synonymstest()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QString creator(qTableName("CREATOR")), appuser(qTableName("APPUSER")), table1(qTableName("TABLE1"));
+ const QString creator(qTableName("CREATOR", __FILE__)), appuser(qTableName("APPUSER", __FILE__)), table1(qTableName("TABLE1", __FILE__));
// QVERIFY_SQL(q, exec("drop public synonym "+table1));
QVERIFY_SQL(q, exec(QString("create user %1 identified by %2 default tablespace users temporary tablespace temp").arg(creator).arg(creator)));
QVERIFY_SQL(q, exec(QString("grant CONNECT to %1").arg(creator)));
@@ -2223,8 +2230,8 @@ void tst_QSqlDatabase::oci_synonymstest()
db3.close();
QVERIFY_SQL(db3, open(appuser,appuser));
QSqlQuery q3(db3);
- QVERIFY_SQL(q3, exec("create synonym "+appuser+'.'+qTableName("synonyms")+" for "+creator+'.'+table1));
- QVERIFY_SQL(db3, tables().filter(qTableName("synonyms"), Qt::CaseInsensitive).count() >= 1);
+ QVERIFY_SQL(q3, exec("create synonym "+appuser+'.'+qTableName("synonyms", __FILE__)+" for "+creator+'.'+table1));
+ QVERIFY_SQL(db3, tables().filter(qTableName("synonyms", __FILE__), Qt::CaseInsensitive).count() >= 1);
}
@@ -2240,7 +2247,7 @@ void tst_QSqlDatabase::odbc_uniqueidentifier()
return;
}
- QString tableName = qTableName("qtest_sqlguid");
+ const QString tableName(qTableName("qtest_sqlguid", __FILE__));
QString guid = QString("AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE");
QString invalidGuid = QString("GAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE");
@@ -2283,7 +2290,7 @@ void tst_QSqlDatabase::odbc_uintfield()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tableName = qTableName("uint_table");
+ const QString tableName(qTableName("uint_table", __FILE__));
unsigned int val = 4294967295U;
QSqlQuery q(db);
@@ -2347,7 +2354,7 @@ void tst_QSqlDatabase::eventNotificationIBase()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString procedureName = qTableName("posteventProc");
+ const QString procedureName(qTableName("posteventProc", __FILE__));
QSqlDriver *driver=db.driver();
QVERIFY_SQL(*driver, subscribeToNotification(procedureName));
QTest::qWait(300); // Interbase needs some time to call the driver callback.
@@ -2381,7 +2388,7 @@ void tst_QSqlDatabase::eventNotificationPSQL()
#endif
QSqlQuery query(db);
- QString procedureName = qTableName("posteventProc");
+ QString procedureName = qTableName("posteventProc", __FILE__);
QSqlDriver &driver=*(db.driver());
QVERIFY_SQL(driver, subscribeToNotification(procedureName));
@@ -2405,7 +2412,7 @@ void tst_QSqlDatabase::sqlite_bindAndFetchUInt()
}
QSqlQuery q(db);
- QString tableName = qTableName("uint_test");
+ const QString tableName(qTableName("uint_test", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1(uint_field UNSIGNED INTEGER)").arg(tableName)));
QVERIFY_SQL(q, prepare(QString("INSERT INTO %1 VALUES(?)").arg(tableName)));
q.addBindValue(4000000000U);
@@ -2425,7 +2432,7 @@ void tst_QSqlDatabase::db2_valueCacheUpdate()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tableName = qTableName("qtest");
+ const QString tableName(qTableName("qtest", __FILE__));
QSqlQuery q(db);
q.exec(QString("SELECT id, t_varchar, t_char, t_numeric FROM %1").arg(tableName));
q.next();
@@ -2448,7 +2455,7 @@ void tst_QSqlDatabase::sqlStatementUseIsNull_189093()
// select a record with NULL value
QSqlQuery q(QString::null, db);
- QVERIFY_SQL(q, exec("select * from " + qTableName("qtest") + " where id = 4"));
+ QVERIFY_SQL(q, exec("select * from " + qTableName("qtest", __FILE__) + " where id = 4"));
QVERIFY_SQL(q, next());
QSqlDriver *driver = db.driver();
@@ -2471,7 +2478,7 @@ void tst_QSqlDatabase::mysql_savepointtest()
QSqlQuery q(db);
QVERIFY_SQL(q, exec("begin"));
- QVERIFY_SQL(q, exec("insert into "+qTableName("qtest")+" VALUES (54, 'foo', 'foo', 54.54)"));
+ QVERIFY_SQL(q, exec("insert into "+qTableName("qtest", __FILE__)+" VALUES (54, 'foo', 'foo', 54.54)"));
QVERIFY_SQL(q, exec("savepoint foo"));
}
@@ -2481,7 +2488,7 @@ void tst_QSqlDatabase::oci_tables()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
- QString systemTableName("system."+qTableName("mypassword"));
+ const QString systemTableName("system."+qTableName("mypassword", __FILE__));
QVERIFY_SQL(q, exec("CREATE TABLE "+systemTableName+"(name VARCHAR(20))"));
QVERIFY(!db.tables().contains(systemTableName.toUpper()));
QVERIFY(db.tables(QSql::SystemTables).contains(systemTableName.toUpper()));
@@ -2501,8 +2508,8 @@ void tst_QSqlDatabase::sqlite_enable_cache_mode()
db2.setConnectOptions("QSQLITE_ENABLE_SHARED_CACHE");
QVERIFY_SQL(db2, open());
QSqlQuery q(db), q2(db2);
- QVERIFY_SQL(q, exec("select * from "+qTableName("qtest")));
- QVERIFY_SQL(q2, exec("select * from "+qTableName("qtest")));
+ QVERIFY_SQL(q, exec("select * from "+qTableName("qtest", __FILE__)));
+ QVERIFY_SQL(q2, exec("select * from "+qTableName("qtest", __FILE__)));
}
QTEST_MAIN(tst_QSqlDatabase)
diff --git a/tests/auto/qsqldriver/tst_qsqldriver.cpp b/tests/auto/qsqldriver/tst_qsqldriver.cpp
index 19e4001..f2393ba 100644
--- a/tests/auto/qsqldriver/tst_qsqldriver.cpp
+++ b/tests/auto/qsqldriver/tst_qsqldriver.cpp
@@ -84,18 +84,19 @@ void tst_QSqlDriver::initTestCase_data()
void tst_QSqlDriver::recreateTestTables(QSqlDatabase db)
{
QSqlQuery q(db);
+ const QString relTEST1(qTableName("relTEST1", __FILE__));
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- tst_Databases::safeDropTable( db, qTableName( "relTEST1" ) );
+ tst_Databases::safeDropTable( db, relTEST1 );
- QVERIFY_SQL( q, exec("create table " + qTableName("relTEST1") +
+ QVERIFY_SQL( q, exec("create table " + relTEST1 +
" (id int not null primary key, name varchar(20), title_key int, another_title_key int)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(1, 'harry', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(2, 'trond', 2, 1)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(3, 'vohi', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("relTEST1") + " values(4, 'boris', 2, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(1, 'harry', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(2, 'trond', 2, 1)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(3, 'vohi', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(4, 'boris', 2, 2)"));
}
void tst_QSqlDriver::initTestCase()
@@ -108,7 +109,7 @@ void tst_QSqlDriver::cleanupTestCase()
{
foreach (const QString &dbName, dbs.dbNames) {
QSqlDatabase db = QSqlDatabase::database(dbName);
- tst_Databases::safeDropTable( db, qTableName( "relTEST1" ) );
+ tst_Databases::safeDropTable( db, qTableName( "relTEST1", __FILE__ ) );
}
dbs.close();
}
@@ -127,7 +128,7 @@ void tst_QSqlDriver::record()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tablename = qTableName("relTEST1");
+ QString tablename(qTableName("relTEST1", __FILE__));
QStringList fields;
fields << "id" << "name" << "title_key" << "another_title_key";
@@ -180,7 +181,7 @@ void tst_QSqlDriver::primaryIndex()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
- QString tablename = qTableName("relTEST1");
+ QString tablename(qTableName("relTEST1", __FILE__));
//check that we can get primary index using unquoted mixed case table name
QSqlIndex index = db.driver()->primaryIndex(tablename);
QCOMPARE(index.count(), 1);
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 5339132..b9ab73f 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -44,6 +44,8 @@
#include "../qsqldatabase/tst_databases.h"
+const QString qtest(qTableName( "qtest", __FILE__ ));
+
//TESTED_FILES=
class tst_QSqlQuery : public QObject
@@ -295,56 +297,56 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
{
QStringList tablenames;
// drop all the table in case a testcase failed
- tablenames << qTableName( "qtest" )
- << qTableName( "qtest_null" )
- << qTableName( "qtest_blob" )
- << qTableName( "qtest_bittest" )
- << qTableName( "qtest_nullblob" )
- << qTableName( "qtest_rawtest" )
- << qTableName( "qtest_precision" )
- << qTableName( "qtest_prepare" )
- << qTableName( "qtestj1" )
- << qTableName( "qtestj2" )
- << qTableName( "char1Select" )
- << qTableName( "char1SelectUnicode" )
- << qTableName( "qxmltest" )
- << qTableName( "qtest_exerr" )
- << qTableName( "qtest_empty" )
- << qTableName( "clobby" )
- << qTableName( "bindtest" )
- << qTableName( "more_results" )
- << qTableName( "blobstest" )
- << qTableName( "oraRowId" )
- << qTableName( "qtest_batch" )
- << qTableName("bug6421").toUpper()
- << qTableName("bug5765")
- << qTableName("bug6852")
- << qTableName( "qtest_lockedtable" )
- << qTableName( "Planet" )
- << qTableName( "task_250026" )
- << qTableName( "task_234422" )
- << qTableName("test141895");
+ tablenames << qtest
+ << qTableName( "qtest_null", __FILE__ )
+ << qTableName( "qtest_blob", __FILE__ )
+ << qTableName( "qtest_bittest", __FILE__ )
+ << qTableName( "qtest_nullblob", __FILE__ )
+ << qTableName( "qtest_rawtest", __FILE__ )
+ << qTableName( "qtest_precision", __FILE__ )
+ << qTableName( "qtest_prepare", __FILE__ )
+ << qTableName( "qtestj1", __FILE__ )
+ << qTableName( "qtestj2", __FILE__ )
+ << qTableName( "char1Select", __FILE__ )
+ << qTableName( "char1SU", __FILE__ )
+ << qTableName( "qxmltest", __FILE__ )
+ << qTableName( "qtest_exerr", __FILE__ )
+ << qTableName( "qtest_empty", __FILE__ )
+ << qTableName( "clobby", __FILE__ )
+ << qTableName( "bindtest", __FILE__ )
+ << qTableName( "more_results", __FILE__ )
+ << qTableName( "blobstest", __FILE__ )
+ << qTableName( "oraRowId", __FILE__ )
+ << qTableName( "qtest_batch", __FILE__ )
+ << qTableName("bug6421", __FILE__).toUpper()
+ << qTableName("bug5765", __FILE__)
+ << qTableName("bug6852", __FILE__)
+ << qTableName( "qtest_lockedtable", __FILE__ )
+ << qTableName( "Planet", __FILE__ )
+ << qTableName( "task_250026", __FILE__ )
+ << qTableName( "task_234422", __FILE__ )
+ << qTableName("test141895", __FILE__);
if ( db.driverName().startsWith("QPSQL") )
- tablenames << qTableName("task_233829");
+ tablenames << qTableName("task_233829", __FILE__);
if ( db.driverName().startsWith("QSQLITE") )
- tablenames << qTableName( "record_sqlite" );
+ tablenames << qTableName( "record_sqlite", __FILE__ );
if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QOCI" ) )
- tablenames << qTableName( "qtest_longstr" );
+ tablenames << qTableName( "qtest_longstr", __FILE__ );
if (tst_Databases::isSqlServer( db ))
- db.exec("DROP PROCEDURE " + qTableName("test141895_proc"));
+ db.exec("DROP PROCEDURE " + qTableName("test141895_proc", __FILE__));
if (tst_Databases::isMySQL( db ))
- db.exec("DROP PROCEDURE IF EXISTS "+qTableName("bug6852_proc"));
+ db.exec("DROP PROCEDURE IF EXISTS "+qTableName("bug6852_proc", __FILE__));
tst_Databases::safeDropTables( db, tablenames );
if ( db.driverName().startsWith( "QOCI" ) ) {
QSqlQuery q( db );
- q.exec( "DROP PACKAGE " + qTableName("pkg") );
+ q.exec( "DROP PACKAGE " + qTableName("pkg", __FILE__) );
}
}
@@ -360,31 +362,32 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db )
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
if(tst_Databases::isPostgreSQL(db))
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtest + " (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS" ) );
else
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id int "+tst_Databases::autoFieldName(db) +" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtest + " (id int "+tst_Databases::autoFieldName(db) +" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) );
if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QTDS" ) )
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null" ) + " (id int null, t_varchar varchar(20) null)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null", __FILE__ ) + " (id int null, t_varchar varchar(20) null)" ) );
else
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null" ) + " (id int, t_varchar varchar(20))" ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null", __FILE__ ) + " (id int, t_varchar varchar(20))" ) );
}
void tst_QSqlQuery::populateTestTables( QSqlDatabase db )
{
QSqlQuery q( db );
- q.exec( "delete from " + qTableName( "qtest" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (1, 'VarChar1', 'Char1')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (2, 'VarChar2', 'Char2')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (3, 'VarChar3', 'Char3')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (4, 'VarChar4', 'Char4')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (5, 'VarChar5', 'Char5')" ) );
+ const QString qtest_null(qTableName( "qtest_null", __FILE__ ));
+ q.exec( "delete from " + qtest );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (1, 'VarChar1', 'Char1')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (2, 'VarChar2', 'Char2')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (3, 'VarChar3', 'Char3')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (4, 'VarChar4', 'Char4')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (5, 'VarChar5', 'Char5')" ) );
- q.exec( "delete from " + qTableName( "qtest_null" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_null" ) + " values (0, NULL)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_null" ) + " values (1, 'n')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_null" ) + " values (2, 'i')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_null" ) + " values (3, NULL)" ) );
+ q.exec( "delete from " + qtest_null );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_null + " values (0, NULL)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_null + " values (1, 'n')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_null + " values (2, 'i')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_null + " values (3, NULL)" ) );
}
// There were problems with char fields of size 1
@@ -396,9 +399,9 @@ void tst_QSqlQuery::char1Select()
{
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "char1Select" ) + " (id char(1))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "char1Select" ) + " values ('a')" ) );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "char1Select" ) ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "char1Select", __FILE__ ) + " (id char(1))" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qTableName( "char1Select", __FILE__ ) + " values ('a')" ) );
+ QVERIFY_SQL( q, exec( "select * from " + qTableName( "char1Select", __FILE__ ) ) );
QVERIFY( q.next() );
if ( db.driverName().startsWith( "QIBASE" ) )
@@ -427,31 +430,32 @@ void tst_QSqlQuery::char1SelectUnicode()
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QString createQuery;
+ const QString char1SelectUnicode(qTableName( "char1SU", __FILE__ ));
if ( tst_Databases::isSqlServer( db ) )
- createQuery = "create table " + qTableName( "char1SelectUnicode" ) + "(id nchar(1))";
+ createQuery = "create table " + char1SelectUnicode + "(id nchar(1))";
else if ( db.driverName().startsWith( "QDB2" )
|| db.driverName().startsWith( "QOCI" )
|| db.driverName().startsWith( "QPSQL" ) )
- createQuery = "create table " + qTableName( "char1SelectUnicode" ) + " (id char(3))";
+ createQuery = "create table " + char1SelectUnicode + " (id char(3))";
else if ( db.driverName().startsWith( "QIBASE" ) )
- createQuery = "create table " + qTableName( "char1SelectUnicode" ) +
+ createQuery = "create table " + char1SelectUnicode +
" (id char(1) character set unicode_fss)";
else if ( db.driverName().startsWith( "QMYSQL" ) )
- createQuery = "create table " + qTableName( "char1SelectUnicode" ) + " (id char(1)) "
+ createQuery = "create table " + char1SelectUnicode + " (id char(1)) "
"default character set 'utf8'";
else
- createQuery = "create table " + qTableName( "char1SelectUnicode" ) + " (id char(1))";
+ createQuery = "create table " + char1SelectUnicode + " (id char(1))";
QVERIFY_SQL( q, exec( createQuery ) );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "char1SelectUnicode" ) + " values(?)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + char1SelectUnicode + " values(?)" ) );
q.bindValue( 0, uniStr );
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "char1SelectUnicode" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + char1SelectUnicode ) );
QVERIFY( q.next() );
@@ -471,24 +475,25 @@ void tst_QSqlQuery::oraRowId()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString oraRowId(qTableName("oraRowId", __FILE__));
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "select rowid from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select rowid from " + qtest ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).type(), QVariant::String );
QVERIFY( !q.value( 0 ).toString().isEmpty() );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "oraRowId" ) + " (id char(1))" ) );
+ QVERIFY_SQL( q, exec( "create table " + oraRowId + " (id char(1))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "oraRowId" ) + " values('a')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + oraRowId + " values('a')" ) );
QVariant v1 = q.lastInsertId();
QVERIFY( v1.isValid() );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "oraRowId" ) + " values('b')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + oraRowId + " values('b')" ) );
QVariant v2 = q.lastInsertId();
QVERIFY( v2.isValid() );
- QVERIFY_SQL( q, prepare( "select * from " + qTableName( "oraRowId" ) + " where rowid = ?" ) );
+ QVERIFY_SQL( q, prepare( "select * from " + oraRowId + " where rowid = ?" ) );
q.addBindValue( v1 );
QVERIFY_SQL( q, exec() );
QVERIFY( q.next() );
@@ -505,49 +510,50 @@ void tst_QSqlQuery::mysqlOutValues()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString hello(qTableName( "hello", __FILE__ )), qtestproc(qTableName( "qtestproc", __FILE__ ));
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
- q.exec( "drop function " + qTableName( "hello" ) );
+ q.exec( "drop function " + hello );
- QVERIFY_SQL( q, exec( "create function " + qTableName( "hello" ) + " (s char(20)) returns varchar(50) return concat('Hello ', s)" ) );
+ QVERIFY_SQL( q, exec( "create function " + hello + " (s char(20)) returns varchar(50) return concat('Hello ', s)" ) );
- QVERIFY_SQL( q, exec( "select " + qTableName( "hello" ) + "('world')" ) );
+ QVERIFY_SQL( q, exec( "select " + hello + "('world')" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toString(), QString( "Hello world" ) );
- QVERIFY_SQL( q, prepare( "select " + qTableName( "hello" ) + "('harald')" ) );
+ QVERIFY_SQL( q, prepare( "select " + hello + "('harald')" ) );
QVERIFY_SQL( q, exec() );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toString(), QString( "Hello harald" ) );
- QVERIFY_SQL( q, exec( "drop function " + qTableName( "hello" ) ) );
+ QVERIFY_SQL( q, exec( "drop function " + hello ) );
- q.exec( "drop procedure " + qTableName( "qtestproc" ) );
+ q.exec( "drop procedure " + qtestproc );
- QVERIFY_SQL( q, exec( "create procedure " + qTableName( "qtestproc" ) + " () "
- "BEGIN select * from " + qTableName( "qtest" ) + " order by id; END" ) );
- QVERIFY_SQL( q, exec( "call " + qTableName( "qtestproc" ) + "()" ) );
+ QVERIFY_SQL( q, exec( "create procedure " + qtestproc + " () "
+ "BEGIN select * from " + qtest + " order by id; END" ) );
+ QVERIFY_SQL( q, exec( "call " + qtestproc + "()" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 1 ).toString(), QString( "VarChar1" ) );
- QVERIFY_SQL( q, exec( "drop procedure " + qTableName( "qtestproc" ) ) );
+ QVERIFY_SQL( q, exec( "drop procedure " + qtestproc ) );
- QVERIFY_SQL( q, exec( "create procedure " + qTableName( "qtestproc" ) + " (OUT param1 INT) "
+ QVERIFY_SQL( q, exec( "create procedure " + qtestproc + " (OUT param1 INT) "
"BEGIN set param1 = 42; END" ) );
- QVERIFY_SQL( q, exec( "call " + qTableName( "qtestproc" ) + " (@out)" ) );
+ QVERIFY_SQL( q, exec( "call " + qtestproc + " (@out)" ) );
QVERIFY_SQL( q, exec( "select @out" ) );
QCOMPARE( q.record().fieldName( 0 ), QString( "@out" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toInt(), 42 );
- QVERIFY_SQL( q, exec( "drop procedure " + qTableName( "qtestproc" ) ) );
+ QVERIFY_SQL( q, exec( "drop procedure " + qtestproc ) );
}
void tst_QSqlQuery::oraOutValues()
@@ -555,6 +561,7 @@ void tst_QSqlQuery::oraOutValues()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString tst_outValues(qTableName("tst_outValues", __FILE__));
if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) {
QSKIP( "Test requires prepared query support", SkipSingle );
@@ -566,11 +573,11 @@ void tst_QSqlQuery::oraOutValues()
q.setForwardOnly( true );
/*** outvalue int ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x out int) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x out int) is\n"
"begin\n"
" x := 42;\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
q.addBindValue( 0, QSql::Out );
QVERIFY_SQL( q, exec() );
QCOMPARE( q.boundValue( 0 ).toInt(), 42 );
@@ -582,11 +589,11 @@ void tst_QSqlQuery::oraOutValues()
QVERIFY( !q.boundValue( 0 ).isNull() );
/*** outvalue varchar ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x out varchar) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x out varchar) is\n"
"begin\n"
" x := 'blah';\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
QString s1( "12345" );
s1.reserve( 512 );
q.addBindValue( s1, QSql::Out );
@@ -594,51 +601,51 @@ void tst_QSqlQuery::oraOutValues()
QCOMPARE( q.boundValue( 0 ).toString(), QString( "blah" ) );
/*** in/outvalue numeric ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x in out numeric) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x in out numeric) is\n"
"begin\n"
" x := x + 10;\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
q.addBindValue( 10, QSql::Out );
QVERIFY_SQL( q, exec() );
QCOMPARE( q.boundValue( 0 ).toInt(), 20 );
/*** in/outvalue varchar ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x in out varchar) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x in out varchar) is\n"
"begin\n"
" x := 'homer';\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
q.addBindValue( QString( "maggy" ), QSql::Out );
QVERIFY_SQL( q, exec() );
QCOMPARE( q.boundValue( 0 ).toString(), QString( "homer" ) );
/*** in/outvalue varchar ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x in out varchar) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x in out varchar) is\n"
"begin\n"
" x := NULL;\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
q.addBindValue( QString( "maggy" ), QSql::Out );
QVERIFY_SQL( q, exec() );
QVERIFY( q.boundValue( 0 ).isNull() );
/*** in/outvalue int ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x in out int) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x in out int) is\n"
"begin\n"
" x := NULL;\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
q.addBindValue( 42, QSql::Out );
QVERIFY_SQL( q, exec() );
QVERIFY( q.boundValue( 0 ).isNull() );
/*** in/outvalue varchar ***/
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x in varchar, y out varchar) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x in varchar, y out varchar) is\n"
"begin\n"
" y := x||'bubulalakikikokololo';\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?, ?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?, ?)" ) );
q.addBindValue( QString( "fifi" ), QSql::In );
QString out;
out.reserve( 50 );
@@ -652,30 +659,31 @@ void tst_QSqlQuery::oraClob()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString clobby(qTableName("clobby", __FILE__));
QSqlQuery q( db );
// simple short string
- QVERIFY_SQL( q, exec( "create table " + qTableName( "clobby" ) + "(id int primary key, cl clob, bl blob)" ) );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "clobby" ) + " (id, cl, bl) values(?, ?, ?)" ) );
+ QVERIFY_SQL( q, exec( "create table " + clobby + "(id int primary key, cl clob, bl blob)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + clobby + " (id, cl, bl) values(?, ?, ?)" ) );
q.addBindValue( 1 );
q.addBindValue( "bubu" );
q.addBindValue( QByteArray("bubu") );
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select bl, cl from " + qTableName( "clobby" ) + " where id = 1" ) );
+ QVERIFY_SQL( q, exec( "select bl, cl from " + clobby + " where id = 1" ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toString(), QString( "bubu" ) );
QCOMPARE( q.value( 1 ).toString(), QString( "bubu" ) );
// simple short string with binding
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "clobby" ) + " (id, cl, bl) values(?, ?, ?)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + clobby + " (id, cl, bl) values(?, ?, ?)" ) );
q.addBindValue( 2 );
q.addBindValue( "lala", QSql::Binary );
q.addBindValue( QByteArray("lala"), QSql::Binary );
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select bl, cl from " + qTableName( "clobby" ) + " where id = 2" ) );
+ QVERIFY_SQL( q, exec( "select bl, cl from " + clobby + " where id = 2" ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toString(), QString( "lala" ) );
QCOMPARE( q.value( 1 ).toString(), QString( "lala" ) );
@@ -683,13 +691,13 @@ void tst_QSqlQuery::oraClob()
// loooong string
QString loong;
loong.fill( QLatin1Char( 'A' ), 25000 );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "clobby" ) + " (id, cl, bl) values(?, ?, ?)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + clobby + " (id, cl, bl) values(?, ?, ?)" ) );
q.addBindValue( 3 );
q.addBindValue( loong, QSql::Binary );
q.addBindValue( loong.toLatin1(), QSql::Binary );
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select bl, cl from " + qTableName( "clobby" ) + " where id = 3" ) );
+ QVERIFY_SQL( q, exec( "select bl, cl from " + clobby + " where id = 3" ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toString().count(), loong.count() );
QVERIFY( q.value( 0 ).toString() == loong );
@@ -704,16 +712,16 @@ void tst_QSqlQuery::storedProceduresIBase()
CHECK_DATABASE( db );
QSqlQuery q( db );
- q.exec( "drop procedure " + qTableName( "TESTPROC" ) );
+ q.exec( "drop procedure " + qTableName( "TESTPROC", __FILE__ ) );
- QVERIFY_SQL( q, exec( "create procedure " + qTableName( "TESTPROC" ) +
+ QVERIFY_SQL( q, exec( "create procedure " + qTableName( "TESTPROC", __FILE__ ) +
" RETURNS (x integer, y varchar(20)) "
"AS BEGIN "
" x = 42; "
" y = 'Hello Anders'; "
"END" ) );
- QVERIFY_SQL( q, prepare( "execute procedure " + qTableName( "TestProc" ) ) );
+ QVERIFY_SQL( q, prepare( "execute procedure " + qTableName( "TestProc", __FILE__ ) ) );
QVERIFY_SQL( q, exec() );
// check for a valid result set
@@ -730,7 +738,7 @@ void tst_QSqlQuery::storedProceduresIBase()
// the second next shall fail
QVERIFY( !q.next() );
- q.exec( "drop procedure " + qTableName( "TestProc" ) );
+ q.exec( "drop procedure " + qTableName( "TestProc", __FILE__ ) );
}
void tst_QSqlQuery::outValuesDB2()
@@ -748,8 +756,8 @@ void tst_QSqlQuery::outValuesDB2()
q.setForwardOnly( true );
- q.exec( "drop procedure " + qTableName( "tst_outValues" ) ); //non-fatal
- QVERIFY_SQL( q, exec( "CREATE PROCEDURE " + qTableName( "tst_outValues" ) +
+ q.exec( "drop procedure " + qTableName( "tst_outValues", __FILE__ ) ); //non-fatal
+ QVERIFY_SQL( q, exec( "CREATE PROCEDURE " + qTableName( "tst_outValues", __FILE__ ) +
" (OUT x int, OUT x2 double, OUT x3 char(20))\n"
"LANGUAGE SQL\n"
"P1: BEGIN\n"
@@ -758,7 +766,7 @@ void tst_QSqlQuery::outValuesDB2()
" SET x3 = 'Homer';\n"
"END P1" ) );
- QVERIFY_SQL( q, prepare( "call " + qTableName( "tst_outValues" ) + "(?, ?, ?)" ) );
+ QVERIFY_SQL( q, prepare( "call " + qTableName( "tst_outValues", __FILE__ ) + "(?, ?, ?)" ) );
q.addBindValue( 0, QSql::Out );
q.addBindValue( 0.0, QSql::Out );
@@ -776,6 +784,7 @@ void tst_QSqlQuery::outValues()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString tst_outValues(qTableName("tst_outValues", __FILE__));
if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) {
QSKIP( "Test requires prepared query support", SkipSingle );
@@ -787,26 +796,26 @@ void tst_QSqlQuery::outValues()
q.setForwardOnly( true );
if ( db.driverName().startsWith( "QOCI" ) ) {
- QVERIFY_SQL( q, exec( "create or replace procedure " + qTableName( "tst_outValues" ) + "(x out int) is\n"
+ QVERIFY_SQL( q, exec( "create or replace procedure " + tst_outValues + "(x out int) is\n"
"begin\n"
" x := 42;\n"
"end;\n" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outvalues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
} else if ( db.driverName().startsWith( "QDB2" ) ) {
- q.exec( "drop procedure " + qTableName( "tst_outValues" ) ); //non-fatal
- QVERIFY_SQL( q, exec( "CREATE PROCEDURE " + qTableName( "tst_outValues" ) + " (OUT x int)\n"
+ q.exec( "drop procedure " + tst_outValues ); //non-fatal
+ QVERIFY_SQL( q, exec( "CREATE PROCEDURE " + tst_outValues + " (OUT x int)\n"
"LANGUAGE SQL\n"
"P1: BEGIN\n"
" SET x = 42;\n"
"END P1" ) );
- QVERIFY( q.prepare( "call " + qTableName( "tst_outValues" ) + "(?)" ) );
+ QVERIFY( q.prepare( "call " + tst_outValues + "(?)" ) );
} else if ( tst_Databases::isSqlServer( db ) ) {
- q.exec( "drop procedure " + qTableName( "tst_outValues" ) ); //non-fatal
- QVERIFY_SQL( q, exec( "create procedure " + qTableName( "tst_outValues" ) + " (@x int out) as\n"
+ q.exec( "drop procedure " + tst_outValues ); //non-fatal
+ QVERIFY_SQL( q, exec( "create procedure " + tst_outValues + " (@x int out) as\n"
"begin\n"
" set @x = 42\n"
"end\n" ) );
- QVERIFY( q.prepare( "{call " + qTableName( "tst_outvalues" ) + "(?)}" ) );
+ QVERIFY( q.prepare( "{call " + tst_outValues + "(?)}" ) );
} else {
QSKIP( "Don't know how to create a stored procedure for this database server, please fix this test", SkipSingle );
return;
@@ -843,11 +852,11 @@ void tst_QSqlQuery::blob()
q.setForwardOnly( true );
- QString queryString = QString( "create table " + qTableName( "qtest_blob" ) +
+ QString queryString = QString( "create table " + qTableName( "qtest_blob", __FILE__ ) +
" (id int not null primary key, t_blob %1)" ).arg( tst_Databases::blobTypeName( db, BLOBSIZE ) );
QVERIFY_SQL( q, exec( queryString ) );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_blob" ) + " (id, t_blob) values (?, ?)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_blob", __FILE__ ) + " (id, t_blob) values (?, ?)" ) );
for ( i = 0; i < BLOBCOUNT; ++i ) {
q.addBindValue( i );
@@ -855,7 +864,7 @@ void tst_QSqlQuery::blob()
QVERIFY_SQL( q, exec() );
}
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_blob" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_blob", __FILE__ ) ) );
for ( i = 0; i < BLOBCOUNT; ++i ) {
QVERIFY( q.next() );
@@ -878,7 +887,7 @@ void tst_QSqlQuery::value()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "select id, t_varchar, t_char from " + qTableName( "qtest" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select id, t_varchar, t_char from " + qtest + " order by id" ) );
int i = 1;
while ( q.next() ) {
@@ -910,7 +919,7 @@ void tst_QSqlQuery::record()
QSqlQuery q( db );
QVERIFY( q.record().isEmpty() );
- QVERIFY_SQL( q, exec( "select id, t_varchar, t_char from " + qTableName( "qtest" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select id, t_varchar, t_char from " + qtest + " order by id" ) );
QSqlRecord rec = q.record();
QCOMPARE( q.record().fieldName( 0 ).toLower(), QString( "id" ) );
QCOMPARE( q.record().fieldName( 1 ).toLower(), QString( "t_varchar" ) );
@@ -934,7 +943,7 @@ void tst_QSqlQuery::isValid()
QSqlQuery q( db );
QVERIFY( !q.isValid() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.first() );
QVERIFY( q.isValid() );
}
@@ -947,7 +956,7 @@ void tst_QSqlQuery::isActive()
QSqlQuery q( db );
QVERIFY( !q.isActive() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.isActive() );
QVERIFY( q.last() );
@@ -957,15 +966,15 @@ void tst_QSqlQuery::isActive()
QVERIFY( q.isActive() );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (41, 'VarChar41', 'Char41')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (41, 'VarChar41', 'Char41')" ) );
QVERIFY( q.isActive() );
- QVERIFY_SQL( q, exec( "update " + qTableName( "qtest" ) + " set id = 42 where id = 41" ) );
+ QVERIFY_SQL( q, exec( "update " + qtest + " set id = 42 where id = 41" ) );
QVERIFY( q.isActive() );
- QVERIFY_SQL( q, exec( "delete from " + qTableName( "qtest" ) + " where id = 42" ) );
+ QVERIFY_SQL( q, exec( "delete from " + qtest + " where id = 42" ) );
QVERIFY( q.isActive() );
}
@@ -979,7 +988,7 @@ void tst_QSqlQuery::numRowsAffected()
QSqlQuery q( db );
QCOMPARE( q.numRowsAffected(), -1 );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
int i = 0;
while ( q.next() )
@@ -993,21 +1002,21 @@ void tst_QSqlQuery::numRowsAffected()
qDebug( "Expected numRowsAffected to be -1, 0 or %d, got %d", i, q.numRowsAffected() );
}
- QVERIFY_SQL( q, exec( "update " + qTableName( "qtest" ) + " set id = 100 where id = 1" ) );
+ QVERIFY_SQL( q, exec( "update " + qtest + " set id = 100 where id = 1" ) );
QCOMPARE( q.numRowsAffected(), 1 );
QCOMPARE( q.numRowsAffected(), 1 ); // yes, we check twice
- QVERIFY_SQL( q, exec( "update " + qTableName( "qtest" ) + " set id = id + 100" ) );
+ QVERIFY_SQL( q, exec( "update " + qtest + " set id = id + 100" ) );
QCOMPARE( q.numRowsAffected(), i );
QCOMPARE( q.numRowsAffected(), i ); // yes, we check twice
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (42000, 'homer', 'marge')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (42000, 'homer', 'marge')" ) );
QCOMPARE( q.numRowsAffected(), 1 );
QCOMPARE( q.numRowsAffected(), 1 ); // yes, we check twice
QSqlQuery q2( db );
- QVERIFY_SQL( q2, exec( "insert into " + qTableName( "qtest" ) + " values (42001, 'homer', 'marge')" ) );
+ QVERIFY_SQL( q2, exec( "insert into " + qtest + " values (42001, 'homer', 'marge')" ) );
if ( !db.driverName().startsWith( "QSQLITE2" ) ) {
// SQLite 2.x accumulates changed rows in nested queries. See task 33794
@@ -1025,7 +1034,7 @@ void tst_QSqlQuery::size()
QSqlQuery q( db );
QCOMPARE( q.size(), -1 );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
int i = 0;
while ( q.next() )
@@ -1039,7 +1048,7 @@ void tst_QSqlQuery::size()
QCOMPARE( q.size(), -1 ); // yes, twice
}
- QSqlQuery q2( "select * from " + qTableName( "qtest" ), db );
+ QSqlQuery q2( "select * from " + qtest, db );
if ( db.driver()->hasFeature( QSqlDriver::QuerySize ) )
QCOMPARE( q.size(), i );
@@ -1048,7 +1057,7 @@ void tst_QSqlQuery::size()
q2.clear();
- QVERIFY_SQL( q, exec( "update " + qTableName( "qtest" ) + " set id = 100 where id = 1" ) );
+ QVERIFY_SQL( q, exec( "update " + qtest + " set id = 100 where id = 1" ) );
QCOMPARE( q.size(), -1 );
QCOMPARE( q.size(), -1 ); // yes, twice
}
@@ -1060,10 +1069,10 @@ void tst_QSqlQuery::isSelect()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.isSelect() );
- QVERIFY_SQL( q, exec( "update " + qTableName( "qtest" ) + " set id = 1 where id = 1" ) );
+ QVERIFY_SQL( q, exec( "update " + qtest + " set id = 1 where id = 1" ) );
QVERIFY( q.isSelect() == false );
}
@@ -1075,7 +1084,7 @@ void tst_QSqlQuery::first()
QSqlQuery q( db );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.last() );
QVERIFY_SQL( q, first() );
QVERIFY( q.at() == 0 );
@@ -1089,7 +1098,7 @@ void tst_QSqlQuery::next()
QSqlQuery q( db );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.first() );
QVERIFY( q.next() );
QVERIFY( q.at() == 1 );
@@ -1103,7 +1112,7 @@ void tst_QSqlQuery::prev()
QSqlQuery q( db );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.first() );
QVERIFY( q.next() );
QVERIFY( q.previous() );
@@ -1118,7 +1127,7 @@ void tst_QSqlQuery::last()
QSqlQuery q( db );
QCOMPARE( q.at(), int( QSql::BeforeFirstRow ) );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
int i = 0;
while ( q.next() )
@@ -1132,7 +1141,7 @@ void tst_QSqlQuery::last()
// Access doesn't return the correct position
QCOMPARE( q.at(), ( i-1 ) );
- QSqlQuery q2( "select * from " + qTableName( "qtest" ), db );
+ QSqlQuery q2( "select * from " + qtest, db );
QVERIFY( q2.last() );
@@ -1148,7 +1157,7 @@ void tst_QSqlQuery::seek()
CHECK_DATABASE( db );
QSqlQuery q( db );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( QString( "select id from %1 order by id" ).arg( qTableName( "qtest" ) ) ) );
+ QVERIFY_SQL( q, exec( QString( "select id from %1 order by id" ).arg( qtest ) ) );
// NB! The order of the calls below are important!
QVERIFY( q.last() );
@@ -1184,7 +1193,7 @@ void tst_QSqlQuery::seekForwardOnlyQuery()
QVERIFY( !q.isForwardOnly() );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( QString( "select id from %1 order by id" ).arg( qTableName( "qtest" ) ) ) );
+ QVERIFY_SQL( q, exec( QString( "select id from %1 order by id" ).arg( qtest ) ) );
QSqlRecord rec;
@@ -1223,7 +1232,7 @@ void tst_QSqlQuery::forwardOnly()
q.setForwardOnly( true );
QVERIFY( q.isForwardOnly() );
QVERIFY( q.at() == QSql::BeforeFirstRow );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest + " order by id" ) );
QVERIFY( q.at() == QSql::BeforeFirstRow );
QVERIFY( q.first() );
QCOMPARE( q.at(), 0 );
@@ -1248,7 +1257,7 @@ void tst_QSqlQuery::forwardOnly()
QCOMPARE( q.at(), 3 );
QCOMPARE( q.value( 0 ).toInt(), 4 );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
int i = 0;
while ( q.next() )
@@ -1260,7 +1269,7 @@ void tst_QSqlQuery::forwardOnly()
QVERIFY( q2.isForwardOnly() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest + " order by id" ) );
QVERIFY( q.isForwardOnly() );
@@ -1306,7 +1315,7 @@ void tst_QSqlQuery::query_exec()
QSqlQuery q( db );
QVERIFY( !q.isValid() );
QVERIFY( !q.isActive() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest ) );
QVERIFY( q.isActive() );
QVERIFY( q.next() );
QVERIFY( q.isValid() );
@@ -1319,7 +1328,7 @@ void tst_QSqlQuery::isNull()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "select id, t_varchar from " + qTableName( "qtest_null" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select id, t_varchar from " + qTableName( "qtest_null", __FILE__ ) + " order by id" ) );
QVERIFY( q.next() );
QVERIFY( !q.isNull( 0 ) );
QVERIFY( q.isNull( 1 ) );
@@ -1345,13 +1354,13 @@ void tst_QSqlQuery::bitField()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_bittest" ) + " (bitty bit)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_bittest", __FILE__ ) + " (bitty bit)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_bittest" ) + " values (0)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_bittest", __FILE__ ) + " values (0)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_bittest" ) + " values (1)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_bittest", __FILE__ ) + " values (1)" ) );
- QVERIFY_SQL( q, exec( "select bitty from " + qTableName( "qtest_bittest" ) ) );
+ QVERIFY_SQL( q, exec( "select bitty from " + qTableName( "qtest_bittest", __FILE__ ) ) );
QVERIFY( q.next() );
@@ -1369,15 +1378,16 @@ void tst_QSqlQuery::nullBlob()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString qtest_nullblob(qTableName("qtest_nullblob", __FILE__));
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_nullblob" ) + " (id int primary key, bb blob)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_nullblob" ) + " values (0, EMPTY_BLOB())" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_nullblob" ) + " values (1, NULL)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_nullblob" ) + " values (2, 'aabbcc00112233445566')" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtest_nullblob + " (id int primary key, bb blob)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_nullblob + " values (0, EMPTY_BLOB())" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_nullblob + " values (1, NULL)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_nullblob + " values (2, 'aabbcc00112233445566')" ) );
// necessary otherwise oracle will bombard you with internal errors
q.setForwardOnly( true );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_nullblob" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest_nullblob + " order by id" ) );
QVERIFY( q.next() );
QCOMPARE(( int )q.value( 1 ).toByteArray().size(), 0 );
@@ -1398,14 +1408,15 @@ void tst_QSqlQuery::rawField()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString qtest_rawtest(qTableName("qtest_rawtest", __FILE__));
QSqlQuery q( db );
q.setForwardOnly( true );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_rawtest" ) +
+ QVERIFY_SQL( q, exec( "create table " + qtest_rawtest +
" (id int, col raw(20))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_rawtest" ) + " values (0, NULL)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_rawtest" ) + " values (1, '00aa1100ddeeff')" ) );
- QVERIFY_SQL( q, exec( "select col from " + qTableName( "qtest_rawtest" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_rawtest + " values (0, NULL)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_rawtest + " values (1, '00aa1100ddeeff')" ) );
+ QVERIFY_SQL( q, exec( "select col from " + qtest_rawtest + " order by id" ) );
QVERIFY( q.next() );
QVERIFY( q.isNull( 0 ) );
QCOMPARE(( int )q.value( 0 ).toByteArray().size(), 0 );
@@ -1422,6 +1433,7 @@ void tst_QSqlQuery::precision()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString qtest_precision(qTableName( "qtest_precision", __FILE__ ));
static const char* precStr = "1.2345678901234567891";
@@ -1433,13 +1445,13 @@ void tst_QSqlQuery::precision()
QSqlQuery q( db );
if ( tst_Databases::isMSAccess( db ) )
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_precision" ) + " (col1 number)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtest_precision + " (col1 number)" ) );
else
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_precision" ) + " (col1 numeric(21, 20))" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtest_precision + " (col1 numeric(21, 20))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest_precision" ) + " (col1) values (1.2345678901234567891)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest_precision + " (col1) values (1.2345678901234567891)" ) );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_precision" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest_precision ) );
QVERIFY( q.next() );
QString val = q.value( 0 ).toString();
@@ -1472,7 +1484,7 @@ void tst_QSqlQuery::nullResult()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest" ) + " where id > 50000" ) );
+ QVERIFY_SQL( q, exec( "select * from " + qtest + " where id > 50000" ) );
if ( q.driver()->hasFeature( QSqlDriver::QuerySize ) )
QCOMPARE( q.size(), 0 );
@@ -1513,9 +1525,9 @@ void tst_QSqlQuery::transaction()
// test a working transaction
q.exec( startTransactionStr );
- QVERIFY_SQL( q, exec( "insert into" + qTableName( "qtest" ) + " values (40, 'VarChar40', 'Char40')" ) );
+ QVERIFY_SQL( q, exec( "insert into" + qtest + " values (40, 'VarChar40', 'Char40')" ) );
- QVERIFY_SQL( q, exec( "select * from" + qTableName( "qtest" ) + " where id = 40" ) );
+ QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 40" ) );
QVERIFY( q.next() );
@@ -1523,7 +1535,7 @@ void tst_QSqlQuery::transaction()
QVERIFY_SQL( q, exec( "commit" ) );
- QVERIFY_SQL( q, exec( "select * from" + qTableName( "qtest" ) + " where id = 40" ) );
+ QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 40" ) );
QVERIFY( q.next() );
@@ -1532,9 +1544,9 @@ void tst_QSqlQuery::transaction()
// test a rollback
q.exec( startTransactionStr );
- QVERIFY_SQL( q, exec( "insert into" + qTableName( "qtest" ) + " values (41, 'VarChar41', 'Char41')" ) );
+ QVERIFY_SQL( q, exec( "insert into" + qtest + " values (41, 'VarChar41', 'Char41')" ) );
- QVERIFY_SQL( q, exec( "select * from" + qTableName( "qtest" ) + " where id = 41" ) );
+ QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 41" ) );
QVERIFY( q.next() );
@@ -1548,18 +1560,18 @@ void tst_QSqlQuery::transaction()
QFAIL( "Could not rollback transaction: " + tst_Databases::printError( q.lastError() ) );
}
- QVERIFY_SQL( q, exec( "select * from" + qTableName( "qtest" ) + " where id = 41" ) );
+ QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 41" ) );
QVERIFY( q.next() == false );
// test concurrent access
q.exec( startTransactionStr );
- QVERIFY_SQL( q, exec( "insert into" + qTableName( "qtest" ) + " values (42, 'VarChar42', 'Char42')" ) );
- QVERIFY_SQL( q, exec( "select * from" + qTableName( "qtest" ) + " where id = 42" ) );
+ QVERIFY_SQL( q, exec( "insert into" + qtest + " values (42, 'VarChar42', 'Char42')" ) );
+ QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 42" ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 42 );
- QVERIFY_SQL( q2, exec( "select * from" + qTableName( "qtest" ) + " where id = 42" ) );
+ QVERIFY_SQL( q2, exec( "select * from" + qtest + " where id = 42" ) );
if ( q2.next() )
qDebug( QString( "DBMS '%1' doesn't support query based transactions with concurrent access" ).arg(
@@ -1567,7 +1579,7 @@ void tst_QSqlQuery::transaction()
QVERIFY_SQL( q, exec( "commit" ) );
- QVERIFY_SQL( q2, exec( "select * from" + qTableName( "qtest" ) + " where id = 42" ) );
+ QVERIFY_SQL( q2, exec( "select * from" + qtest + " where id = 42" ) );
QVERIFY( q2.next() );
@@ -1579,6 +1591,7 @@ void tst_QSqlQuery::joins()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString qtestj1(qTableName("qtestj1", __FILE__)), qtestj2(qTableName("qtestj2", __FILE__));
if ( db.driverName().startsWith( "QOCI" )
|| db.driverName().startsWith( "QTDS" )
@@ -1592,17 +1605,17 @@ void tst_QSqlQuery::joins()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtestj1" ) + " (id1 int, id2 int)" ) );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtestj2" ) + " (id int, name varchar(20))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtestj1" ) + " values (1, 1)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtestj1" ) + " values (1, 2)" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtestj2" ) + " values(1, 'trenton')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtestj2" ) + " values(2, 'marius')" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtestj1 + " (id1 int, id2 int)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qtestj2 + " (id int, name varchar(20))" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtestj1 + " values (1, 1)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtestj1 + " values (1, 2)" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtestj2 + " values(1, 'trenton')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtestj2 + " values(2, 'marius')" ) );
QVERIFY_SQL( q, exec( "select qtestj1.id1, qtestj1.id2, qtestj2.id, qtestj2.name, qtestj3.id, qtestj3.name "
- "from " + qTableName( "qtestj1" ) + " qtestj1 left outer join " + qTableName( "qtestj2" ) +
+ "from " + qtestj1 + " qtestj1 left outer join " + qtestj2 +
" qtestj2 on (qtestj1.id1 = qtestj2.id) "
- "left outer join " + qTableName( "qtestj2" ) + " as qtestj3 on (qtestj1.id2 = qtestj3.id)" ) );
+ "left outer join " + qtestj2 + " as qtestj3 on (qtestj1.id2 = qtestj3.id)" ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
@@ -1628,7 +1641,7 @@ void tst_QSqlQuery::synonyms()
CHECK_DATABASE( db );
QSqlQuery q(db);
- QVERIFY_SQL( q, exec("select a.id, a.t_char, a.t_varchar from " + qTableName( "qtest" ) + " a where a.id = 1") );
+ QVERIFY_SQL( q, exec("select a.id, a.t_char, a.t_varchar from " + qtest + " a where a.id = 1") );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
QCOMPARE( q.value( 1 ).toString().trimmed(), QString( "Char1" ) );
@@ -1647,6 +1660,8 @@ void tst_QSqlQuery::prepare_bind_exec()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString qtest_prepare(qTableName("qtest_prepare", __FILE__));
+
if(db.driverName().startsWith("QIBASE") && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb"))
QSKIP("Can't transliterate extended unicode to ascii", SkipSingle);
if(db.driverName().startsWith("QDB2"))
@@ -1671,15 +1686,15 @@ void tst_QSqlQuery::prepare_bind_exec()
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QTDS" ) )
- createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int primary key, name nvarchar(200) null)";
+ createQuery = "create table " + qtest_prepare + " (id int primary key, name nvarchar(200) null)";
else if ( tst_Databases::isMySQL(db) && useUnicode )
- createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(200) character set utf8)";
+ createQuery = "create table " + qtest_prepare + " (id int not null primary key, name varchar(200) character set utf8)";
else
- createQuery = "create table " + qTableName( "qtest_prepare" ) + " (id int not null primary key, name varchar(200))";
+ createQuery = "create table " + qtest_prepare + " (id int not null primary key, name varchar(200))";
QVERIFY_SQL( q, exec( createQuery ) );
- QVERIFY( q.prepare( "insert into " + qTableName( "qtest_prepare" ) + " (id, name) values (:id, :name)" ) );
+ QVERIFY( q.prepare( "insert into " + qtest_prepare + " (id, name) values (:id, :name)" ) );
int i;
for ( i = 0; i < 6; ++i ) {
@@ -1702,7 +1717,7 @@ void tst_QSqlQuery::prepare_bind_exec()
QVERIFY_SQL( q, exec() );
}
- QVERIFY_SQL( q, exec( "SELECT * FROM " + qTableName( "qtest_prepare" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "SELECT * FROM " + qtest_prepare + " order by id" ) );
for ( i = 0; i < 6; ++i ) {
QVERIFY( q.next() );
@@ -1721,12 +1736,12 @@ void tst_QSqlQuery::prepare_bind_exec()
QCOMPARE( q.value( 0 ).toInt(), 8 );
QCOMPARE( q.value( 1 ).toString(), values[5] );
- QVERIFY( q.prepare( "insert into " + qTableName( "qtest_prepare" ) + " (id, name) values (:id, 'Bart')" ) );
+ QVERIFY( q.prepare( "insert into " + qtest_prepare + " (id, name) values (:id, 'Bart')" ) );
q.bindValue( ":id", 99 );
QVERIFY_SQL( q, exec() );
q.bindValue( ":id", 100 );
QVERIFY_SQL( q, exec() );
- QVERIFY( q.exec( "select * from " + qTableName( "qtest_prepare" ) + " where id > 98 order by id" ) );
+ QVERIFY( q.exec( "select * from " + qtest_prepare + " where id > 98 order by id" ) );
for ( i = 99; i <= 100; ++i ) {
QVERIFY( q.next() );
@@ -1735,7 +1750,7 @@ void tst_QSqlQuery::prepare_bind_exec()
}
/*** SELECT stuff ***/
- QVERIFY( q.prepare( "select * from " + qTableName( "qtest_prepare" ) + " where id = :id" ) );
+ QVERIFY( q.prepare( "select * from " + qtest_prepare + " where id = :id" ) );
for ( i = 0; i < 6; ++i ) {
q.bindValue( ":id", i );
@@ -1750,9 +1765,9 @@ void tst_QSqlQuery::prepare_bind_exec()
QVERIFY( !q.next() );
}
- QVERIFY_SQL( q, exec( "DELETE FROM " + qTableName( "qtest_prepare" ) ) );
+ QVERIFY_SQL( q, exec( "DELETE FROM " + qtest_prepare ) );
- QVERIFY( q.prepare( "insert into " + qTableName( "qtest_prepare" ) + " (id, name) values (?, ?)" ) );
+ QVERIFY( q.prepare( "insert into " + qtest_prepare + " (id, name) values (?, ?)" ) );
q.bindValue( 0, 0 );
q.bindValue( 1, values[ 0 ] );
QVERIFY_SQL( q, exec() );
@@ -1781,7 +1796,7 @@ void tst_QSqlQuery::prepare_bind_exec()
QVERIFY_SQL( q, exec() );
}
- QVERIFY_SQL( q, exec( "SELECT * FROM " + qTableName( "qtest_prepare" ) + " order by id" ) );
+ QVERIFY_SQL( q, exec( "SELECT * FROM " + qtest_prepare + " order by id" ) );
for ( i = 0; i < 6; ++i ) {
QVERIFY( q.next() );
@@ -1800,13 +1815,13 @@ void tst_QSqlQuery::prepare_bind_exec()
QCOMPARE( q.value( 1 ).toString(), utf8str );
}
- QVERIFY( q.prepare( "insert into " + qTableName( "qtest_prepare" ) + " (id, name) values (?, 'Bart')" ) );
+ QVERIFY( q.prepare( "insert into " + qtest_prepare + " (id, name) values (?, 'Bart')" ) );
q.bindValue( 0, 99 );
QVERIFY_SQL( q, exec() );
q.addBindValue( 100 );
QVERIFY_SQL( q, exec() );
- QVERIFY( q.exec( "select * from " + qTableName( "qtest_prepare" ) + " where id > 98 order by id" ) );
+ QVERIFY( q.exec( "select * from " + qtest_prepare + " where id > 98 order by id" ) );
for ( i = 99; i <= 100; ++i ) {
QVERIFY( q.next() );
@@ -1815,7 +1830,7 @@ void tst_QSqlQuery::prepare_bind_exec()
}
/* insert a duplicate id and make sure the db bails out */
- QVERIFY( q.prepare( "insert into " + qTableName( "qtest_prepare" ) + " (id, name) values (?, ?)" ) );
+ QVERIFY( q.prepare( "insert into " + qtest_prepare + " (id, name) values (?, ?)" ) );
q.addBindValue( 99 );
@@ -1837,7 +1852,7 @@ void tst_QSqlQuery::prepared_select()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, prepare( "select a.id, a.t_char, a.t_varchar from " + qTableName( "qtest" ) + " a where a.id = ?" ) );
+ QVERIFY_SQL( q, prepare( "select a.id, a.t_char, a.t_varchar from " + qtest + " a where a.id = ?" ) );
q.bindValue( 0, 1 );
QVERIFY_SQL( q, exec() );
@@ -1857,7 +1872,7 @@ void tst_QSqlQuery::prepared_select()
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 3 );
- QVERIFY_SQL( q, prepare( "select a.id, a.t_char, a.t_varchar from " + qTableName( "qtest" ) + " a where a.id = ?" ) );
+ QVERIFY_SQL( q, prepare( "select a.id, a.t_char, a.t_varchar from " + qtest + " a where a.id = ?" ) );
QCOMPARE( q.at(), ( int )QSql::BeforeFirstRow );
QVERIFY( !q.first() );
}
@@ -1873,9 +1888,9 @@ void tst_QSqlQuery::sqlServerLongStrings()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "CREATE TABLE " + qTableName( "qtest_longstr" ) + " (id int primary key, longstring ntext)" ) );
+ QVERIFY_SQL( q, exec( "CREATE TABLE " + qTableName( "qtest_longstr", __FILE__ ) + " (id int primary key, longstring ntext)" ) );
- QVERIFY_SQL( q, prepare( "INSERT INTO " + qTableName( "qtest_longstr" ) + " VALUES (?, ?)" ) );
+ QVERIFY_SQL( q, prepare( "INSERT INTO " + qTableName( "qtest_longstr", __FILE__ ) + " VALUES (?, ?)" ) );
q.addBindValue( 0 );
@@ -1893,7 +1908,7 @@ void tst_QSqlQuery::sqlServerLongStrings()
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_longstr" ) ) );
+ QVERIFY_SQL( q, exec( "select * from " + qTableName( "qtest_longstr", __FILE__ ) ) );
QVERIFY_SQL( q, next() );
@@ -1957,7 +1972,7 @@ void tst_QSqlQuery::batchExec()
QSKIP( "Database can't do BatchOperations", SkipSingle );
QSqlQuery q( db );
- QString tableName = qTableName( "qtest_batch" );
+ const QString tableName = qTableName( "qtest_batch", __FILE__ );
QVERIFY_SQL( q, exec( "create table " + tableName + " (id int, name varchar(20), dt date, num numeric(8, 4))" ) );
QVERIFY_SQL( q, prepare( "insert into " + tableName + " (id, name, dt, num) values (?, ?, ?, ?)" ) );
@@ -2101,9 +2116,9 @@ void tst_QSqlQuery::record_sqlite()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table "+qTableName( "record_sqlite" )+"(id integer primary key, name varchar, title int)" ) );
+ QVERIFY_SQL( q, exec( "create table "+qTableName( "record_sqlite", __FILE__ )+"(id integer primary key, name varchar, title int)" ) );
- QSqlRecord rec = db.record( qTableName( "record_sqlite" ) );
+ QSqlRecord rec = db.record( qTableName( "record_sqlite", __FILE__ ) );
QCOMPARE( rec.count(), 3 );
QCOMPARE( rec.field( 0 ).type(), QVariant::Int );
@@ -2111,7 +2126,7 @@ void tst_QSqlQuery::record_sqlite()
QCOMPARE( rec.field( 2 ).type(), QVariant::Int );
/* important - select from an empty table */
- QVERIFY_SQL( q, exec( "select id, name, title from "+qTableName( "record_sqlite" ) ) );
+ QVERIFY_SQL( q, exec( "select id, name, title from "+qTableName( "record_sqlite", __FILE__ ) ) );
rec = q.record();
QCOMPARE( rec.count(), 3 );
@@ -2130,13 +2145,13 @@ void tst_QSqlQuery::oraLong()
QString aLotOfText( 127000, QLatin1Char( 'H' ) );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_longstr" ) + " (id int primary key, astr long)" ) );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_longstr" ) + " (id, astr) values (?, ?)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_longstr", __FILE__ ) + " (id int primary key, astr long)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_longstr", __FILE__ ) + " (id, astr) values (?, ?)" ) );
q.addBindValue( 1 );
q.addBindValue( aLotOfText );
QVERIFY_SQL( q, exec() );
- QVERIFY_SQL( q, exec( "select id,astr from " + qTableName( "qtest_longstr" ) ) );
+ QVERIFY_SQL( q, exec( "select id,astr from " + qTableName( "qtest_longstr", __FILE__ ) ) );
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
@@ -2151,8 +2166,8 @@ void tst_QSqlQuery::execErrorRecovery()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_exerr" ) + " (id int not null primary key)" ) );
- QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_exerr" ) + " values (?)" ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_exerr", __FILE__ ) + " (id int not null primary key)" ) );
+ QVERIFY_SQL( q, prepare( "insert into " + qTableName( "qtest_exerr", __FILE__ ) + " values (?)" ) );
q.addBindValue( 1 );
QVERIFY_SQL( q, exec() );
@@ -2175,7 +2190,7 @@ void tst_QSqlQuery::lastInsertId()
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "qtest" ) + " values (41, 'VarChar41', 'Char41')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + qtest + " values (41, 'VarChar41', 'Char41')" ) );
QVariant v = q.lastInsertId();
@@ -2189,7 +2204,7 @@ void tst_QSqlQuery::lastQuery()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QString sql = "select * from " + qTableName( "qtest" );
+ QString sql = "select * from " + qtest;
QVERIFY_SQL( q, exec( sql ) );
QCOMPARE( q.lastQuery(), sql );
QCOMPARE( q.executedQuery(), sql );
@@ -2208,7 +2223,7 @@ void tst_QSqlQuery::bindWithDoubleColonCastOperator()
return;
}
- QString tablename = qTableName( "bindtest" );
+ const QString tablename(qTableName( "bindtest", __FILE__ ));
QSqlQuery q( db );
@@ -2282,7 +2297,7 @@ void tst_QSqlQuery::createQueryOnClosedDatabase()
QSqlQuery q( db );
db.open();
- QVERIFY_SQL( q, exec( QString( "select * from %1 where id = 1" ).arg( qTableName( "qtest" ) ) ) );
+ QVERIFY_SQL( q, exec( QString( "select * from %1 where id = 1" ).arg( qtest ) ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
@@ -2290,7 +2305,7 @@ void tst_QSqlQuery::createQueryOnClosedDatabase()
QCOMPARE( q.value( 2 ).toString().trimmed(), QLatin1String( "Char1" ) );
db.close();
- QVERIFY2( !q.exec( QString( "select * from %1 where id = 1" ).arg( qTableName( "qtest" ) ) ),
+ QVERIFY2( !q.exec( QString( "select * from %1 where id = 1" ).arg( qtest ) ),
qPrintable( QString( "This can't happen! The query should not have been executed!" ) ) );
}
@@ -2303,7 +2318,7 @@ void tst_QSqlQuery::reExecutePreparedForwardOnlyQuery()
QSqlQuery q( db );
q.setForwardOnly( true );
- QVERIFY_SQL( q, prepare( QString( "SELECT id, t_varchar, t_char FROM %1 WHERE id = :id" ).arg( qTableName( "qtest" ) ) ) );
+ QVERIFY_SQL( q, prepare( QString( "SELECT id, t_varchar, t_char FROM %1 WHERE id = :id" ).arg( qtest ) ) );
q.bindValue( ":id", 1 );
QVERIFY_SQL( q, exec() );
@@ -2328,7 +2343,7 @@ void tst_QSqlQuery::finish()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QVERIFY_SQL( q, prepare( "SELECT id FROM " + qTableName( "qtest" ) + " WHERE id = ?" ) );
+ QVERIFY_SQL( q, prepare( "SELECT id FROM " + qtest + " WHERE id = ?" ) );
int id = 4;
q.bindValue( 0, id );
@@ -2349,7 +2364,7 @@ void tst_QSqlQuery::finish()
q.finish();
QVERIFY( !q.isActive() );
- QVERIFY_SQL( q, exec( "SELECT id FROM " + qTableName( "qtest" ) + " WHERE id = 1" ) );
+ QVERIFY_SQL( q, exec( "SELECT id FROM " + qtest + " WHERE id = 1" ) );
QVERIFY( q.isActive() );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
@@ -2374,7 +2389,7 @@ void tst_QSqlQuery::sqlite_finish()
db2.setDatabaseName( db.databaseName() );
QVERIFY_SQL( db2, open() );
- QString tableName = qTableName( "qtest_lockedtable" );
+ const QString tableName(qTableName( "qtest_lockedtable", __FILE__ ));
QSqlQuery q( db );
tst_Databases::safeDropTable( db, tableName );
@@ -2424,7 +2439,7 @@ void tst_QSqlQuery::nextResult()
else if ( db.driverName().startsWith( "QDB2" ) )
driverType = DB2;
- QString tableName = qTableName( "more_results" );
+ const QString tableName(qTableName( "more_results", __FILE__ ));
QVERIFY_SQL( q, exec( "CREATE TABLE " + tableName + " (id integer, text varchar(20), num numeric(6, 3), empty varchar(10));" ) );
@@ -2528,7 +2543,7 @@ void tst_QSqlQuery::nextResult()
}
// Stored procedure with multiple result sets
- QString procName = qTableName( "proc_more_res" );
+ const QString procName(qTableName( "proc_more_res", __FILE__ ));
q.exec( QString( "DROP PROCEDURE %1;" ).arg( procName ) );
@@ -2606,7 +2621,7 @@ void tst_QSqlQuery::blobsPreparedQuery()
if ( !db.driver()->hasFeature( QSqlDriver::BLOB ) || !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
QSKIP( "DBMS does not support BLOBs or prepared queries", SkipSingle );
- QString tableName = qTableName( "blobstest" );
+ const QString tableName(qTableName( "blobstest", __FILE__ ));
QSqlQuery q( db );
q.setForwardOnly( true ); // This is needed to make the test work with DB2.
@@ -2661,8 +2676,8 @@ void tst_QSqlQuery::emptyTableNavigate()
{
QSqlQuery q( db );
- QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_empty" ) + " (id char(10))" ) );
- QVERIFY_SQL( q, prepare( "select * from " + qTableName( "qtest_empty" ) ) );
+ QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_empty", __FILE__ ) + " (id char(10))" ) );
+ QVERIFY_SQL( q, prepare( "select * from " + qTableName( "qtest_empty", __FILE__ ) ) );
QVERIFY_SQL( q, exec() );
QVERIFY( !q.next() );
QCOMPARE( q.lastError().isValid(), false );
@@ -2675,19 +2690,20 @@ void tst_QSqlQuery::task_217003()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
QSqlQuery q( db );
+ const QString Planet(qTableName( "Planet", __FILE__));
- QVERIFY_SQL( q, exec( "create table " + qTableName( "Planet" ) + " (Name varchar(20))" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "Planet" ) + " VALUES ('Mercury')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "Planet" ) + " VALUES ('Venus')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "Planet" ) + " VALUES ('Earth')" ) );
- QVERIFY_SQL( q, exec( "insert into " + qTableName( "Planet" ) + " VALUES ('Mars')" ) );
+ QVERIFY_SQL( q, exec( "create table " + Planet + " (Name varchar(20))" ) );
+ QVERIFY_SQL( q, exec( "insert into " + Planet + " VALUES ('Mercury')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + Planet + " VALUES ('Venus')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + Planet + " VALUES ('Earth')" ) );
+ QVERIFY_SQL( q, exec( "insert into " + Planet + " VALUES ('Mars')" ) );
- QVERIFY_SQL( q, exec( "SELECT Name FROM "+qTableName( "Planet" ) ) );
+ QVERIFY_SQL( q, exec( "SELECT Name FROM " + Planet ) );
QVERIFY_SQL( q, seek( 3 ) );
QCOMPARE( q.value( 0 ).toString(), QString( "Mars" ) );
QVERIFY_SQL( q, seek( 1 ) );
QCOMPARE( q.value( 0 ).toString(), QString( "Venus" ) );
- QVERIFY_SQL( q, exec( "SELECT Name FROM "+qTableName( "Planet" ) ) );
+ QVERIFY_SQL( q, exec( "SELECT Name FROM " + Planet ) );
QVERIFY_SQL( q, seek( 3 ) );
QCOMPARE( q.value( 0 ).toString(), QString( "Mars" ) );
QVERIFY_SQL( q, seek( 0 ) );
@@ -2704,7 +2720,7 @@ void tst_QSqlQuery::task_250026()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QString tableName = qTableName( "task_250026" );
+ const QString tableName(qTableName( "task_250026", __FILE__ ));
if ( !q.exec( "create table " + tableName + " (longfield varchar(1100))" ) ) {
qDebug() << "Error" << q.lastError();
@@ -2752,7 +2768,7 @@ void tst_QSqlQuery::task_229811()
QSqlQuery q( db );
- QString tableName = qTableName( "task_229811" );
+ const QString tableName(qTableName( "task_229811", __FILE__ ));
if ( !q.exec( "CREATE TABLE " + tableName + " (Word varchar(20))" ) ) {
qDebug() << "Warning" << q.lastError();
@@ -2799,7 +2815,7 @@ void tst_QSqlQuery::task_234422()
m_airlines << "Lufthansa" << "SAS" << "United" << "KLM" << "Aeroflot";
m_countries << "DE" << "SE" << "US" << "NL" << "RU";
- QString tableName = qTableName( "task_234422" );
+ const QString tableName(qTableName( "task_234422", __FILE__ ));
QVERIFY_SQL(query,exec("CREATE TABLE " + tableName + " (id int primary key, "
"name varchar(20), homecountry varchar(2))"));
@@ -2831,7 +2847,7 @@ void tst_QSqlQuery::task_233829()
CHECK_DATABASE( db );
QSqlQuery q( db );
- QString tableName = qTableName("task_233829");
+ const QString tableName(qTableName("task_233829", __FILE__));
QVERIFY_SQL(q,exec("CREATE TABLE " + tableName + "(dbl1 double precision,dbl2 double precision) without oids;"));
QString queryString("INSERT INTO " + tableName +"(dbl1, dbl2) VALUES(?,?)");
@@ -2851,7 +2867,7 @@ void tst_QSqlQuery::sqlServerReturn0()
if (!tst_Databases::isSqlServer( db ))
QSKIP("SQL Server specific test", SkipSingle);
- QString tableName(qTableName("test141895")), procName(qTableName("test141895_proc"));
+ const QString tableName(qTableName("test141895", __FILE__)), procName(qTableName("test141895_proc", __FILE__));
QSqlQuery q( db );
q.exec("DROP TABLE " + tableName);
q.exec("DROP PROCEDURE " + procName);
@@ -2877,7 +2893,7 @@ void tst_QSqlQuery::QTBUG_551()
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
QSqlQuery q(db);
- QString pkgname=qTableName("pkg");
+ const QString pkgname(qTableName("pkg", __FILE__));
QVERIFY_SQL(q, exec("CREATE OR REPLACE PACKAGE "+pkgname+" IS \n\
\n\
TYPE IntType IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;\n\
@@ -2923,17 +2939,18 @@ void tst_QSqlQuery::QTBUG_5251()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
+ const QString timetest(qTableName("timetest", __FILE__));
if (!db.driverName().startsWith( "QPSQL" )) return;
QSqlQuery q(db);
- q.exec("DROP TABLE " + qTableName("timetest"));
- QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("timetest") + " (t TIME)"));
- QVERIFY_SQL(q, exec("INSERT INTO " + qTableName("timetest") + " VALUES ('1:2:3.666')"));
+ q.exec("DROP TABLE " + timetest);
+ QVERIFY_SQL(q, exec("CREATE TABLE " + timetest + " (t TIME)"));
+ QVERIFY_SQL(q, exec("INSERT INTO " + timetest + " VALUES ('1:2:3.666')"));
QSqlTableModel timetestModel(0,db);
timetestModel.setEditStrategy(QSqlTableModel::OnManualSubmit);
- timetestModel.setTable(qTableName("timetest"));
+ timetestModel.setTable(timetest);
QVERIFY_SQL(timetestModel, select());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("01:02:03.666"));
@@ -2942,7 +2959,7 @@ void tst_QSqlQuery::QTBUG_5251()
QVERIFY_SQL(timetestModel, submitAll());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:12:34.500"));
- QVERIFY_SQL(q, exec("UPDATE " + qTableName("timetest") + " SET t = '0:11:22.33'"));
+ QVERIFY_SQL(q, exec("UPDATE " + timetest + " SET t = '0:11:22.33'"));
QVERIFY_SQL(timetestModel, select());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:11:22.330"));
@@ -2955,7 +2972,7 @@ void tst_QSqlQuery::QTBUG_6421()
CHECK_DATABASE( db );
QSqlQuery q(db);
- QString tableName=qTableName(QLatin1String("bug6421")).toUpper();
+ const QString tableName(qTableName("bug6421", __FILE__).toUpper());
QVERIFY_SQL(q, exec("create table "+tableName+"(COL1 char(10), COL2 char(10), COL3 char(10))"));
QVERIFY_SQL(q, exec("create index INDEX1 on "+tableName+" (COL1 desc)"));
@@ -2980,16 +2997,16 @@ void tst_QSqlQuery::QTBUG_6618()
QSKIP("SQL Server specific test", SkipSingle);
QSqlQuery q(db);
- q.exec( "drop procedure " + qTableName( "tst_raiseError" ) ); //non-fatal
+ q.exec( "drop procedure " + qTableName( "tst_raiseError", __FILE__ ) ); //non-fatal
QString errorString;
for (int i=0;i<110;i++)
errorString+="reallylong";
errorString+=" error";
- QVERIFY_SQL( q, exec("create procedure " + qTableName( "tst_raiseError" ) + " as\n"
+ QVERIFY_SQL( q, exec("create procedure " + qTableName( "tst_raiseError", __FILE__ ) + " as\n"
"begin\n"
" raiserror('" + errorString + "', 16, 1)\n"
"end\n" ));
- q.exec( "{call " + qTableName( "tst_raiseError" ) + "}" );
+ q.exec( "{call " + qTableName( "tst_raiseError", __FILE__ ) + "}" );
QVERIFY(q.lastError().text().contains(errorString));
}
@@ -3002,7 +3019,7 @@ void tst_QSqlQuery::QTBUG_6852()
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QSqlQuery q(db);
- QString tableName(qTableName(QLatin1String("bug6852"))), procName(qTableName(QLatin1String("bug6852_proc")));
+ const QString tableName(qTableName("bug6852", __FILE__)), procName(qTableName("bug6852_proc", __FILE__));
QVERIFY_SQL(q, exec("DROP PROCEDURE IF EXISTS "+procName));
QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(\n"
@@ -3036,7 +3053,7 @@ void tst_QSqlQuery::QTBUG_5765()
QSKIP( "Test requires MySQL >= 4.1", SkipSingle );
QSqlQuery q(db);
- QString tableName(qTableName(QLatin1String("bug5765")));
+ const QString tableName(qTableName("bug5765", __FILE__));
QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(testval TINYINT(1) DEFAULT 0)"));
q.prepare("INSERT INTO "+tableName+" SET testval = :VALUE");
@@ -3074,7 +3091,7 @@ void tst_QSqlQuery::benchmark()
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QSqlQuery q(db);
- QString tableName(qTableName(QLatin1String("benchmark")));
+ const QString tableName(qTableName("benchmark", __FILE__));
tst_Databases::safeDropTable( db, tableName );
diff --git a/tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp
index 7e75d28..b64d599 100644
--- a/tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp
+++ b/tests/auto/qsqlquerymodel/tst_qsqlquerymodel.cpp
@@ -148,10 +148,10 @@ void tst_QSqlQueryModel::cleanupTestCase()
void tst_QSqlQueryModel::dropTestTables(QSqlDatabase db)
{
QStringList tableNames;
- tableNames << qTableName("test")
- << qTableName("test2")
- << qTableName("test3")
- << qTableName("many");
+ tableNames << qTableName("test", __FILE__)
+ << qTableName("test2", __FILE__)
+ << qTableName("test3", __FILE__)
+ << qTableName("many", __FILE__);
tst_Databases::safeDropTables(db, tableNames);
}
@@ -161,10 +161,10 @@ void tst_QSqlQueryModel::createTestTables(QSqlDatabase db)
QSqlQuery q(db);
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test") + "(id integer not null, name varchar(20), title integer, primary key (id))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test2") + "(id integer not null, title varchar(20), primary key (id))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test3") + "(id integer not null, primary key (id))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("many") + "(id integer not null, name varchar(20), primary key (id))"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("test", __FILE__) + "(id integer not null, name varchar(20), title integer, primary key (id))"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("test2", __FILE__) + "(id integer not null, title varchar(20), primary key (id))"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("test3", __FILE__) + "(id integer not null, primary key (id))"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("many", __FILE__) + "(id integer not null, name varchar(20), primary key (id))"));
}
void tst_QSqlQueryModel::populateTestTables(QSqlDatabase db)
@@ -174,38 +174,38 @@ void tst_QSqlQueryModel::populateTestTables(QSqlDatabase db)
QSqlQuery q(db), q2(db);
- tst_Databases::safeDropTables(db, QStringList() << qTableName("manytmp") << qTableName("test3tmp"));
- QVERIFY_SQL(q, exec("create table " + qTableName("manytmp") + "(id integer not null, name varchar(20), primary key (id))"));
- QVERIFY_SQL(q, exec("create table " + qTableName("test3tmp") + "(id integer not null, primary key (id))"));
+ tst_Databases::safeDropTables(db, QStringList() << qTableName("manytmp", __FILE__) << qTableName("test3tmp", __FILE__));
+ QVERIFY_SQL(q, exec("create table " + qTableName("manytmp", __FILE__) + "(id integer not null, name varchar(20), primary key (id))"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("test3tmp", __FILE__) + "(id integer not null, primary key (id))"));
if (hasTransactions) QVERIFY_SQL(db, transaction());
- QVERIFY_SQL(q, exec("insert into " + qTableName("test") + " values(1, 'harry', 1)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test") + " values(2, 'trond', 2)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test2") + " values(1, 'herr')"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test2") + " values(2, 'mister')"));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("test", __FILE__) + " values(1, 'harry', 1)"));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("test", __FILE__) + " values(2, 'trond', 2)"));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("test2", __FILE__) + " values(1, 'herr')"));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("test2", __FILE__) + " values(2, 'mister')"));
- QVERIFY_SQL(q, exec(QString("insert into " + qTableName("test3") + " values(0)")));
- QVERIFY_SQL(q, prepare("insert into "+qTableName("test3")+"(id) select id + ? from "+qTableName("test3tmp")));
+ QVERIFY_SQL(q, exec(QString("insert into " + qTableName("test3", __FILE__) + " values(0)")));
+ QVERIFY_SQL(q, prepare("insert into "+qTableName("test3", __FILE__)+"(id) select id + ? from "+qTableName("test3tmp", __FILE__)));
for (int i=1; i<260; i*=2) {
- q2.exec("delete from "+qTableName("test3tmp"));
- QVERIFY_SQL(q2, exec("insert into "+qTableName("test3tmp")+"(id) select id from "+qTableName("test3")));
+ q2.exec("delete from "+qTableName("test3tmp", __FILE__));
+ QVERIFY_SQL(q2, exec("insert into "+qTableName("test3tmp", __FILE__)+"(id) select id from "+qTableName("test3", __FILE__)));
q.bindValue(0, i);
QVERIFY_SQL(q, exec());
}
- QVERIFY_SQL(q, exec(QString("insert into " + qTableName("many") + "(id, name) values (0, \'harry\')")));
- QVERIFY_SQL(q, prepare("insert into "+qTableName("many")+"(id, name) select id + ?, name from "+qTableName("manytmp")));
+ QVERIFY_SQL(q, exec(QString("insert into " + qTableName("many", __FILE__) + "(id, name) values (0, \'harry\')")));
+ QVERIFY_SQL(q, prepare("insert into "+qTableName("many", __FILE__)+"(id, name) select id + ?, name from "+qTableName("manytmp", __FILE__)));
for (int i=1; i < 2048; i*=2) {
- q2.exec("delete from "+qTableName("manytmp"));
- QVERIFY_SQL(q2, exec("insert into "+qTableName("manytmp")+"(id, name) select id, name from "+qTableName("many")));
+ q2.exec("delete from "+qTableName("manytmp", __FILE__));
+ QVERIFY_SQL(q2, exec("insert into "+qTableName("manytmp", __FILE__)+"(id, name) select id, name from "+qTableName("many", __FILE__)));
q.bindValue(0, i);
QVERIFY_SQL(q, exec());
}
if (hasTransactions) QVERIFY_SQL(db, commit());
- tst_Databases::safeDropTables(db, QStringList() << qTableName("manytmp") << qTableName("test3tmp"));
+ tst_Databases::safeDropTables(db, QStringList() << qTableName("manytmp", __FILE__) << qTableName("test3tmp", __FILE__));
}
void tst_QSqlQueryModel::generic_data(const QString& engine)
@@ -233,7 +233,7 @@ void tst_QSqlQueryModel::removeColumn()
CHECK_DATABASE(db);
DBTestModel model;
- model.setQuery(QSqlQuery("select * from " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__), db));
model.fetchMore();
QSignalSpy spy(&model, SIGNAL(columnsAboutToBeRemoved(QModelIndex, int, int)));
@@ -315,7 +315,7 @@ void tst_QSqlQueryModel::insertColumn()
CHECK_DATABASE(db);
DBTestModel model;
- model.setQuery(QSqlQuery("select * from " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__), db));
model.fetchMore(); // necessary???
QSignalSpy spy(&model, SIGNAL(columnsInserted(QModelIndex, int, int)));
@@ -395,7 +395,7 @@ void tst_QSqlQueryModel::record()
CHECK_DATABASE(db);
QSqlQueryModel model;
- model.setQuery(QSqlQuery("select * from " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__), db));
QSqlRecord rec = model.record();
@@ -429,7 +429,7 @@ void tst_QSqlQueryModel::setHeaderData()
QVERIFY(!model.setHeaderData(5, Qt::Vertical, "foo"));
QVERIFY(model.headerData(5, Qt::Vertical).isValid());
- model.setQuery(QSqlQuery("select * from " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("select * from " + qTableName("test", __FILE__), db));
qRegisterMetaType<Qt::Orientation>("Qt::Orientation");
QSignalSpy spy(&model, SIGNAL(headerDataChanged(Qt::Orientation, int, int)));
@@ -459,7 +459,7 @@ void tst_QSqlQueryModel::fetchMore()
QSqlQueryModel model;
QSignalSpy spy(&model, SIGNAL(rowsInserted(QModelIndex, int, int)));
- model.setQuery(QSqlQuery("select * from " + qTableName("many"), db));
+ model.setQuery(QSqlQuery("select * from " + qTableName("many", __FILE__), db));
int rowCount = model.rowCount();
QCOMPARE(spy.value(0).value(1).toInt(), 0);
@@ -491,7 +491,7 @@ void tst_QSqlQueryModel::withSortFilterProxyModel()
QSKIP("Test applies only for drivers not reporting the query size.", SkipSingle);
QSqlQueryModel model;
- model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test3"), db));
+ model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test3", __FILE__), db));
QSortFilterProxyModel proxy;
proxy.setSourceModel(&model);
@@ -500,7 +500,7 @@ void tst_QSqlQueryModel::withSortFilterProxyModel()
QSignalSpy modelRowsRemovedSpy(&model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)));
QSignalSpy modelRowsInsertedSpy(&model, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
- model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test3"), db));
+ model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test3", __FILE__), db));
view.scrollToBottom();
QTestEventLoop::instance().enterLoop(1);
@@ -536,12 +536,12 @@ void tst_QSqlQueryModel::setQuerySignalEmission()
QSignalSpy modelRowsRemovedSpy(&model, SIGNAL(rowsRemoved(const QModelIndex &, int, int)));
// First select, the model was empty and no rows had to be removed!
- model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test", __FILE__), db));
QCOMPARE(modelRowsAboutToBeRemovedSpy.count(), 0);
QCOMPARE(modelRowsRemovedSpy.count(), 0);
// Second select, the model wasn't empty and two rows had to be removed!
- model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test"), db));
+ model.setQuery(QSqlQuery("SELECT * FROM " + qTableName("test", __FILE__), db));
QCOMPARE(modelRowsAboutToBeRemovedSpy.count(), 1);
QCOMPARE(modelRowsAboutToBeRemovedSpy.value(0).value(1).toInt(), 0);
QCOMPARE(modelRowsAboutToBeRemovedSpy.value(0).value(2).toInt(), 1);
@@ -564,7 +564,7 @@ void tst_QSqlQueryModel::setQueryWithNoRowsInResultSet()
// The query's result set will be empty so no signals should be emitted!
QSqlQuery query(db);
- QVERIFY_SQL(query, exec("SELECT * FROM " + qTableName("test") + " where 0 = 1"));
+ QVERIFY_SQL(query, exec("SELECT * FROM " + qTableName("test", __FILE__) + " where 0 = 1"));
model.setQuery(query);
QCOMPARE(modelRowsAboutToBeInsertedSpy.count(), 0);
QCOMPARE(modelRowsInsertedSpy.count(), 0);
@@ -578,13 +578,14 @@ void tst_QSqlQueryModel::task_180617()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString test3(qTableName("test3", __FILE__));
QTableView view;
QCOMPARE(view.columnAt(0), -1);
QCOMPARE(view.rowAt(0), -1);
QSqlQueryModel model;
- model.setQuery( "SELECT TOP 0 * FROM " + qTableName("test3"), db );
+ model.setQuery( "SELECT TOP 0 * FROM " + test3, db );
view.setModel(&model);
bool error = false;
@@ -595,10 +596,10 @@ void tst_QSqlQueryModel::task_180617()
QCOMPARE(view.columnAt(0), (error)?-1:0 );
QCOMPARE(view.rowAt(0), -1);
- model.setQuery( "SELECT TOP 0 * FROM " + qTableName("test3"), db );
- model.setQuery( "SELECT TOP 0 * FROM " + qTableName("test3"), db );
- model.setQuery( "SELECT TOP 0 * FROM " + qTableName("test3"), db );
- model.setQuery( "SELECT TOP 0 * FROM " + qTableName("test3"), db );
+ model.setQuery( "SELECT TOP 0 * FROM " + test3, db );
+ model.setQuery( "SELECT TOP 0 * FROM " + test3, db );
+ model.setQuery( "SELECT TOP 0 * FROM " + test3, db );
+ model.setQuery( "SELECT TOP 0 * FROM " + test3, db );
QCOMPARE(view.columnAt(0), (error)?-1:0 );
QCOMPARE(view.rowAt(0), -1);
diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
index eab1364..c4bd540 100644
--- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
+++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
@@ -45,6 +45,11 @@
#include "../qsqldatabase/tst_databases.h"
+const QString reltest1(qTableName("reltest1", __FILE__)),
+ reltest2(qTableName("reltest2", __FILE__)),
+ reltest3(qTableName("reltest3", __FILE__)),
+ reltest4(qTableName("reltest4", __FILE__)),
+ reltest5(qTableName("reltest5", __FILE__));
//TESTED_CLASS=
@@ -107,37 +112,37 @@ void tst_QSqlRelationalTableModel::recreateTestTables(QSqlDatabase db)
dropTestTables(db);
QSqlQuery q(db);
- QVERIFY_SQL( q, exec("create table " + qTableName("reltest1") +
+ QVERIFY_SQL( q, exec("create table " + reltest1 +
" (id int not null primary key, name varchar(20), title_key int, another_title_key int)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest1") + " values(1, 'harry', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest1") + " values(2, 'trond', 2, 1)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest1") + " values(3, 'vohi', 1, 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest1") + " values(4, 'boris', 2, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest1 + " values(1, 'harry', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest1 + " values(2, 'trond', 2, 1)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest1 + " values(3, 'vohi', 1, 2)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest1 + " values(4, 'boris', 2, 2)"));
- QVERIFY_SQL( q, exec("create table " + qTableName("reltest2") + " (tid int not null primary key, title varchar(20))"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest2") + " values(1, 'herr')"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest2") + " values(2, 'mister')"));
+ QVERIFY_SQL( q, exec("create table " + reltest2 + " (tid int not null primary key, title varchar(20))"));
+ QVERIFY_SQL( q, exec("insert into " + reltest2 + " values(1, 'herr')"));
+ QVERIFY_SQL( q, exec("insert into " + reltest2 + " values(2, 'mister')"));
- QVERIFY_SQL( q, exec("create table " + qTableName("reltest3") + " (id int not null primary key, name varchar(20), city_key int)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest3") + " values(1, 'Gustav', 1)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest3") + " values(2, 'Heidi', 2)"));
+ QVERIFY_SQL( q, exec("create table " + reltest3 + " (id int not null primary key, name varchar(20), city_key int)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest3 + " values(1, 'Gustav', 1)"));
+ QVERIFY_SQL( q, exec("insert into " + reltest3 + " values(2, 'Heidi', 2)"));
- QVERIFY_SQL( q, exec("create table " + qTableName("reltest4") + " (id int not null primary key, name varchar(20))"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest4") + " values(1, 'Oslo')"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest4") + " values(2, 'Trondheim')"));
+ QVERIFY_SQL( q, exec("create table " + reltest4 + " (id int not null primary key, name varchar(20))"));
+ QVERIFY_SQL( q, exec("insert into " + reltest4 + " values(1, 'Oslo')"));
+ QVERIFY_SQL( q, exec("insert into " + reltest4 + " values(2, 'Trondheim')"));
- QVERIFY_SQL( q, exec("create table " + qTableName("reltest5") + " (title varchar(20) not null primary key, abbrev varchar(20))"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest5") + " values('herr', 'Hr')"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("reltest5") + " values('mister', 'Mr')"));
+ QVERIFY_SQL( q, exec("create table " + reltest5 + " (title varchar(20) not null primary key, abbrev varchar(20))"));
+ QVERIFY_SQL( q, exec("insert into " + reltest5 + " values('herr', 'Hr')"));
+ QVERIFY_SQL( q, exec("insert into " + reltest5 + " values('mister', 'Mr')"));
if (testWhiteSpaceNames(db.driverName())) {
- QString reltest6 = db.driver()->escapeIdentifier(qTableName("rel test6"), QSqlDriver::TableName);
+ QString reltest6 = db.driver()->escapeIdentifier(qTableName("rel", __FILE__)+" test6", QSqlDriver::TableName);
QVERIFY_SQL( q, exec("create table " + reltest6 + " (id int not null primary key, " + db.driver()->escapeIdentifier("city key", QSqlDriver::FieldName) +
" int, " + db.driver()->escapeIdentifier("extra field", QSqlDriver::FieldName) + " int)"));
QVERIFY_SQL( q, exec("insert into " + reltest6 + " values(1, 1,9)"));
QVERIFY_SQL( q, exec("insert into " + reltest6 + " values(2, 2,8)"));
- QString reltest7 = db.driver()->escapeIdentifier(qTableName("rel test7"), QSqlDriver::TableName);
+ QString reltest7 = db.driver()->escapeIdentifier(qTableName("rel", __FILE__)+" test7", QSqlDriver::TableName);
QVERIFY_SQL( q, exec("create table " + reltest7 + " (" + db.driver()->escapeIdentifier("city id", QSqlDriver::TableName) + " int not null primary key, " + db.driver()->escapeIdentifier("city name", QSqlDriver::FieldName) + " varchar(20))"));
QVERIFY_SQL( q, exec("insert into " + reltest7 + " values(1, 'New York')"));
QVERIFY_SQL( q, exec("insert into " + reltest7 + " values(2, 'Washington')"));
@@ -173,19 +178,19 @@ void tst_QSqlRelationalTableModel::cleanupTestCase()
void tst_QSqlRelationalTableModel::dropTestTables( QSqlDatabase db )
{
QStringList tableNames;
- tableNames << qTableName( "reltest1" )
- << qTableName( "reltest2" )
- << qTableName( "reltest3" )
- << qTableName( "reltest4" )
- << qTableName( "reltest5" )
- << qTableName( "rel test6" )
- << qTableName( "rel test7" )
- << qTableName("CASETEST1" )
- << qTableName("casetest1" );
+ tableNames << reltest1
+ << reltest2
+ << reltest3
+ << reltest4
+ << reltest5
+ << (qTableName( "rel", __FILE__)+" test6")
+ << (qTableName( "rel", __FILE__)+" test7")
+ << qTableName("CASETEST1", db.driver() )
+ << qTableName("casetest1", db.driver() );
tst_Databases::safeDropTables( db, tableNames );
- db.exec("DROP SCHEMA "+qTableName("QTBUG_5373")+" CASCADE");
- db.exec("DROP SCHEMA "+qTableName("QTBUG_5373_s2")+" CASCADE");
+ db.exec("DROP SCHEMA "+qTableName("QTBUG_5373", __FILE__)+" CASCADE");
+ db.exec("DROP SCHEMA "+qTableName("QTBUG_5373_s2", __FILE__)+" CASCADE");
}
void tst_QSqlRelationalTableModel::init()
@@ -204,8 +209,8 @@ void tst_QSqlRelationalTableModel::data()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.columnCount(), 4);
@@ -219,8 +224,8 @@ void tst_QSqlRelationalTableModel::data()
//check data retrieval when relational key is a non-integer type
//in this case a string
QSqlRelationalTableModel model2(0,db);
- model2.setTable(qTableName("reltest2"));
- model2.setRelation(1, QSqlRelation(qTableName("reltest5"),"title","abbrev"));
+ model2.setTable(reltest2);
+ model2.setRelation(1, QSqlRelation(reltest5,"title","abbrev"));
QVERIFY_SQL(model2, select());
QCOMPARE(model2.data(model2.index(0, 1)).toString(), QString("Hr"));
@@ -237,9 +242,9 @@ void tst_QSqlRelationalTableModel::setData()
{
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setSort(0, Qt::AscendingOrder);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QVERIFY(model.setData(model.index(0, 1), QString("harry2")));
@@ -260,7 +265,7 @@ void tst_QSqlRelationalTableModel::setData()
}
{ //verify values
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -269,7 +274,7 @@ void tst_QSqlRelationalTableModel::setData()
QCOMPARE(model.data(model.index(3, 1)).toString(), QString("boris2"));
QCOMPARE(model.data(model.index(3, 2)).toInt(), 1);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("mister"));
QCOMPARE(model.data(model.index(3,2)).toString(), QString("herr"));
@@ -279,10 +284,10 @@ void tst_QSqlRelationalTableModel::setData()
//set the values using OnFieldChange strategy
{
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setEditStrategy(QSqlTableModel::OnFieldChange);
model.setSort(0, Qt::AscendingOrder);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QVERIFY(model.setData(model.index(1,1), QString("trond2")));
@@ -293,14 +298,14 @@ void tst_QSqlRelationalTableModel::setData()
}
{ //verify values
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond2"));
QCOMPARE(model.data(model.index(2, 2)).toInt(), 2);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(2, 2)).toString(), QString("mister"));
}
@@ -309,13 +314,13 @@ void tst_QSqlRelationalTableModel::setData()
{
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
//sybase doesn't allow tables with the same alias used twice as col names
//so don't set up an identical relation when using the tds driver
if (!db.driverName().startsWith("QTDS"))
- model.setRelation(3, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "tid", "title"));
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
model.setSort(0, Qt::AscendingOrder);
@@ -336,7 +341,7 @@ void tst_QSqlRelationalTableModel::setData()
}
{ //verify values
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -344,9 +349,9 @@ void tst_QSqlRelationalTableModel::setData()
QCOMPARE(model.data(model.index(3, 2)).toInt(), 1);
QCOMPARE(model.data(model.index(0, 3)).toInt(), 1);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
if (!db.driverName().startsWith("QTDS"))
- model.setRelation(3, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(3, 2)).toString(), QString("herr"));
@@ -361,8 +366,8 @@ void tst_QSqlRelationalTableModel::setData()
{
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest2"));
- model.setRelation(1, QSqlRelation(qTableName("reltest5"), "title", "abbrev"));
+ model.setTable(reltest2);
+ model.setRelation(1, QSqlRelation(reltest5, "title", "abbrev"));
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
@@ -385,9 +390,9 @@ void tst_QSqlRelationalTableModel::multipleRelation()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
- model.setRelation(3, QSqlRelation(qTableName("reltest4"), "id", "name"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest4, "id", "name"));
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -407,8 +412,8 @@ void tst_QSqlRelationalTableModel::insertRecord()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -449,8 +454,8 @@ void tst_QSqlRelationalTableModel::setRecord()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -502,12 +507,12 @@ void tst_QSqlRelationalTableModel::insertWithStrategies()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
model.setSort(0, Qt::AscendingOrder);
if (!db.driverName().startsWith("QTDS"))
- model.setRelation(3, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(0,0)).toInt(), 1);
@@ -608,8 +613,8 @@ void tst_QSqlRelationalTableModel::removeColumn()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QVERIFY_SQL(model, removeColumn(3));
@@ -639,8 +644,8 @@ void tst_QSqlRelationalTableModel::filter()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
model.setFilter("title = 'herr'");
QVERIFY_SQL(model, select());
@@ -657,10 +662,10 @@ void tst_QSqlRelationalTableModel::sort()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
if (!db.driverName().startsWith("QTDS"))
- model.setRelation(3, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "tid", "title"));
model.setSort(2, Qt::DescendingOrder);
QVERIFY_SQL(model, select());
@@ -755,9 +760,9 @@ void tst_QSqlRelationalTableModel::revert()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
- model.setRelation(3, QSqlRelation(qTableName("reltest4"), "id", "name"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest4, "id", "name"));
model.setSort(0, Qt::AscendingOrder);
@@ -781,11 +786,11 @@ void tst_QSqlRelationalTableModel::clearDisplayValuesCache()
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
if (!db.driverName().startsWith("QTDS"))
- model.setRelation(3, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "tid", "title"));
model.setSort(1, Qt::AscendingOrder);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
@@ -833,19 +838,19 @@ void tst_QSqlRelationalTableModel::insertRecordDuplicateFieldNames()
CHECK_DATABASE(db);
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest3"));
+ model.setTable(reltest3);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
model.setSort(0, Qt::AscendingOrder);
// Duplication of "name", used in both reltest3 and reltest4.
- model.setRelation(2, QSqlRelation(qTableName("reltest4"), "id", "name"));
+ model.setRelation(2, QSqlRelation(reltest4, "id", "name"));
QVERIFY_SQL(model, select());
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name_2")).toUpper()).toString(),
+ QCOMPARE(model.record(1).value((reltest4+QLatin1String("_name_2")).toUpper()).toString(),
QString("Trondheim"));
} else {
- QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name_2"))).toString(),
+ QCOMPARE(model.record(1).value((reltest4+QLatin1String("_name_2"))).toString(),
QString("Trondheim"));
}
@@ -864,9 +869,9 @@ void tst_QSqlRelationalTableModel::insertRecordDuplicateFieldNames()
// The duplicate field names is aliased because it's comes from the relation's display column.
if(db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2"))
- QCOMPARE(rec.fieldName(2), (qTableName("reltest4").append(QLatin1String("_name_2"))).toUpper());
+ QCOMPARE(rec.fieldName(2), (reltest4+QLatin1String("_name_2")).toUpper());
else
- QCOMPARE(rec.fieldName(2), qTableName("reltest4").append(QLatin1String("_name_2")));
+ QCOMPARE(rec.fieldName(2), reltest4+QLatin1String("_name_2"));
QVERIFY(model.insertRecord(-1, rec));
QCOMPARE(model.data(model.index(2, 2)).toString(), QString("Oslo"));
@@ -881,8 +886,8 @@ void tst_QSqlRelationalTableModel::invalidData()
CHECK_DATABASE(db);
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
//try set a non-existent relational key
@@ -900,8 +905,8 @@ void tst_QSqlRelationalTableModel::relationModel()
CHECK_DATABASE(db);
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QVERIFY(model.relationModel(0) == NULL);
@@ -910,7 +915,7 @@ void tst_QSqlRelationalTableModel::relationModel()
QVERIFY(model.relationModel(3) == NULL);
QVERIFY(model.relationModel(4) == NULL);
- model.setRelation(3, QSqlRelation(qTableName("reltest4"), "id", "name"));
+ model.setRelation(3, QSqlRelation(reltest4, "id", "name"));
QVERIFY_SQL(model, select());
QVERIFY(model.relationModel(0) == NULL);
@@ -981,7 +986,7 @@ void tst_QSqlRelationalTableModel::casing()
QSqlRelationalTableModel model(0, db);
model.setTable(qTableName("CASETEST1", db.driver()).toUpper());
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(0, 0)).toInt(), 1);
@@ -997,15 +1002,15 @@ void tst_QSqlRelationalTableModel::escapedRelations()
recreateTestTables(db);
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
//try with relation table name quoted
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- model.setRelation(2, QSqlRelation(db.driver()->escapeIdentifier(qTableName("reltest2").toUpper(),QSqlDriver::TableName),
+ model.setRelation(2, QSqlRelation(db.driver()->escapeIdentifier(reltest2.toUpper(),QSqlDriver::TableName),
"tid",
"title"));
} else {
- model.setRelation(2, QSqlRelation(db.driver()->escapeIdentifier(qTableName("reltest2"),QSqlDriver::TableName),
+ model.setRelation(2, QSqlRelation(db.driver()->escapeIdentifier(reltest2,QSqlDriver::TableName),
"tid",
"title"));
@@ -1018,11 +1023,11 @@ void tst_QSqlRelationalTableModel::escapedRelations()
//try with index column quoted
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
db.driver()->escapeIdentifier("tid", QSqlDriver::FieldName).toUpper(),
"title"));
} else {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
db.driver()->escapeIdentifier("tid", QSqlDriver::FieldName),
"title"));
}
@@ -1036,11 +1041,11 @@ void tst_QSqlRelationalTableModel::escapedRelations()
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
"tid",
db.driver()->escapeIdentifier("title", QSqlDriver::FieldName).toUpper()));
} else {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
"tid",
db.driver()->escapeIdentifier("title", QSqlDriver::FieldName)));
}
@@ -1054,11 +1059,11 @@ void tst_QSqlRelationalTableModel::escapedRelations()
//try with tablename and index and display columns quoted in the relation
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
"tid",
db.driver()->escapeIdentifier("title", QSqlDriver::FieldName).toUpper()));
} else {
- model.setRelation(2, QSqlRelation(qTableName("reltest2"),
+ model.setRelation(2, QSqlRelation(reltest2,
"tid",
db.driver()->escapeIdentifier("title", QSqlDriver::FieldName)));
}
@@ -1080,12 +1085,12 @@ void tst_QSqlRelationalTableModel::escapedTableName()
QSqlRelationalTableModel model(0, db);
if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) {
- model.setTable(db.driver()->escapeIdentifier(qTableName("reltest1").toUpper(), QSqlDriver::TableName));
+ model.setTable(db.driver()->escapeIdentifier(reltest1.toUpper(), QSqlDriver::TableName));
} else {
- model.setTable(db.driver()->escapeIdentifier(qTableName("reltest1"), QSqlDriver::TableName));
+ model.setTable(db.driver()->escapeIdentifier(reltest1, QSqlDriver::TableName));
}
model.setSort(0, Qt::AscendingOrder);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QVERIFY(model.setData(model.index(0, 1), QString("harry2")));
@@ -1106,7 +1111,7 @@ void tst_QSqlRelationalTableModel::escapedTableName()
}
{ //verify values
QSqlRelationalTableModel model(0, db);
- model.setTable(qTableName("reltest1"));
+ model.setTable(reltest1);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -1115,7 +1120,7 @@ void tst_QSqlRelationalTableModel::escapedTableName()
QCOMPARE(model.data(model.index(3, 1)).toString(), QString("boris2"));
QCOMPARE(model.data(model.index(3, 2)).toInt(), 1);
- model.setRelation(2, QSqlRelation(qTableName("reltest2"), "tid", "title"));
+ model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("mister"));
QCOMPARE(model.data(model.index(3,2)).toString(), QString("herr"));
@@ -1132,9 +1137,9 @@ void tst_QSqlRelationalTableModel::whiteSpaceInIdentifiers()
if (!testWhiteSpaceNames(db.driverName()))
QSKIP("White space test irrelevant for driver", SkipAll);
QSqlRelationalTableModel model(0, db);
- model.setTable(db.driver()->escapeIdentifier(qTableName("rel test6"), QSqlDriver::TableName));
+ model.setTable(db.driver()->escapeIdentifier(qTableName("rel", __FILE__)+" test6", QSqlDriver::TableName));
model.setSort(0, Qt::DescendingOrder);
- model.setRelation(1, QSqlRelation(db.driver()->escapeIdentifier(qTableName("rel test7"), QSqlDriver::TableName),
+ model.setRelation(1, QSqlRelation(db.driver()->escapeIdentifier(qTableName("rel", __FILE__)+" test7", QSqlDriver::TableName),
db.driver()->escapeIdentifier("city id", QSqlDriver::FieldName),
db.driver()->escapeIdentifier("city name", QSqlDriver::FieldName)));
QVERIFY_SQL(model, select());
@@ -1210,13 +1215,13 @@ void tst_QSqlRelationalTableModel::psqlSchemaTest()
}
QSqlRelationalTableModel model(0, db);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373")));
- QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373_s2")));
- QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373")+"."+qTableName("document")+"(document_id int primary key, relatingid int, userid int)"));
- QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373_s2")+"."+qTableName("user")+"(userid int primary key, username char(40))"));
- model.setTable(qTableName("QTBUG_5373")+"."+qTableName("document"));
- model.setRelation(1, QSqlRelation(qTableName("QTBUG_5373_s2")+"."+qTableName("user"), "userid", "username"));
- model.setRelation(2, QSqlRelation(qTableName("QTBUG_5373_s2")+"."+qTableName("user"), "userid", "username"));
+ QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373", __FILE__)));
+ QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373_s2", __FILE__)));
+ QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373", __FILE__)+"."+qTableName("document", __FILE__)+"(document_id int primary key, relatingid int, userid int)"));
+ QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373_s2", __FILE__)+"."+qTableName("user", __FILE__)+"(userid int primary key, username char(40))"));
+ model.setTable(qTableName("QTBUG_5373", __FILE__)+"."+qTableName("document", __FILE__));
+ model.setRelation(1, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__)+"."+qTableName("user", __FILE__), "userid", "username"));
+ model.setRelation(2, QSqlRelation(qTableName("QTBUG_5373_s2", __FILE__)+"."+qTableName("user", __FILE__), "userid", "username"));
QVERIFY_SQL(model, select());
}
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index b295838..8a084bb 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -44,6 +44,10 @@
#include "../qsqldatabase/tst_databases.h"
#include <QtSql>
+const QString test(qTableName("test", __FILE__)),
+ test2(qTableName("test2", __FILE__)),
+ test3(qTableName("test3", __FILE__));
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -147,20 +151,20 @@ void tst_QSqlTableModel::dropTestTables()
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
QStringList tableNames;
- tableNames << qTableName("test")
- << qTableName("test2")
- << qTableName("test3")
- << qTableName("test4")
- << qTableName("emptytable")
- << qTableName("bigtable")
- << qTableName("foo");
+ tableNames << test
+ << test2
+ << test3
+ << qTableName("test4", __FILE__)
+ << qTableName("emptytable", __FILE__)
+ << qTableName("bigtable", __FILE__)
+ << qTableName("foo", __FILE__);
if (testWhiteSpaceNames(db.driverName()))
tableNames << qTableName("qtestw hitespace", db.driver());
tst_Databases::safeDropTables(db, tableNames);
if (db.driverName().startsWith("QPSQL")) {
- q.exec("DROP SCHEMA " + qTableName("testschema") + " CASCADE");
+ q.exec("DROP SCHEMA " + qTableName("testschema", __FILE__) + " CASCADE");
}
}
}
@@ -171,15 +175,15 @@ void tst_QSqlTableModel::createTestTables()
QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i));
QSqlQuery q(db);
- QVERIFY_SQL( q, exec("create table " + qTableName("test") + "(id int, name varchar(20), title int)"));
+ QVERIFY_SQL( q, exec("create table " + test + "(id int, name varchar(20), title int)"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test2") + "(id int, title varchar(20))"));
+ QVERIFY_SQL( q, exec("create table " + test2 + "(id int, title varchar(20))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test3") + "(id int, random varchar(20), randomtwo varchar(20))"));
+ QVERIFY_SQL( q, exec("create table " + test3 + "(id int, random varchar(20), randomtwo varchar(20))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("test4") + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("test4", __FILE__) + "(column1 varchar(50), column2 varchar(50), column3 varchar(50))"));
- QVERIFY_SQL( q, exec("create table " + qTableName("emptytable") + "(id int)"));
+ QVERIFY_SQL( q, exec("create table " + qTableName("emptytable", __FILE__) + "(id int)"));
if (testWhiteSpaceNames(db.driverName())) {
QString qry = "create table " + qTableName("qtestw hitespace", db.driver()) + " ("+ db.driver()->escapeIdentifier("a field", QSqlDriver::FieldName) + " int)";
@@ -194,18 +198,18 @@ void tst_QSqlTableModel::repopulateTestTables()
QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i));
QSqlQuery q(db);
- q.exec("delete from " + qTableName("test"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(1, 'harry', 1)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(2, 'trond', 2)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(3, 'vohi', 3)"));
+ q.exec("delete from " + test);
+ QVERIFY_SQL( q, exec("insert into " + test + " values(1, 'harry', 1)"));
+ QVERIFY_SQL( q, exec("insert into " + test + " values(2, 'trond', 2)"));
+ QVERIFY_SQL( q, exec("insert into " + test + " values(3, 'vohi', 3)"));
- q.exec("delete from " + qTableName("test2"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test2") + " values(1, 'herr')"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test2") + " values(2, 'mister')"));
+ q.exec("delete from " + test2);
+ QVERIFY_SQL( q, exec("insert into " + test2 + " values(1, 'herr')"));
+ QVERIFY_SQL( q, exec("insert into " + test2 + " values(2, 'mister')"));
- q.exec("delete from " + qTableName("test3"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test3") + " values(1, 'foo', 'bar')"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test3") + " values(2, 'baz', 'joe')"));
+ q.exec("delete from " + test3);
+ QVERIFY_SQL( q, exec("insert into " + test3 + " values(1, 'foo', 'bar')"));
+ QVERIFY_SQL( q, exec("insert into " + test3 + " values(2, 'baz', 'joe')"));
}
}
@@ -253,7 +257,7 @@ void tst_QSqlTableModel::select()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -294,7 +298,7 @@ void tst_QSqlTableModel::setRecord()
QSqlTableModel model(0, db);
model.setEditStrategy((QSqlTableModel::EditStrategy)submitpolicy);
- model.setTable(qTableName("test3"));
+ model.setTable(test3);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -336,7 +340,7 @@ void tst_QSqlTableModel::insertRow()
QSqlTableModel model(0, db);
model.setEditStrategy(QSqlTableModel::OnRowChange);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -361,7 +365,7 @@ void tst_QSqlTableModel::insertRecord()
QSqlTableModel model(0, db);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -394,7 +398,7 @@ void tst_QSqlTableModel::insertMultiRecords()
QSqlTableModel model(0, db);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -421,7 +425,7 @@ void tst_QSqlTableModel::insertMultiRecords()
QVERIFY(model.submitAll());
model.clear();
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
QVERIFY_SQL(model, select());
@@ -442,7 +446,7 @@ void tst_QSqlTableModel::submitAll()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
@@ -477,7 +481,7 @@ void tst_QSqlTableModel::removeRow()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
@@ -502,7 +506,7 @@ void tst_QSqlTableModel::removeRow()
recreateTestTables();
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setEditStrategy(QSqlTableModel::OnRowChange);
QVERIFY_SQL(model, select());
QCOMPARE(model.rowCount(), 3);
@@ -523,7 +527,7 @@ void tst_QSqlTableModel::removeRows()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
model.setEditStrategy(QSqlTableModel::OnFieldChange);
QVERIFY_SQL(model, select());
@@ -539,7 +543,7 @@ void tst_QSqlTableModel::removeRows()
model.clear();
recreateTestTables();
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
QCOMPARE(model.rowCount(), 3);
@@ -574,7 +578,7 @@ void tst_QSqlTableModel::removeInsertedRow()
for (int i = 0; i <= 1; ++i) {
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setSort(0, Qt::AscendingOrder);
model.setEditStrategy(i == 0
@@ -607,7 +611,7 @@ void tst_QSqlTableModel::emptyTable()
QCOMPARE(model.rowCount(), 0);
QCOMPARE(model.columnCount(), 0);
- model.setTable(qTableName("emptytable"));
+ model.setTable(qTableName("emptytable", __FILE__));
QCOMPARE(model.rowCount(), 0);
QCOMPARE(model.columnCount(), 1);
@@ -623,9 +627,9 @@ void tst_QSqlTableModel::tablesAndSchemas()
CHECK_DATABASE(db);
QSqlQuery q(db);
- q.exec("DROP SCHEMA " + qTableName("testschema") + " CASCADE");
- QVERIFY_SQL( q, exec("create schema " + qTableName("testschema")));
- QString tableName = qTableName("testschema") + '.' + qTableName("testtable");
+ q.exec("DROP SCHEMA " + qTableName("testschema", __FILE__) + " CASCADE");
+ QVERIFY_SQL( q, exec("create schema " + qTableName("testschema", __FILE__)));
+ QString tableName = qTableName("testschema", __FILE__) + '.' + qTableName("testtable", __FILE__);
QVERIFY_SQL( q, exec("create table " + tableName + "(id int)"));
QVERIFY_SQL( q, exec("insert into " + tableName + " values(1)"));
QVERIFY_SQL( q, exec("insert into " + tableName + " values(2)"));
@@ -664,10 +668,10 @@ void tst_QSqlTableModel::primaryKeyOrder()
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
- QVERIFY_SQL( q, exec("create table "+qTableName("foo")+"(a varchar(20), id int not null primary key, b varchar(20))"));
+ QVERIFY_SQL( q, exec("create table "+qTableName("foo", __FILE__)+"(a varchar(20), id int not null primary key, b varchar(20))"));
QSqlTableModel model(0, db);
- model.setTable(qTableName("foo"));
+ model.setTable(qTableName("foo", __FILE__));
QSqlIndex pk = model.primaryKey();
QCOMPARE(pk.count(), 1);
@@ -693,7 +697,7 @@ void tst_QSqlTableModel::setInvalidFilter()
// set an invalid filter, make sure it fails
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setFilter("blahfahsel");
QCOMPARE(model.filter(), QString("blahfahsel"));
@@ -711,7 +715,7 @@ void tst_QSqlTableModel::setFilter()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setFilter("id = 1");
QCOMPARE(model.filter(), QString("id = 1"));
QVERIFY_SQL(model, select());
@@ -762,12 +766,13 @@ void tst_QSqlTableModel::sqlite_bigTable()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString bigtable(qTableName("bigtable", __FILE__));
bool hasTransactions = db.driver()->hasFeature(QSqlDriver::Transactions);
if (hasTransactions) QVERIFY(db.transaction());
QSqlQuery q(db);
- QVERIFY_SQL( q, exec("create table "+qTableName("bigtable")+"(id int primary key, name varchar)"));
- QVERIFY_SQL( q, prepare("insert into "+qTableName("bigtable")+"(id, name) values (?, ?)"));
+ QVERIFY_SQL( q, exec("create table "+bigtable+"(id int primary key, name varchar)"));
+ QVERIFY_SQL( q, prepare("insert into "+bigtable+"(id, name) values (?, ?)"));
QTime startTime;
startTime.start();
for (int i = 0; i < 10000; ++i) {
@@ -781,7 +786,7 @@ void tst_QSqlTableModel::sqlite_bigTable()
if (hasTransactions) QVERIFY(db.commit());
QSqlTableModel model(0, db);
- model.setTable(qTableName("bigtable"));
+ model.setTable(bigtable);
QVERIFY_SQL(model, select());
QSqlRecord rec = model.record();
@@ -801,7 +806,7 @@ void tst_QSqlTableModel::insertRecordBeforeSelect()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
QCOMPARE(model.lastError().type(), QSqlError::NoError);
QSqlRecord buffer = model.record();
@@ -820,7 +825,7 @@ void tst_QSqlTableModel::insertRecordBeforeSelect()
QCOMPARE(model.rowCount(), 0);
QSqlTableModel model2(0, db);
- model2.setTable(qTableName("test"));
+ model2.setTable(test);
QVERIFY_SQL(model2, select());
QCOMPARE(model2.rowCount(), rowCount);
}
@@ -838,7 +843,7 @@ void tst_QSqlTableModel::submitAllOnInvalidTable()
// setTable returns a void, so the error can only be caught by
// manually checking lastError(). ### Qt5: This should be changed!
- model.setTable(qTableName("invalidTable"));
+ model.setTable(qTableName("invalidTable", __FILE__));
QCOMPARE(model.lastError().type(), QSqlError::StatementError);
// This will give us an empty record which is expected behavior
@@ -866,7 +871,7 @@ void tst_QSqlTableModel::insertRecordsInLoop()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
model.select();
@@ -952,7 +957,7 @@ void tst_QSqlTableModel::tableModifyWithBlank()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test4"));
+ model.setTable(qTableName("test4", __FILE__));
model.select();
//generate a time stamp for the test. Add one second to the current time to make sure
@@ -1008,7 +1013,7 @@ void tst_QSqlTableModel::removeColumnAndRow()
CHECK_DATABASE(db);
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
QCOMPARE(model.rowCount(), 3);
@@ -1023,7 +1028,7 @@ void tst_QSqlTableModel::removeColumnAndRow()
// check with another table because the model has been modified
// but not the sql table
QSqlTableModel model2(0, db);
- model2.setTable(qTableName("test"));
+ model2.setTable(test);
QVERIFY_SQL(model2, select());
QCOMPARE(model2.rowCount(), 2);
QCOMPARE(model2.columnCount(), 3);
@@ -1036,11 +1041,11 @@ void tst_QSqlTableModel::insertBeforeDelete()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(9, 'andrew', 9)"));
- QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(10, 'justin', 10)"));
+ QVERIFY_SQL( q, exec("insert into " + test + " values(9, 'andrew', 9)"));
+ QVERIFY_SQL( q, exec("insert into " + test + " values(10, 'justin', 10)"));
QSqlTableModel model(0, db);
- model.setTable(qTableName("test"));
+ model.setTable(test);
model.setEditStrategy(QSqlTableModel::OnManualSubmit);
QVERIFY_SQL(model, select());
diff --git a/tests/auto/qsqlthread/tst_qsqlthread.cpp b/tests/auto/qsqlthread/tst_qsqlthread.cpp
index 632586a28..791f804 100644
--- a/tests/auto/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/qsqlthread/tst_qsqlthread.cpp
@@ -53,6 +53,7 @@
#include <pthread.h>
#endif
+const QString qtest(qTableName("qtest", __FILE__));
// set this define if Oracle is built with threading support
//#define QOCI_THREADED
@@ -115,7 +116,7 @@ public:
QVERIFY_SQL(db, open());
int sum = 0;
- QSqlQuery q("select id from " + qTableName("test"), db);
+ QSqlQuery q("select id from " + qtest, db);
QVERIFY_SQL(q, isActive());
while (q.next())
sum += q.value(0).toInt();
@@ -150,7 +151,7 @@ public:
QSqlDatabase db = QSqlDatabase::cloneDatabase(sourceDb, dbName);
QVERIFY_SQL(db, open());
QSqlQuery q(db);
- QVERIFY_SQL(q, prepare("insert into " + qTableName("test") + " values (?, ?, ?)"));
+ QVERIFY_SQL(q, prepare("insert into " + qtest + " values (?, ?, ?)"));
int id = 10;
for (int i = 0; i < ProdConIterations; ++i) {
q.bindValue(0, ++id);
@@ -187,10 +188,10 @@ public:
QSqlDatabase db = QSqlDatabase::cloneDatabase(sourceDb, dbName);
QVERIFY_SQL(db, open());
QSqlQuery q1(db), q2(db);
- QVERIFY_SQL(q2, prepare("delete from " + qTableName("test") + " where id = :id"));
+ QVERIFY_SQL(q2, prepare("delete from " + qtest + " where id = :id"));
for (int i = 0; i < ProdConIterations; ++i) {
- QVERIFY_SQL(q1, exec("select max(id) from " + qTableName("test")));
+ QVERIFY_SQL(q1, exec("select max(id) from " + qtest));
q1.first();
q2.bindValue("id", q1.value(0));
q1.clear();
@@ -231,7 +232,7 @@ public:
// Executes a Query for reading, iterates over the first 4 results
QSqlQuery q(sourceDb);
for (int j = 0; j < ProdConIterations; ++j) {
- QVERIFY_SQL(q, exec("select id,name from " + qTableName("test") + " order by id"));
+ QVERIFY_SQL(q, exec("select id,name from " + qtest + " order by id"));
for (int i = 1; i < 4; ++i) {
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), i);
@@ -242,7 +243,7 @@ public:
// Executes a query for writing (appends a new row)
QSqlQuery q(sourceDb);
for (int j = 0; j < ProdConIterations; ++j) {
- QVERIFY_SQL(q, exec(QString("insert into " + qTableName("test")
+ QVERIFY_SQL(q, exec(QString("insert into " + qtest
+ " (id, name) values(%1, '%2')")
.arg(counter.fetchAndAddRelaxed(1)).arg("Robert")));
}
@@ -250,7 +251,7 @@ public:
case PreparedReading: {
// Prepares a query for reading and iterates over the results
QSqlQuery q(sourceDb);
- QVERIFY_SQL(q, prepare("select id, name from " + qTableName("test") + " where id = ?"));
+ QVERIFY_SQL(q, prepare("select id, name from " + qtest + " where id = ?"));
for (int j = 0; j < ProdConIterations; ++j) {
q.addBindValue(j % 3 + 1);
QVERIFY_SQL(q, exec());
@@ -260,7 +261,7 @@ public:
break; }
case PreparedWriting: {
QSqlQuery q(sourceDb);
- QVERIFY_SQL(q, prepare("insert into " + qTableName("test") + " (id, name) "
+ QVERIFY_SQL(q, prepare("insert into " + qtest + " (id, name) "
"values(?, ?)"));
for (int i = 0; i < ProdConIterations; ++i) {
q.addBindValue(counter.fetchAndAddRelaxed(1));
@@ -302,7 +303,7 @@ void tst_QSqlThread::dropTestTables()
QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i));
QSqlQuery q(db);
- tst_Databases::safeDropTables(db, QStringList() << qTableName("test") << qTableName("test2") << qTableName("emptytable"));
+ tst_Databases::safeDropTables(db, QStringList() << qtest << qTableName("qtest2", __FILE__) << qTableName("emptytable", __FILE__));
}
}
@@ -312,13 +313,13 @@ void tst_QSqlThread::createTestTables()
QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i));
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("create table " + qTableName("test")
+ QVERIFY_SQL(q, exec("create table " + qtest
+ "(id int NOT NULL primary key, name varchar(20), title int)"));
- QVERIFY_SQL(q, exec("create table " + qTableName("test2")
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest2", __FILE__)
+ "(id int NOT NULL primary key, title varchar(20))"));
- QVERIFY_SQL(q, exec("create table " + qTableName("emptytable")
+ QVERIFY_SQL(q, exec("create table " + qTableName("emptytable", __FILE__)
+ "(id int NOT NULL primary key)"));
}
}
@@ -329,14 +330,14 @@ void tst_QSqlThread::repopulateTestTables()
QSqlDatabase db = QSqlDatabase::database(dbs.dbNames.at(i));
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("delete from " + qTableName("test")));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test") + " values(1, 'harry', 1)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test") + " values(2, 'trond', 2)"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test") + " values(3, 'vohi', 3)"));
+ QVERIFY_SQL(q, exec("delete from " + qtest));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " values(1, 'harry', 1)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " values(2, 'trond', 2)"));
+ QVERIFY_SQL(q, exec("insert into " + qtest + " values(3, 'vohi', 3)"));
- QVERIFY_SQL(q, exec("delete from " + qTableName("test2")));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test2") + " values(1, 'herr')"));
- QVERIFY_SQL(q, exec("insert into " + qTableName("test2") + " values(2, 'mister')"));
+ QVERIFY_SQL(q, exec("delete from " + qTableName("qtest2", __FILE__)));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("qtest2", __FILE__) + " values(1, 'herr')"));
+ QVERIFY_SQL(q, exec("insert into " + qTableName("qtest2", __FILE__) + " values(2, 'mister')"));
}
}
diff --git a/tests/auto/qsslkey/rsa-with-passphrase.pem b/tests/auto/qsslkey/rsa-with-passphrase.pem
new file mode 100644
index 0000000..cb29bec
--- /dev/null
+++ b/tests/auto/qsslkey/rsa-with-passphrase.pem
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-CBC,36BD1242254C5E1E
+
+sqt8qlQfkjJiz0djd0WYjhN/IGxA/nU/wVKuf5RWDAghDBrABzJ3dU4Jh1WIsS4+
+f22TBr6fwgjpPxGkt361Z9oxon/QeyBZLFtyUxnFSqZcVMMR3vndtMyYJbVKjRm1
+lvF3BjFWNh6+SZe20cut2GiUJDqhw7RbjaAN6LaCpFqwusY6vbjW6vzB8ezDvLou
+5jQAkwArGoI0KqUMwBOYukiWdBA0iERavspKGRnB3mGtgv5ziTEFzx58mn1Lv3Qs
+LYQqTYgzpFyAMP9SZaRv4m/y5O9foAXnlh0GhmDWBQ2D5flwZqrIAzoJ5BcZKU6/
+HJCh4snw3kheeE8NhrlzypEONedvu4ifUbqN5idMU7S4t40NAmQ/dF0Z4wDen/M/
+iFbt5tTWh6sXK82XzJtAfprH07odtJHK7CMeurCi5BupmnLtPbUrl6hpKItBzu+g
+7MB5AyNk548V9Y8+kKBtEG5EgYZrMYX4yqQ+Z8F1hy0UUMXu9cAnO06OTavxLtWJ
+ikmwYJNy421Hj+oZVSagCUILQyUfgx6fXWwDRqy/stlX+hpPPjVmd/A2WBm5x/Sf
+5CGfUtddZRuAZpChBXV6a/R+nMzDXhkKl4XTkN8hg3yXLY6xy3CR3RIYDlKkn85y
+VziP32V6Bc8ucGifsZLNnvj8CFXTZP+8CWun9yLSkcq+wm4cQOLswztEMA8bbPJQ
+g7Gp59BC4ofN5bMZ1R1z+l96x+YMY9btkyjE1uEyRT88dHwxnkhC5AKBx2P6sg0C
+doe5Dh8Ny5Ic24ibwyvZbAS46tSVdha7ACGnGXV4Z3iqBfN0b0UNmw==
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/qsslkey/rsa-without-passphrase.pem b/tests/auto/qsslkey/rsa-without-passphrase.pem
new file mode 100644
index 0000000..f7c834b
--- /dev/null
+++ b/tests/auto/qsslkey/rsa-without-passphrase.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQC1mZlLC6g8/vaw8XEOQ59gwQ5WxIvcKCSx7B5SHaeN8zzbENpl
+32BtyfrCccHF7j6qwfMZ2RwM5RTlFw/eBF4SSXAgp/P5CgcugSs1dOJUfPveos/5
+h3fmnUcKeQIU4m5EGcQicmR8//WUUfdtHDp/fJ0dRXcY2tTOx89vNPEtgwIDAQAB
+AoGBAKqE2f4vqf/sYPPxInmEYclWPgKXd8R4JUy0LBxrIAQYXBJPluOFhmRQ/hdK
+/eq/NTTd/UlOJhqtmJsstoeAjlsELl2AejX2n1B9aSffQ0WzdB5gVMNotPGRKRIG
+eOq2pp2JOFkGps11LUAqDEMNUb3EV6HiBucoGEOUpdITLrRxAkEA4Ul3o44wMvIb
+muwp7/erSvDMWRZ1GjksEmBMAHL6y8avZd9UgrjHeCy8uHXrT0id4Cig8FA+nQA5
+UwTr9y5e9wJBAM5bc8xuAuCg4Si3exssFfxQIxFTmPzhkVubglO9IcLqfXLl3k5S
+CxgRb/4pBMKVRCMRXAkaZpjJqTIofjp4ptUCQQC4hySnot932zchPi9bjtGPII1A
+q1RfllSy+I1IEOW745HnL3ZZXGCF3p71uCB1YFVwNdcc/51Jm9VYWr+sRx8hAkBL
+KoTDsk7aA8AAVNVC0Iwxm/8qEIlpk8Ce3cZbOklR9pg7gf+4B6qC2dcxfT9+oWBw
+ZaJgrn0wqkQ3QQi5w7kBAkBAR2tKc2OqnljMPnXYEreRyHHjhqCsJYFAE7u16cY/
+NQGJq9jBAD5WANclrYRxKtD6yohi+Y7Vi7+SXve3pGdF
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/qsslkey/tst_qsslkey.cpp b/tests/auto/qsslkey/tst_qsslkey.cpp
index d156344..3c8ae11 100644
--- a/tests/auto/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/qsslkey/tst_qsslkey.cpp
@@ -99,6 +99,7 @@ private slots:
void toEncryptedPemOrDer_data();
void toEncryptedPemOrDer();
+ void passphraseChecks();
#endif
};
@@ -371,6 +372,77 @@ void tst_QSslKey::toEncryptedPemOrDer()
// ### add a test to verify that public keys are _decrypted_ correctly (by the ctor)
}
+void tst_QSslKey::passphraseChecks()
+{
+ {
+ QString fileName(SRCDIR "/rsa-with-passphrase.pem");
+ QFile keyFile(fileName);
+ QVERIFY(keyFile.exists());
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(key.isNull()); // null passphrase => should not be able to decode key
+ }
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "");
+ QVERIFY(key.isNull()); // empty passphrase => should not be able to decode key
+ }
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "WRONG!");
+ QVERIFY(key.isNull()); // wrong passphrase => should not be able to decode key
+ }
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "123");
+ QVERIFY(!key.isNull()); // correct passphrase
+ }
+ }
+
+ {
+ // be sure and check a key without passphrase too
+ QString fileName(SRCDIR "/rsa-without-passphrase.pem");
+ QFile keyFile(fileName);
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull()); // null passphrase => should be able to decode key
+ }
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "");
+ QVERIFY(!key.isNull()); // empty passphrase => should be able to decode key
+ }
+ {
+ if (!keyFile.isOpen())
+ keyFile.open(QIODevice::ReadOnly);
+ else
+ keyFile.reset();
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "xxx");
+ QVERIFY(!key.isNull()); // passphrase given but key is not encrypted anyway => should work
+ }
+ }
+}
+
#endif
QTEST_MAIN(tst_QSslKey)
diff --git a/tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg b/tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg
index 99926b3..f1f9e35 100644
--- a/tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg
+++ b/tests/auto/qsvggenerator/referenceSvgs/fileName_output.svg
@@ -4,12 +4,12 @@
<desc>Generated with Qt</desc>
<defs>
</defs>
-<g fill="none" stroke="black" vector-effect="non-scaling-stroke" stroke-width="1" fill-rule="evenodd" stroke-linecap="square" stroke-linejoin="bevel" >
+<g fill="none" stroke="black" stroke-width="1" fill-rule="evenodd" stroke-linecap="square" stroke-linejoin="bevel" >
<g fill="#ff0000" fill-opacity="1" stroke="none" transform="matrix(1,0,0,1,0,0)"
-font-family="Arial" font-size="11pt" font-weight="400" font-style="normal"
+font-family="Sans Serif" font-size="8.25" font-weight="400" font-style="normal"
>
-<path fill-rule="evenodd" d="M0,0 L100,0 L100,100 L0,100 L0,0"/>
+<path vector-effect="non-scaling-stroke" fill-rule="evenodd" d="M0,0 L100,0 L100,100 L0,100 L0,0"/>
</g>
</g>
</svg>
diff --git a/tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg b/tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg
index f61dd40..84afbf3 100644
--- a/tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg
+++ b/tests/auto/qsvggenerator/referenceSvgs/radial_gradient.svg
@@ -13,18 +13,18 @@
<stop offset="1" stop-color="#0000ff" stop-opacity="1" />
</radialGradient>
</defs>
-<g fill="none" stroke="black" vector-effect="non-scaling-stroke" stroke-width="1" fill-rule="evenodd" stroke-linecap="square" stroke-linejoin="bevel" >
+<g fill="none" stroke="black" stroke-width="1" fill-rule="evenodd" stroke-linecap="square" stroke-linejoin="bevel" >
<g fill="url(#gradient1)" stroke="none" transform="matrix(1,0,0,1,0,0)"
-font-family="Sans Serif" font-size="9pt" font-weight="400" font-style="normal"
+font-family="Sans Serif" font-size="8.25" font-weight="400" font-style="normal"
>
-<path fill-rule="evenodd" d="M0,0 L100,0 L100,100 L0,100 L0,0"/>
+<path vector-effect="non-scaling-stroke" fill-rule="evenodd" d="M0,0 L100,0 L100,100 L0,100 L0,0"/>
</g>
<g fill="url(#gradient2)" stroke="none" transform="matrix(1,0,0,1,0,0)"
-font-family="Sans Serif" font-size="9pt" font-weight="400" font-style="normal"
+font-family="Sans Serif" font-size="8.25" font-weight="400" font-style="normal"
>
-<path fill-rule="evenodd" d="M100,0 L200,0 L200,100 L100,100 L100,0"/>
+<path vector-effect="non-scaling-stroke" fill-rule="evenodd" d="M100,0 L200,0 L200,100 L100,100 L100,0"/>
</g>
</g>
</svg>
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 16dd2b4..106fd8c 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -74,6 +74,7 @@ private slots:
void nestedQXmlStreamReader() const;
void stylePropagation() const;
void matrixForElement() const;
+ void boundsOnElement() const;
void gradientStops() const;
void gradientRefs();
void fillRule();
@@ -470,6 +471,36 @@ void tst_QSvgRenderer::matrixForElement() const
compareTransforms(QTransform(painter.worldMatrix()), QTransform(renderer.matrixForElement(QLatin1String("firkant"))));
}
+void tst_QSvgRenderer::boundsOnElement() const
+{
+ QByteArray data("<svg>"
+ "<g id=\"prim\" transform=\"translate(-3,1)\">"
+ "<g id=\"sjokade\" stroke=\"none\" stroke-width=\"10\">"
+ "<rect id=\"kaviar\" transform=\"rotate(45)\" x=\"-10\" y=\"-10\" width=\"20\" height=\"20\"/>"
+ "</g>"
+ "<g id=\"nugatti\" stroke=\"black\" stroke-width=\"2\">"
+ "<use x=\"0\" y=\"0\" transform=\"rotate(45)\" xlink:href=\"#kaviar\"/>"
+ "</g>"
+ "<g id=\"nutella\" stroke=\"none\" stroke-width=\"10\">"
+ "<path id=\"baconost\" transform=\"rotate(45)\" d=\"M-10 -10 L10 -10 L10 10 L-10 10 Z\"/>"
+ "</g>"
+ "<g id=\"hapaa\" transform=\"translate(-2,2)\" stroke=\"black\" stroke-width=\"2\">"
+ "<use x=\"0\" y=\"0\" transform=\"rotate(45)\" xlink:href=\"#baconost\"/>"
+ "</g>"
+ "</g>"
+ "</svg>");
+
+ qreal sqrt2 = qSqrt(2);
+ QSvgRenderer renderer(data);
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("sjokade")), QRectF(-10 * sqrt2, -10 * sqrt2, 20 * sqrt2, 20 * sqrt2));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("kaviar")), QRectF(-10 * sqrt2, -10 * sqrt2, 20 * sqrt2, 20 * sqrt2));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("nugatti")), QRectF(-11, -11, 22, 22));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("nutella")), QRectF(-10 * sqrt2, -10 * sqrt2, 20 * sqrt2, 20 * sqrt2));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("baconost")), QRectF(-10 * sqrt2, -10 * sqrt2, 20 * sqrt2, 20 * sqrt2));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("hapaa")), QRectF(-13, -9, 22, 22));
+ QCOMPARE(renderer.boundsOnElement(QLatin1String("prim")), QRectF(-10 * sqrt2 - 3, -10 * sqrt2 + 1, 20 * sqrt2, 20 * sqrt2));
+}
+
void tst_QSvgRenderer::gradientStops() const
{
{
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 35fba52..54e32218 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -201,6 +201,7 @@ private slots:
void taskQTBUG_5237_wheelEventOnHeader();
void taskQTBUG_8585_crashForNoGoodReason();
void taskQTBUG_7774_RtoLVisualRegionForSelection();
+ void taskQTBUG_8777_scrollToSpans();
void mouseWheel_data();
void mouseWheel();
@@ -3994,7 +3995,6 @@ void tst_QTableView::taskQTBUG_8585_crashForNoGoodReason()
}
}
-
class TableView7774 : public QTableView
{
public:
@@ -4020,5 +4020,19 @@ void tst_QTableView::taskQTBUG_7774_RtoLVisualRegionForSelection()
QCOMPARE(region.rects().at(0), view.visualRect(range.topLeft()) | view.visualRect(range.bottomRight()));
}
+void tst_QTableView::taskQTBUG_8777_scrollToSpans()
+{
+ QTableWidget table(75,5);
+ for (int i=0; i<50; i++)
+ table.setSpan(2+i, 0, 1, 5);
+ table.setCurrentCell(0,2);
+ table.show();
+
+ for (int i = 0; i < 45; ++i)
+ QTest::keyClick(&table, Qt::Key_Down);
+
+ QVERIFY(table.verticalScrollBar()->value() > 10);
+}
+
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"
diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro
index afd7f5e..efa2e85 100644
--- a/tests/auto/qtextcodec/test/test.pro
+++ b/tests/auto/qtextcodec/test/test.pro
@@ -27,6 +27,7 @@ wince*: {
DEFINES += SRCDIR=\\\"\\\"
}else:symbian {
# Symbian can't define SRCDIR meaningfully here
+ LIBS += -lcharconv -lconvnames -lgb2312_shared -ljisx0201 -ljisx0208 -lefsrv
} else {
DEFINES += SRCDIR=\\\"$$PWD/../\\\"
}
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index aa97e87..1c64ade 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -99,6 +99,13 @@ private slots:
#ifdef Q_OS_UNIX
void toLocal8Bit();
#endif
+
+ void invalidNames();
+ void checkAliases_data();
+ void checkAliases();
+
+ void moreToFromUnicode_data();
+ void moreToFromUnicode();
};
void tst_QTextCodec::toUnicode_data()
@@ -119,6 +126,7 @@ void tst_QTextCodec::toUnicode()
if ( file.open( QIODevice::ReadOnly ) ) {
QByteArray ba = file.readAll();
+ QVERIFY(!ba.isEmpty());
QTextCodec *c = QTextCodec::codecForName( codecName.toLatin1() );
QVERIFY(c != 0);
QString uniString = c->toUnicode( ba );
@@ -126,6 +134,7 @@ void tst_QTextCodec::toUnicode()
QCOMPARE(uniString, QString::fromUtf8(ba));
QCOMPARE(ba, uniString.toUtf8());
}
+ QVERIFY(!uniString.isEmpty());
QCOMPARE( ba, c->fromUnicode( uniString ) );
if (codecName == QLatin1String("eucKR")) {
@@ -185,7 +194,9 @@ void tst_QTextCodec::fromUnicode_data()
QTest::newRow("data16") << "ISO-8859-16" << true;
QTest::newRow("data18") << "IBM850" << true;
+#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid
QTest::newRow("data19") << "IBM874" << true;
+#endif
QTest::newRow("data20") << "IBM866" << true;
QTest::newRow("data21") << "windows-1250" << true;
@@ -193,7 +204,9 @@ void tst_QTextCodec::fromUnicode_data()
QTest::newRow("data23") << "windows-1252" << true;
QTest::newRow("data24") << "windows-1253" << true;
QTest::newRow("data25") << "windows-1254" << true;
+#ifndef Q_OS_SYMBIAN //symbian implementation will return empty string if all char are invalid
QTest::newRow("data26") << "windows-1255" << true;
+#endif
QTest::newRow("data27") << "windows-1256" << true;
QTest::newRow("data28") << "windows-1257" << true;
QTest::newRow("data28") << "windows-1258" << true;
@@ -205,6 +218,39 @@ void tst_QTextCodec::fromUnicode_data()
QTest::newRow("data32") << "SJIS" << false;
QTest::newRow("data33") << "EUC-KR" << false;
+
+ // all codecs from documentation
+ QTest::newRow("doc2") << "Big5" << false;
+ QTest::newRow("doc3") << "Big5-HKSCS" << false;
+ QTest::newRow("doc4") << "CP949" << false;
+ QTest::newRow("doc5") << "EUC-JP" << false;
+ QTest::newRow("doc6") << "EUC-KR" << false;
+ //QTest::newRow("doc7") << "GB18030-0" << false; // only GB18030 works
+ QTest::newRow("doc7-bis") << "GB18030" << false;
+ QTest::newRow("doc8") << "IBM 850" << false;
+ QTest::newRow("doc9") << "IBM 866" << false;
+ QTest::newRow("doc10") << "IBM 874" << false;
+ QTest::newRow("doc11") << "ISO 2022-JP" << false;
+ //ISO 8859-1 to 10 and ISO 8859-13 to 16 tested previously
+ // Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml tested in Iscii test
+ //QTest::newRow("doc12") << "JIS X 0201" << false; //actually not there
+ //QTest::newRow("doc13") << "JIS X 0208" << false; // actually not there
+ QTest::newRow("doc14") << "KOI8-R" << false;
+ QTest::newRow("doc15") << "KOI8-U" << false;
+ //QTest::newRow("doc16") << "MuleLao-1" << false; //only on x11
+ QTest::newRow("doc17") << "ROMAN8" << false;
+ QTest::newRow("doc18") << "Shift-JIS" << false;
+ QTest::newRow("doc19") << "TIS-620" << false;
+ QTest::newRow("doc20") << "TSCII" << false;
+ QTest::newRow("doc21") << "UTF-8" << false;
+ QTest::newRow("doc22") << "UTF-16" << false;
+ QTest::newRow("doc23") << "UTF-16BE" << false;
+ QTest::newRow("doc24") << "UTF-16LE" << false;
+ QTest::newRow("doc25") << "UTF-32" << false;
+ QTest::newRow("doc26") << "UTF-32BE" << false;
+ QTest::newRow("doc27") << "UTF-32LE" << false;
+ //Windows-1250 to 1258 tested previously
+ QTest::newRow("doc3") << "WINSAMI2" << false;
}
void tst_QTextCodec::fromUnicode()
@@ -222,6 +268,7 @@ void tst_QTextCodec::fromUnicode()
chars[i] = i + 128;
QString s = codec->toUnicode(chars, 128);
QByteArray c = codec->fromUnicode(s);
+ QCOMPARE(c.size(), 128);
int numberOfQuestionMarks = 0;
for (int i = 0; i < 128; ++i) {
@@ -360,7 +407,7 @@ void tst_QTextCodec::asciiToIscii() const
/* For each codec. */
const QTextCodec *const textCodec = QTextCodec::codecForName(isciiCodecs[i]);
- Q_ASSERT(textCodec);
+ QVERIFY(textCodec);
for(int i2 = 0; i2 < len; ++i2) {
/* For each character in ascii. */
@@ -384,9 +431,12 @@ void tst_QTextCodec::flagCodepointFFFF() const
Q_ASSERT(codec);
const QByteArray asDecoded(codec->fromUnicode(input));
+ QCOMPARE(asDecoded, QByteArray("?"));
+
+ QByteArray ffff("\357\277\277");
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull);
- QVERIFY(codec->toUnicode(asDecoded.constData(), asDecoded.length(), &state) == QChar(0));
- QVERIFY(codec->toUnicode(asDecoded) == QChar(0xfffd));
+ QVERIFY(codec->toUnicode(ffff.constData(), ffff.length(), &state) == QChar(0));
+ QVERIFY(codec->toUnicode(ffff) == QChar(0xfffd));
}
void tst_QTextCodec::flagF7808080() const
@@ -447,12 +497,11 @@ void tst_QTextCodec::flagEFBFBF() const
/* When 0xEFBFBF is preceeded by what seems to be an arbitrary character,
* QTextCodec fails to flag it. */
{
- QEXPECT_FAIL("", "This is a bug and needs to be fixed.", Continue);
QByteArray start("B");
start.append(invalidInput);
QTextCodec::ConverterState state(QTextCodec::ConvertInvalidToNull);
- QVERIFY(codec->toUnicode(start.constData(), start.length(), &state) == QChar(0));
+ QVERIFY(codec->toUnicode(start.constData(), start.length(), &state) == QString::fromLatin1("B\0", 2));
}
}
@@ -478,7 +527,9 @@ void tst_QTextCodec::aliasForUTF16() const
void tst_QTextCodec::mibForTSCII() const
{
- QCOMPARE(QTextCodec::codecForName("TSCII")->mibEnum(), 2107);
+ QTextCodec *codec = QTextCodec::codecForName("TSCII");
+ QVERIFY(codec);
+ QCOMPARE(codec->mibEnum(), 2107);
}
static QString fromInvalidUtf8Sequence(const QByteArray &ba)
@@ -695,15 +746,15 @@ void tst_QTextCodec::utf8Codec_data()
str = QChar(QChar::ReplacementCharacter);
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.3") << utf8 << str << -1;
- // 2.3.4 U+0010FFFF
+ // 2.3.4 U+0010FFFD
utf8.clear();
utf8 += char(0xf4);
utf8 += char(0x8f);
utf8 += char(0xbf);
- utf8 += char(0xbf);
+ utf8 += char(0xbd);
str.clear();
str += QChar(0xdbff);
- str += QChar(0xdfff);
+ str += QChar(0xdffd);
QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 2.3.4") << utf8 << str << -1;
// 2.3.5 U+00110000
@@ -1938,17 +1989,210 @@ static int loadAndConvertMIB(int mib)
void tst_QTextCodec::threadSafety()
{
+ QList<QByteArray> codecList = QTextCodec::availableCodecs();
+ QList<int> mibList = QTextCodec::availableMibs();
+#ifndef QT_NO_CONCURRENT
QThreadPool::globalInstance()->setMaxThreadCount(12);
- QList<QByteArray> codecList = QTextCodec::availableCodecs();
QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert);
- QList<int> mibList = QTextCodec::availableMibs();
+
QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB);
QCOMPARE(res.results(), codecList);
QCOMPARE(res2.results(), mibList);
+#endif
+}
+
+void tst_QTextCodec::invalidNames()
+{
+ QVERIFY(!QTextCodec::codecForName(""));
+ QVERIFY(!QTextCodec::codecForName(QByteArray()));
+ QVERIFY(!QTextCodec::codecForName("-"));
+ QVERIFY(!QTextCodec::codecForName("\1a\2b\3a\4d\5c\6s\7a\xffr\xec_\x9c_"));
+ QVERIFY(!QTextCodec::codecForName("\n"));
+ QVERIFY(!QTextCodec::codecForName("don't exist"));
+ QByteArray huge = "azertyuiop^$qsdfghjklm<wxcvbn,;:=1234567890°_";
+ huge = huge + huge + huge + huge + huge + huge + huge + huge;
+ huge = huge + huge + huge + huge + huge + huge + huge + huge;
+ huge = huge + huge + huge + huge + huge + huge + huge + huge;
+ huge = huge + huge + huge + huge + huge + huge + huge + huge;
+ QVERIFY(!QTextCodec::codecForName(huge));
+}
+
+void tst_QTextCodec::checkAliases_data()
+{
+ QTest::addColumn<QByteArray>("codecName");
+ QList<QByteArray> codecList = QTextCodec::availableCodecs();
+ foreach (const QByteArray &a, codecList) {
+ QTest::newRow( a.constData() ) << a;
+ }
+}
+
+void tst_QTextCodec::checkAliases()
+{
+ QFETCH( QByteArray, codecName );
+ QTextCodec *c = QTextCodec::codecForName(codecName);
+ QVERIFY(c);
+ QCOMPARE(QTextCodec::codecForName(codecName), c);
+ QCOMPARE(QTextCodec::codecForName(c->name()), c);
+
+ foreach(const QByteArray &a, c->aliases()) {
+ QCOMPARE(QTextCodec::codecForName(a), c);
+ }
+}
+
+
+void tst_QTextCodec::moreToFromUnicode_data() {
+ QTest::addColumn<QByteArray>("codecName");
+ QTest::addColumn<QByteArray>("testData");
+
+ QTest::newRow("russian") << QByteArray("ISO-8859-5")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\x00");
+
+ QTest::newRow("arabic") << QByteArray("ISO-8859-6")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA4\xAC\xAD\xBB\xBF\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2");
+
+ QTest::newRow("greek") << QByteArray("ISO-8859-7")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE");
+
+ QTest::newRow("turkish") << QByteArray("ISO-8859-9")
+ << QByteArray("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+#ifdef Q_OS_SYMBIAN
+ QTest::newRow("thai") << QByteArray("TIS-620")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB");
+#endif
+
+ QTest::newRow("latin1") << QByteArray("ISO-8859-1")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QByteArray sms7bit_ba;
+ for (int i=1; i <= 0x7f; ++i) {
+ if (i!='\x1b') {
+ sms7bit_ba.append(i);
+ }
+ }
+#ifdef Q_OS_SYMBIAN
+ QTest::newRow("sms7bit") << QByteArray("SMS 7-bit") << sms7bit_ba;
+#endif
+
+ QTest::newRow("latin2") << QByteArray("ISO-8859-2")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("latin3") << QByteArray("ISO-8859-3")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBF\xC0\xC1\xC2\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("latin4") << QByteArray("ISO-8859-4")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("russian 2") << QByteArray("ISO-8859-5")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("arabic 2") << QByteArray("ISO-8859-6")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA4\xAC\xAD\xBB\xBF\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2");
+
+ QTest::newRow("greek 2") << QByteArray("ISO-8859-7")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE");
+
+#ifdef Q_OS_SYMBIAN
+ QTest::newRow("hebriew") << QByteArray("ISO-8859-8")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFD\xFE");
+#endif
+
+ QTest::newRow("latin5") << QByteArray("ISO-8859-9")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("latin6") << QByteArray("ISO-8859-10")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+#if 0
+ QByteArray iso8859_11_ba;
+ for (int x=0x20; x<=0x7f; ++x) {
+ iso8859_11_ba.append(x);
+ }
+ for (int x=0xa0; x<0xff; ++x) {
+ if ((x>=0xdb && x<0xdf) || x>0xfb){
+ continue;
+ }
+ iso8859_11_ba.append(x);
+ }
+ QTest::newRow("latin-thai") << QByteArray("ISO-8859-11") << iso8859_11_ba;
+#endif
+
+ QTest::newRow("latin7") << QByteArray("ISO-8859-13")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("celtic") << QByteArray("ISO-8859-14")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("latin9") << QByteArray("ISO-8859-15")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("latin10") << QByteArray("ISO-8859-16")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp850") << QByteArray("CP850")
+ << QByteArray("\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff");
+
+ QTest::newRow("cp874") << QByteArray("CP874")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x85\x91\x92\x93\x94\x95\x96\x97\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB");
+
+ QTest::newRow("cp1250") << QByteArray("CP1250")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x84\x85\x86\x87\x89\x8A\x8B\x8C\x8D\x8E\x8F\x91\x92\x93\x94\x95\x96\x97\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1251") << QByteArray("CP1251")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1252") << QByteArray("CP1252")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8E\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1253") << QByteArray("CP1253")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x89\x8B\x91\x92\x93\x94\x95\x96\x97\x99\x9B\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE");
+
+ QTest::newRow("cp1254") << QByteArray("CP1254")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1255") << QByteArray("CP1255")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89,x8B\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9B\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFD\xFE");
+
+ QTest::newRow("cp1256") << QByteArray("CP1256")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1257") << QByteArray("CP1257")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x84\x85\x86\x87\x89\x8B\x8D\x8E\x8F\x91\x92\x93\x94\x95\x96\x97\x99\x9B\x9D\x9E\xA0\xA2\xA3\xA4\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QTest::newRow("cp1258") << QByteArray("CP1258")
+ << QByteArray("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8B\x8C\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9B\x9C\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF");
+
+ QByteArray koi8_r_ba;
+ for (int x=0x20; x<=0xff; ++x) {
+ if (x!=0x9A && x!=0xbf) {
+ koi8_r_ba.append(x);
+ }
+ }
+ QTest::newRow("KOI8-R") << QByteArray("KOI8-R") << koi8_r_ba;
+
+ QByteArray koi8_u_ba;
+ for (int x=0x20; x<=0xff; ++x) {
+ koi8_u_ba.append(x);
+ }
+ QTest::newRow("KOI8-U") << QByteArray("KOI8-U") << koi8_u_ba;
}
+void tst_QTextCodec::moreToFromUnicode()
+{
+ QFETCH( QByteArray, codecName );
+ QFETCH( QByteArray, testData );
+
+ QTextCodec *c = QTextCodec::codecForName( codecName.data() );
+ QVERIFY(c);
+
+ QString uStr = c->toUnicode(testData);
+ QByteArray cStr = c->fromUnicode(uStr);
+ QCOMPARE(testData, cStr);
+}
+
+
QTEST_MAIN(tst_QTextCodec)
#include "tst_qtextcodec.moc"
diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp
index 9146be2..4c78ef0 100644
--- a/tests/auto/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/qtextstream/tst_qtextstream.cpp
@@ -221,6 +221,7 @@ private slots:
void nanInf();
void utf8IncompleteAtBufferBoundary_data();
void utf8IncompleteAtBufferBoundary();
+ void writeSeekWriteNoBOM();
// status
void status_real_read_data();
@@ -1847,6 +1848,63 @@ void tst_QTextStream::utf8IncompleteAtBufferBoundary()
}
// ------------------------------------------------------------------------------
+
+// Make sure we don't write a BOM after seek()ing
+
+void tst_QTextStream::writeSeekWriteNoBOM()
+{
+
+ //First with the default codec (normally either latin-1 or UTF-8)
+
+ QBuffer out;
+ out.open(QIODevice::WriteOnly);
+ QTextStream stream(&out);
+
+ int number = 0;
+ QString sizeStr = QLatin1String("Size=")
+ + QString::number(number).rightJustified(10, QLatin1Char('0'));
+ stream << sizeStr << endl;
+ stream << "Version=" << QString::number(14) << endl;
+ stream << "blah blah blah" << endl;
+ stream.flush();
+
+ QCOMPARE(out.buffer().constData(), "Size=0000000000\nVersion=14\nblah blah blah\n");
+
+ // Now overwrite the size header item
+ number = 42;
+ stream.seek(0);
+ sizeStr = QLatin1String("Size=")
+ + QString::number(number).rightJustified(10, QLatin1Char('0'));
+ stream << sizeStr << endl;
+ stream.flush();
+
+ // Check buffer is still OK
+ QCOMPARE(out.buffer().constData(), "Size=0000000042\nVersion=14\nblah blah blah\n");
+
+
+ //Then UTF-16
+
+ QBuffer out16;
+ out16.open(QIODevice::WriteOnly);
+ QTextStream stream16(&out16);
+ stream16.setCodec("UTF-16");
+
+ stream16 << "one" << "two" << QLatin1String("three");
+ stream16.flush();
+
+ // save that output
+ QByteArray first = out16.buffer();
+
+ stream16.seek(0);
+ stream16 << "one";
+ stream16.flush();
+
+ QCOMPARE(out16.buffer(), first);
+}
+
+
+
+// ------------------------------------------------------------------------------
void tst_QTextStream::generateOperatorCharData(bool for_QString)
{
QTest::addColumn<QByteArray>("input");
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index cc97e4e..a0408ef 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -85,6 +85,7 @@ private slots:
void timerFiresOnlyOncePerProcessEvents();
void timerIdPersistsAfterThreadExit();
void cancelLongTimer();
+ void singleShotStaticFunctionZeroTimeout();
};
class TimerHelper : public QObject
@@ -611,5 +612,16 @@ void tst_QTimer::cancelLongTimer()
QVERIFY(!timer.isActive());
}
+void tst_QTimer::singleShotStaticFunctionZeroTimeout()
+{
+ TimerHelper helper;
+
+ QTimer::singleShot(0, &helper, SLOT(timeout()));
+ QTest::qWait(500);
+ QCOMPARE(helper.count, 1);
+ QTest::qWait(500);
+ QCOMPARE(helper.count, 1);
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp
index 827a486..a3ded8e 100644
--- a/tests/auto/qtransform/tst_qtransform.cpp
+++ b/tests/auto/qtransform/tst_qtransform.cpp
@@ -610,6 +610,11 @@ void tst_QTransform::types()
m4.rotate(45);
QCOMPARE(m4.type(), QTransform::TxRotate);
+
+ QTransform m5;
+ m5.scale(5, 5);
+ m5 = m5.adjoint() / m5.determinant();
+ QCOMPARE(m5.type(), QTransform::TxScale);
}
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 83109b5..b7cbdb8 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -193,6 +193,7 @@ private slots:
void fromUserInput();
void task_199967();
void task_240612();
+ void taskQTBUG_6962();
#ifdef QT3_SUPPORT
void dirPath();
@@ -3860,5 +3861,13 @@ void tst_QUrl::resolvedWithAbsoluteSchemes_data() const
<< QUrl::fromEncoded("http://www.foo.com:8080/newfile.html");
}
+void tst_QUrl::taskQTBUG_6962()
+{
+ //bug 6962: empty authority ignored by setAuthority
+ QUrl url("http://example.com/something");
+ url.setAuthority(QString());
+ QCOMPARE(url.authority(), QString());
+}
+
QTEST_MAIN(tst_QUrl)
#include "tst_qurl.moc"
diff --git a/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
index 0fcde21..1c43069 100644
--- a/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <qvarlengtharray.h>
+#include <qvariant.h>
const int N = 1;
@@ -61,6 +62,7 @@ private slots:
void removeLast();
void oldTests();
void task214223();
+ void QTBUG6718_resize();
};
int fooCtor = 0;
@@ -71,7 +73,7 @@ struct Foo
int *p;
Foo() { p = new int; ++fooCtor; }
- Foo(const Foo &other) { p = new int; ++fooCtor; }
+ Foo(const Foo &/*other*/) { p = new int; ++fooCtor; }
void operator=(const Foo & /* other */) { }
@@ -244,9 +246,50 @@ void tst_QVarLengthArray::task214223()
// will make the next call to append(const T&) corrupt the memory
// you should get a segfault pretty soon after that :-)
QVarLengthArray<float, 1> d(1);
- for (int i=0; i<30; i++)
+ for (int i=0; i<30; i++)
d.append(i);
}
+void tst_QVarLengthArray::QTBUG6718_resize()
+{
+ //MOVABLE
+ {
+ QVarLengthArray<QVariant,1> values(1);
+ QCOMPARE(values.size(), 1);
+ values[0] = 1;
+ values.resize(2);
+ QCOMPARE(values[1], QVariant());
+ QCOMPARE(values[0], QVariant(1));
+ values[1] = 2;
+ QCOMPARE(values[1], QVariant(2));
+ QCOMPARE(values.size(), 2);
+ }
+
+ //POD
+ {
+ QVarLengthArray<int,1> values(1);
+ QCOMPARE(values.size(), 1);
+ values[0] = 1;
+ values.resize(2);
+ QCOMPARE(values[0], 1);
+ values[1] = 2;
+ QCOMPARE(values[1], 2);
+ QCOMPARE(values.size(), 2);
+ }
+
+ //COMPLEX
+ {
+ QVarLengthArray<QVarLengthArray<QString, 15>,1> values(1);
+ QCOMPARE(values.size(), 1);
+ values[0].resize(10);
+ values.resize(2);
+ QCOMPARE(values[1].size(), 0);
+ QCOMPARE(values[0].size(), 10);
+ values[1].resize(20);
+ QCOMPARE(values[1].size(), 20);
+ QCOMPARE(values.size(), 2);
+ }
+}
+
QTEST_APPLESS_MAIN(tst_QVarLengthArray)
#include "tst_qvarlengtharray.moc"
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index abd9604..76e20b9 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -402,6 +402,7 @@ private slots:
void scrollWithoutBackingStore();
void taskQTBUG_7532_tabOrderWithFocusProxy();
+ void movedAndResizedAttributes();
private:
bool ensureScreenSize(int width, int height);
@@ -10040,5 +10041,61 @@ void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy()
// No Q_ASSERT, then it's allright.
}
+void tst_QWidget::movedAndResizedAttributes()
+{
+#if defined (Q_OS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
+ QEXPECT_FAIL("", "FixMe, QTBUG-8941 and QTBUG-8977", Abort);
+ QVERIFY(false);
+#else
+ QWidget w;
+ w.show();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowFullScreen);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowMaximized);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowMinimized);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showNormal();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showMaximized();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showFullScreen();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showNormal();
+ w.move(10,10);
+ QVERIFY(w.testAttribute(Qt::WA_Moved));
+#if defined(Q_OS_WIN)
+ QEXPECT_FAIL("", "FixMe, QTBUG-8911", Abort);
+#endif
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.resize(100, 100);
+ QVERIFY(w.testAttribute(Qt::WA_Moved));
+ QVERIFY(w.testAttribute(Qt::WA_Resized));
+#endif
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"
diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P02/ibm02v01.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P02/ibm02v01.xml
index 60479f4..2363b97 100644
--- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P02/ibm02v01.xml
+++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P02/ibm02v01.xml
@@ -5,6 +5,6 @@
discrete legal characters for production 02. -->
<?NAME_09- _0A-
_0D-
-_20- _D7FF-퟿_6c0f-æ°_E000-_FFFD-�_effe-_010000-ð€€_10FFFF-ô¿¿_08ffff-ò¿¿ This is a PI target ?>
+_20- _D7FF-퟿_6c0f-æ°_E000-_FFFD-�_effd-_010000-ð€€_10FFFD-ô¿½_08fffd-ò¿½ This is a PI target ?>
]>
<book/>
diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/ibm66v01.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/ibm66v01.xml
index 7ac675e..d7f7722 100644
--- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/ibm66v01.xml
+++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/ibm66v01.xml
@@ -11,6 +11,6 @@ Test all valid Charater references for P66:
&#67; &#x43; &#x5f;
&#x20; &#xD7A3; &#xAC00;
&#xF900; &#xFFFD;
-&#x10000; &#x10FFFF;
+&#x10000; &#x10FFFD;
</root>
<!--* a valid test for P66 *-->
diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/out/ibm66v01.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/out/ibm66v01.xml
index 1b04b6d..ed05e61 100644
--- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/out/ibm66v01.xml
+++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/ibm/valid/P66/out/ibm66v01.xml
@@ -1 +1 @@
-<root>&#10;Test all valid Charater references for P66:&#10;&#9;&#9;&#9;&#10;&#10;&#10;&#10;&#10;&#10;&#13;&#10;« « à à ï ï&#10;C C _&#10; 힣 ê°€&#10;豈 �&#10;ð€€ ô¿¿&#10;</root> \ No newline at end of file
+<root>&#10;Test all valid Charater references for P66:&#10;&#9;&#9;&#9;&#10;&#10;&#10;&#10;&#10;&#10;&#13;&#10;« « à à ï ï&#10;C C _&#10; 힣 ê°€&#10;豈 �&#10;ð€€ ô¿½&#10;</root> \ No newline at end of file
diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/089.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/089.xml
index 2d80c8f..42ffcb6 100644
--- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/089.xml
+++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/089.xml
@@ -1,5 +1,5 @@
<!DOCTYPE doc [
-<!ENTITY e "&#x10000;&#x10FFFD;&#x10FFFF;">
+<!ENTITY e "&#x10000;&#x10FFFD;">
<!ELEMENT doc (#PCDATA)>
]>
<doc>&e;</doc>
diff --git a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/out/089.xml b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/out/089.xml
index e01d86e..f5a0484 100644
--- a/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/out/089.xml
+++ b/tests/auto/qxmlstream/XML-Test-Suite/xmlconf/xmltest/valid/sa/out/089.xml
@@ -1 +1 @@
-<doc>ð€€ô¿½ô¿¿</doc> \ No newline at end of file
+<doc>ð€€ô¿½</doc> \ No newline at end of file
diff --git a/tests/auto/utf8/tst_utf8.cpp b/tests/auto/utf8/tst_utf8.cpp
index 1183b81..7bbbfab 100644
--- a/tests/auto/utf8/tst_utf8.cpp
+++ b/tests/auto/utf8/tst_utf8.cpp
@@ -73,6 +73,9 @@ private slots:
void invalidUtf8_data();
void invalidUtf8();
+
+ void nonCharacters_data();
+ void nonCharacters();
};
void tst_Utf8::initTestCase()
@@ -134,8 +137,8 @@ void tst_Utf8::roundTrip_data()
static const uint utf32_5[] = { 0x010203 };
QTest::newRow("utf8_5") << QByteArray(utf8_5) << QString::fromUcs4(utf32_5, 1);
- static const char utf8_6[] = "\364\217\277\277"; // U+10FFFF
- static const uint utf32_6[] = { 0x10FFFF };
+ static const char utf8_6[] = "\364\217\277\275"; // U+10FFFD
+ static const uint utf32_6[] = { 0x10FFFD };
QTest::newRow("utf8_6") << QByteArray(utf8_6) << QString::fromUcs4(utf32_6, 1);
static const char utf8_7[] = "abc\302\240\303\241\303\251\307\275 \342\202\254def";
@@ -144,10 +147,10 @@ void tst_Utf8::roundTrip_data()
' ', 0x20AC, 'd', 'e', 'f', 0 };
QTest::newRow("utf8_7") << QByteArray(utf8_7) << QString::fromUtf16(utf16_7);
- static const char utf8_8[] = "abc\302\240\303\241\303\251\307\275 \364\217\277\277 \342\202\254def";
+ static const char utf8_8[] = "abc\302\240\303\241\303\251\307\275 \364\217\277\275 \342\202\254def";
static const uint utf32_8[] = { 'a', 'b', 'c', 0x00A0,
0x00E1, 0x00E9, 0x01FD,
- ' ', 0x10FFFF, ' ',
+ ' ', 0x10FFFD, ' ',
0x20AC, 'd', 'e', 'f', 0 };
QTest::newRow("utf8_8") << QByteArray(utf8_8) << QString::fromUcs4(utf32_8);
}
@@ -214,14 +217,6 @@ void tst_Utf8::invalidUtf8_data()
QTest::newRow("4chars-2") << QByteArray("\xF0\x90\xC0\x80");
QTest::newRow("4chars-3") << QByteArray("\xF0\xC0\x80\x80");
- // U+FFFE and U+FFFF are non-characters and must not be present
- // U+FFFE: 1111 11 1111 11 1110
- // encoding: xxxz:1111 xz11:1111 xz11:1110
- QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE");
- // U+FFFF: 1111 11 1111 11 1111
- // encoding: xxxz:1111 xz11:1111 xz11:1111
- QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF");
-
// Surrogate pairs must now be present either
// U+D800: 1101 10 0000 00 0000
// encoding: xxxz:1101 xz10:0000 xz00:0000
@@ -302,7 +297,7 @@ void tst_Utf8::invalidUtf8()
QFETCH_GLOBAL(bool, useLocale);
QSharedPointer<QTextDecoder> decoder = QSharedPointer<QTextDecoder>(codec->makeDecoder());
- QString decoded = decoder->toUnicode(utf8);
+ decoder->toUnicode(utf8);
// Only enforce correctness on our UTF-8 decoder
// The system's UTF-8 codec is sometimes buggy
@@ -314,5 +309,69 @@ void tst_Utf8::invalidUtf8()
qWarning("System codec does not report failure when it should. Should report bug upstream.");
}
+void tst_Utf8::nonCharacters_data()
+{
+ QTest::addColumn<QByteArray>("utf8");
+ QTest::addColumn<QString>("utf16");
+
+ // Unicode has a couple of "non-characters" that one can use internally,
+ // but are not allowed to be used for text interchange.
+ //
+ // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF,
+ // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and
+ // U+FDEF (inclusive)
+
+ // U+FDD0 through U+FDEF
+ for (int i = 0; i < 16; ++i) {
+ char utf8[] = { 0357, 0267, 0220 + i, 0 };
+ QString utf16 = QChar(0xfdd0 + i);
+ QTest::newRow(qPrintable(QString::number(0xfdd0 + i, 16))) << QByteArray(utf8) << utf16;
+ }
+
+ // the last two in Planes 1 through 16
+ for (uint plane = 1; plane <= 16; ++plane) {
+ for (uint lower = 0xfffe; lower < 0x10000; ++lower) {
+ uint ucs4 = (plane << 16) | lower;
+ char utf8[] = { 0xf0 | uchar(ucs4 >> 18),
+ 0x80 | (uchar(ucs4 >> 12) & 0x3f),
+ 0x80 | (uchar(ucs4 >> 6) & 0x3f),
+ 0x80 | (uchar(ucs4) & 0x3f),
+ 0 };
+ ushort utf16[] = { QChar::highSurrogate(ucs4), QChar::lowSurrogate(ucs4), 0 };
+
+ QTest::newRow(qPrintable(QString::number(ucs4, 16))) << QByteArray(utf8) << QString::fromUtf16(utf16);
+ }
+ }
+
+ QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE") << QString(QChar(0xfffe));
+ QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF") << QString(QChar(0xffff));
+}
+
+void tst_Utf8::nonCharacters()
+{
+ QFETCH(QByteArray, utf8);
+ QFETCH(QString, utf16);
+ QFETCH_GLOBAL(bool, useLocale);
+
+ QSharedPointer<QTextDecoder> decoder = QSharedPointer<QTextDecoder>(codec->makeDecoder());
+ decoder->toUnicode(utf8);
+
+ // Only enforce correctness on our UTF-8 decoder
+ // The system's UTF-8 codec is sometimes buggy
+ // GNU libc's iconv is known to accept U+FFFF and U+FFFE encoded as UTF-8
+ // OS X's iconv is known to accept those, plus surrogates and codepoints above U+10FFFF
+ if (!useLocale)
+ QVERIFY(decoder->hasFailure());
+ else if (!decoder->hasFailure())
+ qWarning("System codec does not report failure when it should. Should report bug upstream.");
+
+ QSharedPointer<QTextEncoder> encoder(codec->makeEncoder());
+ encoder->fromUnicode(utf16);
+ if (!useLocale)
+ QVERIFY(encoder->hasFailure());
+ else if (!encoder->hasFailure())
+ qWarning("System codec does not report failure when it should. Should report bug upstream.");
+}
+
QTEST_MAIN(tst_Utf8)
#include "tst_utf8.moc"
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-datatype.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-datatype.xsd
new file mode 100644
index 0000000..60f3e4f
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-datatype.xsd
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:simpleType name="testType">
+ <xsd:list itemType="xsd:int" />
+ </xsd:simpleType>
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-import-a.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-import-a.xsd
new file mode 100644
index 0000000..e6da433
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-import-a.xsd
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:import schemaLocation="indirect-import-b.xsd" namespace="http://qt.nokia.com/test2" />
+ <xsd:import schemaLocation="indirect-import-c.xsd" namespace="http://qt.nokia.com/test2" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-import-b.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-import-b.xsd
new file mode 100644
index 0000000..88be377
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-import-b.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test2">
+ <xsd:import schemaLocation="indirect-datatype.xsd" namespace="http://qt.nokia.com/test" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-import-c.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-import-c.xsd
new file mode 100644
index 0000000..88be377
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-import-c.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test2">
+ <xsd:import schemaLocation="indirect-datatype.xsd" namespace="http://qt.nokia.com/test" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-include-a.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-include-a.xsd
new file mode 100644
index 0000000..02ca5c5
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-include-a.xsd
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:include schemaLocation="indirect-include-b.xsd" />
+ <xsd:include schemaLocation="indirect-include-c.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-include-b.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-include-b.xsd
new file mode 100644
index 0000000..efaba74
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-include-b.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:include schemaLocation="indirect-datatype.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-include-c.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-include-c.xsd
new file mode 100644
index 0000000..efaba74
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-include-c.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:include schemaLocation="indirect-datatype.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-redefine-a.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-a.xsd
new file mode 100644
index 0000000..4f0804c
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-a.xsd
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:redefine schemaLocation="indirect-redefine-b.xsd" />
+ <xsd:redefine schemaLocation="indirect-redefine-c.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-redefine-b.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-b.xsd
new file mode 100644
index 0000000..019a127
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-b.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:redefine schemaLocation="indirect-datatype.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/files/indirect-redefine-c.xsd b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-c.xsd
new file mode 100644
index 0000000..019a127
--- /dev/null
+++ b/tests/auto/xmlpatternsvalidator/files/indirect-redefine-c.xsd
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://qt.nokia.com/test" targetNamespace="http://qt.nokia.com/test">
+ <xsd:redefine schemaLocation="indirect-datatype.xsd" />
+</xsd:schema>
diff --git a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp
index 6d4ed69..7aab47f 100644
--- a/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp
+++ b/tests/auto/xmlpatternsvalidator/tst_xmlpatternsvalidator.cpp
@@ -196,6 +196,21 @@ void tst_XmlPatternsValidator::xsdSupport_data() const
<< 1
<< (QStringList() << QLatin1String("files/instance.xml"))
<< QString();
+
+ QTest::newRow("A schema with an indirectly included type")
+ << 0
+ << (QStringList() << QLatin1String("files/indirect-include-a.xsd"))
+ << QString();
+
+ QTest::newRow("A schema with an indirectly imported type")
+ << 0
+ << (QStringList() << QLatin1String("files/indirect-import-a.xsd"))
+ << QString();
+
+ QTest::newRow("A schema with an indirectly redefined type")
+ << 0
+ << (QStringList() << QLatin1String("files/indirect-redefine-a.xsd"))
+ << QString();
}
QTEST_MAIN(tst_XmlPatternsValidator)
diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
index 3167f26..23f0e00 100644
--- a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
+++ b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-TARGET = tst_qtextcodec
+TARGET = tst_bench_qtextcodec
QT -= gui
SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
index e06d746..320746c 100755
--- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qdiriterator
+TARGET = tst_bench_qdiriterator
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/io/qfile/qfile.pro b/tests/benchmarks/corelib/io/qfile/qfile.pro
index 99505c3..8663cab 100644
--- a/tests/benchmarks/corelib/io/qfile/qfile.pro
+++ b/tests/benchmarks/corelib/io/qfile/qfile.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qfile
+TARGET = tst_bench_qfile
QT -= gui
win32: DEFINES+= _CRT_SECURE_NO_WARNINGS
diff --git a/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro b/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
index eca619f..3edf6a6 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/benchmarks/corelib/io/qfileinfo/qfileinfo.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qfileinfo
+TARGET = tst_bench_qfileinfo
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
index 749a4d6..2e0f6a1 100755
--- a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
+++ b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qiodevice
+TARGET = tst_bench_qiodevice
TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/qtemporaryfile.pro b/tests/benchmarks/corelib/io/qtemporaryfile/qtemporaryfile.pro
index c1b04f4..74fd534 100644
--- a/tests/benchmarks/corelib/io/qtemporaryfile/qtemporaryfile.pro
+++ b/tests/benchmarks/corelib/io/qtemporaryfile/qtemporaryfile.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qtemporaryfile
+TARGET = tst_bench_qtemporaryfile
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/io/qurl/main.cpp b/tests/benchmarks/corelib/io/qurl/main.cpp
new file mode 100644
index 0000000..49ace64
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qurl/main.cpp
@@ -0,0 +1,244 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qurl.h>
+#include <qtest.h>
+
+class tst_qurl: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void emptyUrl();
+ void relativeUrl();
+ void absoluteUrl();
+ void isRelative_data();
+ void isRelative();
+ void toLocalFile_data();
+ void toLocalFile();
+ void toString_data();
+ void toString();
+ void toEncoded_data();
+ void toEncoded();
+ void resolved_data();
+ void resolved();
+ void equality_data();
+ void equality();
+ void qmlPropertyWriteUseCase();
+
+private:
+ void generateFirstRunData();
+};
+
+void tst_qurl::emptyUrl()
+{
+ QBENCHMARK {
+ QUrl url;
+ }
+}
+
+void tst_qurl::relativeUrl()
+{
+ QBENCHMARK {
+ QUrl url("pics/avatar.png");
+ }
+}
+
+void tst_qurl::absoluteUrl()
+{
+ QBENCHMARK {
+ QUrl url("/tmp/avatar.png");
+ }
+}
+
+void tst_qurl::generateFirstRunData()
+{
+ QTest::addColumn<bool>("firstRun");
+
+ QTest::newRow("construction + first run") << true;
+ QTest::newRow("subsequent runs") << false;
+}
+
+void tst_qurl::isRelative_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::isRelative()
+{
+ QFETCH(bool, firstRun);
+ if (firstRun) {
+ QBENCHMARK {
+ QUrl url("pics/avatar.png");
+ url.isRelative();
+ }
+ } else {
+ QUrl url("pics/avatar.png");
+ QBENCHMARK {
+ url.isRelative();
+ }
+ }
+}
+
+void tst_qurl::toLocalFile_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::toLocalFile()
+{
+ QFETCH(bool, firstRun);
+ if (firstRun) {
+ QBENCHMARK {
+ QUrl url("/tmp/avatar.png");
+ url.toLocalFile();
+ }
+ } else {
+ QUrl url("/tmp/avatar.png");
+ QBENCHMARK {
+ url.toLocalFile();
+ }
+ }
+}
+
+void tst_qurl::toString_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::toString()
+{
+ QFETCH(bool, firstRun);
+ if(firstRun) {
+ QBENCHMARK {
+ QUrl url("pics/avatar.png");
+ url.toString();
+ }
+ } else {
+ QUrl url("pics/avatar.png");
+ QBENCHMARK {
+ url.toString();
+ }
+ }
+}
+
+void tst_qurl::toEncoded_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::toEncoded()
+{
+ QFETCH(bool, firstRun);
+ if(firstRun) {
+ QBENCHMARK {
+ QUrl url("pics/avatar.png");
+ url.toEncoded(QUrl::FormattingOption(0x100));
+ }
+ } else {
+ QUrl url("pics/avatar.png");
+ QBENCHMARK {
+ url.toEncoded(QUrl::FormattingOption(0x100));
+ }
+ }
+}
+
+void tst_qurl::resolved_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::resolved()
+{
+ QFETCH(bool, firstRun);
+ if(firstRun) {
+ QBENCHMARK {
+ QUrl baseUrl("/home/user/");
+ QUrl url("pics/avatar.png");
+ baseUrl.resolved(url);
+ }
+ } else {
+ QUrl baseUrl("/home/user/");
+ QUrl url("pics/avatar.png");
+ QBENCHMARK {
+ baseUrl.resolved(url);
+ }
+ }
+}
+
+void tst_qurl::equality_data()
+{
+ generateFirstRunData();
+}
+
+void tst_qurl::equality()
+{
+ QFETCH(bool, firstRun);
+ if(firstRun) {
+ QBENCHMARK {
+ QUrl url("pics/avatar.png");
+ QUrl url2("pics/avatar2.png");
+ //url == url2;
+ }
+ } else {
+ QUrl url("pics/avatar.png");
+ QUrl url2("pics/avatar2.png");
+ QBENCHMARK {
+ url == url2;
+ }
+ }
+}
+
+void tst_qurl::qmlPropertyWriteUseCase()
+{
+ QUrl base("file:///home/user/qt/demos/declarative/samegame/SamegameCore/");
+ QString str("pics/redStar.png");
+
+ QBENCHMARK {
+ QUrl u = QUrl(str);
+ if (!u.isEmpty() && u.isRelative())
+ u = base.resolved(u);
+ }
+}
+
+QTEST_MAIN(tst_qurl)
+
+#include "main.moc"
diff --git a/tests/benchmarks/corelib/io/qurl/qurl.pro b/tests/benchmarks/corelib/io/qurl/qurl.pro
new file mode 100644
index 0000000..1d2d35e
--- /dev/null
+++ b/tests/benchmarks/corelib/io/qurl/qurl.pro
@@ -0,0 +1,7 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qurl
+QT -= gui
+win32: DEFINES+= _CRT_SECURE_NO_WARNINGS
+
+SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/kernel/events/events.pro b/tests/benchmarks/corelib/kernel/events/events.pro
index adf2317..43a7131 100644
--- a/tests/benchmarks/corelib/kernel/events/events.pro
+++ b/tests/benchmarks/corelib/kernel/events/events.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_events
+TARGET = tst_bench_events
DEPENDPATH += .
INCLUDEPATH += .
# Input
diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/qmetaobject.pro b/tests/benchmarks/corelib/kernel/qmetaobject/qmetaobject.pro
index 78300f6..a02273f 100644
--- a/tests/benchmarks/corelib/kernel/qmetaobject/qmetaobject.pro
+++ b/tests/benchmarks/corelib/kernel/qmetaobject/qmetaobject.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qmetaobject
+TARGET = tst_bench_qmetaobject
SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/kernel/qobject/qobject.pro b/tests/benchmarks/corelib/kernel/qobject/qobject.pro
index 2855de4..1baaf58 100644
--- a/tests/benchmarks/corelib/kernel/qobject/qobject.pro
+++ b/tests/benchmarks/corelib/kernel/qobject/qobject.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qobject
+TARGET = tst_bench_qobject
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro
new file mode 100644
index 0000000..9c6b16b
--- /dev/null
+++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = qtimer_vs_qmetaobject
+DEPENDPATH += .
+INCLUDEPATH += .
+
+CONFIG += release
+#CONFIG += debug
+
+
+SOURCES += tst_qtimer_vs_qmetaobject.cpp
diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
new file mode 100644
index 0000000..2f265bf
--- /dev/null
+++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore>
+#include <QtTest/QtTest>
+
+#define INVOKE_COUNT 10000
+
+class qtimer_vs_qmetaobject : public QObject
+{
+ Q_OBJECT
+private slots:
+ void testZeroTimerSingleShot();
+ void testQueuedInvokeMethod();
+};
+
+class InvokeCounter : public QObject {
+ Q_OBJECT
+public:
+ InvokeCounter() : count(0) { };
+public slots:
+ void invokeSlot() {
+ count++;
+ if (count == INVOKE_COUNT)
+ QTestEventLoop::instance().exitLoop();
+ }
+protected:
+ int count;
+};
+
+void qtimer_vs_qmetaobject::testZeroTimerSingleShot()
+{
+ QBENCHMARK {
+ InvokeCounter invokeCounter;
+ for(int i = 0; i < INVOKE_COUNT; ++i) {
+ QTimer::singleShot(0, &invokeCounter, SLOT(invokeSlot()));
+ }
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ }
+}
+
+void qtimer_vs_qmetaobject::testQueuedInvokeMethod()
+{
+ QBENCHMARK {
+ InvokeCounter invokeCounter;
+ for(int i = 0; i < INVOKE_COUNT; ++i) {
+ QMetaObject::invokeMethod(&invokeCounter, "invokeSlot", Qt::QueuedConnection);
+ }
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ }
+}
+
+
+QTEST_MAIN(qtimer_vs_qmetaobject)
+
+#include "tst_qtimer_vs_qmetaobject.moc"
diff --git a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
index 63b5442..f3dd66a 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
+++ b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qvariant
+TARGET = tst_bench_qvariant
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro
index f9c1978..654b7b6 100644
--- a/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro
+++ b/tests/benchmarks/corelib/thread/qthreadstorage/qthreadstorage.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qthreadstorage
+TARGET = tst_bench_qthreadstorage
SOURCES += tst_qthreadstorage.cpp
diff --git a/tests/benchmarks/corelib/tools/containers-associative/containers-associative.pro b/tests/benchmarks/corelib/tools/containers-associative/containers-associative.pro
index c6f3fa6..3e3bf2b 100644
--- a/tests/benchmarks/corelib/tools/containers-associative/containers-associative.pro
+++ b/tests/benchmarks/corelib/tools/containers-associative/containers-associative.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_containers-associative
+TARGET = tst_bench_containers-associative
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/tools/containers-sequential/containers-sequential.pro b/tests/benchmarks/corelib/tools/containers-sequential/containers-sequential.pro
index bf6db44..4236b35 100644
--- a/tests/benchmarks/corelib/tools/containers-sequential/containers-sequential.pro
+++ b/tests/benchmarks/corelib/tools/containers-sequential/containers-sequential.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_containers-sequential
+TARGET = tst_bench_containers-sequential
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
index a0bf021..3474dd0 100755
--- a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
+++ b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qbytearray
+TARGET = tst_bench_qbytearray
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/tools/qrect/qrect.pro b/tests/benchmarks/corelib/tools/qrect/qrect.pro
index 6e35119..4bd05aa 100644
--- a/tests/benchmarks/corelib/tools/qrect/qrect.pro
+++ b/tests/benchmarks/corelib/tools/qrect/qrect.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qrect
+TARGET = tst_bench_qrect
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
index 83d723c..e0f47c9 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qregexp
+TARGET = tst_bench_qregexp
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro
index 2e7c86a..fa4310e 100644
--- a/tests/benchmarks/corelib/tools/qstring/qstring.pro
+++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-TARGET = tst_qstring
+TARGET = tst_bench_qstring
QT -= gui
SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro b/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro
index 79171b4..948657e 100644
--- a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro
+++ b/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qstringbuilder
+TARGET = tst_bench_qstringbuilder
QMAKE_CXXFLAGS += -g
QMAKE_CFLAGS += -g
diff --git a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro
index 5c64b34..06a5836 100644
--- a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro
+++ b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
-TARGET = tst_qstringlist
+TARGET = tst_bench_qstringlist
CONFIG -= debug
CONFIG += release
QT -= gui
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
index 5b0004f..cd69cfe 100644
--- a/tests/benchmarks/declarative/creation/tst_creation.cpp
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -47,6 +47,7 @@
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QDeclarativeItem>
+#include <QDeclarativeContext>
#include <private/qobject_p.h>
#ifdef Q_OS_SYMBIAN
@@ -67,6 +68,8 @@ private slots:
void qobject_qmltype();
void qobject_alloc();
+ void qdeclarativecontext();
+
void objects_qmltype_data();
void objects_qmltype();
@@ -101,7 +104,8 @@ void tst_creation::qobject_cpp()
void tst_creation::qobject_qml()
{
- QDeclarativeComponent component(&engine, TEST_FILE("qobject.qml"));
+ QDeclarativeComponent component(&engine);
+ component.setData("import Qt 4.6\nQtObject {}", QUrl());
QObject *obj = component.create();
delete obj;
@@ -150,6 +154,14 @@ void tst_creation::qobject_alloc()
}
}
+void tst_creation::qdeclarativecontext()
+{
+ QBENCHMARK {
+ QDeclarativeContext *ctxt = new QDeclarativeContext(&engine);
+ delete ctxt;
+ }
+}
+
void tst_creation::objects_qmltype_data()
{
QTest::addColumn<QByteArray>("type");
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
index e48194a..b14531d 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.labs.particles 1.0
Item { id:block
property bool dying: false
diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro
index 55cd75e..53a139a 100644
--- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro
+++ b/tests/benchmarks/gui/animation/qanimation/qanimation.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qanimation
+TARGET = tst_bench_qanimation
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro b/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
index 0d563b9..3ede6e8 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/qgraphicsanchorlayout.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qgraphicsanchorlayout
+TARGET = tst_bench_qgraphicsanchorlayout
SOURCES += tst_qgraphicsanchorlayout.cpp
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro
index 726bb96..d4935c0 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsitem/qgraphicsitem.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qgraphicsitem
+TARGET = tst_bench_qgraphicsitem
SOURCES += tst_qgraphicsitem.cpp
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro
index b460e2a..1b7a5dc 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsscene/qgraphicsscene.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qgraphicsscene
+TARGET = tst_bench_qgraphicsscene
SOURCES += tst_qgraphicsscene.cpp
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
index 927d731..6e044f9 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qgraphicsview
+TARGET = tst_bench_qgraphicsview
SOURCES += tst_qgraphicsview.cpp
RESOURCES += qgraphicsview.qrc
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro
index f1ec54e..ed53237 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro
+++ b/tests/benchmarks/gui/graphicsview/qgraphicswidget/qgraphicswidget.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qgraphicswidget
+TARGET = tst_bench_qgraphicswidget
TEMPLATE = app
# Input
SOURCES += tst_qgraphicswidget.cpp
diff --git a/tests/benchmarks/gui/image/blendbench/blendbench.pro b/tests/benchmarks/gui/image/blendbench/blendbench.pro
index a3228c5..aa6ab95 100644
--- a/tests/benchmarks/gui/image/blendbench/blendbench.pro
+++ b/tests/benchmarks/gui/image/blendbench/blendbench.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_blendbench
+TARGET = tst_bench_blendbench
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
index 276ac33..d67f4be 100644
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qimagereader
+TARGET = tst_bench_qimagereader
SOURCES += tst_qimagereader.cpp
diff --git a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro b/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
index e8330bd..201ac9e 100644
--- a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
+++ b/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qpixmap
+TARGET = tst_bench_qpixmap
SOURCES += tst_qpixmap.cpp
diff --git a/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro b/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro
index e0d7543..78ac97d 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro
+++ b/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qpixmapcache
+TARGET = tst_bench_qpixmapcache
TEMPLATE = app
# Input
SOURCES += tst_qpixmapcache.cpp
diff --git a/tests/benchmarks/gui/itemviews/qtableview/qtableview.pro b/tests/benchmarks/gui/itemviews/qtableview/qtableview.pro
index 02bc530..3f4d4e1 100644
--- a/tests/benchmarks/gui/itemviews/qtableview/qtableview.pro
+++ b/tests/benchmarks/gui/itemviews/qtableview/qtableview.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qtableview
+TARGET = tst_bench_qtableview
SOURCES += tst_qtableview.cpp
diff --git a/tests/benchmarks/gui/kernel/qapplication/qapplication.pro b/tests/benchmarks/gui/kernel/qapplication/qapplication.pro
index f8601e4..e12a60c 100644
--- a/tests/benchmarks/gui/kernel/qapplication/qapplication.pro
+++ b/tests/benchmarks/gui/kernel/qapplication/qapplication.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qapplication
+TARGET = tst_bench_qapplication
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/gui/kernel/qwidget/qwidget.pro b/tests/benchmarks/gui/kernel/qwidget/qwidget.pro
index ff47445..4c6e5c7 100644
--- a/tests/benchmarks/gui/kernel/qwidget/qwidget.pro
+++ b/tests/benchmarks/gui/kernel/qwidget/qwidget.pro
@@ -1,4 +1,4 @@
load(qttest_p4)
-TARGET = tst_qwidget
+TARGET = tst_bench_qwidget
SOURCES += tst_qwidget.cpp
diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro b/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro
index e82d9de..b6a2046 100644
--- a/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro
+++ b/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qmatrix4x4
+TARGET = tst_bench_qmatrix4x4
SOURCES += tst_qmatrix4x4.cpp
diff --git a/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro b/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro
index cd68423..bd6a0d3 100644
--- a/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro
+++ b/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qquaternion
+TARGET = tst_bench_qquaternion
SOURCES += tst_qquaternion.cpp
diff --git a/tests/benchmarks/gui/painting/painting.pro b/tests/benchmarks/gui/painting/painting.pro
index 2c042b5..76c26c1 100644
--- a/tests/benchmarks/gui/painting/painting.pro
+++ b/tests/benchmarks/gui/painting/painting.pro
@@ -3,4 +3,5 @@ SUBDIRS = \
qpainter \
qregion \
qtransform \
- qtracebench
+ qtracebench \
+ qtbench
diff --git a/tests/benchmarks/gui/painting/qpainter/qpainter.pro b/tests/benchmarks/gui/painting/qpainter/qpainter.pro
index 5ac8c64..6603aba 100644
--- a/tests/benchmarks/gui/painting/qpainter/qpainter.pro
+++ b/tests/benchmarks/gui/painting/qpainter/qpainter.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qpainter
+TARGET = tst_bench_qpainter
SOURCES += tst_qpainter.cpp
diff --git a/tests/benchmarks/gui/painting/qregion/main.cpp b/tests/benchmarks/gui/painting/qregion/main.cpp
index 3d16e41..1d19854 100644
--- a/tests/benchmarks/gui/painting/qregion/main.cpp
+++ b/tests/benchmarks/gui/painting/qregion/main.cpp
@@ -49,6 +49,9 @@ class tst_qregion : public QObject
private slots:
void map_data();
void map();
+
+ void intersects_data();
+ void intersects();
};
@@ -84,6 +87,53 @@ void tst_qregion::map()
}
}
+void tst_qregion::intersects_data()
+{
+ QTest::addColumn<QRegion>("region");
+ QTest::addColumn<QRect>("rect");
+
+ QRegion region(0, 0, 100, 100);
+ QRegion complexRegion;
+ complexRegion = complexRegion.united(QRect(0, 0, 100, 100));
+ complexRegion = complexRegion.united(QRect(120, 20, 100, 100));
+
+ {
+ QRect rect(0, 0, 100, 100);
+ QTest::newRow("same -- simple") << region << rect;
+ }
+ {
+ QRect rect(10, 10, 10, 10);
+ QTest::newRow("inside -- simple") << region << rect;
+ }
+ {
+ QRect rect(110, 110, 10, 10);
+ QTest::newRow("outside -- simple") << region << rect;
+ }
+
+ {
+ QRect rect(0, 0, 100, 100);
+ QTest::newRow("same -- complex") << complexRegion << rect;
+ }
+ {
+ QRect rect(10, 10, 10, 10);
+ QTest::newRow("inside -- complex") << complexRegion << rect;
+ }
+ {
+ QRect rect(110, 110, 10, 10);
+ QTest::newRow("outside -- complex") << complexRegion << rect;
+ }
+}
+
+void tst_qregion::intersects()
+{
+ QFETCH(QRegion, region);
+ QFETCH(QRect, rect);
+
+ QBENCHMARK {
+ region.intersects(rect);
+ }
+}
+
QTEST_MAIN(tst_qregion)
#include "main.moc"
diff --git a/tests/benchmarks/gui/painting/qregion/qregion.pro b/tests/benchmarks/gui/painting/qregion/qregion.pro
index fc67177..ec93a62 100644
--- a/tests/benchmarks/gui/painting/qregion/qregion.pro
+++ b/tests/benchmarks/gui/painting/qregion/qregion.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qregion
+TARGET = tst_bench_qregion
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
new file mode 100644
index 0000000..362d121
--- /dev/null
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -0,0 +1,841 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef BENCHMARKTESTS_H
+#define BENCHMARKTESTS_H
+
+#include <QApplication>
+#include <QTextDocument>
+#include <QDesktopWidget>
+#include <QTextLayout>
+#include <QFontMetrics>
+#include <QDebug>
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+# include <QStaticText>
+#endif
+
+class Benchmark
+{
+public:
+ virtual ~Benchmark() {}
+
+ Benchmark(const QSize &size)
+ : m_size(size)
+ {
+ for (int i=0; i<16; ++i) {
+ m_colors[i] = QColor::fromRgbF((rand() % 4) / 3.0,
+ (rand() % 4) / 3.0,
+ (rand() % 4) / 3.0,
+ 1);
+ }
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int iteration) = 0;
+ virtual QString name() const = 0;
+
+ inline const QSize &size() const
+ {
+ return m_size;
+ }
+ virtual void begin(QPainter *, int iterations = 1) { Q_UNUSED(iterations); }
+ virtual void end(QPainter *) { }
+
+ inline const QColor &randomColor(int i) { return m_colors[i % 16]; }
+
+protected:
+ QColor m_colors[16];
+ QSize m_size;
+};
+
+class PaintingRectAdjuster
+{
+public:
+ PaintingRectAdjuster()
+ : m_benchmark(0),
+ m_bounds(),
+ m_screen_filled(false)
+ {
+ }
+
+ const QRect &newPaintingRect() {
+ m_rect.translate(m_rect.width(), 0);
+
+ if (m_rect.right() > m_bounds.width()) {
+ m_rect.moveLeft(m_bounds.left());
+ m_rect.translate(0,m_rect.height());
+ if (m_rect.bottom() > m_bounds.height()) {
+ m_screen_filled = true;
+ m_rect.moveTo(m_bounds.topLeft());
+ }
+ }
+ return m_rect;
+ }
+
+ inline bool isScreenFilled() const
+ { return m_screen_filled; }
+
+ void reset(const QRect &bounds)
+ {
+ m_bounds = bounds;
+ m_rect.moveTo(m_bounds.topLeft());
+ m_rect = QRect(m_bounds.topLeft(),m_benchmark->size());
+ m_rect.translate(-m_rect.width(),0);
+ m_screen_filled = false;
+ }
+
+ inline void setNewBenchmark( Benchmark *benchmark )
+ {
+ m_benchmark = benchmark;
+ }
+
+protected:
+ Benchmark *m_benchmark;
+ QRect m_rect;
+ QRect m_bounds;
+ bool m_screen_filled;
+};
+
+class FillRectBenchmark : public Benchmark
+{
+public:
+ FillRectBenchmark(int size)
+ : Benchmark(QSize(size, size))
+ {
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int iterationCount) {
+ p->fillRect(rect, randomColor(iterationCount));
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("fillRect(%1)").arg(m_size.width());
+ }
+};
+
+class ImageFillRectBenchmark : public Benchmark
+{
+public:
+ ImageFillRectBenchmark(int size)
+ : Benchmark(QSize(size, size))
+ {
+ int s = rand() % 24 + 8;
+ m_content = QImage(s, s, QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&m_content);
+ p.fillRect(0, 0, s, s, Qt::white);
+ p.fillRect(s/2, 0, s/2, s/2, Qt::gray);
+ p.fillRect(0, s/2, s/2, s/2, Qt::gray);
+ p.end();
+
+ m_brush = QBrush(m_content);
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ p->fillRect(rect, m_brush);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("fillRect with image(%1)").arg(m_size.width());
+ }
+
+private:
+ QImage m_content;
+ QBrush m_brush;
+};
+
+
+class DrawRectBenchmark : public Benchmark
+{
+public:
+ DrawRectBenchmark(int size)
+ : Benchmark(QSize(size, size))
+ {
+ }
+
+ virtual void begin(QPainter *p, int) {
+ p->setPen(Qt::NoPen);
+ p->setBrush(randomColor(m_size.width()));
+ }
+
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ p->drawRect(rect);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("drawRect(%1)").arg(m_size.width());
+ }
+};
+
+
+class DrawRectWithBrushChangeBenchmark : public Benchmark
+{
+public:
+ DrawRectWithBrushChangeBenchmark(int size)
+ : Benchmark(QSize(size, size))
+ {
+ }
+
+ virtual void begin(QPainter *p, int) {
+ p->setPen(Qt::NoPen);
+ }
+
+
+ virtual void draw(QPainter *p, const QRect &rect, int i) {
+ p->setBrush(randomColor(i));
+ p->drawRect(rect);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("drawRect with brushchange(%1)").arg(m_size.width());
+ }
+};
+
+class RoundRectBenchmark : public Benchmark
+{
+public:
+ RoundRectBenchmark(int size)
+ : Benchmark(QSize(size, size))
+ {
+ m_roundness = size / 4.;
+ }
+
+ virtual void begin(QPainter *p, int) {
+ p->setPen(Qt::NoPen);
+ p->setBrush(Qt::red);
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ p->drawRoundedRect(rect, m_roundness, m_roundness);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("drawRoundedRect(%1)").arg(m_size.width());
+ }
+
+ qreal m_roundness;
+};
+
+
+class ArcsBenchmark : public Benchmark
+{
+public:
+ enum Type {
+ Stroked = 0x0001,
+ Filled = 0x0002,
+
+ ArcShape = 0x0010,
+ ChordShape = 0x0020,
+ PieShape = 0x0040,
+ CircleShape = 0x0080,
+ Shapes = 0x00f0
+
+ };
+
+ ArcsBenchmark(int size, uint type)
+ : Benchmark(QSize(size, size)),
+ m_type(type)
+ {
+ }
+
+ virtual void begin(QPainter *p, int) {
+ if (m_type & Stroked)
+ p->setPen(Qt::black);
+ else
+ p->setPen(Qt::NoPen);
+
+ if (m_type & Filled)
+ p->setBrush(Qt::red);
+ else
+ p->setBrush(Qt::NoBrush);
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ switch (m_type & Shapes) {
+ case ArcShape:
+ p->drawArc(rect, 45*16, 120*16);
+ break;
+ case ChordShape:
+ p->drawChord(rect, 45*16, 120*16);
+ break;
+ case PieShape:
+ p->drawPie(rect, 45*16, 120*16);
+ break;
+ case CircleShape:
+ p->drawEllipse(rect);
+ break;
+ }
+ }
+
+ virtual QString name() const {
+ QString fillStroke;
+
+ if ((m_type & (Stroked|Filled)) == (Stroked|Filled)) {
+ fillStroke = QLatin1String("Fill & Outline");
+ } else if (m_type & Stroked) {
+ fillStroke = QLatin1String("Outline");
+ } else if (m_type & Filled) {
+ fillStroke = QLatin1String("Fill");
+ }
+
+ QString shape;
+ if (m_type & PieShape) shape = QLatin1String("drawPie");
+ else if (m_type & ChordShape) shape = QLatin1String("drawChord");
+ else if (m_type & ArcShape) shape = QLatin1String("drawArc");
+ else if (m_type & CircleShape) shape = QLatin1String("drawEllipse");
+
+ return QString::fromLatin1("%1(%2) %3").arg(shape).arg(m_size.width()).arg(fillStroke);
+ }
+
+ uint m_type;
+};
+
+
+class DrawScaledImage : public Benchmark
+{
+public:
+ DrawScaledImage(const QImage &image, qreal scale, bool asPixmap)
+ : Benchmark(QSize(image.width(), image.height())),
+ m_image(image),
+ m_type(m_as_pixmap ? "Pixmap" : "Image"),
+ m_scale(scale),
+ m_as_pixmap(asPixmap)
+ {
+ m_pixmap = QPixmap::fromImage(m_image);
+ }
+ DrawScaledImage(const QString& type, const QPixmap &pixmap, qreal scale)
+ : Benchmark(QSize(pixmap.width(), pixmap.height())),
+ m_type(type),
+ m_scale(scale),
+ m_as_pixmap(true),
+ m_pixmap(pixmap)
+ {
+ }
+
+ virtual void begin(QPainter *p, int) {
+ p->scale(m_scale, m_scale);
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ if (m_as_pixmap)
+ p->drawPixmap(rect.topLeft(), m_pixmap);
+ else
+ p->drawImage(rect.topLeft(), m_image);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("draw%4(%1) at scale=%2, depth=%3")
+ .arg(m_size.width())
+ .arg(m_scale)
+ .arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth())
+ .arg(m_type);
+ }
+
+private:
+ QImage m_image;
+ QString m_type;
+ qreal m_scale;
+ bool m_as_pixmap;
+ QPixmap m_pixmap;
+};
+
+class DrawTransformedImage : public Benchmark
+{
+public:
+ DrawTransformedImage(const QImage &image, bool asPixmap)
+ : Benchmark(QSize(image.width(), image.height())),
+ m_image(image),
+ m_type(m_as_pixmap ? "Pixmap" : "Image"),
+ m_as_pixmap(asPixmap)
+ {
+ m_pixmap = QPixmap::fromImage(m_image);
+ }
+ DrawTransformedImage(const QString& type, const QPixmap &pixmap)
+ : Benchmark(QSize(pixmap.width(), pixmap.height())),
+ m_type(type),
+ m_as_pixmap(true),
+ m_pixmap(pixmap)
+ {
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ QTransform oldTransform = p->transform();
+ p->translate(0.5 * rect.width() + rect.left(), 0.5 * rect.height() + rect.top());
+ p->shear(0.25, 0.0);
+ p->rotate(5.0);
+ if (m_as_pixmap)
+ p->drawPixmap(-0.5 * rect.width(), -0.5 * rect.height(), m_pixmap);
+ else
+ p->drawImage(-0.5 * rect.width(), -0.5 * rect.height(), m_image);
+ p->setTransform(oldTransform);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("draw%3(%1) w/transform, depth=%2")
+ .arg(m_size.width())
+ .arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth())
+ .arg(m_type);
+ }
+
+private:
+ QImage m_image;
+ QString m_type;
+ bool m_as_pixmap;
+ QPixmap m_pixmap;
+};
+
+
+class DrawImage : public Benchmark
+{
+public:
+ DrawImage(const QImage &image, bool asPixmap)
+ : Benchmark(QSize(image.width(), image.height())),
+ m_image(image),
+ m_type(m_as_pixmap ? "Pixmap" : "Image"),
+ m_as_pixmap(asPixmap)
+ {
+ m_pixmap = QPixmap::fromImage(image);
+ }
+ DrawImage(const QString& type, const QPixmap &pixmap)
+ : Benchmark(QSize(pixmap.width(), pixmap.height())),
+ m_type(type),
+ m_as_pixmap(true),
+ m_pixmap(pixmap)
+ {
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ if (m_as_pixmap)
+ p->drawPixmap(rect.topLeft(), m_pixmap);
+ else
+ p->drawImage(rect.topLeft(), m_image);
+ }
+
+ virtual QString name() const {
+ return QString::fromLatin1("draw%2(%1), depth=%3")
+ .arg(m_size.width())
+ .arg(m_type)
+ .arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth());
+ }
+
+private:
+ QImage m_image;
+ QString m_type;
+ bool m_as_pixmap;
+ QPixmap m_pixmap;
+};
+
+
+class DrawText : public Benchmark
+{
+public:
+ enum Mode {
+ PainterMode,
+ PainterQPointMode,
+ LayoutMode,
+ DocumentMode,
+ PixmapMode
+
+#if QT_VERSION >= 0x040700
+ , StaticTextMode,
+ StaticTextWithMaximumSizeMode,
+ StaticTextBackendOptimizations
+#endif
+ };
+
+ DrawText(const QString &text, Mode mode)
+ : Benchmark(QSize()), m_mode(mode), m_text(text), m_document(text), m_layout(text)
+ {
+ }
+
+ virtual void begin(QPainter *p, int iterations) {
+#if QT_VERSION >= 0x040700
+ m_staticTexts.clear();
+ m_currentStaticText = 0;
+#else
+ Q_UNUSED(iterations);
+#endif
+ m_pixmaps.clear();
+ m_currentPixmap = 0;
+ QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
+ switch (m_mode) {
+ case PainterMode:
+ m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
+// m_rect = m_rect.translated(-m_rect.topLeft());
+ break;
+ case DocumentMode:
+ m_size = QSize(m_document.size().toSize());
+ break;
+ case PixmapMode:
+ for (int i=0; i<4; ++i) {
+ m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
+ QPixmap pixmap = QPixmap(m_size);
+ pixmap.fill(Qt::transparent);
+ {
+ QPainter p(&pixmap);
+ p.drawText(pixmap.rect(), m_text);
+ }
+ m_pixmaps.append(pixmap);
+ }
+ break;
+
+ case LayoutMode: {
+ QRect r = p->boundingRect(m_bounds, 0, m_text);
+ QStringList lines = m_text.split('\n');
+ int height = 0;
+ int leading = p->fontMetrics().leading();
+ m_layout.beginLayout();
+ for (int i=0; i<lines.size(); ++i) {
+ QTextLine textLine = m_layout.createLine();
+ if (textLine.isValid()) {
+ textLine.setLineWidth(r.width());
+ textLine.setPosition(QPointF(0, height));
+ height += leading + textLine.height();
+ }
+ }
+ m_layout.endLayout();
+ m_layout.setCacheEnabled(true);
+ m_size = m_layout.boundingRect().toRect().size();
+ break; }
+
+#if QT_VERSION >= 0x040700
+ case StaticTextWithMaximumSizeMode: {
+ QStaticText staticText;
+ m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
+ staticText.setMaximumSize(m_size + QSize(10, 10));
+ staticText.setText(m_text);
+ staticText.prepare(p->transform(), p->font());
+ m_staticTexts.append(staticText);
+ break;
+ }
+ case StaticTextBackendOptimizations: {
+ m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
+ for (int i=0; i<iterations; ++i) {
+ QStaticText staticText;
+ staticText.setPerformanceHint(QStaticText::AggressiveCaching);
+ staticText.setMaximumSize(m_size + QSize(10, 10));
+ staticText.setText(m_text);
+ staticText.prepare(p->transform(), p->font());
+ m_staticTexts.append(staticText);
+ }
+
+ break;
+ }
+ case StaticTextMode: {
+ QStaticText staticText;
+ staticText.setText(m_text);
+ staticText.prepare(p->transform(), p->font());
+ m_staticTexts.append(staticText);
+
+ QFontMetrics fm(p->font());
+ m_size = QSize(fm.width(m_text, m_text.length()), fm.height());
+
+ break;
+ }
+#endif
+
+ case PainterQPointMode: {
+ QFontMetrics fm(p->font());
+ m_size = QSize(fm.width(m_text, m_text.length()), fm.height());
+ break;
+ }
+
+ }
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int)
+ {
+ switch (m_mode) {
+ case PainterMode:
+ p->drawText(rect, 0, m_text);
+ break;
+ case PainterQPointMode:
+ p->drawText(rect.topLeft(), m_text);
+ break;
+ case PixmapMode:
+ p->drawPixmap(rect.topLeft(), m_pixmaps.at(m_currentPixmap));
+ m_currentPixmap = (m_currentPixmap + 1) % m_pixmaps.size();
+ break;
+ case DocumentMode:
+ p->translate(rect.topLeft());
+ m_document.drawContents(p);
+ p->translate(-rect.topLeft());
+ break;
+ case LayoutMode:
+ m_layout.draw(p, rect.topLeft());
+ break;
+
+#if QT_VERSION >= 0x040700
+ case StaticTextWithMaximumSizeMode:
+ case StaticTextMode:
+ p->drawStaticText(rect.topLeft(), m_staticTexts.at(0));
+ break;
+ case StaticTextBackendOptimizations:
+ p->drawStaticText(rect.topLeft(), m_staticTexts.at(m_currentStaticText));
+ m_currentStaticText = (m_currentStaticText + 1) % m_staticTexts.size();
+ break;
+#endif
+ }
+ }
+
+ virtual QString name() const {
+ int letters = m_text.length();
+ int lines = m_text.count('\n');
+ if (lines == 0)
+ lines = 1;
+ QString type;
+ switch (m_mode) {
+ case PainterMode: type = "drawText(rect)"; break;
+ case PainterQPointMode: type = "drawText(point)"; break;
+ case LayoutMode: type = "layout.draw()"; break;
+ case DocumentMode: type = "doc.drawContents()"; break;
+ case PixmapMode: type = "pixmap cached text"; break;
+
+#if QT_VERSION >= 0x040700
+ case StaticTextMode: type = "drawStaticText()"; break;
+ case StaticTextWithMaximumSizeMode: type = "drawStaticText() w/ maxsize"; break;
+ case StaticTextBackendOptimizations: type = "drawStaticText() w/ backend optimizations"; break;
+#endif
+ }
+
+ return QString::fromLatin1("%3, len=%1, lines=%2")
+ .arg(letters)
+ .arg(lines)
+ .arg(type);
+ }
+
+private:
+ Mode m_mode;
+ QString m_text;
+ QTextDocument m_document;
+ QTextLayout m_layout;
+
+ QList<QPixmap> m_pixmaps;
+ int m_currentPixmap;
+
+#if QT_VERSION >= 0x040700
+ int m_currentStaticText;
+ QList<QStaticText> m_staticTexts;
+#endif
+};
+
+
+
+
+class ClippedDrawRectBenchmark : public Benchmark
+{
+public:
+ enum ClipType {
+ RectClip,
+ TwoRectRegionClip,
+ EllipseRegionClip,
+ TwoRectPathClip,
+ EllipsePathClip,
+ AAEllipsePathClip,
+ EllipseRegionThenRectClip,
+ EllipsePathThenRectClip
+ };
+
+ ClippedDrawRectBenchmark(int size, ClipType type)
+ : Benchmark(QSize(size, size)), m_type(type)
+ {
+ }
+
+ virtual void begin(QPainter *p, int) {
+ QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
+ p->setPen(Qt::NoPen);
+ p->setBrush(Qt::red);
+
+ switch (m_type) {
+ case RectClip:
+ p->setClipRect(m_bounds.adjusted(1, 1, -1, -1));
+ break;
+ case TwoRectRegionClip:
+ p->setClipRegion(QRegion(m_bounds.adjusted(0, 0, -1, -1))
+ | QRegion(m_bounds.adjusted(1, 1, 0, 0)));
+ break;
+ case EllipseRegionClip:
+ p->setClipRegion(QRegion(m_bounds, QRegion::Ellipse));
+ break;
+ case TwoRectPathClip:
+ {
+ QPainterPath path;
+ path.addRect(m_bounds.adjusted(0, 0, -1, -1));
+ path.addRect(m_bounds.adjusted(1, 1, 0, 0));
+ path.setFillRule(Qt::WindingFill);
+ p->setClipPath(path);
+ }
+ break;
+ case EllipsePathClip:
+ {
+ QPainterPath path;
+ path.addEllipse(m_bounds);
+ p->setClipPath(path);
+ }
+ break;
+ case AAEllipsePathClip:
+ {
+ QPainterPath path;
+ path.addEllipse(m_bounds);
+ p->setRenderHint(QPainter::Antialiasing);
+ p->setClipPath(path);
+ p->setRenderHint(QPainter::Antialiasing, false);
+ }
+ break;
+ case EllipseRegionThenRectClip:
+ p->setClipRegion(QRegion(m_bounds, QRegion::Ellipse));
+ p->setClipRegion(QRegion(m_bounds.width() / 4,
+ m_bounds.height() / 4,
+ m_bounds.width() / 2,
+ m_bounds.height() / 2), Qt::IntersectClip);
+ break;
+ case EllipsePathThenRectClip:
+ {
+ QPainterPath path;
+ path.addEllipse(m_bounds);
+ p->setClipPath(path);
+ p->setClipRegion(QRegion(m_bounds.width() / 4,
+ m_bounds.height() / 4,
+ m_bounds.width() / 2,
+ m_bounds.height() / 2), Qt::IntersectClip);
+ }
+ break;
+ }
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ p->drawRect(rect);
+ }
+
+ virtual QString name() const {
+ QString namedType;
+ switch (m_type) {
+ case RectClip:
+ namedType = "rect";
+ break;
+ case TwoRectRegionClip:
+ namedType = "two-rect-region";
+ break;
+ case EllipseRegionClip:
+ namedType = "ellipse-region";
+ break;
+ case TwoRectPathClip:
+ namedType = "two-rect-path";
+ break;
+ case EllipsePathClip:
+ namedType = "ellipse-path";
+ break;
+ case AAEllipsePathClip:
+ namedType = "aa-ellipse-path";
+ break;
+ case EllipseRegionThenRectClip:
+ namedType = "ellipseregion&rect";
+ break;
+ case EllipsePathThenRectClip:
+ namedType = "ellipsepath&rect";
+ break;
+ }
+ return QString::fromLatin1("%1-clipped-drawRect(%2)").arg(namedType).arg(m_size.width());
+ }
+
+ ClipType m_type;
+};
+
+class LinesBenchmark : public Benchmark
+{
+public:
+ enum LineType {
+ Horizontal_Integer,
+ Diagonal_Integer,
+ Vertical_Integer,
+ Horizontal_Float,
+ Diagonal_Float,
+ Vertical_Float
+ };
+
+ LinesBenchmark(int length, LineType type)
+ : Benchmark(QSize(qAbs(length), qAbs(length))),
+ m_type(type),
+ m_length(length)
+ {
+
+ }
+
+ virtual void draw(QPainter *p, const QRect &rect, int) {
+ switch (m_type) {
+ case Horizontal_Integer:
+ p->drawLine(QLine(rect.x(), rect.y(), rect.x() + m_length, rect.y()));
+ break;
+ case Diagonal_Integer:
+ p->drawLine(QLine(rect.x(), rect.y(), rect.x() + m_length, rect.y() + m_length));
+ break;
+ case Vertical_Integer:
+ p->drawLine(QLine(rect.x() + 4, rect.y(), rect.x() + 4, rect.y() + m_length));
+ break;
+ case Horizontal_Float:
+ p->drawLine(QLineF(rect.x(), rect.y(), rect.x() + m_length, rect.y()));
+ break;
+ case Diagonal_Float:
+ p->drawLine(QLineF(rect.x(), rect.y(), rect.x() + m_length, rect.y() + m_length));
+ break;
+ case Vertical_Float:
+ p->drawLine(QLineF(rect.x() + 4, rect.y(), rect.x() + 4, rect.y() + m_length));
+ break;
+ }
+ }
+
+ virtual QString name() const {
+ const char *names[] = {
+ "Hor_I",
+ "Diag_I",
+ "Ver_I",
+ "Hor_F",
+ "Diag_F",
+ "Ver_F"
+ };
+ return QString::fromLatin1("drawLine(size=%1,type=%2)").arg(m_length).arg(names[m_type]);
+ }
+
+ LineType m_type;
+ int m_length;
+};
+
+#endif // BENCHMARKTESTS_H
diff --git a/tests/benchmarks/gui/painting/qtbench/qtbench.pro b/tests/benchmarks/gui/painting/qtbench/qtbench.pro
new file mode 100644
index 0000000..91f416d
--- /dev/null
+++ b/tests/benchmarks/gui/painting/qtbench/qtbench.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qtbench
+
+SOURCES += tst_qtbench.cpp
+
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
new file mode 100644
index 0000000..8eef472
--- /dev/null
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -0,0 +1,254 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+
+#include <QtGui>
+
+#include "benchmarktests.h"
+
+//TESTED_FILES=
+
+class BenchWidget : public QWidget
+{
+public:
+ BenchWidget(Benchmark *benchmark);
+
+ void paintEvent(QPaintEvent *event);
+
+ bool done() const { return m_done; }
+ qreal result() const { return m_result; }
+
+public:
+ QTime timer;
+
+ Benchmark *m_benchmark;
+
+ bool m_done;
+ qreal m_result;
+
+ uint m_total;
+ uint m_iteration;
+
+ QVector<uint> iterationTimes;
+};
+
+void BenchWidget::paintEvent(QPaintEvent *)
+{
+ if (m_done)
+ return;
+
+ QPainter p(this);
+
+ m_benchmark->begin(&p, 100);
+
+ PaintingRectAdjuster adjuster;
+ adjuster.setNewBenchmark(m_benchmark);
+ adjuster.reset(rect());
+
+ for (int i = 0; i < 100; ++i)
+ m_benchmark->draw(&p, adjuster.newPaintingRect(), i);
+
+ m_benchmark->end(&p);
+
+ ++m_iteration;
+
+ uint currentElapsed = timer.isNull() ? 0 : timer.elapsed();
+ timer.restart();
+
+ m_total += currentElapsed;
+
+ // warm up for at most 5 iterations or half a second
+ if (m_iteration >= 5 || m_total >= 500) {
+ iterationTimes << currentElapsed;
+
+ if (iterationTimes.size() >= 5) {
+ qreal mean = 0;
+ qreal stddev = 0;
+ uint min = INT_MAX;
+
+ for (int i = 0; i < iterationTimes.size(); ++i) {
+ mean += iterationTimes.at(i);
+ min = qMin(min, iterationTimes.at(i));
+ }
+
+ mean /= qreal(iterationTimes.size());
+
+ for (int i = 0; i < iterationTimes.size(); ++i) {
+ qreal delta = iterationTimes.at(i) - mean;
+ stddev += delta * delta;
+ }
+
+ stddev = qSqrt(stddev / iterationTimes.size());
+
+ stddev = 100 * stddev / mean;
+ // do 50 iterations, break earlier if we spend more than 5 seconds or have a low std deviation after 2 seconds
+ if (iterationTimes.size() >= 50 || m_total >= 5000 || (m_total >= 2000 && stddev < 4)) {
+ m_result = min;
+ m_done = true;
+ return;
+ }
+ }
+ }
+}
+
+BenchWidget::BenchWidget(Benchmark *benchmark)
+ : m_benchmark(benchmark)
+ , m_done(false)
+ , m_result(0)
+ , m_total(0)
+ , m_iteration(0)
+{
+ setWindowTitle(benchmark->name());
+ resize(640, 480);
+}
+
+class tst_QtBench : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void qtBench();
+ void qtBench_data();
+};
+
+QString makeString(int length)
+{
+ const char chars[] = "abcd efgh ijkl mnop qrst uvwx yz!$. ABCD 1234";
+ int len = strlen(chars);
+
+ QString ret;
+ for (int j = 0; j < length; j++) {
+ ret += QChar(chars[(j * 97) % len]);
+ }
+
+ return ret;
+}
+
+void tst_QtBench::qtBench_data()
+{
+ QTest::addColumn<void *>("benchmark");
+
+ QString shortString = makeString(5);
+ QString middleString = makeString(50);
+ QString longString = makeString(35) + "\n"
+ + makeString(45) + "\n"
+ + makeString(75);
+ QString superLongString = "Lorem ipsum dolor sit am\n"
+ "et, consectetur adipisci\n"
+ "ng elit. Integer mi leo,\n"
+ "interdum ut congue at, p\n"
+ "ulvinar et tellus. Quisq\n"
+ "ue pretium eleifend laci\n"
+ "nia. Ut semper gravida l\n"
+ "ectus in commodo. Vestib\n"
+ "ulum pharetra arcu in en\n"
+ "im ultrices hendrerit. P\n"
+ "ellentesque habitant mor\n"
+ "bi tristique senectus et\n"
+ "netus et malesuada fames\n"
+ "ac turpis egestas. Ut er\n"
+ "os sem, feugiat in eleme\n"
+ "ntum in, porta sit amet \n"
+ "neque. Fusce mi tellus, \n"
+ "congue non dapibus eget,\n"
+ "pharetra quis quam. Duis\n"
+ "dui massa, pulvinar ac s\n"
+ "odales pharetra, dictum \n"
+ "in enim. Phasellus a nis\n"
+ "i erat, sed pellentesque\n"
+ "mi. Curabitur sed.";
+
+ QList<Benchmark *> benchmarks;
+ benchmarks << (new DrawText(shortString, DrawText::PainterMode));
+ benchmarks << (new DrawText(middleString, DrawText::PainterMode));
+ benchmarks << (new DrawText(longString, DrawText::PainterMode));
+ benchmarks << (new DrawText(superLongString, DrawText::PainterMode));
+
+ benchmarks << (new DrawText(shortString, DrawText::PainterQPointMode));
+ benchmarks << (new DrawText(middleString, DrawText::PainterQPointMode));
+ benchmarks << (new DrawText(longString, DrawText::PainterQPointMode));
+ benchmarks << (new DrawText(superLongString, DrawText::PainterQPointMode));
+
+ benchmarks << (new DrawText(shortString, DrawText::PixmapMode));
+ benchmarks << (new DrawText(middleString, DrawText::PixmapMode));
+ benchmarks << (new DrawText(longString, DrawText::PixmapMode));
+ benchmarks << (new DrawText(superLongString, DrawText::PixmapMode));
+
+#if QT_VERSION >= 0x040700
+ benchmarks << (new DrawText(shortString, DrawText::StaticTextMode));
+ benchmarks << (new DrawText(middleString, DrawText::StaticTextMode));
+ benchmarks << (new DrawText(longString, DrawText::StaticTextMode));
+ benchmarks << (new DrawText(superLongString, DrawText::StaticTextMode));
+
+ benchmarks << (new DrawText(shortString, DrawText::StaticTextWithMaximumSizeMode));
+ benchmarks << (new DrawText(middleString, DrawText::StaticTextWithMaximumSizeMode));
+ benchmarks << (new DrawText(longString, DrawText::StaticTextWithMaximumSizeMode));
+ benchmarks << (new DrawText(superLongString, DrawText::StaticTextWithMaximumSizeMode));
+
+ benchmarks << (new DrawText(shortString, DrawText::StaticTextBackendOptimizations));
+ benchmarks << (new DrawText(middleString, DrawText::StaticTextBackendOptimizations));
+ benchmarks << (new DrawText(longString, DrawText::StaticTextBackendOptimizations));
+ benchmarks << (new DrawText(superLongString, DrawText::StaticTextBackendOptimizations));
+#endif
+
+ foreach (Benchmark *benchmark, benchmarks)
+ QTest::newRow(qPrintable(benchmark->name())) << reinterpret_cast<void *>(benchmark);
+}
+
+void tst_QtBench::qtBench()
+{
+ QFETCH(void *, benchmark);
+
+ BenchWidget widget(reinterpret_cast<Benchmark *>(benchmark));
+ widget.show();
+ QTest::qWaitForWindowShown(&widget);
+
+ while (!widget.done()) {
+ widget.update();
+ QApplication::processEvents();
+ }
+
+ QTest::setBenchmarkResult(widget.result(), QTest::WalltimeMilliseconds);
+}
+
+QTEST_MAIN(tst_QtBench)
+#include "tst_qtbench.moc"
diff --git a/tests/benchmarks/gui/painting/qtransform/qtransform.pro b/tests/benchmarks/gui/painting/qtransform/qtransform.pro
index 8d87656..dc60407 100644
--- a/tests/benchmarks/gui/painting/qtransform/qtransform.pro
+++ b/tests/benchmarks/gui/painting/qtransform/qtransform.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qtransform
+TARGET = tst_bench_qtransform
SOURCES += tst_qtransform.cpp
diff --git a/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro
index c097307..f4bf9ab 100644
--- a/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qstylesheetstyle
+TARGET = tst_bench_qstylesheetstyle
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro b/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro
index b6c7b92..973f881 100644
--- a/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro
+++ b/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro
@@ -1,5 +1,5 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_QFontMetrics
+TARGET = tst_bench_QFontMetrics
SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro
index 9e8860f..a1b6a22 100644
--- a/tests/benchmarks/gui/text/qtext/qtext.pro
+++ b/tests/benchmarks/gui/text/qtext/qtext.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_QText
+TARGET = tst_bench_QText
SOURCES += main.cpp
diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro
index 89f5d31..0949af7 100644
--- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro
+++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/qfile_vs_qnetworkaccessmanager.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qfile_vs_qnetworkaccessmanager
+TARGET = tst_bench_qfile_vs_qnetworkaccessmanager
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/network/access/qnetworkreply/qnetworkreply.pro b/tests/benchmarks/network/access/qnetworkreply/qnetworkreply.pro
index 1e67d81..9d96dc7 100644
--- a/tests/benchmarks/network/access/qnetworkreply/qnetworkreply.pro
+++ b/tests/benchmarks/network/access/qnetworkreply/qnetworkreply.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qnetworkreply
+TARGET = tst_bench_qnetworkreply
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
index f18d6d7..e621d50 100755
--- a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qhostinfo
+TARGET = tst_bench_qhostinfo
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
index e7bf13a..e5b9346 100644
--- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
+++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qtcpserver
+TARGET = tst_bench_qtcpserver
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/opengl/opengl.pro b/tests/benchmarks/opengl/opengl.pro
index 1458b5e..5c58751 100644
--- a/tests/benchmarks/opengl/opengl.pro
+++ b/tests/benchmarks/opengl/opengl.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_opengl
+TARGET = tst_bench_opengl
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp
new file mode 100644
index 0000000..2cb9421
--- /dev/null
+++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QFile>
+#include <QByteArray>
+#include <QBuffer>
+#include <QImageReader>
+#include <QSize>
+
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
+class tst_jpeg : public QObject
+{
+ Q_OBJECT
+private slots:
+ void jpegDecodingQtWebkitStyle();
+};
+
+void tst_jpeg::jpegDecodingQtWebkitStyle()
+{
+ // QtWebkit currently calls size() to get the image size for layouting purposes.
+ // Then when it is in the viewport (we assume that here) it actually gets decoded.
+ QFile inputJpeg(SRCDIR "n900.jpeg");
+ QVERIFY(inputJpeg.exists());
+ inputJpeg.open(QIODevice::ReadOnly);
+ QByteArray imageData = inputJpeg.readAll();
+ QBuffer buffer;
+ buffer.setData(imageData);
+ buffer.open(QBuffer::ReadOnly);
+ QCOMPARE(buffer.size(), qint64(19016));
+
+
+ QBENCHMARK{
+ for (int i = 0; i < 50; i++) {
+ QImageReader reader(&buffer, "jpeg");
+ QSize size = reader.size();
+ QVERIFY(!size.isNull());
+ QByteArray format = reader.format();
+ QVERIFY(!format.isEmpty());
+ QImage img = reader.read();
+ QVERIFY(!img.isNull());
+ buffer.reset();
+ }
+ }
+}
+
+QTEST_MAIN(tst_jpeg)
+
+#include "jpeg.moc"
diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro
new file mode 100644
index 0000000..e106f3e
--- /dev/null
+++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = jpeg
+DEPENDPATH += .
+INCLUDEPATH += .
+
+CONFIG += release
+
+wince*: {
+ DEFINES += SRCDIR=\\\"\\\"
+} else:symbian {
+ # SRCDIR and SVGFILE defined in code in symbian
+}else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
+# Input
+SOURCES += jpeg.cpp
diff --git a/tests/benchmarks/plugins/imageformats/jpeg/n900.jpeg b/tests/benchmarks/plugins/imageformats/jpeg/n900.jpeg
new file mode 100644
index 0000000..681989a
--- /dev/null
+++ b/tests/benchmarks/plugins/imageformats/jpeg/n900.jpeg
Binary files differ
diff --git a/tests/benchmarks/script/qscriptclass/qscriptclass.pro b/tests/benchmarks/script/qscriptclass/qscriptclass.pro
index f0ffeb7..90c9582 100644
--- a/tests/benchmarks/script/qscriptclass/qscriptclass.pro
+++ b/tests/benchmarks/script/qscriptclass/qscriptclass.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qscriptclass
+TARGET = tst_bench_qscriptclass
SOURCES += tst_qscriptclass.cpp
diff --git a/tests/benchmarks/script/qscriptengine/qscriptengine.pro b/tests/benchmarks/script/qscriptengine/qscriptengine.pro
index df6dbb3..72a547a 100644
--- a/tests/benchmarks/script/qscriptengine/qscriptengine.pro
+++ b/tests/benchmarks/script/qscriptengine/qscriptengine.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qscriptengine
+TARGET = tst_bench_qscriptengine
SOURCES += tst_qscriptengine.cpp
diff --git a/tests/benchmarks/script/qscriptvalue/qscriptvalue.pro b/tests/benchmarks/script/qscriptvalue/qscriptvalue.pro
index 04ea324..1c26438 100644
--- a/tests/benchmarks/script/qscriptvalue/qscriptvalue.pro
+++ b/tests/benchmarks/script/qscriptvalue/qscriptvalue.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qscriptvalue
+TARGET = tst_bench_qscriptvalue
SOURCES += tst_qscriptvalue.cpp
diff --git a/tests/benchmarks/svg/qsvgrenderer/qsvgrenderer.pro b/tests/benchmarks/svg/qsvgrenderer/qsvgrenderer.pro
index 8222a09..9e59eb7 100644
--- a/tests/benchmarks/svg/qsvgrenderer/qsvgrenderer.pro
+++ b/tests/benchmarks/svg/qsvgrenderer/qsvgrenderer.pro
@@ -1,6 +1,6 @@
load(qttest_p4)
TEMPLATE = app
-TARGET = tst_qsvgrenderer
+TARGET = tst_bench_qsvgrenderer
SOURCES += tst_qsvgrenderer.cpp
RESOURCES += qsvgrenderer.qrc
diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index ff0ecc5..bc4d495 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -30,8 +30,6 @@ HEADERS += aboutdialog.h \
filternamedialog.h \
helpenginewrapper.h \
helpviewer.h \
- helpviewer_qtb.h \
- helpviewer_qwv.h \
indexwindow.h \
installdialog.h \
mainwindow.h \
@@ -43,6 +41,11 @@ HEADERS += aboutdialog.h \
tracer.h \
xbelsupport.h \
../shared/collectionconfiguration.h
+contains(QT_CONFIG, webkit) {
+ HEADERS += helpviewer_qwv.h
+} else {
+ HEADERS += helpviewer_qtb.h
+ }
win32:HEADERS += remotecontrol_win.h
SOURCES += aboutdialog.cpp \
@@ -59,8 +62,6 @@ SOURCES += aboutdialog.cpp \
filternamedialog.cpp \
helpenginewrapper.cpp \
helpviewer.cpp \
- helpviewer_qtb.cpp \
- helpviewer_qwv.cpp \
indexwindow.cpp \
installdialog.cpp \
main.cpp \
@@ -71,7 +72,12 @@ SOURCES += aboutdialog.cpp \
searchwidget.cpp \
topicchooser.cpp \
xbelsupport.cpp \
- ../shared/collectionconfiguration.cpp \
+ ../shared/collectionconfiguration.cpp
+ contains(QT_CONFIG, webkit) {
+ SOURCES += helpviewer_qwv.cpp
+} else {
+ SOURCES += helpviewer_qtb.cpp
+}
FORMS += bookmarkdialog.ui \
bookmarkmanagerwidget.ui \
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index f56e9e3..2359479 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -43,12 +43,16 @@
#include "centralwidget.h"
#include "findwidget.h"
#include "helpenginewrapper.h"
-#include "helpviewer_qtb.h"
-#include "helpviewer_qwv.h"
#include "searchwidget.h"
#include "mainwindow.h"
#include "../shared/collectionconfiguration.h"
+#if defined(QT_NO_WEBKIT)
+#include "helpviewer_qtb.h"
+#else
+#include "helpviewer_qwv.h"
+#endif // QT_NO_WEBKIT
+
#include <QtCore/QTimer>
#include <QtGui/QApplication>
diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.cpp b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
index bba2850..07b89eb 100644
--- a/tools/assistant/tools/assistant/helpviewer_qtb.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qtb.cpp
@@ -40,8 +40,6 @@
****************************************************************************/
#include "helpviewer_qtb.h"
-#if defined(QT_NO_WEBKIT)
-
#include "centralwidget.h"
#include "helpenginewrapper.h"
#include "tracer.h"
@@ -287,7 +285,3 @@ bool HelpViewer::eventFilter(QObject *obj, QEvent *event)
return true;
return QTextBrowser::eventFilter(obj, event);
}
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_WEBKIT
diff --git a/tools/assistant/tools/assistant/helpviewer_qtb.h b/tools/assistant/tools/assistant/helpviewer_qtb.h
index 5b38870..a05782c 100644
--- a/tools/assistant/tools/assistant/helpviewer_qtb.h
+++ b/tools/assistant/tools/assistant/helpviewer_qtb.h
@@ -41,10 +41,6 @@
#ifndef HELPVIEWERQTB_H
#define HELPVIEWERQTB_H
-#include <QtCore/qglobal.h>
-
-#if defined(QT_NO_WEBKIT)
-
#include "helpviewer.h"
#include <QtCore/QUrl>
@@ -111,6 +107,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_WEBKIT
-
#endif // HELPVIEWERQTB_H
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index 9bb66e1..582d013 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -41,8 +41,6 @@
#include "helpviewer_qwv.h"
-#if !defined(QT_NO_WEBKIT)
-
#include "centralwidget.h"
#include "helpenginewrapper.h"
#include "tracer.h"
@@ -223,7 +221,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
if (type == QWebPage::NavigationTypeLinkClicked
&& (m_keyboardModifiers & Qt::ControlModifier
|| m_pressedButtons == Qt::MidButton)) {
- if (HelpViewer* viewer = centralWidget->newEmptyTab())
+ if (centralWidget->newEmptyTab())
centralWidget->setSource(url);
m_pressedButtons = Qt::NoButton;
m_keyboardModifiers = Qt::NoModifier;
@@ -385,5 +383,3 @@ void HelpViewer::setLoadFinished(bool ok)
}
QT_END_NAMESPACE
-
-#endif // !QT_NO_WEBKIT
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.h b/tools/assistant/tools/assistant/helpviewer_qwv.h
index fbfbaac..41ee553 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.h
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.h
@@ -42,10 +42,6 @@
#ifndef HELPVIEWERQWV_H
#define HELPVIEWERQWV_H
-#include <QtCore/qglobal.h>
-
-#if !defined(QT_NO_WEBKIT)
-
#include "helpviewer.h"
#include <QtGui/QAction>
@@ -120,6 +116,4 @@ private:
QT_END_NAMESPACE
-#endif // !QT_NO_WEBKIT
-
#endif // HELPVIEWERQWV_H
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index 8096218..687e6bc 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -341,7 +341,7 @@ void MainWindow::lookForNewQtDocumentation()
m_qtDocInstaller = new QtDocInstaller(qtDocInfos);
connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this,
- SLOT(qtDocumentationInstalled(bool)));
+ SLOT(qtDocumentationInstalled()));
connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this,
SLOT(resetQtDocInfo(QString)));
connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)),
@@ -351,7 +351,7 @@ void MainWindow::lookForNewQtDocumentation()
m_qtDocInstaller->installDocs();
}
-void MainWindow::qtDocumentationInstalled(bool newDocsInstalled)
+void MainWindow::qtDocumentationInstalled()
{
TRACE_OBJ
statusBar()->clearMessage();
diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h
index 40ca624..8e4276d 100644
--- a/tools/assistant/tools/assistant/mainwindow.h
+++ b/tools/assistant/tools/assistant/mainwindow.h
@@ -112,7 +112,7 @@ private slots:
void lookForNewQtDocumentation();
void indexingStarted();
void indexingFinished();
- void qtDocumentationInstalled(bool newDocsInstalled);
+ void qtDocumentationInstalled();
void registerDocumentation(const QString &component,
const QString &absFileName);
void resetQtDocInfo(const QString &component);
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 6b7740e..dd68fcd 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1495,6 +1495,7 @@ void Configure::applySpecSpecifics()
dictionary[ "QT_INSTALL_PREFIX" ] = "";
dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins";
dictionary[ "QT_INSTALL_IMPORTS" ] = "\\resource\\qt\\imports";
+ dictionary[ "QT_INSTALL_TRANSLATIONS" ] = "\\resource\\qt\\translations";
dictionary[ "ARM_FPU_TYPE" ] = "softvfp";
dictionary[ "SQL_SQLITE" ] = "yes";
dictionary[ "SQL_SQLITE_LIB" ] = "system";
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index 6e5c656..321fe8c 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -2370,7 +2370,7 @@ static bool haveMnemonic(const QString &str)
// because we get a lot of false positives.
if (c != '&' && c != ' ' && QChar(c).isPrint()) {
const ushort *pp = p;
- for (; ::isalpha(*p); p++) ;
+ for (; *p < 256 && ::isalpha(*p); p++) ;
if (pp == p || *p != ';')
return true;
// This looks like a HTML &entity;, so ignore it. As a HTML string
diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp
index b08910a..ce18cb9 100644
--- a/tools/qdbus/qdbus/qdbus.cpp
+++ b/tools/qdbus/qdbus/qdbus.cpp
@@ -249,116 +249,123 @@ static QStringList readList(QStringList &args)
}
static int placeCall(const QString &service, const QString &path, const QString &interface,
- const QString &member, QStringList args, bool try_prop=true)
+ const QString &member, const QStringList& arguments, bool try_prop=true)
{
QDBusInterface iface(service, path, interface, connection);
// Don't check whether the interface is valid to allow DBus try to
// activate the service if possible.
+ QList<int> knownIds;
+ bool matchFound = false;
+ QStringList args = arguments;
QVariantList params;
if (!args.isEmpty()) {
const QMetaObject *mo = iface.metaObject();
QByteArray match = member.toLatin1();
match += '(';
- int midx = -1;
for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
QMetaMethod mm = mo->method(i);
QByteArray signature = mm.signature();
- if (signature.startsWith(match)) {
- midx = i;
- break;
- }
+ if (signature.startsWith(match))
+ knownIds += i;
}
- if (midx == -1) {
- // Failed to set property after falling back?
- // Bail out without displaying an error
- if (!try_prop)
+
+ while (!matchFound) {
+ args = arguments; // reset
+ params.clear();
+ if (knownIds.isEmpty()) {
+ // Failed to set property after falling back?
+ // Bail out without displaying an error
+ if (!try_prop)
+ return 1;
+ if (try_prop && args.size() == 1) {
+ QStringList proparg;
+ proparg += interface;
+ proparg += member;
+ proparg += args.first();
+ if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false))
+ return 0;
+ }
+ fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n",
+ qPrintable(interface), qPrintable(member), qPrintable(path),
+ qPrintable(service));
return 1;
- if (try_prop && args.size() == 1) {
- QStringList proparg;
- proparg += interface;
- proparg += member;
- proparg += args.first();
- if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false))
- return 0;
}
- fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n",
- qPrintable(interface), qPrintable(member), qPrintable(path),
- qPrintable(service));
- return 1;
- }
- QMetaMethod mm = mo->method(midx);
- QList<QByteArray> types = mm.parameterTypes();
- for (int i = 0; i < types.count(); ++i) {
- if (types.at(i).endsWith('&')) {
- // reference (and not a reference to const): output argument
- // we're done with the inputs
- while (types.count() > i)
- types.removeLast();
- break;
+ QMetaMethod mm = mo->method(knownIds.takeFirst());
+ QList<QByteArray> types = mm.parameterTypes();
+ for (int i = 0; i < types.count(); ++i) {
+ if (types.at(i).endsWith('&')) {
+ // reference (and not a reference to const): output argument
+ // we're done with the inputs
+ while (types.count() > i)
+ types.removeLast();
+ break;
+ }
}
- }
- for (int i = 0; !args.isEmpty() && i < types.count(); ++i) {
- int id = QVariant::nameToType(types.at(i));
- if (id == QVariant::UserType)
- id = QMetaType::type(types.at(i));
- Q_ASSERT(id);
-
- QVariant p;
- QString argument;
- if ((id == QVariant::List || id == QVariant::StringList)
- && args.at(0) == QLatin1String("("))
- p = readList(args);
- else
- p = argument = args.takeFirst();
-
- if (id == int(QMetaType::UChar)) {
- // special case: QVariant::convert doesn't convert to/from
- // UChar because it can't decide if it's a character or a number
- p = qVariantFromValue<uchar>(p.toUInt());
- } else if (id < int(QMetaType::User) && id != int(QVariant::Map)) {
- p.convert(QVariant::Type(id));
- if (p.type() == QVariant::Invalid) {
- fprintf(stderr, "Could not convert '%s' to type '%s'.\n",
- qPrintable(argument), types.at(i).constData());
- return 1 ;
- }
- } else if (id == qMetaTypeId<QDBusVariant>()) {
- QDBusVariant tmp(p);
- p = qVariantFromValue(tmp);
- } else if (id == qMetaTypeId<QDBusObjectPath>()) {
- QDBusObjectPath path(argument);
- if (path.path().isNull()) {
- fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n",
- qPrintable(argument));
+ for (int i = 0; !args.isEmpty() && i < types.count(); ++i) {
+ int id = QVariant::nameToType(types.at(i));
+ if (id == QVariant::UserType)
+ id = QMetaType::type(types.at(i));
+ Q_ASSERT(id);
+
+ QVariant p;
+ QString argument;
+ if ((id == QVariant::List || id == QVariant::StringList)
+ && args.at(0) == QLatin1String("("))
+ p = readList(args);
+ else
+ p = argument = args.takeFirst();
+
+ if (id == int(QMetaType::UChar)) {
+ // special case: QVariant::convert doesn't convert to/from
+ // UChar because it can't decide if it's a character or a number
+ p = qVariantFromValue<uchar>(p.toUInt());
+ } else if (id < int(QMetaType::User) && id != int(QVariant::Map)) {
+ p.convert(QVariant::Type(id));
+ if (p.type() == QVariant::Invalid) {
+ fprintf(stderr, "Could not convert '%s' to type '%s'.\n",
+ qPrintable(argument), types.at(i).constData());
+ return 1 ;
+ }
+ } else if (id == qMetaTypeId<QDBusVariant>()) {
+ QDBusVariant tmp(p);
+ p = qVariantFromValue(tmp);
+ } else if (id == qMetaTypeId<QDBusObjectPath>()) {
+ QDBusObjectPath path(argument);
+ if (path.path().isNull()) {
+ fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n",
+ qPrintable(argument));
+ return 1;
+ }
+ p = qVariantFromValue(path);
+ } else if (id == qMetaTypeId<QDBusSignature>()) {
+ QDBusSignature sig(argument);
+ if (sig.signature().isNull()) {
+ fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n",
+ qPrintable(argument));
+ return 1;
+ }
+ p = qVariantFromValue(sig);
+ } else {
+ fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n",
+ types.at(i).constData());
return 1;
}
- p = qVariantFromValue(path);
- } else if (id == qMetaTypeId<QDBusSignature>()) {
- QDBusSignature sig(argument);
- if (sig.signature().isNull()) {
- fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n",
- qPrintable(argument));
- return 1;
- }
- p = qVariantFromValue(sig);
- } else {
- fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n",
- types.at(i).constData());
+ params += p;
+ }
+ if (params.count() == types.count() && args.isEmpty())
+ matchFound = true;
+ else if (knownIds.isEmpty()) {
+ fprintf(stderr, "Invalid number of parameters\n");
return 1;
}
- params += p;
- }
- if (params.count() != types.count() || !args.isEmpty()) {
- fprintf(stderr, "Invalid number of parameters\n");
- return 1;
- }
- }
+ } // while (!matchFound)
+ } // if (!args.isEmpty()
QDBusMessage reply = iface.callWithArgumentList(QDBus::Block, member, params);
if (reply.type() == QDBusMessage::ErrorMessage) {
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index c8a39ef..80f7e45 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -226,6 +226,7 @@ void Generator::terminate()
imageFiles.clear();
imageDirs.clear();
outDir = "";
+ QmlClassNode::clear();
}
Generator *Generator::generatorForFormat(const QString& format)
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 5415559..d4e4196 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1284,6 +1284,15 @@ QmlClassNode::~QmlClassNode()
}
/*!
+ Clear the multimap so that subsequent runs don't try to use
+ nodes from a previous run.
+ */
+void QmlClassNode::clear()
+{
+ inheritedBy.clear();
+}
+
+/*!
The base file name for this kind of node has "qml_"
prepended to it.
@@ -1305,8 +1314,8 @@ QString QmlClassNode::fileBase() const
*/
void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
{
- //qDebug() << "QmlClassNode::addInheritedBy(): insert" << base << sub->name();
inheritedBy.insert(base,sub);
+ qDebug() << "QmlClassNode::addInheritedBy(): insert" << base << sub->name() << inheritedBy.size();
}
/*!
@@ -1318,7 +1327,7 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs)
if (inheritedBy.count(base) > 0) {
subs = inheritedBy.values(base);
qDebug() << "QmlClassNode::subclasses():" << inheritedBy.count(base) << base
- << "subs:" << subs.size();
+ << "subs:" << subs.size() << "total size:" << inheritedBy.size();
}
}
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index fd39698..1017813 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -385,6 +385,7 @@ class QmlClassNode : public FakeNode
virtual QString fileBase() const;
static void addInheritedBy(const QString& base, Node* sub);
static void subclasses(const QString& base, NodeList& subs);
+ static void clear();
public:
static bool qmlOnly;
diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml
index 35120bc..62996ef 100644
--- a/tools/qml/content/Browser.qml
+++ b/tools/qml/content/Browser.qml
@@ -137,12 +137,12 @@ Rectangle {
Transition {
to: "current"
SequentialAnimation {
- NumberAnimation { matchProperties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
}
},
Transition {
- NumberAnimation { matchProperties: "x"; duration: 250 }
- NumberAnimation { matchProperties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
}
]
Keys.onPressed: { root.keyPressed = true; }
@@ -177,11 +177,11 @@ Rectangle {
Transition {
to: "current"
SequentialAnimation {
- NumberAnimation { matchProperties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
}
},
Transition {
- NumberAnimation { matchProperties: "x"; duration: 250 }
+ NumberAnimation { properties: "x"; duration: 250 }
}
]
Keys.onPressed: { root.keyPressed = true; }
diff --git a/tools/qml/qdeclarativefolderlistmodel.cpp b/tools/qml/qdeclarativefolderlistmodel.cpp
index 58bf59b..d36033d 100644
--- a/tools/qml/qdeclarativefolderlistmodel.cpp
+++ b/tools/qml/qdeclarativefolderlistmodel.cpp
@@ -413,7 +413,7 @@ void QDeclarativeFolderListModel::setShowOnlyReadable(bool on)
void QDeclarativeFolderListModel::registerTypes()
{
- QML_REGISTER_TYPE(Qt,4,6,FolderListModel,QDeclarativeFolderListModel);
+ qmlRegisterType<QDeclarativeFolderListModel>("Qt",4,6,"FolderListModel");
}
QT_END_NAMESPACE
diff --git a/tools/qml/qfxtester.cpp b/tools/qml/qfxtester.cpp
index 638a3c9..28bbf5e 100644
--- a/tools/qml/qfxtester.cpp
+++ b/tools/qml/qfxtester.cpp
@@ -372,10 +372,10 @@ void QDeclarativeTester::updateCurrentTime(int msec)
void QDeclarativeTester::registerTypes()
{
- QML_REGISTER_TYPE(Qt.VisualTest, 4,6, VisualTest, QDeclarativeVisualTest);
- QML_REGISTER_TYPE(Qt.VisualTest, 4,6, Frame, QDeclarativeVisualTestFrame);
- QML_REGISTER_TYPE(Qt.VisualTest, 4,6, Mouse, QDeclarativeVisualTestMouse);
- QML_REGISTER_TYPE(Qt.VisualTest, 4,6, Key, QDeclarativeVisualTestKey);
+ qmlRegisterType<QDeclarativeVisualTest>("Qt.VisualTest", 4,6, "VisualTest");
+ qmlRegisterType<QDeclarativeVisualTestFrame>("Qt.VisualTest", 4,6, "Frame");
+ qmlRegisterType<QDeclarativeVisualTestMouse>("Qt.VisualTest", 4,6, "Mouse");
+ qmlRegisterType<QDeclarativeVisualTestKey>("Qt.VisualTest", 4,6, "Key");
}
QT_END_NAMESPACE
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 9b68dbc..0579493 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -55,6 +55,6 @@ symbian {
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h
- LIBS += -lesock -lconnmon -linsock
+ LIBS += -lesock -lcommdb -linsock
TARGET.CAPABILITY = "All -TCB"
}
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 7da3f5a..c7acf2c 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -1444,10 +1444,15 @@ void QDeclarativeViewer::setUseGL(bool useGL)
#ifdef GL_SUPPORTED
if (useGL) {
QGLFormat format = QGLFormat::defaultFormat();
+#ifdef Q_WS_MAC
+ format.setSampleBuffers(true);
+#else
format.setSampleBuffers(false);
+#endif
QGLWidget *glWidget = new QGLWidget(format);
glWidget->setAutoFillBackground(false);
+
canvas->setViewport(glWidget);
}
#endif
@@ -1460,7 +1465,7 @@ void QDeclarativeViewer::setUseNativeFileBrowser(bool use)
void QDeclarativeViewer::registerTypes()
{
- QML_REGISTER_TYPE(QDeclarativeViewer, 1, 0, Screen, Screen);
+ qmlRegisterType<Screen>("QDeclarativeViewer", 1, 0, "Screen");
}
QT_END_NAMESPACE
diff --git a/translations/qt_da.ts b/translations/qt_da.ts
index 6267bb2..515ed50 100644
--- a/translations/qt_da.ts
+++ b/translations/qt_da.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="da_DK">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Tjenester</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Skjul %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Skjul andre</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Vis alle</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index f02a7bb..2108774 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="de">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Dienste</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>%1 ausblenden</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Andere ausblenden</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Alle anzeigen</translation>
+ </message>
+</context>
+<context>
<name>CloseButton</name>
<message>
<location filename="../src/gui/widgets/qtabbar.cpp" line="+2266"/>
diff --git a/translations/qt_es.ts b/translations/qt_es.ts
index e65f092..596864a 100644
--- a/translations/qt_es.ts
+++ b/translations/qt_es.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="es">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Servicios</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Ocultar %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Ocultar otros</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Mostrar todo</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_fr.ts b/translations/qt_fr.ts
index 3186a1f..322fb65 100644
--- a/translations/qt_fr.ts
+++ b/translations/qt_fr.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="fr">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Services</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Masquer %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Masquer les autres</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Tout afficher</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_ja_JP.ts b/translations/qt_ja_JP.ts
index 493f3a2..f0dae3a 100644
--- a/translations/qt_ja_JP.ts
+++ b/translations/qt_ja_JP.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="ja">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>サービス</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>%1ã‚’éš ã™</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>ã»ã‹ã‚’éš ã™</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>ã™ã¹ã¦ã‚’表示</translation>
+ </message>
+</context>
+<context>
<name>CloseButton</name>
<message>
<location filename="../src/gui/widgets/qtabbar.cpp" line="+2253"/>
diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts
index e219c9a..bf6e1fe 100644
--- a/translations/qt_pl.ts
+++ b/translations/qt_pl.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="pl">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Usługi</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Ukryj %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Ukryj pozostałe</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Pokaż wszystko</translation>
+ </message>
+</context>
+<context>
<name>CloseButton</name>
<message>
<location filename="../src/gui/widgets/qtabbar.cpp" line="+2264"/>
diff --git a/translations/qt_pt.ts b/translations/qt_pt.ts
index 101267c..7ca7fe7 100644
--- a/translations/qt_pt.ts
+++ b/translations/qt_pt.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="pt_PT">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Serviços</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Ocultar %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Ocultar Outros</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Mostrar Tudo</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts
index 9a2ad84..641d7aa 100644
--- a/translations/qt_ru.ts
+++ b/translations/qt_ru.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="ru_RU">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Службы</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Скрыть %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Скрыть оÑтальные</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Показать вÑе</translation>
+ </message>
+</context>
+<context>
<name>CloseButton</name>
<message>
<location filename="../src/gui/widgets/qtabbar.cpp" line="+2264"/>
diff --git a/translations/qt_sv.ts b/translations/qt_sv.ts
index 61fc081..391af4a 100644
--- a/translations/qt_sv.ts
+++ b/translations/qt_sv.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>Tjänster</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>Göm %1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>Göm övriga</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>Visa alla</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_zh_CN.ts b/translations/qt_zh_CN.ts
index a3f20a1..d6a995d 100644
--- a/translations/qt_zh_CN.ts
+++ b/translations/qt_zh_CN.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="zh">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>æœåŠ¡</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>éšè—%1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>éšè—其他</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>全部显示</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/qt_zh_TW.ts b/translations/qt_zh_TW.ts
index a2cd27e..50c0048 100644
--- a/translations/qt_zh_TW.ts
+++ b/translations/qt_zh_TW.ts
@@ -2,6 +2,29 @@
<!DOCTYPE TS>
<TS version="2.0" language="zh_TW">
<context>
+ <name>MAC_APPLICATION_MENU</name>
+ <message>
+ <location filename="../src/gui/kernel/qapplication.cpp" line="+2316"/>
+ <source>Services</source>
+ <translation>æœå‹™</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide %1</source>
+ <translation>éš±è—%1</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Hide Others</source>
+ <translation>éš±è—其他</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show All</source>
+ <translation>顯示全部</translation>
+ </message>
+</context>
+<context>
<name>AudioOutput</name>
<message>
<location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+375"/>
diff --git a/translations/translations.pro b/translations/translations.pro
index f1b9c99..8f37451 100644
--- a/translations/translations.pro
+++ b/translations/translations.pro
@@ -42,5 +42,6 @@ isEmpty(vcproj) {
translations.path = $$[QT_INSTALL_TRANSLATIONS]
translations.files = $$TRANSLATIONS
translations.files ~= s,\\.ts$,.qm,g
+translations.files ~= s,^,$$OUT_PWD/,g
translations.CONFIG += no_check_exist
INSTALLS += translations
diff --git a/util/unicode/.gitattributes b/util/unicode/.gitattributes
new file mode 100644
index 0000000..772b88f
--- /dev/null
+++ b/util/unicode/.gitattributes
@@ -0,0 +1 @@
+data/*.txt -crlf
diff --git a/util/unicode/data/CompositionExclusions.txt b/util/unicode/data/CompositionExclusions.txt
deleted file mode 100644
index 8a9b7be..0000000
--- a/util/unicode/data/CompositionExclusions.txt
+++ /dev/null
@@ -1,197 +0,0 @@
-# CompositionExclusions-5.0.0.txt
-# Date: 2006-05-23, 12:42:00 PST [KW]
-#
-# This file lists the characters for the Composition Exclusion Table
-# defined in UAX #15, Unicode Normalization Forms.
-#
-# This file is a normative contributory data file in the
-# Unicode Character Database.
-#
-# Copyright (c) 1991-2006 Unicode, Inc.
-# For terms of use, see http://www.unicode.org/terms_of_use.html
-#
-# For more information, see
-# http://www.unicode.org/unicode/reports/tr15/#Primary Exclusion List Table
-#
-# For a full derivation of composition exclusions, see the derived property
-# Full_Composition_Exclusion in DerivedNormalizationProps.txt
-#
-
-# ================================================
-# (1) Script Specifics
-#
-# This list of characters cannot be derived from the UnicodeData.txt file.
-# ================================================
-
-0958 # DEVANAGARI LETTER QA
-0959 # DEVANAGARI LETTER KHHA
-095A # DEVANAGARI LETTER GHHA
-095B # DEVANAGARI LETTER ZA
-095C # DEVANAGARI LETTER DDDHA
-095D # DEVANAGARI LETTER RHA
-095E # DEVANAGARI LETTER FA
-095F # DEVANAGARI LETTER YYA
-09DC # BENGALI LETTER RRA
-09DD # BENGALI LETTER RHA
-09DF # BENGALI LETTER YYA
-0A33 # GURMUKHI LETTER LLA
-0A36 # GURMUKHI LETTER SHA
-0A59 # GURMUKHI LETTER KHHA
-0A5A # GURMUKHI LETTER GHHA
-0A5B # GURMUKHI LETTER ZA
-0A5E # GURMUKHI LETTER FA
-0B5C # ORIYA LETTER RRA
-0B5D # ORIYA LETTER RHA
-0F43 # TIBETAN LETTER GHA
-0F4D # TIBETAN LETTER DDHA
-0F52 # TIBETAN LETTER DHA
-0F57 # TIBETAN LETTER BHA
-0F5C # TIBETAN LETTER DZHA
-0F69 # TIBETAN LETTER KSSA
-0F76 # TIBETAN VOWEL SIGN VOCALIC R
-0F78 # TIBETAN VOWEL SIGN VOCALIC L
-0F93 # TIBETAN SUBJOINED LETTER GHA
-0F9D # TIBETAN SUBJOINED LETTER DDHA
-0FA2 # TIBETAN SUBJOINED LETTER DHA
-0FA7 # TIBETAN SUBJOINED LETTER BHA
-0FAC # TIBETAN SUBJOINED LETTER DZHA
-0FB9 # TIBETAN SUBJOINED LETTER KSSA
-FB1D # HEBREW LETTER YOD WITH HIRIQ
-FB1F # HEBREW LIGATURE YIDDISH YOD YOD PATAH
-FB2A # HEBREW LETTER SHIN WITH SHIN DOT
-FB2B # HEBREW LETTER SHIN WITH SIN DOT
-FB2C # HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT
-FB2D # HEBREW LETTER SHIN WITH DAGESH AND SIN DOT
-FB2E # HEBREW LETTER ALEF WITH PATAH
-FB2F # HEBREW LETTER ALEF WITH QAMATS
-FB30 # HEBREW LETTER ALEF WITH MAPIQ
-FB31 # HEBREW LETTER BET WITH DAGESH
-FB32 # HEBREW LETTER GIMEL WITH DAGESH
-FB33 # HEBREW LETTER DALET WITH DAGESH
-FB34 # HEBREW LETTER HE WITH MAPIQ
-FB35 # HEBREW LETTER VAV WITH DAGESH
-FB36 # HEBREW LETTER ZAYIN WITH DAGESH
-FB38 # HEBREW LETTER TET WITH DAGESH
-FB39 # HEBREW LETTER YOD WITH DAGESH
-FB3A # HEBREW LETTER FINAL KAF WITH DAGESH
-FB3B # HEBREW LETTER KAF WITH DAGESH
-FB3C # HEBREW LETTER LAMED WITH DAGESH
-FB3E # HEBREW LETTER MEM WITH DAGESH
-FB40 # HEBREW LETTER NUN WITH DAGESH
-FB41 # HEBREW LETTER SAMEKH WITH DAGESH
-FB43 # HEBREW LETTER FINAL PE WITH DAGESH
-FB44 # HEBREW LETTER PE WITH DAGESH
-FB46 # HEBREW LETTER TSADI WITH DAGESH
-FB47 # HEBREW LETTER QOF WITH DAGESH
-FB48 # HEBREW LETTER RESH WITH DAGESH
-FB49 # HEBREW LETTER SHIN WITH DAGESH
-FB4A # HEBREW LETTER TAV WITH DAGESH
-FB4B # HEBREW LETTER VAV WITH HOLAM
-FB4C # HEBREW LETTER BET WITH RAFE
-FB4D # HEBREW LETTER KAF WITH RAFE
-FB4E # HEBREW LETTER PE WITH RAFE
-
-# Total code points: 67
-
-# ================================================
-# (2) Post Composition Version precomposed characters
-#
-# These characters cannot be derived solely from the UnicodeData.txt file
-# in this version of Unicode.
-#
-# Note that characters added to the standard after the
-# Composition Version and which have canonical decomposition mappings
-# are not automatically added to this list of Post Composition
-# Version precomposed characters.
-# ================================================
-
-2ADC # FORKING
-1D15E # MUSICAL SYMBOL HALF NOTE
-1D15F # MUSICAL SYMBOL QUARTER NOTE
-1D160 # MUSICAL SYMBOL EIGHTH NOTE
-1D161 # MUSICAL SYMBOL SIXTEENTH NOTE
-1D162 # MUSICAL SYMBOL THIRTY-SECOND NOTE
-1D163 # MUSICAL SYMBOL SIXTY-FOURTH NOTE
-1D164 # MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
-1D1BB # MUSICAL SYMBOL MINIMA
-1D1BC # MUSICAL SYMBOL MINIMA BLACK
-1D1BD # MUSICAL SYMBOL SEMIMINIMA WHITE
-1D1BE # MUSICAL SYMBOL SEMIMINIMA BLACK
-1D1BF # MUSICAL SYMBOL FUSA WHITE
-1D1C0 # MUSICAL SYMBOL FUSA BLACK
-
-# Total code points: 14
-
-# ================================================
-# (3) Singleton Decompositions
-#
-# These characters can be derived from the UnicodeData.txt file
-# by including all characters whose canonical decomposition
-# consists of a single character.
-#
-# These characters are simply quoted here for reference.
-# See also Full_Composition_Exclusion in DerivedNormalizationProps.txt
-# ================================================
-
-# 0340..0341 [2] COMBINING GRAVE TONE MARK..COMBINING ACUTE TONE MARK
-# 0343 COMBINING GREEK KORONIS
-# 0374 GREEK NUMERAL SIGN
-# 037E GREEK QUESTION MARK
-# 0387 GREEK ANO TELEIA
-# 1F71 GREEK SMALL LETTER ALPHA WITH OXIA
-# 1F73 GREEK SMALL LETTER EPSILON WITH OXIA
-# 1F75 GREEK SMALL LETTER ETA WITH OXIA
-# 1F77 GREEK SMALL LETTER IOTA WITH OXIA
-# 1F79 GREEK SMALL LETTER OMICRON WITH OXIA
-# 1F7B GREEK SMALL LETTER UPSILON WITH OXIA
-# 1F7D GREEK SMALL LETTER OMEGA WITH OXIA
-# 1FBB GREEK CAPITAL LETTER ALPHA WITH OXIA
-# 1FBE GREEK PROSGEGRAMMENI
-# 1FC9 GREEK CAPITAL LETTER EPSILON WITH OXIA
-# 1FCB GREEK CAPITAL LETTER ETA WITH OXIA
-# 1FD3 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
-# 1FDB GREEK CAPITAL LETTER IOTA WITH OXIA
-# 1FE3 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
-# 1FEB GREEK CAPITAL LETTER UPSILON WITH OXIA
-# 1FEE..1FEF [2] GREEK DIALYTIKA AND OXIA..GREEK VARIA
-# 1FF9 GREEK CAPITAL LETTER OMICRON WITH OXIA
-# 1FFB GREEK CAPITAL LETTER OMEGA WITH OXIA
-# 1FFD GREEK OXIA
-# 2000..2001 [2] EN QUAD..EM QUAD
-# 2126 OHM SIGN
-# 212A..212B [2] KELVIN SIGN..ANGSTROM SIGN
-# 2329 LEFT-POINTING ANGLE BRACKET
-# 232A RIGHT-POINTING ANGLE BRACKET
-# F900..FA0D [270] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA0D
-# FA10 CJK COMPATIBILITY IDEOGRAPH-FA10
-# FA12 CJK COMPATIBILITY IDEOGRAPH-FA12
-# FA15..FA1E [10] CJK COMPATIBILITY IDEOGRAPH-FA15..CJK COMPATIBILITY IDEOGRAPH-FA1E
-# FA20 CJK COMPATIBILITY IDEOGRAPH-FA20
-# FA22 CJK COMPATIBILITY IDEOGRAPH-FA22
-# FA25..FA26 [2] CJK COMPATIBILITY IDEOGRAPH-FA25..CJK COMPATIBILITY IDEOGRAPH-FA26
-# FA2A..FA2D [4] CJK COMPATIBILITY IDEOGRAPH-FA2A..CJK COMPATIBILITY IDEOGRAPH-FA2D
-# FA30..FA6A [59] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6A
-# FA70..FAD9 [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9
-# 2F800..2FA1D [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
-
-# Total code points: 924
-
-# ================================================
-# (4) Non-Starter Decompositions
-#
-# These characters can be derived from the UnicodeData file
-# by including all characters whose canonical decomposition consists
-# of a sequence of characters, the first of which has a non-zero
-# combining class.
-#
-# These characters are simply quoted here for reference.
-# See also Full_Composition_Exclusion in DerivedNormalizationProps.txt
-# ================================================
-
-# 0344 COMBINING GREEK DIALYTIKA TONOS
-# 0F73 TIBETAN VOWEL SIGN II
-# 0F75 TIBETAN VOWEL SIGN UU
-# 0F81 TIBETAN VOWEL SIGN REVERSED II
-
-# Total code points: 4
-
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 8f27d4a..f2ebe7c 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -38,36 +38,56 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <qlist.h>
#include <qhash.h>
#include <qfile.h>
+#include <qbytearray.h>
#include <qstring.h>
#include <qchar.h>
-#include <private/qunicodetables_p.h>
#include <qvector.h>
#include <qdebug.h>
+#if 0
+#include <private/qunicodetables_p.h>
+#endif
+#define DATA_VERSION_S "5.0"
+#define DATA_VERSION_STR "QChar::Unicode_5_0"
+
+#define LAST_CODEPOINT 0x10ffff
+#define LAST_CODEPOINT_STR "0x10ffff"
+
+
+static QHash<QByteArray, QChar::UnicodeVersion> age_map;
+
+static void initAgeMap()
+{
+ struct AgeMap {
+ const QChar::UnicodeVersion version;
+ const char *age;
+ } ageMap[] = {
+ { QChar::Unicode_1_1, "1.1" },
+ { QChar::Unicode_2_0, "2.0" },
+ { QChar::Unicode_2_1_2, "2.1" },
+ { QChar::Unicode_3_0, "3.0" },
+ { QChar::Unicode_3_1, "3.1" },
+ { QChar::Unicode_3_2, "3.2" },
+ { QChar::Unicode_4_0, "4.0" },
+ { QChar::Unicode_4_1, "4.1" },
+ { QChar::Unicode_5_0, "5.0" },
+ { QChar::Unicode_Unassigned, 0 }
+ };
+ AgeMap *d = ageMap;
+ while (d->age) {
+ age_map.insert(d->age, d->version);
+ ++d;
+ }
+}
-static struct AgeMap {
- const char *age;
- const QChar::UnicodeVersion version;
-} ageMap [] = {
- { "1.1", QChar::Unicode_1_1 },
- { "2.0", QChar::Unicode_2_0 },
- { "2.1", QChar::Unicode_2_1_2 },
- { "3.0", QChar::Unicode_3_0 },
- { "3.1", QChar::Unicode_3_1 },
- { "3.2", QChar::Unicode_3_2 },
- { "4.0", QChar::Unicode_4_0 },
- { "4.1", QChar::Unicode_4_1 },
- { "5.0", QChar::Unicode_5_0 },
- { 0, QChar::Unicode_Unassigned }
-};
-#define CURRENT_UNICODE_VERSION "QChar::Unicode_5_0"
static const char *grapheme_break_string =
" enum GraphemeBreak {\n"
- " GraphemeBreakOther, \n"
+ " GraphemeBreakOther,\n"
" GraphemeBreakCR,\n"
" GraphemeBreakLF,\n"
" GraphemeBreakControl,\n"
@@ -90,9 +110,11 @@ enum GraphemeBreak {
GraphemeBreakT,
GraphemeBreakLV,
GraphemeBreakLVT
+
+ , GraphemeBreak_Unassigned
};
-QHash<QByteArray, GraphemeBreak> grapheme_break_map;
+static QHash<QByteArray, GraphemeBreak> grapheme_break_map;
static void initGraphemeBreak()
{
@@ -110,7 +132,7 @@ static void initGraphemeBreak()
{ GraphemeBreakT, "T" },
{ GraphemeBreakLV, "LV" },
{ GraphemeBreakLVT, "LVT" },
- { GraphemeBreakOther, 0 }
+ { GraphemeBreak_Unassigned, 0 }
};
GraphemeBreakList *d = breaks;
while (d->name) {
@@ -119,7 +141,8 @@ static void initGraphemeBreak()
}
}
-const char *word_break_string =
+
+static const char *word_break_string =
" enum WordBreak {\n"
" WordBreakOther,\n"
" WordBreakFormat,\n"
@@ -140,10 +163,11 @@ enum WordBreak {
WordBreakMidNum,
WordBreakNumeric,
WordBreakExtendNumLet
-};
+ , WordBreak_Unassigned
+};
-QHash<QByteArray, WordBreak> word_break_map;
+static QHash<QByteArray, WordBreak> word_break_map;
static void initWordBreak()
{
@@ -159,7 +183,7 @@ static void initWordBreak()
{ WordBreakMidNum, "MidNum" },
{ WordBreakNumeric, "Numeric" },
{ WordBreakExtendNumLet, "ExtendNumLet" },
- { WordBreakFormat, 0 }
+ { WordBreak_Unassigned, 0 }
};
WordBreakList *d = breaks;
while (d->name) {
@@ -196,10 +220,11 @@ enum SentenceBreak {
SentenceBreakATerm,
SentenceBreakSTerm,
SentenceBreakClose
-};
+ , SentenceBreak_Unassigned
+};
-QHash<QByteArray, SentenceBreak> sentence_break_map;
+static QHash<QByteArray, SentenceBreak> sentence_break_map;
static void initSentenceBreak()
{
@@ -218,7 +243,7 @@ static void initSentenceBreak()
{ SentenceBreakATerm, "ATerm" },
{ SentenceBreakSTerm, "STerm" },
{ SentenceBreakClose, "Close" },
- { SentenceBreakOther, 0 }
+ { SentenceBreak_Unassigned, 0 }
};
SentenceBreakList *d = breaks;
while (d->name) {
@@ -228,33 +253,7 @@ static void initSentenceBreak()
}
-// Keep this one in sync with the code in createPropertyInfo
-const char *property_string =
- " struct Properties {\n"
- " ushort category : 8;\n"
- " ushort line_break_class : 8;\n"
- " ushort direction : 8;\n"
- " ushort combiningClass :8;\n"
- " ushort joining : 2;\n"
- " signed short digitValue : 6; /* 5 needed */\n"
- " ushort unicodeVersion : 4;\n"
- " ushort lowerCaseSpecial : 1;\n"
- " ushort upperCaseSpecial : 1;\n"
- " ushort titleCaseSpecial : 1;\n"
- " ushort caseFoldSpecial : 1; /* currently unused */\n"
- " signed short mirrorDiff : 16;\n"
- " signed short lowerCaseDiff : 16;\n"
- " signed short upperCaseDiff : 16;\n"
- " signed short titleCaseDiff : 16;\n"
- " signed short caseFoldDiff : 16;\n"
- " ushort graphemeBreak : 8;\n"
- " ushort wordBreak : 8;\n"
- " ushort sentenceBreak : 8;\n"
- " };\n"
- " Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);\n"
- " Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);\n";
-
-const char *lineBreakClass =
+static const char *lineBreakClass =
" // see http://www.unicode.org/reports/tr14/tr14-19.html\n"
" // we don't use the XX, AI and CB properties and map them to AL instead.\n"
" // as we don't support any EBDIC based OS'es, NL is ignored and mapped to AL as well.\n"
@@ -268,16 +267,108 @@ const char *lineBreakClass =
" LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK\n"
" };\n\n";
-const char *methods =
+enum LineBreakClass {
+ LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS,
+ LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO,
+ LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY,
+ LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM,
+ LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV,
+ LineBreak_JT, LineBreak_SA, LineBreak_SG,
+ LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK
+
+ , LineBreak_Unassigned
+};
+
+static QHash<QByteArray, LineBreakClass> line_break_map;
+
+static void initLineBreak()
+{
+ // ### Classes XX and AI are left out and mapped to AL for now;
+ // ### Class NL is ignored and mapped to AL as well.
+ struct LineBreakList {
+ LineBreakClass brk;
+ const char *name;
+ } breaks[] = {
+ { LineBreak_BK, "BK" },
+ { LineBreak_CR, "CR" },
+ { LineBreak_LF, "LF" },
+ { LineBreak_CM, "CM" },
+ { LineBreak_AL, "NL" },
+ { LineBreak_SG, "SG" },
+ { LineBreak_WJ, "WJ" },
+ { LineBreak_ZW, "ZW" },
+ { LineBreak_GL, "GL" },
+ { LineBreak_SP, "SP" },
+ { LineBreak_B2, "B2" },
+ { LineBreak_BA, "BA" },
+ { LineBreak_BB, "BB" },
+ { LineBreak_HY, "HY" },
+ { LineBreak_AL, "CB" }, // ###
+ { LineBreak_CL, "CL" },
+ { LineBreak_EX, "EX" },
+ { LineBreak_IN, "IN" },
+ { LineBreak_NS, "NS" },
+ { LineBreak_OP, "OP" },
+ { LineBreak_QU, "QU" },
+ { LineBreak_IS, "IS" },
+ { LineBreak_NU, "NU" },
+ { LineBreak_PO, "PO" },
+ { LineBreak_PR, "PR" },
+ { LineBreak_SY, "SY" },
+ { LineBreak_AL, "AI" },
+ { LineBreak_AL, "AL" },
+ { LineBreak_H2, "H2" },
+ { LineBreak_H3, "H3" },
+ { LineBreak_ID, "ID" },
+ { LineBreak_JL, "JL" },
+ { LineBreak_JV, "JV" },
+ { LineBreak_JT, "JT" },
+ { LineBreak_SA, "SA" },
+ { LineBreak_AL, "XX" },
+ { LineBreak_Unassigned, 0 }
+ };
+ LineBreakList *d = breaks;
+ while (d->name) {
+ line_break_map.insert(d->name, d->brk);
+ ++d;
+ }
+}
+
+
+// Keep this one in sync with the code in createPropertyInfo
+static const char *property_string =
+ " struct Properties {\n"
+ " ushort category : 8; /* 5 needed */\n"
+ " ushort line_break_class : 8; /* 6 needed */\n"
+ " ushort direction : 8; /* 5 needed */\n"
+ " ushort combiningClass : 8;\n"
+ " ushort joining : 2;\n"
+ " signed short digitValue : 6; /* 5 needed */\n"
+ " ushort unicodeVersion : 4;\n"
+ " ushort lowerCaseSpecial : 1;\n"
+ " ushort upperCaseSpecial : 1;\n"
+ " ushort titleCaseSpecial : 1;\n"
+ " ushort caseFoldSpecial : 1; /* currently unused */\n"
+ " signed short mirrorDiff : 16;\n"
+ " signed short lowerCaseDiff : 16;\n"
+ " signed short upperCaseDiff : 16;\n"
+ " signed short titleCaseDiff : 16;\n"
+ " signed short caseFoldDiff : 16;\n"
+ " ushort graphemeBreak : 8; /* 4 needed */\n"
+ " ushort wordBreak : 8; /* 4 needed */\n"
+ " ushort sentenceBreak : 8; /* 4 needed */\n"
+ " };\n"
+ " Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);\n"
+ " Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);\n";
+
+static const char *methods =
" Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);\n"
- " inline int lineBreakClass(const QChar &ch) {\n"
- " return QUnicodeTables::lineBreakClass(ch.unicode());\n"
- " }\n"
+ " inline int lineBreakClass(const QChar &ch)\n"
+ " { return lineBreakClass(ch.unicode()); }\n"
"\n"
" Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4);\n"
- " Q_CORE_EXPORT_INLINE int QT_FASTCALL script(const QChar &ch) {\n"
- " return script(ch.unicode());\n"
- " }\n\n";
+ " inline int script(const QChar &ch)\n"
+ " { return script(ch.unicode()); }\n\n";
struct PropertyFlags {
@@ -312,7 +403,7 @@ struct PropertyFlags {
// from DerivedAge.txt
QChar::UnicodeVersion age : 4;
int digitValue;
- uint line_break_class : 5;
+ uint line_break_class : 6;
int mirrorDiff : 16;
@@ -329,8 +420,9 @@ struct PropertyFlags {
SentenceBreak sentenceBreak;
};
-QList<int> specialCaseMap;
-int specialCaseMaxLen = 0;
+
+static QList<int> specialCaseMap;
+static int specialCaseMaxLen = 0;
static int appendToSpecialCaseMap(const QList<int> &map)
{
@@ -347,7 +439,7 @@ static int appendToSpecialCaseMap(const QList<int> &map)
specialCaseMaxLen = qMax(specialCaseMaxLen, utf16map.size());
utf16map << 0;
- for (int i = 0; i < specialCaseMap.size() - utf16map.size() - 1; ++i) {
+ for (int i = 0; i < specialCaseMap.size() - utf16map.size() + 1; ++i) {
int j;
for (j = 0; j < utf16map.size(); ++j) {
if (specialCaseMap.at(i+j) != utf16map.at(j))
@@ -364,7 +456,7 @@ static int appendToSpecialCaseMap(const QList<int> &map)
struct UnicodeData {
UnicodeData(int codepoint = 0) {
- p.category = QChar::NoCategory;
+ p.category = QChar::Other_NotAssigned; // Cn
p.combiningClass = 0;
p.direction = QChar::DirL;
@@ -387,7 +479,7 @@ struct UnicodeData {
p.age = QChar::Unicode_Unassigned;
p.mirrorDiff = 0;
p.digitValue = -1;
- p.line_break_class = QUnicodeTables::LineBreak_AL;
+ p.line_break_class = LineBreak_AL; // XX -> AL
p.lowerCaseDiff = 0;
p.upperCaseDiff = 0;
p.titleCaseDiff = 0;
@@ -438,14 +530,15 @@ enum UniDataFields {
UD_TitleCase
};
-QHash<QByteArray, QChar::Category> categoryMap;
+
+static QHash<QByteArray, QChar::Category> categoryMap;
static void initCategoryMap()
{
struct Cat {
QChar::Category cat;
const char *name;
- } categories [] = {
+ } categories[] = {
{ QChar::Mark_NonSpacing, "Mn" },
{ QChar::Mark_SpacingCombining, "Mc" },
{ QChar::Mark_Enclosing, "Me" },
@@ -485,13 +578,14 @@ static void initCategoryMap()
{ QChar::NoCategory, 0 }
};
Cat *c = categories;
- while (c->cat != QChar::NoCategory) {
+ while (c->name) {
categoryMap.insert(c->name, c->cat);
++c;
}
}
-QHash<QByteArray, QChar::Direction> directionMap;
+
+static QHash<QByteArray, QChar::Direction> directionMap;
static void initDirectionMap()
{
@@ -528,7 +622,7 @@ static void initDirectionMap()
}
-QHash<QByteArray, QChar::Decomposition> decompositionMap;
+static QHash<QByteArray, QChar::Decomposition> decompositionMap;
static void initDecompositionMap()
{
@@ -553,7 +647,7 @@ static void initDecompositionMap()
{ QChar::Square, "<square>" },
{ QChar::Compat, "<compat>" },
{ QChar::Fraction, "<fraction>" },
- { QChar::NoDecomposition, 0 }
+ { QChar::NoDecomposition, 0 }
};
Dec *d = decompositions;
while (d->name) {
@@ -563,28 +657,31 @@ static void initDecompositionMap()
}
-QHash<int, UnicodeData> unicodeData;
-QList<PropertyFlags> uniqueProperties;
+static QHash<int, UnicodeData> unicodeData;
+static QList<PropertyFlags> uniqueProperties;
-QHash<int, int> decompositionLength;
-int highestComposedCharacter = 0;
-int numLigatures = 0;
-int highestLigature = 0;
+static QHash<int, int> decompositionLength;
+static int highestComposedCharacter = 0;
+static int numLigatures = 0;
+static int highestLigature = 0;
-struct Ligature {ushort u1; ushort u2; ushort ligature;};
+struct Ligature {
+ ushort u1;
+ ushort u2;
+ ushort ligature;
+};
// we need them sorted after the first component for fast lookup
-bool operator < (const Ligature &l1, const Ligature &l2) {
- return l1.u1 < l2.u1;
-}
+bool operator < (const Ligature &l1, const Ligature &l2)
+{ return l1.u1 < l2.u1; }
-QHash<ushort, QList<Ligature> > ligatureHashes;
+static QHash<ushort, QList<Ligature> > ligatureHashes;
-QHash<int, int> combiningClassUsage;
+static QHash<int, int> combiningClassUsage;
-int maxLowerCaseDiff = 0;
-int maxUpperCaseDiff = 0;
-int maxTitleCaseDiff = 0;
+static int maxLowerCaseDiff = 0;
+static int maxUpperCaseDiff = 0;
+static int maxTitleCaseDiff = 0;
static void readUnicodeData()
{
@@ -609,6 +706,8 @@ static void readUnicodeData()
QList<QByteArray> properties = line.split(';');
bool ok;
int codepoint = properties[UD_Value].toInt(&ok, 16);
+ Q_ASSERT(ok);
+ Q_ASSERT(codepoint <= LAST_CODEPOINT);
int lastCodepoint = codepoint;
QByteArray name = properties[UD_Name];
@@ -617,11 +716,16 @@ static void readUnicodeData()
nextLine.resize(1024);
f.readLine(nextLine.data(), 1024);
QList<QByteArray> properties = nextLine.split(';');
+ Q_ASSERT(properties[UD_Name].startsWith('<') && properties[UD_Name].contains("Last"));
lastCodepoint = properties[UD_Value].toInt(&ok, 16);
+ Q_ASSERT(ok);
+ Q_ASSERT(lastCodepoint <= LAST_CODEPOINT);
}
UnicodeData data(codepoint);
data.p.category = categoryMap.value(properties[UD_Category], QChar::NoCategory);
+ if (data.p.category == QChar::NoCategory)
+ qFatal("unassigned char category: %s", properties[UD_Category].constData());
data.p.combiningClass = properties[UD_CombiningClass].toInt();
if (!combiningClassUsage.contains(data.p.combiningClass))
@@ -634,6 +738,8 @@ static void readUnicodeData()
if (!properties[UD_UpperCase].isEmpty()) {
int upperCase = properties[UD_UpperCase].toInt(&ok, 16);
Q_ASSERT(ok);
+ if (qAbs(upperCase - codepoint) >= (1<<14))
+ qWarning() << "upperCaseDiff exceeded (" << hex << codepoint << "->" << upperCase << ")";
data.p.upperCaseDiff = upperCase - codepoint;
maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(data.p.upperCaseDiff));
if (codepoint > 0xffff) {
@@ -644,7 +750,9 @@ static void readUnicodeData()
}
if (!properties[UD_LowerCase].isEmpty()) {
int lowerCase = properties[UD_LowerCase].toInt(&ok, 16);
- Q_ASSERT (ok);
+ Q_ASSERT(ok);
+ if (qAbs(lowerCase - codepoint) >= (1<<14))
+ qWarning() << "lowerCaseDiff exceeded (" << hex << codepoint << "->" << lowerCase << ")";
data.p.lowerCaseDiff = lowerCase - codepoint;
maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(data.p.lowerCaseDiff));
if (codepoint > 0xffff) {
@@ -658,7 +766,9 @@ static void readUnicodeData()
properties[UD_TitleCase] = properties[UD_UpperCase];
if (!properties[UD_TitleCase].isEmpty()) {
int titleCase = properties[UD_TitleCase].toInt(&ok, 16);
- Q_ASSERT (ok);
+ Q_ASSERT(ok);
+ if (qAbs(titleCase - codepoint) >= (1<<14))
+ qWarning() << "titleCaseDiff exceeded (" << hex << codepoint << "->" << titleCase << ")";
data.p.titleCaseDiff = titleCase - codepoint;
maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(data.p.titleCaseDiff));
if (codepoint > 0xffff) {
@@ -677,13 +787,17 @@ static void readUnicodeData()
highestComposedCharacter = qMax(highestComposedCharacter, codepoint);
QList<QByteArray> d = decomposition.split(' ');
if (d[0].contains('<')) {
- data.decompositionType = decompositionMap.value(d[0], QChar::Canonical);
+ data.decompositionType = decompositionMap.value(d[0], QChar::NoDecomposition);
+ if (data.decompositionType == QChar::NoDecomposition)
+ qFatal("unassigned decomposition type: %s", d[0].constData());
d.takeFirst();
} else {
data.decompositionType = QChar::Canonical;
}
- for (int i = 0; i < d.size(); ++i)
+ for (int i = 0; i < d.size(); ++i) {
data.decomposition.append(d[i].toInt(&ok, 16));
+ Q_ASSERT(ok);
+ }
if (!decompositionLength.contains(data.decomposition.size()))
decompositionLength[data.decomposition.size()] = 1;
else
@@ -725,14 +839,14 @@ static void readBidiMirroring()
bool ok;
int codepoint = pair[0].toInt(&ok, 16);
+ Q_ASSERT(ok);
int mirror = pair[1].toInt(&ok, 16);
+ Q_ASSERT(ok);
UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
d.mirroredChar = mirror;
- if (qAbs(codepoint-d.mirroredChar) > maxMirroredDiff)
- maxMirroredDiff = qAbs(codepoint - d.mirroredChar);
-
d.p.mirrorDiff = d.mirroredChar - codepoint;
+ maxMirroredDiff = qMax(maxMirroredDiff, qAbs(d.p.mirrorDiff));
unicodeData.insert(codepoint, d);
}
}
@@ -764,6 +878,8 @@ static void readArabicShaping()
bool ok;
int codepoint = shaping[0].toInt(&ok, 16);
+ Q_ASSERT(ok);
+
QChar::Joining j = QChar::OtherJoining;
QByteArray shape = shaping[2].trimmed();
if (shape == "R")
@@ -810,22 +926,17 @@ static void readDerivedAge()
bool ok;
int from = cl[0].toInt(&ok, 16);
+ Q_ASSERT(ok);
int to = from;
- if (cl.size() == 2)
+ if (cl.size() == 2) {
to = cl[1].toInt(&ok, 16);
-
- QChar::UnicodeVersion age = QChar::Unicode_Unassigned;
- QByteArray ba = l[1];
- AgeMap *map = ageMap;
- while (map->age) {
- if (ba == map->age) {
- age = map->version;
- break;
- }
- ++map;
+ Q_ASSERT(ok);
}
+
+ QChar::UnicodeVersion age = age_map.value(l[1].trimmed(), QChar::Unicode_Unassigned);
//qDebug() << hex << from << ".." << to << ba << age;
- Q_ASSERT(age != QChar::Unicode_Unassigned);
+ if (age == QChar::Unicode_Unassigned)
+ qFatal("unassigned or unhandled age value: %s", l[1].constData());
for (int codepoint = from; codepoint <= to; ++codepoint) {
UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
@@ -836,11 +947,11 @@ static void readDerivedAge()
}
-static void readCompositionExclusion()
+static void readDerivedNormalizationProps()
{
- QFile f("data/CompositionExclusions.txt");
+ QFile f("data/DerivedNormalizationProps.txt");
if (!f.exists())
- qFatal("Couldn't find CompositionExclusions.txt");
+ qFatal("Couldn't find DerivedNormalizationProps.txt");
f.open(QFile::ReadOnly);
@@ -853,42 +964,61 @@ static void readCompositionExclusion()
int comment = line.indexOf('#');
if (comment >= 0)
line = line.left(comment);
- line.replace(" ", "");
- if (line.isEmpty())
+ if (line.trimmed().isEmpty())
continue;
- Q_ASSERT(!line.contains(".."));
+ QList<QByteArray> l = line.split(';');
+ Q_ASSERT(l.size() >= 2);
+
+ QByteArray propName = l[1].trimmed();
+ if (propName != "Full_Composition_Exclusion")
+ // ###
+ continue;
+
+ QByteArray codes = l[0].trimmed();
+ codes.replace("..", ".");
+ QList<QByteArray> cl = codes.split('.');
bool ok;
- int codepoint = line.toInt(&ok, 16);
+ int from = cl[0].toInt(&ok, 16);
+ Q_ASSERT(ok);
+ int to = from;
+ if (cl.size() == 2) {
+ to = cl[1].toInt(&ok, 16);
+ Q_ASSERT(ok);
+ }
- UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
- d.excludedComposition = true;
- unicodeData.insert(codepoint, d);
+ for (int codepoint = from; codepoint <= to; ++codepoint) {
+ UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
+ d.excludedComposition = true;
+ unicodeData.insert(codepoint, d);
+ }
}
- for (int i = 0; i < 0x110000; ++i) {
- UnicodeData data = unicodeData.value(i, UnicodeData(i));
- if (!data.excludedComposition
- && data.decompositionType == QChar::Canonical
- && data.decomposition.size() > 1) {
- Q_ASSERT(data.decomposition.size() == 2);
-
- uint part1 = data.decomposition.at(0);
- uint part2 = data.decomposition.at(1);
- UnicodeData first = unicodeData.value(part1, UnicodeData(part1));
- if (first.p.combiningClass != 0)
- continue;
+ for (int codepoint = 0; codepoint <= LAST_CODEPOINT; ++codepoint) {
+ UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
+ if (!d.excludedComposition
+ && d.decompositionType == QChar::Canonical
+ && d.decomposition.size() > 1) {
+ Q_ASSERT(d.decomposition.size() == 2);
+
+ uint part1 = d.decomposition.at(0);
+ uint part2 = d.decomposition.at(1);
+
+ // all non-starters are listed in DerivedNormalizationProps.txt
+ // and already excluded from composition
+ Q_ASSERT(unicodeData.value(part1, UnicodeData(part1)).p.combiningClass == 0);
++numLigatures;
highestLigature = qMax(highestLigature, (int)part1);
- Ligature l = {(ushort)part1, (ushort)part2, i};
+ Ligature l = {(ushort)part1, (ushort)part2, codepoint};
ligatureHashes[part2].append(l);
}
}
}
+
struct NormalizationCorrection {
uint codepoint;
uint mapped;
@@ -933,10 +1063,12 @@ static QByteArray createNormalizationCorrections()
QList<QByteArray> fields = line.split(';');
Q_ASSERT(fields.size() == 4);
- NormalizationCorrection c;
+ NormalizationCorrection c = { 0, 0, 0 };
bool ok;
c.codepoint = fields.at(0).toInt(&ok, 16);
+ Q_ASSERT(ok);
c.mapped = fields.at(1).toInt(&ok, 16);
+ Q_ASSERT(ok);
if (fields.at(3) == "3.2.0")
c.version = QChar::Unicode_3_2;
else if (fields.at(3) == "4.0.0")
@@ -953,7 +1085,6 @@ static QByteArray createNormalizationCorrections()
"enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n\n";
-
return out;
}
@@ -961,7 +1092,7 @@ static QByteArray createNormalizationCorrections()
static void computeUniqueProperties()
{
qDebug("computeUniqueProperties:");
- for (int uc = 0; uc < 0x110000; ++uc) {
+ for (int uc = 0; uc <= LAST_CODEPOINT; ++uc) {
UnicodeData d = unicodeData.value(uc, UnicodeData(uc));
int index = uniqueProperties.indexOf(d.p);
@@ -972,7 +1103,7 @@ static void computeUniqueProperties()
d.propertyIndex = index;
unicodeData.insert(uc, d);
}
- qDebug(" %d unicode properties found", uniqueProperties.size());
+ qDebug(" %d unique unicode properties found", uniqueProperties.size());
}
@@ -1007,54 +1138,17 @@ static void readLineBreak()
bool ok;
int from = cl[0].toInt(&ok, 16);
+ Q_ASSERT(ok);
int to = from;
- if (cl.size() == 2)
+ if (cl.size() == 2) {
to = cl[1].toInt(&ok, 16);
-
- // ### Classes XX and AI are left out and mapped to AL for now
- QUnicodeTables::LineBreakClass lb = QUnicodeTables::LineBreak_AL;
- QByteArray ba = l[1];
-
- if (ba == "AI") lb = QUnicodeTables::LineBreak_AL;
- else if (ba == "XX") lb = QUnicodeTables::LineBreak_AL;
- else if (ba == "NL") lb = QUnicodeTables::LineBreak_AL;
- else if (ba == "OP") lb = QUnicodeTables::LineBreak_OP;
- else if (ba == "CL") lb = QUnicodeTables::LineBreak_CL;
- else if (ba == "QU") lb = QUnicodeTables::LineBreak_QU;
- else if (ba == "GL") lb = QUnicodeTables::LineBreak_GL;
- else if (ba == "NS") lb = QUnicodeTables::LineBreak_NS;
- else if (ba == "EX") lb = QUnicodeTables::LineBreak_EX;
- else if (ba == "SY") lb = QUnicodeTables::LineBreak_SY;
- else if (ba == "IS") lb = QUnicodeTables::LineBreak_IS;
- else if (ba == "PR") lb = QUnicodeTables::LineBreak_PR;
- else if (ba == "PO") lb = QUnicodeTables::LineBreak_PO;
- else if (ba == "NU") lb = QUnicodeTables::LineBreak_NU;
- else if (ba == "AL") lb = QUnicodeTables::LineBreak_AL;
- else if (ba == "ID") lb = QUnicodeTables::LineBreak_ID;
- else if (ba == "IN") lb = QUnicodeTables::LineBreak_IN;
- else if (ba == "HY") lb = QUnicodeTables::LineBreak_HY;
- else if (ba == "BA") lb = QUnicodeTables::LineBreak_BA;
- else if (ba == "BB") lb = QUnicodeTables::LineBreak_BB;
- else if (ba == "B2") lb = QUnicodeTables::LineBreak_B2;
- else if (ba == "ZW") lb = QUnicodeTables::LineBreak_ZW;
- else if (ba == "CM") lb = QUnicodeTables::LineBreak_CM;
- else if (ba == "SA") lb = QUnicodeTables::LineBreak_SA;
- else if (ba == "BK") lb = QUnicodeTables::LineBreak_BK;
- else if (ba == "CR") lb = QUnicodeTables::LineBreak_CR;
- else if (ba == "LF") lb = QUnicodeTables::LineBreak_LF;
- else if (ba == "SG") lb = QUnicodeTables::LineBreak_SG;
- else if (ba == "CB") lb = QUnicodeTables::LineBreak_AL;
- else if (ba == "SP") lb = QUnicodeTables::LineBreak_SP;
- else if (ba == "WJ") lb = QUnicodeTables::LineBreak_WJ;
- else if (ba == "H2") lb = QUnicodeTables::LineBreak_H2;
- else if (ba == "H3") lb = QUnicodeTables::LineBreak_H3;
- else if (ba == "JL") lb = QUnicodeTables::LineBreak_JL;
- else if (ba == "JV") lb = QUnicodeTables::LineBreak_JV;
- else if (ba == "JT") lb = QUnicodeTables::LineBreak_JT;
- else {
- qDebug() << "unhandled line break class:" << ba;
+ Q_ASSERT(ok);
}
+ LineBreakClass lb = line_break_map.value(l[1].trimmed(), LineBreak_Unassigned);
+ if (lb == LineBreak_Unassigned)
+ qFatal("unassigned line break class: %s", l[1].constData());
+
for (int codepoint = from; codepoint <= to; ++codepoint) {
UnicodeData d = unicodeData.value(codepoint, UnicodeData(codepoint));
d.p.line_break_class = lb;
@@ -1066,7 +1160,7 @@ static void readLineBreak()
static void readSpecialCasing()
{
-// qDebug() << "Reading SpecialCasing.txt";
+ qDebug() << "Reading SpecialCasing.txt";
QFile f("data/SpecialCasing.txt");
if (!f.exists())
qFatal("Couldn't find SpecialCasing.txt");
@@ -1114,8 +1208,6 @@ static void readSpecialCasing()
for (int i = 0; i < title.size(); ++i) {
bool ok;
titleMap.append(title.at(i).toInt(&ok, 16));
- if (!ok)
- qDebug() << line << title.at(i);
Q_ASSERT(ok);
}
@@ -1151,7 +1243,7 @@ static void readSpecialCasing()
}
}
-int maxCaseFoldDiff = 0;
+static int maxCaseFoldDiff = 0;
static void readCaseFolding()
{
@@ -1178,7 +1270,7 @@ static void readCaseFolding()
QList<QByteArray> l = line.split(';');
bool ok;
- uint codepoint = l[0].trimmed().toInt(&ok, 16);
+ int codepoint = l[0].trimmed().toInt(&ok, 16);
Q_ASSERT(ok);
@@ -1198,8 +1290,10 @@ static void readCaseFolding()
UnicodeData ud = unicodeData.value(codepoint, UnicodeData(codepoint));
if (foldMap.size() == 1) {
+ if (qAbs(foldMap.at(0) - codepoint) >= (1<<14))
+ qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << foldMap.at(0) << ")";
ud.p.caseFoldDiff = foldMap.at(0) - codepoint;
- maxCaseFoldDiff = qMax(maxCaseFoldDiff, ud.p.caseFoldDiff);
+ maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(ud.p.caseFoldDiff));
if (codepoint > 0xffff) {
// if the condition below doesn't hold anymore we need to modify our case folding code
//qDebug() << codepoint << QChar::highSurrogate(codepoint) << QChar::highSurrogate(foldMap.at(0));
@@ -1208,7 +1302,7 @@ static void readCaseFolding()
if (foldMap.at(0) != codepoint + ud.p.lowerCaseDiff)
qDebug() << hex << codepoint;
} else {
- Q_ASSERT(false); // we currently don't support full case foldings
+ qFatal("we currently don't support full case foldings");
// qDebug() << "special" << hex << foldMap;
ud.p.caseFoldSpecial = true;
ud.p.caseFoldDiff = appendToSpecialCaseMap(foldMap);
@@ -1254,7 +1348,9 @@ static void readGraphemeBreak()
Q_ASSERT(ok);
}
- GraphemeBreak brk = grapheme_break_map.value(l[1].trimmed(), GraphemeBreakOther);
+ GraphemeBreak brk = grapheme_break_map.value(l[1].trimmed(), GraphemeBreak_Unassigned);
+ if (brk == GraphemeBreak_Unassigned)
+ qFatal("unassigned grapheme break class: %s", l[1].constData());
for (int codepoint = from; codepoint <= to; ++codepoint) {
UnicodeData ud = unicodeData.value(codepoint, UnicodeData(codepoint));
@@ -1301,8 +1397,9 @@ static void readWordBreak()
Q_ASSERT(ok);
}
- WordBreak brk = word_break_map.value(l[1].trimmed(), WordBreakOther);
- Q_ASSERT(brk != WordBreakOther);
+ WordBreak brk = word_break_map.value(l[1].trimmed(), WordBreak_Unassigned);
+ if (brk == WordBreak_Unassigned)
+ qFatal("unassigned word break class: %s", l[1].constData());
for (int codepoint = from; codepoint <= to; ++codepoint) {
UnicodeData ud = unicodeData.value(codepoint, UnicodeData(codepoint));
@@ -1349,8 +1446,9 @@ static void readSentenceBreak()
Q_ASSERT(ok);
}
- SentenceBreak brk = sentence_break_map.value(l[1].trimmed(), SentenceBreakOther);
- Q_ASSERT(brk != SentenceBreakOther);
+ SentenceBreak brk = sentence_break_map.value(l[1].trimmed(), SentenceBreak_Unassigned);
+ if (brk == SentenceBreak_Unassigned)
+ qFatal("unassigned sentence break class: %s", l[1].constData());
for (int codepoint = from; codepoint <= to; ++codepoint) {
UnicodeData ud = unicodeData.value(codepoint, UnicodeData(codepoint));
@@ -1644,6 +1742,7 @@ QByteArray createScriptEnumDeclaration()
"Lao",
"Malayalam",
"Myanmar",
+ "Nko",
"Ogham",
"Oriya",
"Runic",
@@ -1661,7 +1760,7 @@ QByteArray createScriptEnumDeclaration()
// generate script enum
QByteArray declaration;
- declaration += " // See http://www.unicode.org/reports/tr24/tr24-5.html\n\n";
+ declaration += " // See http://www.unicode.org/reports/tr24/tr24-5.html\n";
declaration += " enum Script {\n Common";
int uniqueScripts = 1; // Common
@@ -1671,31 +1770,35 @@ QByteArray createScriptEnumDeclaration()
QByteArray scriptName = scriptNames.at(i);
// does the script require special processing?
bool special = false;
- for (int s = 0; !special && s < specialScriptsCount; ++s) {
- if (scriptName == specialScripts[s])
+ for (int s = 0; s < specialScriptsCount; ++s) {
+ if (scriptName == specialScripts[s]) {
special = true;
+ break;
+ }
}
if (!special) {
- scriptHash[i] = 0; // alias for 'Common'
+ scriptHash[i] = 0; // alias for 'Common'
continue;
} else {
++uniqueScripts;
scriptHash[i] = i;
}
- declaration += ",\n ";
- declaration += scriptName;
+ if (scriptName != "Inherited") {
+ declaration += ",\n ";
+ declaration += scriptName;
+ }
}
+ declaration += ",\n Inherited";
declaration += ",\n ScriptCount = Inherited";
// output the ones that are an alias for 'Common'
for (int i = 1; i < scriptNames.size(); ++i) {
if (scriptHash.value(i) != 0)
continue;
- QByteArray scriptName = scriptNames.at(i);
- scriptName += " = Common";
declaration += ",\n ";
- declaration += scriptName;
+ declaration += scriptNames.at(i);
+ declaration += " = Common";
}
declaration += "\n };\n";
@@ -1831,14 +1934,15 @@ struct PropertyBlock {
PropertyBlock() { index = -1; }
int index;
QList<int> properties;
- bool operator ==(const PropertyBlock &other) { return properties == other.properties; }
+ bool operator==(const PropertyBlock &other)
+ { return properties == other.properties; }
};
static QByteArray createPropertyInfo()
{
qDebug("createPropertyInfo:");
- const int BMP_BLOCKSIZE=32;
+ const int BMP_BLOCKSIZE = 32;
const int BMP_SHIFT = 5;
const int BMP_END = 0x11000;
const int SMP_END = 0x110000;
@@ -1890,14 +1994,14 @@ static QByteArray createPropertyInfo()
int bmp_block_data = bmp_blocks*BMP_BLOCKSIZE*2;
int bmp_trie = BMP_END/BMP_BLOCKSIZE*2;
int bmp_mem = bmp_block_data + bmp_trie;
- qDebug(" %d unique blocks in BMP.",blocks.size());
+ qDebug(" %d unique blocks in BMP.", blocks.size());
qDebug(" block data uses: %d bytes", bmp_block_data);
qDebug(" trie data uses : %d bytes", bmp_trie);
- int smp_block_data = (blocks.size()- bmp_blocks)*SMP_BLOCKSIZE*2;
+ int smp_block_data = (blocks.size() - bmp_blocks)*SMP_BLOCKSIZE*2;
int smp_trie = (SMP_END-BMP_END)/SMP_BLOCKSIZE*2;
int smp_mem = smp_block_data + smp_trie;
- qDebug(" %d unique blocks in SMP.",blocks.size()-bmp_blocks);
+ qDebug(" %d unique blocks in SMP.", blocks.size()-bmp_blocks);
qDebug(" block data uses: %d bytes", smp_block_data);
qDebug(" trie data uses : %d bytes", smp_trie);
@@ -1908,7 +2012,7 @@ static QByteArray createPropertyInfo()
out += "static const unsigned short uc_property_trie[] = {\n";
// first write the map
- out += " // 0x" + QByteArray::number(BMP_END, 16);
+ out += " // 0 - 0x" + QByteArray::number(BMP_END, 16);
for (int i = 0; i < BMP_END/BMP_BLOCKSIZE; ++i) {
if (!(i % 8)) {
if (out.endsWith(' '))
@@ -1977,7 +2081,7 @@ static QByteArray createPropertyInfo()
"] + (ucs2 & 0x" + QByteArray::number(BMP_BLOCKSIZE-1, 16)+ ")])\n\n"
- "static const QUnicodeTables::Properties uc_properties [] = {\n";
+ "static const QUnicodeTables::Properties uc_properties[] = {\n";
// keep in sync with the property declaration
for (int i = 0; i < uniqueProperties.size(); ++i) {
@@ -2036,7 +2140,7 @@ static QByteArray createPropertyInfo()
out += QByteArray::number( p.wordBreak );
out += ", ";
out += QByteArray::number( p.sentenceBreak );
- out += "},\n";
+ out += " },\n";
}
out += "};\n\n";
@@ -2064,20 +2168,18 @@ static QByteArray createPropertyInfo()
" return uc_properties + index;\n"
"}\n\n";
- out += "#define CURRENT_VERSION "CURRENT_UNICODE_VERSION"\n\n";
-
- out += "static const ushort specialCaseMap [] = {";
+ out += "static const ushort specialCaseMap[] = {\n ";
for (int i = 0; i < specialCaseMap.size(); ++i) {
- if (!(i % 16))
- out += "\n ";
out += QByteArray(" 0x") + QByteArray::number(specialCaseMap.at(i), 16);
if (i < specialCaseMap.size() - 1)
out += ",";
+ if (!specialCaseMap.at(i))
+ out += "\n ";
}
out += "\n};\n";
out += "#define SPECIAL_CASE_MAX_LEN " + QByteArray::number(specialCaseMaxLen) + "\n\n";
- qDebug() << "Special case map uses " << specialCaseMap.size()*2 << "bytes";
+ qDebug("Special case map uses : %d bytes", specialCaseMap.size()*2);
return out;
}
@@ -2088,14 +2190,14 @@ struct DecompositionBlock {
int index;
QList<int> decompositionPositions;
bool operator ==(const DecompositionBlock &other)
- { return decompositionPositions == other.decompositionPositions; }
+ { return decompositionPositions == other.decompositionPositions; }
};
static QByteArray createCompositionInfo()
{
qDebug("createCompositionInfo:");
- const int BMP_BLOCKSIZE=16;
+ const int BMP_BLOCKSIZE = 16;
const int BMP_SHIFT = 4;
const int BMP_END = 0x3400; // start of Han
const int SMP_END = 0x30000;
@@ -2120,15 +2222,14 @@ static QByteArray createCompositionInfo()
if (!d.decomposition.isEmpty()) {
int utf16Chars = 0;
for (int j = 0; j < d.decomposition.size(); ++j)
- utf16Chars += d.decomposition.at(j) > 0x10000 ? 2 : 1;
+ utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1;
decompositions.append(d.decompositionType + (utf16Chars<<8));
for (int j = 0; j < d.decomposition.size(); ++j) {
int code = d.decomposition.at(j);
- if (code > 0x10000) {
+ if (code >= 0x10000) {
// save as surrogate pair
- code -= 0x10000;
- ushort high = code/0x400 + 0xd800;
- ushort low = code%0x400 + 0xdc00;
+ ushort high = QChar::highSurrogate(code);
+ ushort low = QChar::lowSurrogate(code);
decompositions.append(high);
decompositions.append(low);
} else {
@@ -2162,15 +2263,14 @@ static QByteArray createCompositionInfo()
if (!d.decomposition.isEmpty()) {
int utf16Chars = 0;
for (int j = 0; j < d.decomposition.size(); ++j)
- utf16Chars += d.decomposition.at(j) > 0x10000 ? 2 : 1;
+ utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1;
decompositions.append(d.decompositionType + (utf16Chars<<8));
for (int j = 0; j < d.decomposition.size(); ++j) {
int code = d.decomposition.at(j);
- if (code > 0x10000) {
+ if (code >= 0x10000) {
// save as surrogate pair
- code -= 0x10000;
- ushort high = code/0x400 + 0xd800;
- ushort low = code%0x400 + 0xdc00;
+ ushort high = QChar::highSurrogate(code);
+ ushort low = QChar::lowSurrogate(code);
decompositions.append(high);
decompositions.append(low);
} else {
@@ -2196,15 +2296,15 @@ static QByteArray createCompositionInfo()
int bmp_block_data = bmp_blocks*BMP_BLOCKSIZE*2;
int bmp_trie = BMP_END/BMP_BLOCKSIZE*2;
int bmp_mem = bmp_block_data + bmp_trie;
- qDebug(" %d unique blocks in BMP.",blocks.size());
+ qDebug(" %d unique blocks in BMP.", blocks.size());
qDebug(" block data uses: %d bytes", bmp_block_data);
qDebug(" trie data uses : %d bytes", bmp_trie);
qDebug(" memory usage: %d bytes", bmp_mem);
- int smp_block_data = (blocks.size()- bmp_blocks)*SMP_BLOCKSIZE*2;
+ int smp_block_data = (blocks.size() - bmp_blocks)*SMP_BLOCKSIZE*2;
int smp_trie = (SMP_END-BMP_END)/SMP_BLOCKSIZE*2;
int smp_mem = smp_block_data + smp_trie;
- qDebug(" %d unique blocks in SMP.",blocks.size()-bmp_blocks);
+ qDebug(" %d unique blocks in SMP.", blocks.size()-bmp_blocks);
qDebug(" block data uses: %d bytes", smp_block_data);
qDebug(" trie data uses : %d bytes", smp_trie);
@@ -2347,7 +2447,7 @@ static QByteArray createLigatureInfo()
int bmp_block_data = bmp_blocks*BMP_BLOCKSIZE*2;
int bmp_trie = BMP_END/BMP_BLOCKSIZE*2;
int bmp_mem = bmp_block_data + bmp_trie;
- qDebug(" %d unique blocks in BMP.",blocks.size());
+ qDebug(" %d unique blocks in BMP.", blocks.size());
qDebug(" block data uses: %d bytes", bmp_block_data);
qDebug(" trie data uses : %d bytes", bmp_trie);
qDebug(" ligature data uses : %d bytes", ligatures.size()*2);
@@ -2399,7 +2499,7 @@ static QByteArray createLigatureInfo()
"uc_ligature_trie[uc_ligature_trie[u2>>" + QByteArray::number(BMP_SHIFT) +
"] + (u2 & 0x" + QByteArray::number(BMP_BLOCKSIZE-1, 16)+ ")] : 0xffff);\n\n"
- "static const unsigned short uc_ligature_map [] = {\n";
+ "static const unsigned short uc_ligature_map[] = {\n";
for (int i = 0; i < ligatures.size(); ++i) {
if (!(i % 8)) {
@@ -2433,19 +2533,20 @@ QByteArray createCasingInfo()
int main(int, char **)
{
+ initAgeMap();
initCategoryMap();
initDirectionMap();
initDecompositionMap();
initGraphemeBreak();
initWordBreak();
initSentenceBreak();
-
+ initLineBreak();
+
readUnicodeData();
readBidiMirroring();
readArabicShaping();
readDerivedAge();
- readCompositionExclusion();
- readLineBreak();
+ readDerivedNormalizationProps();
readSpecialCasing();
readCaseFolding();
// readBlocks();
@@ -2453,6 +2554,7 @@ int main(int, char **)
readGraphemeBreak();
readWordBreak();
readSentenceBreak();
+ readLineBreak();
computeUniqueProperties();
QByteArray properties = createPropertyInfo();
@@ -2462,9 +2564,6 @@ int main(int, char **)
QByteArray scriptEnumDeclaration = createScriptEnumDeclaration();
QByteArray scriptTableDeclaration = createScriptTableDeclaration();
- QFile f("../../src/corelib/tools/qunicodetables.cpp");
- f.open(QFile::WriteOnly|QFile::Truncate);
-
QByteArray header =
"/****************************************************************************\n"
"**\n"
@@ -2505,9 +2604,10 @@ int main(int, char **)
"**\n"
"** $QT_END_LICENSE$\n"
"**\n"
- "****************************************************************************/\n\n"
+ "****************************************************************************/\n\n";
- "/* This file is autogenerated from the Unicode 5.0 database. Do not edit */\n\n";
+ QByteArray note =
+ "/* This file is autogenerated from the Unicode "DATA_VERSION_S" database. Do not edit */\n\n";
QByteArray warning =
"//\n"
@@ -2521,41 +2621,47 @@ int main(int, char **)
"// We mean it.\n"
"//\n\n";
+ QFile f("../../src/corelib/tools/qunicodetables.cpp");
+ f.open(QFile::WriteOnly|QFile::Truncate);
f.write(header);
+ f.write(note);
f.write("QT_BEGIN_NAMESPACE\n\n");
f.write(properties);
f.write(compositions);
f.write(ligatures);
f.write(normalizationCorrections);
f.write(scriptTableDeclaration);
- f.write("\nQT_END_NAMESPACE\n");
+ f.write("QT_END_NAMESPACE\n");
f.close();
f.setFileName("../../src/corelib/tools/qunicodetables_p.h");
f.open(QFile::WriteOnly | QFile::Truncate);
f.write(header);
+ f.write(note);
f.write(warning);
f.write("#ifndef QUNICODETABLES_P_H\n"
"#define QUNICODETABLES_P_H\n\n"
"#include <QtCore/qchar.h>\n\n"
"QT_BEGIN_NAMESPACE\n\n");
- f.write("namespace QUnicodeTables {\n");
+ f.write("#define UNICODE_DATA_VERSION "DATA_VERSION_STR"\n\n");
+ f.write("#define UNICODE_LAST_CODEPOINT "LAST_CODEPOINT_STR"\n\n");
+ f.write("namespace QUnicodeTables {\n\n");
f.write(property_string);
f.write("\n");
f.write(scriptEnumDeclaration);
f.write("\n");
f.write(lineBreakClass);
f.write("\n");
- f.write(methods);
- f.write("\n");
f.write(grapheme_break_string);
f.write("\n");
f.write(word_break_string);
f.write("\n");
f.write(sentence_break_string);
- f.write("\n}\n\n"
+ f.write("\n");
+ f.write(methods);
+ f.write("} // namespace QUnicodeTables\n\n"
"QT_END_NAMESPACE\n\n"
- "#endif\n");
+ "#endif // QUNICODETABLES_P_H\n");
f.close();
qDebug() << "maxMirroredDiff = " << hex << maxMirroredDiff;
@@ -2578,7 +2684,7 @@ int main(int, char **)
sum += decompositionLength.value(i, 0);
}
qDebug(" len decomposition map %d, average length %f, num composed chars %d",
- totalcompositions, (float)totalcompositions/(float)sum, sum);
+ totalcompositions, (float)totalcompositions/(float)sum, sum);
qDebug("highest composed character %x", highestComposedCharacter);
qDebug("num ligatures = %d highest=%x, maxLength=%d", numLigatures, highestLigature, longestLigature);
@@ -2599,4 +2705,3 @@ int main(int, char **)
#endif
}
-
diff --git a/util/unicode/unicode.pro b/util/unicode/unicode.pro
index a53f70a..0250c2a 100644
--- a/util/unicode/unicode.pro
+++ b/util/unicode/unicode.pro
@@ -1,2 +1,3 @@
SOURCES += main.cpp
QT = core
+CONFIG += console