summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-10-06 15:00:08 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-10-06 15:00:08 (GMT)
commitd17a315a082a8cb5d7f3f5ae47dabbe721982e2c (patch)
tree42165b4a3639be226100b7f40f7544c13db46fa8
parent54645071fad98b46a44d88b50095dc21ff63fff6 (diff)
parentfa35247d31bd35d72c307f4a6a231400aade0c0b (diff)
downloadQt-d17a315a082a8cb5d7f3f5ae47dabbe721982e2c.zip
Qt-d17a315a082a8cb5d7f3f5ae47dabbe721982e2c.tar.gz
Qt-d17a315a082a8cb5d7f3f5ae47dabbe721982e2c.tar.bz2
Merge commit 'qt/4.6' into mmfphonon
-rw-r--r--INSTALL4
-rw-r--r--config.tests/unix/libtiff/libtiff.cpp5
-rw-r--r--demos/affine/main.cpp4
-rw-r--r--demos/browser/browser.pro10
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro29
-rw-r--r--demos/gradients/main.cpp4
-rw-r--r--demos/pathstroke/main.cpp4
-rw-r--r--demos/pathstroke/pathstroke.cpp95
-rw-r--r--demos/pathstroke/pathstroke.h3
-rw-r--r--demos/shared/arthurwidgets.h21
-rw-r--r--demos/shared/hoverpoints.cpp82
-rw-r--r--demos/shared/hoverpoints.h2
-rw-r--r--demos/sub-attaq/animationmanager.cpp6
-rw-r--r--demos/sub-attaq/boat.cpp92
-rw-r--r--demos/sub-attaq/boat.h12
-rw-r--r--demos/sub-attaq/boat_p.h50
-rw-r--r--demos/sub-attaq/bomb.cpp16
-rw-r--r--demos/sub-attaq/bomb.h16
-rw-r--r--demos/sub-attaq/custompropertyanimation.cpp108
-rw-r--r--demos/sub-attaq/custompropertyanimation.h114
-rw-r--r--demos/sub-attaq/graphicsscene.cpp196
-rw-r--r--demos/sub-attaq/graphicsscene.h13
-rw-r--r--demos/sub-attaq/mainwindow.cpp31
-rw-r--r--demos/sub-attaq/mainwindow.h1
-rw-r--r--demos/sub-attaq/pixmapitem.cpp33
-rw-r--r--demos/sub-attaq/pixmapitem.h14
-rw-r--r--demos/sub-attaq/states.cpp39
-rw-r--r--demos/sub-attaq/states.h2
-rw-r--r--demos/sub-attaq/sub-attaq.pro2
-rw-r--r--demos/sub-attaq/submarine.cpp62
-rw-r--r--demos/sub-attaq/submarine.h11
-rw-r--r--demos/sub-attaq/submarine_p.h1
-rw-r--r--demos/sub-attaq/torpedo.cpp20
-rw-r--r--demos/sub-attaq/torpedo.h16
-rw-r--r--demos/symbianpkgrules.pri2
-rw-r--r--dist/changes-4.5.4123
-rw-r--r--doc/src/getting-started/installation.qdoc2
-rw-r--r--doc/src/howtos/exceptionsafety.qdoc (renamed from doc/src/exceptionsafety.qdoc)2
-rw-r--r--doc/src/platforms/s60-introduction.qdoc (renamed from doc/src/s60-introduction.qdoc)4
-rw-r--r--doc/src/platforms/supported-platforms.qdoc2
-rw-r--r--doc/src/platforms/symbian-exceptionsafety.qdoc (renamed from doc/src/symbian-exceptionsafety.qdoc)0
-rw-r--r--doc/src/snippets/statemachine/main2.cpp4
-rw-r--r--examples/opengl/pbuffers/cube.h6
-rw-r--r--examples/painting/basicdrawing/renderarea.cpp5
-rw-r--r--examples/statemachine/rogue/movementtransition.h2
-rw-r--r--examples/symbianpkgrules.pri2
-rw-r--r--examples/video/videographicsitem/videoitem.h1
-rw-r--r--mkspecs/common/symbian/symbian.conf8
-rw-r--r--mkspecs/features/symbian/qt.prf8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog576
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri20
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp27
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h15
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h12
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h10
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp30
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h22
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h9
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp4
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.cpp6
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.h17
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp263
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITCall.cpp24
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITInlineMethods.h43
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITOpcodes.cpp113
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp128
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp24
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h1
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp41
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jsc.pro31
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.cpp8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp51
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp8
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp4
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h58
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp121
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h19
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.cpp5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h18
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/runtime/TimeoutChecker.cpp25
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.cpp4
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h12
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp14
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h38
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.cpp17
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSpinLock.h7
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp10
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadingPthreads.cpp2
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp4
-rw-r--r--src/3rdparty/javascriptcore/VERSION4
-rw-r--r--src/3rdparty/javascriptcore/WebKit.pri9
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp12
-rw-r--r--src/corelib/animation/qabstractanimation.cpp6
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp76
-rw-r--r--src/corelib/animation/qparallelanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp4
-rw-r--r--src/corelib/arch/qatomic_symbian.h2
-rw-r--r--src/corelib/arch/symbian/qatomic_symbian.cpp2
-rw-r--r--src/corelib/codecs/codecs.pri1
-rw-r--r--src/corelib/codecs/qtextcodec.cpp43
-rw-r--r--src/corelib/global/qglobal.cpp11
-rw-r--r--src/corelib/global/qglobal.h16
-rw-r--r--src/corelib/global/qnamespace.qdoc3
-rw-r--r--src/corelib/io/qdatastream.cpp2
-rw-r--r--src/corelib/io/qdatastream.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian_p.h2
-rw-r--r--src/corelib/io/qprocess_symbian.cpp2
-rw-r--r--src/corelib/io/qurl.cpp4
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp2
-rw-r--r--src/corelib/kernel/qcore_symbian_p.h2
-rw-r--r--src/corelib/kernel/qcoreevent.h1
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qmath.cpp2
-rw-r--r--src/corelib/kernel/qsharedmemory_symbian.cpp2
-rw-r--r--src/corelib/kernel/qsystemsemaphore_symbian.cpp2
-rw-r--r--src/corelib/statemachine/qstatemachine.h1
-rw-r--r--src/dbus/qdbusextratypes.h3
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm2
-rw-r--r--src/gui/embedded/qvfbhdr.h2
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp19
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp12
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp8
-rw-r--r--src/gui/graphicsview/qsimplex_p.cpp30
-rw-r--r--src/gui/image/qpixmap_s60.cpp7
-rw-r--r--src/gui/image/qpixmap_x11.cpp18
-rw-r--r--src/gui/image/qpixmapfilter.cpp10
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp4
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp15
-rw-r--r--src/gui/itemviews/qtableview.cpp404
-rw-r--r--src/gui/itemviews/qtableview.h4
-rw-r--r--src/gui/itemviews/qtableview_p.h21
-rw-r--r--src/gui/kernel/qapplication_qws.cpp1
-rw-r--r--src/gui/kernel/qapplication_s60.cpp10
-rw-r--r--src/gui/kernel/qapplication_x11.cpp9
-rw-r--r--src/gui/kernel/qformlayout.cpp2
-rw-r--r--src/gui/kernel/qtooltip.cpp2
-rw-r--r--src/gui/kernel/qwhatsthis.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp16
-rw-r--r--src/gui/painting/qcolor.cpp2
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp1
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp2
-rw-r--r--src/gui/painting/qprintengine_ps.cpp1
-rw-r--r--src/gui/painting/qtransform.cpp2
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp20
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp5
-rw-r--r--src/gui/s60framework/qs60mainapplication.cpp4
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp21
-rw-r--r--src/gui/statemachine/qguistatemachine.cpp346
-rw-r--r--src/gui/styles/gtksymbols.cpp28
-rw-r--r--src/gui/styles/gtksymbols_p.h29
-rw-r--r--src/gui/text/qtextcontrol.cpp6
-rw-r--r--src/gui/text/qtextoption.cpp6
-rw-r--r--src/gui/widgets/qcombobox.cpp5
-rw-r--r--src/gui/widgets/qlabel.cpp6
-rw-r--r--src/gui/widgets/qmenu.h8
-rw-r--r--src/gui/widgets/qmenu_p.h7
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp20
-rw-r--r--src/gui/widgets/qplaintextedit.cpp54
-rw-r--r--src/gui/widgets/qtextedit.cpp49
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp26
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp4
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h1
-rw-r--r--src/network/socket/qabstractsocket.cpp2
-rw-r--r--src/network/socket/qabstractsocket.h4
-rw-r--r--src/network/ssl/qsslcertificate.cpp4
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp3
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h3
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qglgradientcache.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp8
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/opengl/qgl.cpp184
-rw-r--r--src/opengl/qgl_p.h183
-rw-r--r--src/opengl/qglpixmapfilter.cpp167
-rw-r--r--src/opengl/qpaintengine_opengl.cpp2
-rw-r--r--src/openvg/qpixmapfilter_vg.cpp44
-rw-r--r--src/openvg/qpixmapfilter_vg_p.h3
-rw-r--r--src/qt3support/widgets/q3popupmenu.h14
-rw-r--r--src/qt3support/widgets/q3toolbar.cpp2
-rw-r--r--src/s60installs/qt.svg14
-rw-r--r--src/s60installs/s60installs.pro12
-rw-r--r--src/s60installs/selfsigned.cer18
-rw-r--r--src/script/api/qscriptengine.cpp9
-rw-r--r--src/script/api/qscriptvalue.cpp6
-rw-r--r--src/sql/kernel/qsqlquery.cpp9
-rw-r--r--src/sql/kernel/qsqlresult.cpp7
-rw-r--r--src/svg/qsvghandler.cpp14
-rw-r--r--src/xmlpatterns/api/qabstractxmlpullprovider.cpp2
-rw-r--r--src/xmlpatterns/api/qabstractxmlpullprovider_p.h2
-rw-r--r--src/xmlpatterns/api/qpullbridge.cpp2
-rw-r--r--src/xmlpatterns/api/qpullbridge_p.h2
-rw-r--r--src/xmlpatterns/api/qxmlschema.cpp2
-rw-r--r--src/xmlpatterns/api/qxmlschema.h2
-rw-r--r--src/xmlpatterns/api/qxmlschema_p.cpp2
-rw-r--r--src/xmlpatterns/api/qxmlschema_p.h2
-rw-r--r--src/xmlpatterns/api/qxmlschemavalidator.cpp2
-rw-r--r--src/xmlpatterns/api/qxmlschemavalidator.h2
-rw-r--r--src/xmlpatterns/api/qxmlschemavalidator_p.h2
-rw-r--r--src/xmlpatterns/data/qcomparisonfactory.cpp2
-rw-r--r--src/xmlpatterns/data/qcomparisonfactory_p.h2
-rw-r--r--src/xmlpatterns/data/qvaluefactory.cpp2
-rw-r--r--src/xmlpatterns/data/qvaluefactory_p.h2
-rw-r--r--src/xmlpatterns/schema/qnamespacesupport.cpp2
-rw-r--r--src/xmlpatterns/schema/qnamespacesupport_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdalternative.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdalternative_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdannotated.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdannotated_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdannotation.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdannotation_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdapplicationinformation.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdapplicationinformation_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdassertion.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdassertion_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdattribute.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdattribute_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdattributegroup.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdattributegroup_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdattributereference.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdattributereference_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdattributeterm.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdattributeterm_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdattributeuse.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdattributeuse_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdcomplextype.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdcomplextype_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsddocumentation.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsddocumentation_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdelement.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdelement_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdfacet.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdfacet_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdidcache.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdidcache_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdidchelper.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdidchelper_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdidentityconstraint.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdidentityconstraint_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdinstancereader.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdinstancereader_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdmodelgroup.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdmodelgroup_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdnotation.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdnotation_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdparticle.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdparticle_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdparticlechecker.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdparticlechecker_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdreference.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdreference_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschema.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschema_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemachecker.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemachecker_helper.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemachecker_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemacontext.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemacontext_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemadebugger.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemadebugger_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemahelper.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemahelper_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemamerger.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemamerger_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparsercontext.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparsercontext_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaresolver.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschemaresolver_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschematoken.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschematoken_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdschematypesfactory.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdschematypesfactory_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdsimpletype.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdsimpletype_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachinebuilder_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdterm.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdterm_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdtypechecker.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdtypechecker_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsduserschematype.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsduserschematype_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdvalidatinginstancereader_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdwildcard.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdwildcard_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdxpathexpression.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdxpathexpression_p.h2
-rw-r--r--src/xmlpatterns/schema/tokens.xml2
-rw-r--r--src/xmlpatterns/type/qnamedschemacomponent.cpp2
-rw-r--r--src/xmlpatterns/type/qnamedschemacomponent_p.h2
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/qabstractitemview/tst_qabstractitemview.cpp18
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp4
-rw-r--r--tests/auto/qcssparser/qcssparser.pro6
-rw-r--r--tests/auto/qcssparser/tst_qcssparser.cpp33
-rw-r--r--tests/auto/qdialog/tst_qdialog.cpp28
-rw-r--r--tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp2
-rw-r--r--tests/auto/qgl/tst_qgl.cpp50
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp21
-rw-r--r--tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp2
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp4
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp13
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp71
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp16
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp1
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp9
-rw-r--r--tests/auto/qmath/qmath.pro6
-rw-r--r--tests/auto/qmath/tst_qmath.cpp67
-rw-r--r--tests/auto/qmdiarea/tst_qmdiarea.cpp12
-rw-r--r--tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp10
-rw-r--r--tests/auto/qnetworkreply/certs/server.key15
-rw-r--r--tests/auto/qnetworkreply/certs/server.pem24
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp114
-rw-r--r--tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp146
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp19
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp27
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp34
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp17
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp27
-rw-r--r--tests/auto/qsharedmemory/tst_qsharedmemory.cpp4
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp5
-rw-r--r--tests/auto/qsound/qsound.pro6
-rw-r--r--tests/auto/qsound/tst_qsound.cpp2
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp15
-rw-r--r--tests/auto/qstatemachine/tst_qstatemachine.cpp27
-rw-r--r--tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp9
-rw-r--r--tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp21
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp197
-rw-r--r--tests/auto/qthreadonce/tst_qthreadonce.cpp2
-rw-r--r--tests/auto/qtooltip/tst_qtooltip.cpp22
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp1
-rw-r--r--tests/auto/qurl/tst_qurl.cpp23
-rw-r--r--tests/auto/qwaitcondition/tst_qwaitcondition.cpp8
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp28
-rw-r--r--tests/auto/qwindowsurface/tst_qwindowsurface.cpp9
-rw-r--r--tests/auto/symbols/tst_symbols.cpp1
-rw-r--r--tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro5
-rw-r--r--tests/benchmarks/qtableview/tst_qtableview.cpp174
-rwxr-xr-xutil/webkit/mkdist-javascriptcore1
-rwxr-xr-xutil/webkit/mkdist-webkit3
361 files changed, 4707 insertions, 2254 deletions
diff --git a/INSTALL b/INSTALL
index 22e993a..092dea0 100644
--- a/INSTALL
+++ b/INSTALL
@@ -65,9 +65,7 @@
By default, Qt is configured for installation in the
/usr/local/Trolltech/Qt-%VERSION% directory, but this can be
- changed by using the -prefix option. Alternatively, the
- -prefix-install option can be used to specify a "local"
- installation within the source directory.
+ changed by using the -prefix option.
cd /tmp/%DISTNAME%
./configure
diff --git a/config.tests/unix/libtiff/libtiff.cpp b/config.tests/unix/libtiff/libtiff.cpp
index 2d4b2af..7d41f25 100644
--- a/config.tests/unix/libtiff/libtiff.cpp
+++ b/config.tests/unix/libtiff/libtiff.cpp
@@ -41,6 +41,11 @@
#include <tiffio.h>
+#if !defined(TIFF_VERSION) && defined(TIFF_VERSION_CLASSIC)
+// libtiff 4.0 splits it into TIFF_VERSION_CLASSIC and TIFF_VERSION_BIG
+# define TIFF_VERSION TIFF_VERSION_CLASSIC
+#endif
+
#if !defined(TIFF_VERSION)
# error "Required libtiff not found"
#elif TIFF_VERSION < 42
diff --git a/demos/affine/main.cpp b/demos/affine/main.cpp
index 7d3d781..61fde96 100644
--- a/demos/affine/main.cpp
+++ b/demos/affine/main.cpp
@@ -54,8 +54,10 @@ int main(int argc, char **argv)
xformWidget.setStyle(arthurStyle);
QList<QWidget *> widgets = qFindChildren<QWidget *>(&xformWidget);
- foreach (QWidget *w, widgets)
+ foreach (QWidget *w, widgets) {
w->setStyle(arthurStyle);
+ w->setAttribute(Qt::WA_AcceptTouchEvents);
+ }
xformWidget.show();
diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro
index dab9387..6c5f005 100644
--- a/demos/browser/browser.pro
+++ b/demos/browser/browser.pro
@@ -80,6 +80,16 @@ mac {
ICON = browser.icns
QMAKE_INFO_PLIST = Info_mac.plist
TARGET = Browser
+
+ # No 64-bit Flash on Mac, so build the browser 32-bit
+ contains(QT_CONFIG, x86) {
+ CONFIG -= x86_64
+ CONFIG += x86
+ }
+ contains(QT_CONFIG, ppc) {
+ CONFIG -= ppc64
+ CONFIG += ppc
+ }
}
wince*: {
diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index d677e9d..f2abde6 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -59,7 +59,7 @@ symbian {
load(data_caging_paths)
TARGET.UID3 = 0xA000A641
- ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+ ICON = ../../../src/s60installs/qt.svg
executables.sources = \
styledemo.exe \
@@ -126,21 +126,7 @@ symbian {
mifs.sources = \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A641.mif \ #fluidlauncher
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A63F.mif \ #styledemo
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A63D.mif \ #deform
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A63E.mif \ #pathstroke
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C607.mif \ #wiggly
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A648.mif \ #ftp
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C60A.mif \ #saxbookmarks
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif \ #desktopservices
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C610.mif \ #fridgemagnets
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C612.mif \ #drilldown
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF6B.mif \ #softkeys
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF76.mif \ #raycasting
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF73.mif \ #flickable
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF72.mif \ #digiflip
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF75.mif \ #lightmaps
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF74.mif #flightinfo
+ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif #desktopservices
mifs.path = $$APP_RESOURCE_DIR
contains(QT_CONFIG, svg) {
@@ -155,33 +141,22 @@ symbian {
resource.sources += \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \
$${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.rsc
-
- mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000A640.mif \ #embeddedsvgviewer
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF77.mif #weatherinfo
-
}
contains(QT_CONFIG, webkit) {
executables.sources += anomaly.exe
reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc
- mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000CF71.mif #anomaly
}
contains(QT_CONFIG, phonon) {
executables.sources += qmediaplayer.exe
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.rsc
- mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C613.mif #qmediaplayer
}
contains(QT_CONFIG, script) {
executables.sources += context2d.exe
reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc
resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc
- mifs.sources += \
- $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C608.mif #context2d
}
files.sources = $$PWD/screenshots $$PWD/slides
diff --git a/demos/gradients/main.cpp b/demos/gradients/main.cpp
index 9ffcdd1..c70cdb7 100644
--- a/demos/gradients/main.cpp
+++ b/demos/gradients/main.cpp
@@ -53,8 +53,10 @@ int main(int argc, char **argv)
QStyle *arthurStyle = new ArthurStyle();
gradientWidget.setStyle(arthurStyle);
QList<QWidget *> widgets = qFindChildren<QWidget *>(&gradientWidget);
- foreach (QWidget *w, widgets)
+ foreach (QWidget *w, widgets) {
w->setStyle(arthurStyle);
+ w->setAttribute(Qt::WA_AcceptTouchEvents);
+ }
gradientWidget.show();
return app.exec();
diff --git a/demos/pathstroke/main.cpp b/demos/pathstroke/main.cpp
index 60520f1..67f4639 100644
--- a/demos/pathstroke/main.cpp
+++ b/demos/pathstroke/main.cpp
@@ -57,8 +57,10 @@ int main(int argc, char **argv)
QStyle *arthurStyle = new ArthurStyle();
pathStrokeWidget.setStyle(arthurStyle);
QList<QWidget *> widgets = qFindChildren<QWidget *>(&pathStrokeWidget);
- foreach (QWidget *w, widgets)
+ foreach (QWidget *w, widgets) {
w->setStyle(arthurStyle);
+ w->setAttribute(Qt::WA_AcceptTouchEvents);
+ }
if (smallScreen)
pathStrokeWidget.showFullScreen();
diff --git a/demos/pathstroke/pathstroke.cpp b/demos/pathstroke/pathstroke.cpp
index fdc7480..e072f0a 100644
--- a/demos/pathstroke/pathstroke.cpp
+++ b/demos/pathstroke/pathstroke.cpp
@@ -402,6 +402,7 @@ PathStrokeRenderer::PathStrokeRenderer(QWidget *parent, bool smallScreen)
m_penStyle = Qt::SolidLine;
m_wasAnimated = true;
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ setAttribute(Qt::WA_AcceptTouchEvents);
}
void PathStrokeRenderer::paint(QPainter *painter)
@@ -510,10 +511,6 @@ void PathStrokeRenderer::updatePoints()
Q_ASSERT(m_points.size() == m_vectors.size());
for (int i=0; i<m_points.size(); ++i) {
-
- if (i == m_activePoint)
- continue;
-
QPointF pos = m_points.at(i);
QPointF vec = m_vectors.at(i);
pos += vec;
@@ -532,6 +529,8 @@ void PathStrokeRenderer::updatePoints()
void PathStrokeRenderer::mousePressEvent(QMouseEvent *e)
{
+ if (!m_fingerPointMapping.isEmpty())
+ return;
setDescriptionEnabled(false);
m_activePoint = -1;
qreal distance = -1;
@@ -556,6 +555,8 @@ void PathStrokeRenderer::mousePressEvent(QMouseEvent *e)
void PathStrokeRenderer::mouseMoveEvent(QMouseEvent *e)
{
+ if (!m_fingerPointMapping.isEmpty())
+ return;
// If we've moved more then 25 pixels, assume user is dragging
if (!m_mouseDrag && QPoint(m_mousePress - e->pos()).manhattanLength() > 25)
m_mouseDrag = true;
@@ -568,6 +569,8 @@ void PathStrokeRenderer::mouseMoveEvent(QMouseEvent *e)
void PathStrokeRenderer::mouseReleaseEvent(QMouseEvent *)
{
+ if (!m_fingerPointMapping.isEmpty())
+ return;
m_activePoint = -1;
setAnimation(m_wasAnimated);
@@ -586,6 +589,90 @@ void PathStrokeRenderer::timerEvent(QTimerEvent *e)
// }
}
+bool PathStrokeRenderer::event(QEvent *e)
+{
+ bool touchBegin = false;
+ switch (e->type()) {
+ case QEvent::TouchBegin:
+ touchBegin = true;
+ case QEvent::TouchUpdate:
+ {
+ const QTouchEvent *const event = static_cast<const QTouchEvent*>(e);
+ const QList<QTouchEvent::TouchPoint> points = event->touchPoints();
+ foreach (const QTouchEvent::TouchPoint &touchPoint, points) {
+ const int id = touchPoint.id();
+ switch (touchPoint.state()) {
+ case Qt::TouchPointPressed:
+ {
+ // find the point, move it
+ QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
+ int activePoint = -1;
+ qreal distance = -1;
+ const int pointsCount = m_points.size();
+ for (int i=0; i<pointsCount; ++i) {
+ if (activePoints.contains(i))
+ continue;
+
+ qreal d = QLineF(touchPoint.pos(), m_points.at(i)).length();
+ if ((distance < 0 && d < 12 * m_pointSize) || d < distance) {
+ distance = d;
+ activePoint = i;
+ }
+ }
+ if (activePoint != -1) {
+ m_fingerPointMapping.insert(touchPoint.id(), activePoint);
+ m_points[activePoint] = touchPoint.pos();
+ }
+ }
+ break;
+ case Qt::TouchPointReleased:
+ {
+ // move the point and release
+ QHash<int,int>::iterator it = m_fingerPointMapping.find(id);
+ m_points[it.value()] = touchPoint.pos();
+ m_fingerPointMapping.erase(it);
+ }
+ break;
+ case Qt::TouchPointMoved:
+ {
+ // move the point
+ const int pointIdx = m_fingerPointMapping.value(id, -1);
+ if (pointIdx >= 0)
+ m_points[pointIdx] = touchPoint.pos();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (m_fingerPointMapping.isEmpty()) {
+ e->ignore();
+ return false;
+ } else {
+ if (touchBegin) {
+ m_wasAnimated = m_timer.isActive();
+ setAnimation(false);
+ }
+ update();
+ return true;
+ }
+ }
+ break;
+ case QEvent::TouchEnd:
+ if (m_fingerPointMapping.isEmpty()) {
+ e->ignore();
+ return false;
+ }
+ m_fingerPointMapping.clear();
+ setAnimation(m_wasAnimated);
+ return true;
+ break;
+ default:
+ break;
+ }
+ return QWidget::event(e);
+}
+
void PathStrokeRenderer::setAnimation(bool animation)
{
m_timer.stop();
diff --git a/demos/pathstroke/pathstroke.h b/demos/pathstroke/pathstroke.h
index 3ff2c55..e869515 100644
--- a/demos/pathstroke/pathstroke.h
+++ b/demos/pathstroke/pathstroke.h
@@ -60,6 +60,7 @@ public:
void mouseMoveEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void timerEvent(QTimerEvent *e);
+ bool event(QEvent *e);
QSize sizeHint() const { return QSize(500, 500); }
@@ -118,6 +119,8 @@ private:
bool m_smallScreen;
QPoint m_mousePress;
bool m_mouseDrag;
+
+ QHash<int, int> m_fingerPointMapping;
};
class PathStrokeControls : public QWidget
diff --git a/demos/shared/arthurwidgets.h b/demos/shared/arthurwidgets.h
index aa70002..7b02bcd 100644
--- a/demos/shared/arthurwidgets.h
+++ b/demos/shared/arthurwidgets.h
@@ -49,13 +49,32 @@
#if defined(QT_OPENGL_SUPPORT)
#include <QGLWidget>
+#include <QEvent>
class GLWidget : public QGLWidget
{
public:
GLWidget(QWidget *parent)
- : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) {}
+ : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
+ {
+ setAttribute(Qt::WA_AcceptTouchEvents);
+ }
void disableAutoBufferSwap() { setAutoBufferSwap(false); }
void paintEvent(QPaintEvent *) { parentWidget()->update(); }
+protected:
+ bool event(QEvent *event)
+ {
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ event->ignore();
+ return false;
+ break;
+ default:
+ break;
+ }
+ return QGLWidget::event(event);
+ }
};
#endif
diff --git a/demos/shared/hoverpoints.cpp b/demos/shared/hoverpoints.cpp
index 182f4d8..84f5815 100644
--- a/demos/shared/hoverpoints.cpp
+++ b/demos/shared/hoverpoints.cpp
@@ -53,6 +53,7 @@ HoverPoints::HoverPoints(QWidget *widget, PointShape shape)
{
m_widget = widget;
widget->installEventFilter(this);
+ widget->setAttribute(Qt::WA_AcceptTouchEvents);
m_connectionType = CurveConnection;
m_sortType = NoSort;
@@ -86,6 +87,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
case QEvent::MouseButtonPress:
{
+ if (!m_fingerPointMapping.isEmpty())
+ return true;
QMouseEvent *me = (QMouseEvent *) event;
QPointF clickPos = me->pos();
@@ -147,13 +150,90 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
break;
case QEvent::MouseButtonRelease:
+ if (!m_fingerPointMapping.isEmpty())
+ return true;
m_currentIndex = -1;
break;
case QEvent::MouseMove:
+ if (!m_fingerPointMapping.isEmpty())
+ return true;
if (m_currentIndex >= 0)
movePoint(m_currentIndex, ((QMouseEvent *)event)->pos());
break;
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ {
+ const QTouchEvent *const touchEvent = static_cast<const QTouchEvent*>(event);
+ const QList<QTouchEvent::TouchPoint> points = touchEvent->touchPoints();
+ const qreal pointSize = qMax(m_pointSize.width(), m_pointSize.height());
+ foreach (const QTouchEvent::TouchPoint &touchPoint, points) {
+ const int id = touchPoint.id();
+ switch (touchPoint.state()) {
+ case Qt::TouchPointPressed:
+ {
+ // find the point, move it
+ QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
+ int activePoint = -1;
+ qreal distance = -1;
+ const int pointsCount = m_points.size();
+ const int activePointCount = activePoints.size();
+ if (pointsCount == 2 && activePointCount == 1) { // only two points
+ activePoint = activePoints.contains(0) ? 1 : 0;
+ } else {
+ for (int i=0; i<pointsCount; ++i) {
+ if (activePoints.contains(i))
+ continue;
+
+ qreal d = QLineF(touchPoint.pos(), m_points.at(i)).length();
+ if ((distance < 0 && d < 12 * pointSize) || d < distance) {
+ distance = d;
+ activePoint = i;
+ }
+
+ }
+ }
+ if (activePoint != -1) {
+ m_fingerPointMapping.insert(touchPoint.id(), activePoint);
+ movePoint(activePoint, touchPoint.pos());
+ }
+ }
+ break;
+ case Qt::TouchPointReleased:
+ {
+ // move the point and release
+ QHash<int,int>::iterator it = m_fingerPointMapping.find(id);
+ movePoint(it.value(), touchPoint.pos());
+ m_fingerPointMapping.erase(it);
+ }
+ break;
+ case Qt::TouchPointMoved:
+ {
+ // move the point
+ const int pointIdx = m_fingerPointMapping.value(id, -1);
+ if (pointIdx >= 0) // do we track this point?
+ movePoint(pointIdx, touchPoint.pos());
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (m_fingerPointMapping.isEmpty()) {
+ event->ignore();
+ return false;
+ } else {
+ return true;
+ }
+ }
+ break;
+ case QEvent::TouchEnd:
+ if (m_fingerPointMapping.isEmpty()) {
+ event->ignore();
+ return false;
+ }
+ return true;
+ break;
case QEvent::Resize:
{
@@ -262,6 +342,8 @@ static QPointF bound_point(const QPointF &point, const QRectF &bounds, int lock)
void HoverPoints::setPoints(const QPolygonF &points)
{
+ if (points.size() != m_points.size())
+ m_fingerPointMapping.clear();
m_points.clear();
for (int i=0; i<points.size(); ++i)
m_points << bound_point(points.at(i), boundingRect(), 0);
diff --git a/demos/shared/hoverpoints.h b/demos/shared/hoverpoints.h
index 8f6e1b8..23ac8c1 100644
--- a/demos/shared/hoverpoints.h
+++ b/demos/shared/hoverpoints.h
@@ -133,6 +133,8 @@ private:
bool m_editable;
bool m_enabled;
+ QHash<int, int> m_fingerPointMapping;
+
QPen m_pointPen;
QBrush m_pointBrush;
QPen m_connectionPen;
diff --git a/demos/sub-attaq/animationmanager.cpp b/demos/sub-attaq/animationmanager.cpp
index 916dd21..eb5a125 100644
--- a/demos/sub-attaq/animationmanager.cpp
+++ b/demos/sub-attaq/animationmanager.cpp
@@ -77,16 +77,14 @@ void AnimationManager::unregisterAllAnimations()
void AnimationManager::pauseAll()
{
- foreach (QAbstractAnimation* animation, animations)
- {
+ foreach (QAbstractAnimation* animation, animations) {
if (animation->state() == QAbstractAnimation::Running)
animation->pause();
}
}
void AnimationManager::resumeAll()
{
- foreach (QAbstractAnimation* animation, animations)
- {
+ foreach (QAbstractAnimation* animation, animations) {
if (animation->state() == QAbstractAnimation::Paused)
animation->resume();
}
diff --git a/demos/sub-attaq/boat.cpp b/demos/sub-attaq/boat.cpp
index 864a099..3b1bac7 100644
--- a/demos/sub-attaq/boat.cpp
+++ b/demos/sub-attaq/boat.cpp
@@ -46,7 +46,6 @@
#include "pixmapitem.h"
#include "graphicsscene.h"
#include "animationmanager.h"
-#include "custompropertyanimation.h"
#include "qanimationstate.h"
//Qt
@@ -60,79 +59,35 @@
static QAbstractAnimation *setupDestroyAnimation(Boat *boat)
{
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(boat);
-#if QT_VERSION >=0x040500
- PixmapItem *step1 = new PixmapItem(QString("explosion/boat/step1"),GraphicsScene::Big, boat);
- step1->setZValue(6);
- PixmapItem *step2 = new PixmapItem(QString("explosion/boat/step2"),GraphicsScene::Big, boat);
- step2->setZValue(6);
- PixmapItem *step3 = new PixmapItem(QString("explosion/boat/step3"),GraphicsScene::Big, boat);
- step3->setZValue(6);
- PixmapItem *step4 = new PixmapItem(QString("explosion/boat/step4"),GraphicsScene::Big, boat);
- step4->setZValue(6);
- step1->setOpacity(0);
- step2->setOpacity(0);
- step3->setOpacity(0);
- step4->setOpacity(0);
- CustomPropertyAnimation *anim1 = new CustomPropertyAnimation(boat);
- anim1->setMemberFunctions((QGraphicsItem*)step1, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim1->setDuration(100);
- anim1->setEndValue(1);
- CustomPropertyAnimation *anim2 = new CustomPropertyAnimation(boat);
- anim2->setMemberFunctions((QGraphicsItem*)step2, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim2->setDuration(100);
- anim2->setEndValue(1);
- CustomPropertyAnimation *anim3 = new CustomPropertyAnimation(boat);
- anim3->setMemberFunctions((QGraphicsItem*)step3, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim3->setDuration(100);
- anim3->setEndValue(1);
- CustomPropertyAnimation *anim4 = new CustomPropertyAnimation(boat);
- anim4->setMemberFunctions((QGraphicsItem*)step4, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim4->setDuration(100);
- anim4->setEndValue(1);
- CustomPropertyAnimation *anim5 = new CustomPropertyAnimation(boat);
- anim5->setMemberFunctions((QGraphicsItem*)step1, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim5->setDuration(100);
- anim5->setEndValue(0);
- CustomPropertyAnimation *anim6 = new CustomPropertyAnimation(boat);
- anim6->setMemberFunctions((QGraphicsItem*)step2, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim6->setDuration(100);
- anim6->setEndValue(0);
- CustomPropertyAnimation *anim7 = new CustomPropertyAnimation(boat);
- anim7->setMemberFunctions((QGraphicsItem*)step3, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim7->setDuration(100);
- anim7->setEndValue(0);
- CustomPropertyAnimation *anim8 = new CustomPropertyAnimation(boat);
- anim8->setMemberFunctions((QGraphicsItem*)step4, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim8->setDuration(100);
- anim8->setEndValue(0);
- group->addAnimation(anim1);
- group->addAnimation(anim2);
- group->addAnimation(anim3);
- group->addAnimation(anim4);
- group->addAnimation(anim5);
- group->addAnimation(anim6);
- group->addAnimation(anim7);
- group->addAnimation(anim8);
-#else
- // work around for a bug where we don't transition if the duration is zero.
- QtPauseAnimation *anim = new QtPauseAnimation(group);
- anim->setDuration(1);
- group->addAnimation(anim);
-#endif
+ for (int i = 1; i <= 4; i++) {
+ PixmapItem *step = new PixmapItem(QString("explosion/boat/step%1").arg(i),GraphicsScene::Big, boat);
+ step->setZValue(6);
+ step->setOpacity(0);
+
+ //fade-in
+ QPropertyAnimation *anim = new QPropertyAnimation(step, "opacity");
+ anim->setEndValue(1);
+ anim->setDuration(100);
+ group->insertAnimationAt(i-1, anim);
+
+ //and then fade-out
+ QPropertyAnimation *anim2 = new QPropertyAnimation(step, "opacity");
+ anim2->setEndValue(0);
+ anim2->setDuration(100);
+ group->addAnimation(anim2);
+ }
+
AnimationManager::self()->registerAnimation(group);
return group;
}
-Boat::Boat(QGraphicsItem * parent, Qt::WindowFlags wFlags)
- : QGraphicsWidget(parent,wFlags), speed(0), bombsAlreadyLaunched(0), direction(Boat::None), movementAnimation(0)
+Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big),
+ speed(0), bombsAlreadyLaunched(0), direction(Boat::None), movementAnimation(0)
{
- pixmapItem = new PixmapItem(QString("boat"),GraphicsScene::Big, this);
setZValue(4);
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsFocusable);
- resize(pixmapItem->boundingRect().size());
+ setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsFocusable);
//The movement animation used to animate the boat
movementAnimation = new QPropertyAnimation(this, "pos");
@@ -223,13 +178,13 @@ Boat::Boat(QGraphicsItem * parent, Qt::WindowFlags wFlags)
destroyedState->setAnimation(destroyAnimation);
//Play a nice animation when the boat is destroyed
- moving->addTransition(this, SIGNAL(boatDestroyed()),destroyedState);
+ moving->addTransition(this, SIGNAL(boatDestroyed()), destroyedState);
//Transition to final state when the destroyed animation is finished
destroyedState->addTransition(destroyedState, SIGNAL(animationFinished()), final);
//The machine has finished to be executed, then the boat is dead
- connect(machine,SIGNAL(finished()),this, SIGNAL(boatExecutionFinished()));
+ connect(machine,SIGNAL(finished()), this, SIGNAL(boatExecutionFinished()));
}
@@ -255,7 +210,6 @@ void Boat::updateBoatMovement()
}
movementAnimation->stop();
- movementAnimation->setStartValue(pos());
if (direction == Boat::Left) {
movementAnimation->setEndValue(QPointF(0,y()));
diff --git a/demos/sub-attaq/boat.h b/demos/sub-attaq/boat.h
index 0fe8ce4..0b4de1e 100644
--- a/demos/sub-attaq/boat.h
+++ b/demos/sub-attaq/boat.h
@@ -42,13 +42,8 @@
#ifndef __BOAT__H__
#define __BOAT__H__
-//Qt
-#include <QtCore/QObject>
-#include <QtGui/QKeyEvent>
+#include "pixmapitem.h"
-#include <QtGui/QGraphicsWidget>
-
-class PixmapItem;
class Bomb;
QT_BEGIN_NAMESPACE
class QVariantAnimation;
@@ -56,7 +51,7 @@ class QAbstractAnimation;
class QStateMachine;
QT_END_NAMESPACE
-class Boat : public QGraphicsWidget
+class Boat : public PixmapItem
{
Q_OBJECT
public:
@@ -66,7 +61,7 @@ public:
Right
};
enum { Type = UserType + 2 };
- Boat(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+ Boat();
void destroy();
void run();
void stop();
@@ -95,7 +90,6 @@ private:
QVariantAnimation *movementAnimation;
QAbstractAnimation *destroyAnimation;
QStateMachine *machine;
- PixmapItem *pixmapItem;
};
#endif //__BOAT__H__
diff --git a/demos/sub-attaq/boat_p.h b/demos/sub-attaq/boat_p.h
index 692702b..6eb52b6 100644
--- a/demos/sub-attaq/boat_p.h
+++ b/demos/sub-attaq/boat_p.h
@@ -67,22 +67,16 @@ static const int MAX_BOMB = 5;
class KeyStopTransition : public QKeyEventTransition
{
public:
- KeyStopTransition(Boat *boat, QEvent::Type type, int key)
- : QKeyEventTransition(boat, type, key)
+ KeyStopTransition(Boat *b, QEvent::Type t, int k)
+ : QKeyEventTransition(b, t, k), boat(b), key(k)
{
- this->boat = boat;
- this->key = key;
}
protected:
virtual bool eventTest(QEvent *event)
{
- Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
return false;
- if (boat->currentSpeed() == 1)
- return true;
- else
- return false;
+ return (boat->currentSpeed() == 1);
}
private:
Boat * boat;
@@ -93,23 +87,16 @@ private:
class KeyMoveTransition : public QKeyEventTransition
{
public:
- KeyMoveTransition(Boat *boat, QEvent::Type type, int key)
- : QKeyEventTransition(boat, type, key)
+ KeyMoveTransition(Boat *b, QEvent::Type t, int k)
+ : QKeyEventTransition(b, t, k), boat(b), key(k)
{
- this->boat = boat;
- this->key = key;
}
protected:
virtual bool eventTest(QEvent *event)
{
- Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
return false;
- if (boat->currentSpeed() >= 0)
- return true;
- else
- return false;
-
+ return (boat->currentSpeed() >= 0);
}
void onTransition(QEvent *)
{
@@ -132,22 +119,16 @@ private:
{
public:
KeyLaunchTransition(Boat *boat, QEvent::Type type, int key)
- : QKeyEventTransition(boat, type, key)
+ : QKeyEventTransition(boat, type, key), boat(boat), key(key)
{
- this->boat = boat;
- this->key = key;
}
protected:
virtual bool eventTest(QEvent *event)
{
- Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
return false;
//We have enough bomb?
- if (boat->bombsLaunched() < MAX_BOMB)
- return true;
- else
- return false;
+ return (boat->bombsLaunched() < MAX_BOMB);
}
private:
Boat * boat;
@@ -158,9 +139,8 @@ private:
class MoveStateRight : public QState
{
public:
- MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent)
+ MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
{
- this->boat = boat;
}
protected:
void onEntry(QEvent *)
@@ -176,9 +156,8 @@ private:
class MoveStateLeft : public QState
{
public:
- MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent)
+ MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
{
- this->boat = boat;
}
protected:
void onEntry(QEvent *)
@@ -194,9 +173,8 @@ private:
class StopState : public QState
{
public:
- StopState(Boat *boat,QState *parent = 0) : QState(parent)
+ StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
{
- this->boat = boat;
}
protected:
void onEntry(QEvent *)
@@ -213,9 +191,8 @@ private:
class LaunchStateRight : public QState
{
public:
- LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent)
+ LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
{
- this->boat = boat;
}
protected:
void onEntry(QEvent *)
@@ -235,9 +212,8 @@ private:
class LaunchStateLeft : public QState
{
public:
- LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent)
+ LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat)
{
- this->boat = boat;
}
protected:
void onEntry(QEvent *)
diff --git a/demos/sub-attaq/bomb.cpp b/demos/sub-attaq/bomb.cpp
index d17024f..acc3475 100644
--- a/demos/sub-attaq/bomb.cpp
+++ b/demos/sub-attaq/bomb.cpp
@@ -52,19 +52,14 @@
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
-Bomb::Bomb(QGraphicsItem * parent, Qt::WindowFlags wFlags)
- : QGraphicsWidget(parent,wFlags), launchAnimation(0)
+Bomb::Bomb() : PixmapItem(QString("bomb"), GraphicsScene::Big)
{
- pixmapItem = new PixmapItem(QString("bomb"),GraphicsScene::Big, this);
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- setFlags(QGraphicsItem::ItemIsMovable);
setZValue(2);
- resize(pixmapItem->boundingRect().size());
}
void Bomb::launch(Bomb::Direction direction)
{
- launchAnimation = new QSequentialAnimationGroup();
+ QSequentialAnimationGroup *launchAnimation = new QSequentialAnimationGroup;
AnimationManager::self()->registerAnimation(launchAnimation);
qreal delta = direction == Right ? 20 : - 20;
QPropertyAnimation *anim = new QPropertyAnimation(this, "pos");
@@ -80,7 +75,7 @@ void Bomb::launch(Bomb::Direction direction)
anim->setDuration(y()/2*60);
launchAnimation->addAnimation(anim);
connect(anim,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationLaunchValueChanged(const QVariant &)));
-
+ connect(this, SIGNAL(bombExploded()), launchAnimation, SLOT(stop()));
//We setup the state machine of the bomb
QStateMachine *machine = new QStateMachine(this);
@@ -94,7 +89,7 @@ void Bomb::launch(Bomb::Direction direction)
machine->setInitialState(launched);
//### Add a nice animation when the bomb is destroyed
- launched->addTransition(this, SIGNAL(bombExplosed()),final);
+ launched->addTransition(this, SIGNAL(bombExploded()),final);
//If the animation is finished, then we move to the final state
launched->addTransition(launched, SIGNAL(animationFinished()), final);
@@ -119,6 +114,5 @@ void Bomb::onAnimationLaunchValueChanged(const QVariant &)
void Bomb::destroy()
{
- launchAnimation->stop();
- emit bombExplosed();
+ emit bombExploded();
}
diff --git a/demos/sub-attaq/bomb.h b/demos/sub-attaq/bomb.h
index f5b221c..ec059b5 100644
--- a/demos/sub-attaq/bomb.h
+++ b/demos/sub-attaq/bomb.h
@@ -42,13 +42,9 @@
#ifndef __BOMB__H__
#define __BOMB__H__
-//Qt
-#include <QtGui/QGraphicsWidget>
-#include <QtCore/QAnimationGroup>
+#include "pixmapitem.h"
-class PixmapItem;
-
-class Bomb : public QGraphicsWidget
+class Bomb : public PixmapItem
{
Q_OBJECT
public:
@@ -56,20 +52,16 @@ public:
Left = 0,
Right
};
- Bomb(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0);
+ Bomb();
void launch(Direction direction);
void destroy();
signals:
- void bombExplosed();
+ void bombExploded();
void bombExecutionFinished();
private slots:
void onAnimationLaunchValueChanged(const QVariant &);
-
-private:
- QAnimationGroup *launchAnimation;
- PixmapItem *pixmapItem;
};
#endif //__BOMB__H__
diff --git a/demos/sub-attaq/custompropertyanimation.cpp b/demos/sub-attaq/custompropertyanimation.cpp
deleted file mode 100644
index 9b435f0..0000000
--- a/demos/sub-attaq/custompropertyanimation.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** 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 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 "custompropertyanimation.h"
-
-// Qt
-#include <QtCore/qdebug.h>
-
-CustomPropertyAnimation::CustomPropertyAnimation(QObject *parent) :
- QVariantAnimation(parent), animProp(0)
-{
-}
-
-CustomPropertyAnimation::~CustomPropertyAnimation()
-{
-}
-
-void CustomPropertyAnimation::setProperty(AbstractProperty *_animProp)
-{
- if (animProp == _animProp)
- return;
- delete animProp;
- animProp = _animProp;
-}
-
-/*!
- \reimp
- */
-void CustomPropertyAnimation::updateCurrentValue(const QVariant &value)
-{
- if (!animProp || state() == QAbstractAnimation::Stopped)
- return;
-
- animProp->write(value);
-}
-
-
-/*!
- \reimp
-*/
-void CustomPropertyAnimation::updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState)
-{
- // Initialize start value
- if (oldState == QAbstractAnimation::Stopped) {
- if (!animProp)
- return;
- QVariant def = animProp->read();
- if (def.isValid()) {
- const int t = def.userType();
- KeyValues values = keyValues();
- //this ensures that all the keyValues are of type t
- for (int i = 0; i < values.count(); ++i) {
- QVariantAnimation::KeyValue &pair = values[i];
- if (pair.second.userType() != t)
- pair.second.convert(static_cast<QVariant::Type>(t));
- }
- //let's now update the key values
- setKeyValues(values);
- }
-
- if ((animProp && !startValue().isValid() && currentTime() == 0)
- || (currentTime() == duration() && currentLoop() == (loopCount() - 1))) {
- setStartValue(def);
- }
- }
-
- QVariantAnimation::updateState(oldState, newState);
-}
-
-#include "moc_custompropertyanimation.cpp"
diff --git a/demos/sub-attaq/custompropertyanimation.h b/demos/sub-attaq/custompropertyanimation.h
deleted file mode 100644
index 0c97bf0..0000000
--- a/demos/sub-attaq/custompropertyanimation.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** 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 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$
-**
-****************************************************************************/
-
-#ifndef CUSTOMPROPERTYANIMATION_H
-#define CUSTOMPROPERTYANIMATION_H
-
-#include <QtCore/qvariantanimation.h>
-
-QT_BEGIN_NAMESPACE
-class QGraphicsItem;
-QT_END_NAMESPACE
-
-struct AbstractProperty
-{
- virtual QVariant read() const = 0;
- virtual void write(const QVariant &value) = 0;
-};
-
-
-class CustomPropertyAnimation : public QVariantAnimation
-{
- Q_OBJECT
-
- template <typename Target, typename T, typename T2 = T>
- class MemberFunctionProperty : public AbstractProperty
- {
- public:
- typedef T (Target::*Getter)(void) const;
- typedef void (Target::*Setter)(T2);
-
- MemberFunctionProperty(Target* target, Getter getter, Setter setter)
- : m_target(target), m_getter(getter), m_setter(setter) {}
-
- virtual void write(const QVariant &value)
- {
- if (m_setter) (m_target->*m_setter)(qVariantValue<T>(value));
- }
-
- virtual QVariant read() const
- {
- if (m_getter) return qVariantFromValue<T>((m_target->*m_getter)());
- return QVariant();
- }
-
- private:
- Target *m_target;
- Getter m_getter;
- Setter m_setter;
- };
-
-public:
- CustomPropertyAnimation(QObject *parent = 0);
- ~CustomPropertyAnimation();
-
- template<class Target, typename T>
- void setMemberFunctions(Target* target, T (Target::*getter)() const, void (Target::*setter)(const T& ))
- {
- setProperty(new MemberFunctionProperty<Target, T, const T&>(target, getter, setter));
- }
-
- template<class Target, typename T>
- void setMemberFunctions(Target* target, T (Target::*getter)() const, void (Target::*setter)(T))
- {
- setProperty(new MemberFunctionProperty<Target, T>(target, getter, setter));
- }
-
- void updateCurrentValue(const QVariant &value);
- void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
- void setProperty(AbstractProperty *animProp);
-
-private:
- Q_DISABLE_COPY(CustomPropertyAnimation);
- AbstractProperty *animProp;
-};
-
-#endif // CUSTOMPROPERTYANIMATION_H
diff --git a/demos/sub-attaq/graphicsscene.cpp b/demos/sub-attaq/graphicsscene.cpp
index e5d7aad..812eadf 100644
--- a/demos/sub-attaq/graphicsscene.cpp
+++ b/demos/sub-attaq/graphicsscene.cpp
@@ -47,7 +47,6 @@
#include "torpedo.h"
#include "bomb.h"
#include "pixmapitem.h"
-#include "custompropertyanimation.h"
#include "animationmanager.h"
#include "qanimationstate.h"
#include "progressitem.h"
@@ -68,39 +67,10 @@
#include <QtGui/QGraphicsSceneMouseEvent>
#include <QtCore/QXmlStreamReader>
-//helper function that creates an animation for position and inserts it into group
-static CustomPropertyAnimation *addGraphicsItemPosAnimation(QSequentialAnimationGroup *group,
- QGraphicsItem *item, const QPointF &endPos)
-{
- CustomPropertyAnimation *ret = new CustomPropertyAnimation(group);
- ret->setMemberFunctions(item, &QGraphicsItem::pos, &QGraphicsItem::setPos);
- ret->setEndValue(endPos);
- ret->setDuration(200);
- ret->setEasingCurve(QEasingCurve::OutElastic);
- group->addPause(50);
- return ret;
-}
-
-//helper function that creates an animation for opacity and inserts it into group
-static void addGraphicsItemFadeoutAnimation(QAnimationGroup *group, QGraphicsItem *item)
-{
-#if QT_VERSION >=0x040500
- CustomPropertyAnimation *anim = new CustomPropertyAnimation(group);
- anim->setMemberFunctions(item, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim->setDuration(800);
- anim->setEndValue(0);
- anim->setEasingCurve(QEasingCurve::OutQuad);
-#else
- // work around for a bug where we don't transition if the duration is zero.
- QtPauseAnimation *anim = new QtPauseAnimation(group);
- anim->setDuration(1);
-#endif
-}
-
GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
- : QGraphicsScene(x,y,width,height), mode(mode), newAction(0), quitAction(0), boat(0)
+ : QGraphicsScene(x , y, width, height), mode(mode), boat(new Boat)
{
- backgroundItem = new PixmapItem(QString("background"),mode);
+ PixmapItem *backgroundItem = new PixmapItem(QString("background"),mode);
backgroundItem->setZValue(1);
backgroundItem->setPos(0,0);
addItem(backgroundItem);
@@ -116,7 +86,6 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
textInformationItem = new TextInformationItem(backgroundItem);
textInformationItem->hide();
//We create the boat
- boat = new Boat();
addItem(boat);
boat->setPos(this->width()/2, sealLevel() - boat->size().height());
boat->hide();
@@ -130,28 +99,21 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
while (!reader.atEnd()) {
reader.readNext();
if (reader.tokenType() == QXmlStreamReader::StartElement) {
- if (reader.name() == "submarine")
- {
+ if (reader.name() == "submarine") {
SubmarineDescription desc;
desc.name = reader.attributes().value("name").toString();
desc.points = reader.attributes().value("points").toString().toInt();
desc.type = reader.attributes().value("type").toString().toInt();
submarinesData.append(desc);
- }
- if (reader.name() == "level")
- {
+ } else if (reader.name() == "level") {
currentLevel.id = reader.attributes().value("id").toString().toInt();
currentLevel.name = reader.attributes().value("name").toString();
+ } else if (reader.name() == "subinstance") {
+ currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(), reader.attributes().value("nb").toString().toInt()));
}
- if (reader.name() == "subinstance")
- {
- currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(),reader.attributes().value("nb").toString().toInt()));
- }
- }
- if (reader.tokenType() == QXmlStreamReader::EndElement) {
- if (reader.name() == "level")
- {
- levelsData.insert(currentLevel.id,currentLevel);
+ } else if (reader.tokenType() == QXmlStreamReader::EndElement) {
+ if (reader.name() == "level") {
+ levelsData.insert(currentLevel.id, currentLevel);
currentLevel.submarines.clear();
}
}
@@ -160,80 +122,52 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
qreal GraphicsScene::sealLevel() const
{
- if (mode == Big)
- return 220;
- else
- return 160;
+ return (mode == Big) ? 220 : 160;
}
-void GraphicsScene::setupScene(const QList<QAction *> &actions)
+void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
{
- newAction = actions.at(0);
- quitAction = actions.at(1);
-
- QGraphicsItem *logo_s = addWelcomeItem(QPixmap(":/logo-s"));
- QGraphicsItem *logo_u = addWelcomeItem(QPixmap(":/logo-u"));
- QGraphicsItem *logo_b = addWelcomeItem(QPixmap(":/logo-b"));
- QGraphicsItem *logo_dash = addWelcomeItem(QPixmap(":/logo-dash"));
- QGraphicsItem *logo_a = addWelcomeItem(QPixmap(":/logo-a"));
- QGraphicsItem *logo_t = addWelcomeItem(QPixmap(":/logo-t"));
- QGraphicsItem *logo_t2 = addWelcomeItem(QPixmap(":/logo-t2"));
- QGraphicsItem *logo_a2 = addWelcomeItem(QPixmap(":/logo-a2"));
- QGraphicsItem *logo_q = addWelcomeItem(QPixmap(":/logo-q"));
- QGraphicsItem *logo_excl = addWelcomeItem(QPixmap(":/logo-excl"));
- logo_s->setZValue(3);
- logo_u->setZValue(4);
- logo_b->setZValue(5);
- logo_dash->setZValue(6);
- logo_a->setZValue(7);
- logo_t->setZValue(8);
- logo_t2->setZValue(9);
- logo_a2->setZValue(10);
- logo_q->setZValue(11);
- logo_excl->setZValue(12);
- logo_s->setPos(QPointF(-1000, -1000));
- logo_u->setPos(QPointF(-800, -1000));
- logo_b->setPos(QPointF(-600, -1000));
- logo_dash->setPos(QPointF(-400, -1000));
- logo_a->setPos(QPointF(1000, 2000));
- logo_t->setPos(QPointF(800, 2000));
- logo_t2->setPos(QPointF(600, 2000));
- logo_a2->setPos(QPointF(400, 2000));
- logo_q->setPos(QPointF(200, 2000));
- logo_excl->setPos(QPointF(0, 2000));
+ static const int nLetters = 10;
+ static struct {
+ char *pix;
+ qreal initX, initY;
+ qreal destX, destY;
+ } logoData[nLetters] = {
+ {"s", -1000, -1000, 300, 150 },
+ {"u", -800, -1000, 350, 150 },
+ {"b", -600, -1000, 400, 120 },
+ {"dash", -400, -1000, 460, 150 },
+ {"a", 1000, 2000, 350, 250 },
+ {"t", 800, 2000, 400, 250 },
+ {"t2", 600, 2000, 430, 250 },
+ {"a2", 400, 2000, 465, 250 },
+ {"q", 200, 2000, 510, 250 },
+ {"excl", 0, 2000, 570, 220 } };
QSequentialAnimationGroup * lettersGroupMoving = new QSequentialAnimationGroup(this);
QParallelAnimationGroup * lettersGroupFading = new QParallelAnimationGroup(this);
- //creation of the animations for moving letters
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_s, QPointF(300, 150));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_u, QPointF(350, 150));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_b, QPointF(400, 120));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_dash, QPointF(460, 150));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_a, QPointF(350, 250));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_t, QPointF(400, 250));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_t2, QPointF(430, 250));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_a2, QPointF(465, 250));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_q, QPointF(510, 250));
- addGraphicsItemPosAnimation(lettersGroupMoving, logo_excl, QPointF(570, 220));
-
- //creation of the animations for fading out the letters
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_s);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_u);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_b);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_dash);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_a);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_t);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_t2);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_a2);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_q);
- addGraphicsItemFadeoutAnimation(lettersGroupFading, logo_excl);
- connect(lettersGroupFading, SIGNAL(finished()), this, SLOT(onIntroAnimationFinished()));
+ for (int i = 0; i < nLetters; ++i) {
+ PixmapItem *logo = new PixmapItem(QLatin1String(":/logo-") + logoData[i].pix, this);
+ logo->setPos(logoData[i].initX, logoData[i].initY);
+ logo->setZValue(i + 3);
+ //creation of the animations for moving letters
+ QPropertyAnimation *moveAnim = new QPropertyAnimation(logo, "pos", lettersGroupMoving);
+ moveAnim->setEndValue(QPointF(logoData[i].destX, logoData[i].destY));
+ moveAnim->setDuration(200);
+ moveAnim->setEasingCurve(QEasingCurve::OutElastic);
+ lettersGroupMoving->addPause(50);
+ //creation of the animations for fading out the letters
+ QPropertyAnimation *fadeAnim = new QPropertyAnimation(logo, "opacity", lettersGroupFading);
+ fadeAnim->setDuration(800);
+ fadeAnim->setEndValue(0);
+ fadeAnim->setEasingCurve(QEasingCurve::OutQuad);
+ }
QStateMachine *machine = new QStateMachine(this);
//This state is when the player is playing
- PlayState *gameState = new PlayState(this,machine);
+ PlayState *gameState = new PlayState(this, machine);
//Final state
QFinalState *final = new QFinalState(machine);
@@ -263,7 +197,7 @@ void GraphicsScene::setupScene(const QList<QAction *> &actions)
machine->start();
//We reach the final state, then we quit
- connect(machine,SIGNAL(finished()),this, SLOT(onQuitGameTriggered()));
+ connect(machine, SIGNAL(finished()), qApp, SLOT(quit()));
}
void GraphicsScene::addItem(Bomb *bomb)
@@ -292,16 +226,6 @@ void GraphicsScene::addItem(QGraphicsItem *item)
QGraphicsScene::addItem(item);
}
-void GraphicsScene::mousePressEvent (QGraphicsSceneMouseEvent * event)
-{
- event->ignore();
-}
-
-void GraphicsScene::onQuitGameTriggered()
-{
- qApp->closeAllWindows();
-}
-
void GraphicsScene::onBombExecutionFinished()
{
Bomb *bomb = qobject_cast<Bomb *>(sender());
@@ -322,32 +246,26 @@ void GraphicsScene::onSubMarineExecutionFinished()
{
SubMarine *submarine = qobject_cast<SubMarine *>(sender());
submarines.remove(submarine);
- if (submarines.count() == 0) {
+ if (submarines.count() == 0)
emit allSubMarineDestroyed(submarine->points());
- } else {
+ else
emit subMarineDestroyed(submarine->points());
- }
submarine->deleteLater();
}
-int GraphicsScene::remainingSubMarines() const
-{
- return submarines.count();
-}
-
void GraphicsScene::clearScene()
{
- foreach (SubMarine *sub,submarines) {
+ foreach (SubMarine *sub, submarines) {
sub->destroy();
sub->deleteLater();
}
- foreach (Torpedo *torpedo,torpedos) {
+ foreach (Torpedo *torpedo, torpedos) {
torpedo->destroy();
torpedo->deleteLater();
}
- foreach (Bomb *bomb,bombs) {
+ foreach (Bomb *bomb, bombs) {
bomb->destroy();
bomb->deleteLater();
}
@@ -361,17 +279,3 @@ void GraphicsScene::clearScene()
boat->stop();
boat->hide();
}
-
-QGraphicsPixmapItem *GraphicsScene::addWelcomeItem(const QPixmap &pm)
-{
- QGraphicsPixmapItem *item = addPixmap(pm);
- welcomeItems << item;
- return item;
-}
-
-void GraphicsScene::onIntroAnimationFinished()
-{
- qDeleteAll(welcomeItems);
- welcomeItems.clear();
-}
-
diff --git a/demos/sub-attaq/graphicsscene.h b/demos/sub-attaq/graphicsscene.h
index 7d7252d..ce2c91f 100644
--- a/demos/sub-attaq/graphicsscene.h
+++ b/demos/sub-attaq/graphicsscene.h
@@ -82,41 +82,30 @@ public:
GraphicsScene(int x, int y, int width, int height, Mode mode = Big);
qreal sealLevel() const;
- void setupScene(const QList<QAction *> &actions);
+ void setupScene(QAction *newAction, QAction *quitAction);
void addItem(Bomb *bomb);
void addItem(Torpedo *torpedo);
void addItem(SubMarine *submarine);
void addItem(QGraphicsItem *item);
- int remainingSubMarines() const;
void clearScene();
- QGraphicsPixmapItem *addWelcomeItem(const QPixmap &pm);
signals:
void subMarineDestroyed(int);
void allSubMarineDestroyed(int);
-protected:
- void mousePressEvent (QGraphicsSceneMouseEvent * event);
-
private slots:
- void onQuitGameTriggered();
void onBombExecutionFinished();
void onTorpedoExecutionFinished();
void onSubMarineExecutionFinished();
- void onIntroAnimationFinished();
private:
Mode mode;
- PixmapItem *backgroundItem;
ProgressItem *progressItem;
TextInformationItem *textInformationItem;
- QAction * newAction;
- QAction * quitAction;
Boat *boat;
QSet<SubMarine *> submarines;
QSet<Bomb *> bombs;
QSet<Torpedo *> torpedos;
- QVector<QGraphicsPixmapItem *> welcomeItems;
QVector<SubmarineDescription> submarinesData;
QHash<int, LevelDescription> levelsData;
diff --git a/demos/sub-attaq/mainwindow.cpp b/demos/sub-attaq/mainwindow.cpp
index 37129f8..45e5554 100644
--- a/demos/sub-attaq/mainwindow.cpp
+++ b/demos/sub-attaq/mainwindow.cpp
@@ -56,42 +56,27 @@
MainWindow::MainWindow() : QMainWindow(0)
{
- QMenuBar *menuBar = new QMenuBar;
- QMenu *file = new QMenu(tr("&File"),menuBar);
+ QMenu *file = menuBar()->addMenu(tr("&File"));
- QAction *newAction = new QAction(tr("New Game"),file);
+ QAction *newAction = file->addAction(tr("New Game"));
newAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
- file->addAction(newAction);
- QAction *quitAction = new QAction(tr("Quit"),file);
+ QAction *quitAction = file->addAction(tr("Quit"));
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
- file->addAction(quitAction);
- menuBar->addMenu(file);
- setMenuBar(menuBar);
-
- QStringList list = QApplication::arguments();
- if (list.contains("-fullscreen")) {
- scene = new GraphicsScene(0, 0, 750, 400,GraphicsScene::Small);
+ if (QApplication::arguments().contains("-fullscreen")) {
+ scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small);
setWindowState(Qt::WindowFullScreen);
} else {
scene = new GraphicsScene(0, 0, 880, 630);
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
- view = new QGraphicsView(scene,this);
+ view = new QGraphicsView(scene, this);
view->setAlignment(Qt::AlignLeft | Qt::AlignTop);
- QList<QAction *> actions;
- actions << newAction << quitAction;
- scene->setupScene(actions);
+ scene->setupScene(newAction, quitAction);
#ifndef QT_NO_OPENGL
- view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
+ view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
#endif
setCentralWidget(view);
-
-}
-
-MainWindow::~MainWindow()
-{
}
-
diff --git a/demos/sub-attaq/mainwindow.h b/demos/sub-attaq/mainwindow.h
index d626ad7..12a7364 100644
--- a/demos/sub-attaq/mainwindow.h
+++ b/demos/sub-attaq/mainwindow.h
@@ -54,7 +54,6 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
MainWindow();
- ~MainWindow();
private:
GraphicsScene *scene;
diff --git a/demos/sub-attaq/pixmapitem.cpp b/demos/sub-attaq/pixmapitem.cpp
index 9abf745..fcc7ce9 100644
--- a/demos/sub-attaq/pixmapitem.cpp
+++ b/demos/sub-attaq/pixmapitem.cpp
@@ -43,17 +43,34 @@
#include "pixmapitem.h"
//Qt
-#include <QtCore/QDir>
+#include <QPainter>
-PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent) : QGraphicsPixmapItem(parent),name(fileName)
+PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent) : QGraphicsObject(parent)
{
- loadPixmap(mode);
+ if (mode == GraphicsScene::Big)
+ pix = ":/big/" + fileName;
+ else
+ pix = ":/small/" + fileName;
}
-void PixmapItem::loadPixmap(GraphicsScene::Mode mode)
+PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) : QGraphicsObject(), pix(fileName)
{
- if (mode == GraphicsScene::Big)
- setPixmap(":/big/" + name);
- else
- setPixmap(":/small/" + name);
+ scene->addItem(this);
}
+
+QSizeF PixmapItem::size() const
+{
+ return pix.size();
+}
+
+QRectF PixmapItem::boundingRect() const
+{
+ return QRectF(QPointF(0, 0), pix.size());
+}
+
+void PixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+ painter->drawPixmap(0, 0, pix);
+}
+
+
diff --git a/demos/sub-attaq/pixmapitem.h b/demos/sub-attaq/pixmapitem.h
index b176215..57f831a 100644
--- a/demos/sub-attaq/pixmapitem.h
+++ b/demos/sub-attaq/pixmapitem.h
@@ -46,18 +46,18 @@
#include "graphicsscene.h"
//Qt
-#include <QtGui/QGraphicsPixmapItem>
+#include <QtGui/QGraphicsObject>
-class PixmapItem : public QGraphicsPixmapItem
+class PixmapItem : public QGraphicsObject
{
public:
PixmapItem(const QString &fileName, GraphicsScene::Mode mode, QGraphicsItem * parent = 0);
-
+ PixmapItem(const QString &fileName, QGraphicsScene *scene);
+ QSizeF size() const;
+ QRectF boundingRect() const;
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
private:
- void loadPixmap(GraphicsScene::Mode mode);
-
- QString name;
- QPixmap pixmap;
+ QPixmap pix;
};
#endif //__PIXMAPITEM__H__
diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp
index 7443ae7..742095e 100644
--- a/demos/sub-attaq/states.cpp
+++ b/demos/sub-attaq/states.cpp
@@ -67,8 +67,7 @@ PlayState::PlayState(GraphicsScene *scene, QState *parent)
PlayState::~PlayState()
{
- if (machine)
- delete machine;
+ delete machine;
}
void PlayState::onEntry(QEvent *)
@@ -169,7 +168,7 @@ void LevelState::initializeLevel()
scene->boat->setCurrentDirection(Boat::None);
scene->boat->setBombsLaunched(0);
scene->boat->show();
- scene->setFocusItem(scene->boat,Qt::OtherFocusReason);
+ scene->setFocusItem(scene->boat, Qt::OtherFocusReason);
scene->boat->run();
scene->progressItem->setScore(game->score);
@@ -276,13 +275,8 @@ void WinState::onExit(QEvent *)
}
/** UpdateScore State */
-UpdateScoreState::UpdateScoreState(PlayState *game, QState *parent) : QState(parent)
-{
- this->game = game;
-}
-void UpdateScoreState::onEntry(QEvent *e)
+UpdateScoreState::UpdateScoreState(PlayState *g, QState *parent) : QState(parent), game(g)
{
- QState::onEntry(e);
}
/** Win transition */
@@ -297,12 +291,10 @@ bool UpdateScoreTransition::eventTest(QEvent *event)
{
if (!QSignalTransition::eventTest(event))
return false;
- else {
- QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
- game->score += se->arguments().at(0).toInt();
- scene->progressItem->setScore(game->score);
- return true;
- }
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
+ game->score += se->arguments().at(0).toInt();
+ scene->progressItem->setScore(game->score);
+ return true;
}
/** Win transition */
@@ -317,12 +309,10 @@ bool WinTransition::eventTest(QEvent *event)
{
if (!QSignalTransition::eventTest(event))
return false;
- else {
- QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
- game->score += se->arguments().at(0).toInt();
- scene->progressItem->setScore(game->score);
- return true;
- }
+ QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
+ game->score += se->arguments().at(0).toInt();
+ scene->progressItem->setScore(game->score);
+ return true;
}
/** Space transition */
@@ -334,12 +324,7 @@ CustomSpaceTransition::CustomSpaceTransition(QWidget *widget, PlayState *game, Q
bool CustomSpaceTransition::eventTest(QEvent *event)
{
- Q_UNUSED(event);
if (!QKeyEventTransition::eventTest(event))
return false;
- if (game->currentLevel != 0)
- return true;
- else
- return false;
-
+ return (game->currentLevel != 0);
}
diff --git a/demos/sub-attaq/states.h b/demos/sub-attaq/states.h
index 9e78ae4..f588e5d 100644
--- a/demos/sub-attaq/states.h
+++ b/demos/sub-attaq/states.h
@@ -136,8 +136,6 @@ class UpdateScoreState : public QState
{
public:
UpdateScoreState(PlayState *game, QState *parent);
-protected:
- void onEntry(QEvent *);
private:
QPropertyAnimation *scoreAnimation;
PlayState *game;
diff --git a/demos/sub-attaq/sub-attaq.pro b/demos/sub-attaq/sub-attaq.pro
index 8677ff5..b5aa465 100644
--- a/demos/sub-attaq/sub-attaq.pro
+++ b/demos/sub-attaq/sub-attaq.pro
@@ -10,7 +10,6 @@ HEADERS += boat.h \
states.h \
boat_p.h \
submarine_p.h \
- custompropertyanimation.h \
qanimationstate.h \
progressitem.h \
textinformationitem.h
@@ -24,7 +23,6 @@ SOURCES += boat.cpp \
graphicsscene.cpp \
animationmanager.cpp \
states.cpp \
- custompropertyanimation.cpp \
qanimationstate.cpp \
progressitem.cpp \
textinformationitem.cpp
diff --git a/demos/sub-attaq/submarine.cpp b/demos/sub-attaq/submarine.cpp
index 3d8490f..f71b81c 100644
--- a/demos/sub-attaq/submarine.cpp
+++ b/demos/sub-attaq/submarine.cpp
@@ -46,7 +46,6 @@
#include "pixmapitem.h"
#include "graphicsscene.h"
#include "animationmanager.h"
-#include "custompropertyanimation.h"
#include "qanimationstate.h"
#include <QtCore/QPropertyAnimation>
@@ -57,62 +56,27 @@
static QAbstractAnimation *setupDestroyAnimation(SubMarine *sub)
{
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(sub);
-#if QT_VERSION >=0x040500
- PixmapItem *step1 = new PixmapItem(QString("explosion/submarine/step1"),GraphicsScene::Big, sub);
- step1->setZValue(6);
- PixmapItem *step2 = new PixmapItem(QString("explosion/submarine/step2"),GraphicsScene::Big, sub);
- step2->setZValue(6);
- PixmapItem *step3 = new PixmapItem(QString("explosion/submarine/step3"),GraphicsScene::Big, sub);
- step3->setZValue(6);
- PixmapItem *step4 = new PixmapItem(QString("explosion/submarine/step4"),GraphicsScene::Big, sub);
- step4->setZValue(6);
- step1->setOpacity(0);
- step2->setOpacity(0);
- step3->setOpacity(0);
- step4->setOpacity(0);
- CustomPropertyAnimation *anim1 = new CustomPropertyAnimation(sub);
- anim1->setMemberFunctions((QGraphicsItem*)step1, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim1->setDuration(100);
- anim1->setEndValue(1);
- CustomPropertyAnimation *anim2 = new CustomPropertyAnimation(sub);
- anim2->setMemberFunctions((QGraphicsItem*)step2, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim2->setDuration(100);
- anim2->setEndValue(1);
- CustomPropertyAnimation *anim3 = new CustomPropertyAnimation(sub);
- anim3->setMemberFunctions((QGraphicsItem*)step3, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim3->setDuration(100);
- anim3->setEndValue(1);
- CustomPropertyAnimation *anim4 = new CustomPropertyAnimation(sub);
- anim4->setMemberFunctions((QGraphicsItem*)step4, &QGraphicsItem::opacity, &QGraphicsItem::setOpacity);
- anim4->setDuration(100);
- anim4->setEndValue(1);
- group->addAnimation(anim1);
- group->addAnimation(anim2);
- group->addAnimation(anim3);
- group->addAnimation(anim4);
-#else
- // work around for a bug where we don't transition if the duration is zero.
- QtPauseAnimation *anim = new QtPauseAnimation(group);
- anim->setDuration(1);
- group->addAnimation(anim);
-#endif
+ for (int i = 1; i <= 4; ++i) {
+ PixmapItem *step = new PixmapItem(QString::fromLatin1("explosion/submarine/step%1").arg(i), GraphicsScene::Big, sub);
+ step->setZValue(6);
+ step->setOpacity(0);
+ QPropertyAnimation *anim = new QPropertyAnimation(step, "opacity", group);
+ anim->setDuration(100);
+ anim->setEndValue(1);
+ }
AnimationManager::self()->registerAnimation(group);
return group;
}
-SubMarine::SubMarine(int type, const QString &name, int points, QGraphicsItem * parent, Qt::WindowFlags wFlags)
- : QGraphicsWidget(parent,wFlags), subType(type), subName(name), subPoints(points), speed(0), direction(SubMarine::None)
+SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QString("submarine"), GraphicsScene::Big),
+ subType(type), subName(name), subPoints(points), speed(0), direction(SubMarine::None)
{
- pixmapItem = new PixmapItem(QString("submarine"),GraphicsScene::Big, this);
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setZValue(5);
- setFlags(QGraphicsItem::ItemIsMovable);
- resize(pixmapItem->boundingRect().width(),pixmapItem->boundingRect().height());
setTransformOriginPoint(boundingRect().center());
graphicsRotation = new QGraphicsRotation(this);
- graphicsRotation->setAxis(QVector3D(0, 1, 0));
+ graphicsRotation->setAxis(Qt::YAxis);
graphicsRotation->setOrigin(QVector3D(size().width()/2, size().height()/2, 0));
QList<QGraphicsTransform *> r;
r.append(graphicsRotation);
@@ -163,7 +127,7 @@ SubMarine::SubMarine(int type, const QString &name, int points, QGraphicsItem *
machine->start();
}
-int SubMarine::points()
+int SubMarine::points() const
{
return subPoints;
}
@@ -202,7 +166,7 @@ void SubMarine::launchTorpedo(int speed)
Torpedo * torp = new Torpedo();
GraphicsScene *scene = static_cast<GraphicsScene *>(this->scene());
scene->addItem(torp);
- torp->setPos(x(), y());
+ torp->setPos(pos());
torp->setCurrentSpeed(speed);
torp->launch();
}
diff --git a/demos/sub-attaq/submarine.h b/demos/sub-attaq/submarine.h
index 1a3d2e5..326a1c8 100644
--- a/demos/sub-attaq/submarine.h
+++ b/demos/sub-attaq/submarine.h
@@ -43,15 +43,13 @@
#define __SUBMARINE__H__
//Qt
-#include <QtCore/QVariantAnimation>
-#include <QtGui/QGraphicsWidget>
#include <QtGui/QGraphicsTransform>
-class PixmapItem;
+#include "pixmapitem.h"
class Torpedo;
-class SubMarine : public QGraphicsWidget
+class SubMarine : public PixmapItem
{
Q_OBJECT
public:
@@ -61,9 +59,9 @@ public:
Right
};
enum { Type = UserType + 1 };
- SubMarine(int type, const QString &name, int points, QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0);
+ SubMarine(int type, const QString &name, int points);
- int points();
+ int points() const;
void setCurrentDirection(Movement direction);
enum Movement currentDirection() const;
@@ -89,7 +87,6 @@ private:
int subPoints;
int speed;
Movement direction;
- PixmapItem *pixmapItem;
QGraphicsRotation *graphicsRotation;
};
diff --git a/demos/sub-attaq/submarine_p.h b/demos/sub-attaq/submarine_p.h
index fa7430b..64a0cf7 100644
--- a/demos/sub-attaq/submarine_p.h
+++ b/demos/sub-attaq/submarine_p.h
@@ -94,7 +94,6 @@ protected:
movementAnimation->setEndValue(QPointF(submarine->scene()->width()-submarine->size().width(),submarine->y()));
movementAnimation->setDuration((submarine->scene()->width()-submarine->size().width()-submarine->x())/submarine->currentSpeed()*12);
}
- movementAnimation->setStartValue(submarine->pos());
QAnimationState::onEntry(e);
}
diff --git a/demos/sub-attaq/torpedo.cpp b/demos/sub-attaq/torpedo.cpp
index cce430d..95f88e6 100644
--- a/demos/sub-attaq/torpedo.cpp
+++ b/demos/sub-attaq/torpedo.cpp
@@ -51,24 +51,21 @@
#include <QtCore/QStateMachine>
#include <QtCore/QFinalState>
-Torpedo::Torpedo(QGraphicsItem * parent, Qt::WindowFlags wFlags)
- : QGraphicsWidget(parent,wFlags), currentSpeed(0), launchAnimation(0)
+Torpedo::Torpedo() : PixmapItem(QString::fromLatin1("torpedo"),GraphicsScene::Big),
+ currentSpeed(0)
{
- pixmapItem = new PixmapItem(QString::fromLatin1("torpedo"),GraphicsScene::Big, this);
setZValue(2);
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- setFlags(QGraphicsItem::ItemIsMovable);
- resize(pixmapItem->boundingRect().size());
}
void Torpedo::launch()
{
- launchAnimation = new QPropertyAnimation(this, "pos");
+ QPropertyAnimation *launchAnimation = new QPropertyAnimation(this, "pos");
AnimationManager::self()->registerAnimation(launchAnimation);
launchAnimation->setEndValue(QPointF(x(),qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15));
launchAnimation->setEasingCurve(QEasingCurve::InQuad);
launchAnimation->setDuration(y()/currentSpeed*10);
connect(launchAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationLaunchValueChanged(const QVariant &)));
+ connect(this,SIGNAL(torpedoExploded()), launchAnimation, SLOT(stop()));
//We setup the state machine of the torpedo
QStateMachine *machine = new QStateMachine(this);
@@ -83,7 +80,7 @@ void Torpedo::launch()
machine->setInitialState(launched);
//### Add a nice animation when the torpedo is destroyed
- launched->addTransition(this, SIGNAL(torpedoExplosed()),final);
+ launched->addTransition(this, SIGNAL(torpedoExploded()),final);
//If the animation is finished, then we move to the final state
launched->addTransition(launched, SIGNAL(animationFinished()), final);
@@ -106,15 +103,12 @@ void Torpedo::setCurrentSpeed(int speed)
void Torpedo::onAnimationLaunchValueChanged(const QVariant &)
{
foreach (QGraphicsItem *item , collidingItems(Qt::IntersectsItemBoundingRect)) {
- if (item->type() == Boat::Type) {
- Boat *b = static_cast<Boat *>(item);
+ if (Boat *b = qgraphicsitem_cast<Boat*>(item))
b->destroy();
- }
}
}
void Torpedo::destroy()
{
- launchAnimation->stop();
- emit torpedoExplosed();
+ emit torpedoExploded();
}
diff --git a/demos/sub-attaq/torpedo.h b/demos/sub-attaq/torpedo.h
index 2e654f4..03f277d 100644
--- a/demos/sub-attaq/torpedo.h
+++ b/demos/sub-attaq/torpedo.h
@@ -42,25 +42,19 @@
#ifndef __TORPEDO__H__
#define __TORPEDO__H__
-//Qt
-#include <QtCore/QObject>
+#include "pixmapitem.h"
-#include <QtCore/QVariantAnimation>
-#include <QtGui/QGraphicsWidget>
-
-class PixmapItem;
-
-class Torpedo : public QGraphicsWidget
+class Torpedo : public PixmapItem
{
Q_OBJECT
public:
- Torpedo(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0);
+ Torpedo();
void launch();
void setCurrentSpeed(int speed);
void destroy();
signals:
- void torpedoExplosed();
+ void torpedoExploded();
void torpedoExecutionFinished();
private slots:
@@ -68,8 +62,6 @@ private slots:
private:
int currentSpeed;
- PixmapItem *pixmapItem;
- QVariantAnimation *launchAnimation;
};
#endif //__TORPEDO__H__
diff --git a/demos/symbianpkgrules.pri b/demos/symbianpkgrules.pri
index cf52cb3..7e6852b 100644
--- a/demos/symbianpkgrules.pri
+++ b/demos/symbianpkgrules.pri
@@ -11,5 +11,3 @@ vendorinfo = \
" "
default_deployment.pkg_prerules += vendorinfo
-
-!isEmpty(TARGET.UID3):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
diff --git a/dist/changes-4.5.4 b/dist/changes-4.5.4
new file mode 100644
index 0000000..abaf4f0
--- /dev/null
+++ b/dist/changes-4.5.4
@@ -0,0 +1,123 @@
+Qt 4.5.4 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 4.5.0. For more details,
+refer to the online documentation included in this distribution. The
+documentation is also available online:
+
+ http://doc.trolltech.com/4.5
+
+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:
+
+ http://www.qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+General Improvements
+--------------------
+
+- Documentation and Examples
+
+Third party components
+----------------------
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+
+****************************************************************************
+* Database Drivers *
+****************************************************************************
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for Linux/X11
+----------------
+
+
+Qt for Windows
+--------------
+
+
+Qt for Mac OS X
+---------------
+
+
+Qt for Embedded Linux
+---------------------
+
+
+Qt for Windows CE
+-----------------
+
+
+****************************************************************************
+* Compiler Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- Build System
+
+- Assistant
+
+
+- Designer
+
+
+- Linguist
+ - Linguist GUI
+
+ - lupdate
+
+ - lrelease
+
+
+- rcc
+
+
+- moc
+
+
+- uic
+
+
+- uic3
+
+
+- qmake
+
+
+- configure
+
+
+- qtconfig
+
+
+- qt3to4
+
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 539c1d5..2ace8de 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -520,7 +520,7 @@ in the \l{Qt for S60 Requirements} document.
We've included a subset of the Qt demos in this package for you
to try out. An excellent starting point is the "fluidlauncher"
demo. To run the demo on a real device, you first have to install
- \c{qt_for_s60.sis} and \c{fluidlauncher.sis} found in the Qt installation
+ \c{qt.sis} and \c{fluidlauncher.sis} found in the Qt installation
directory. Begin by connecting your phone using the USB cable and
selecting "PC Suite mode". In Windows Explorer right click on the
\c{.sis} files and select "Install with Nokia Application Installer"
diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/howtos/exceptionsafety.qdoc
index b70df6b..23bedf5 100644
--- a/doc/src/exceptionsafety.qdoc
+++ b/doc/src/howtos/exceptionsafety.qdoc
@@ -42,7 +42,7 @@
/*!
\page exceptionsafety.html
\title Exception Safety
- \ingroup architecture
+ \ingroup best-practices
\brief A guide to exception safety in Qt.
\bold {Preliminary warning}: Exception safety is not feature complete!
diff --git a/doc/src/s60-introduction.qdoc b/doc/src/platforms/s60-introduction.qdoc
index d0a1976..086ee52 100644
--- a/doc/src/s60-introduction.qdoc
+++ b/doc/src/platforms/s60-introduction.qdoc
@@ -121,8 +121,8 @@
\row \o \c QT_SIS_OPTIONS \o Options accepted by \c .sis creation.
-i, install the package right away using PC suite.
-c=<file>, read certificate information from a file.
- Execute \c{perl createpackage.pl} for more information
- about options.
+ Execute \c{createpackage.pl} script without any
+ parameters for more information about options.
By default no otions are given.
\row \o \c QT_SIS_TARGET \o Target for which \c .sis file is created.
Accepted values are build targets listed in
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index 65d335b..4c3929a 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -128,6 +128,8 @@
\o Intel Compiler
\row \o Embedded Linux QWS (Mips, PowerPC)
\o gcc (\l{http:\\www.codesourcery.com}{Codesourcery version)}
+ \row \o Embedded Linux X11 (ARM)
+ \o gcc (\l{http://www.scratchbox.org/}{Scratchbox)}
\row \o Windows CE 6.0 (ARMv4i, x86, MIPS)
\o MSVC 2008 WinCE 6.0 Professional
\endtable
diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/platforms/symbian-exceptionsafety.qdoc
index 88f4d03..88f4d03 100644
--- a/doc/src/symbian-exceptionsafety.qdoc
+++ b/doc/src/platforms/symbian-exceptionsafety.qdoc
diff --git a/doc/src/snippets/statemachine/main2.cpp b/doc/src/snippets/statemachine/main2.cpp
index d882400..2419dc2 100644
--- a/doc/src/snippets/statemachine/main2.cpp
+++ b/doc/src/snippets/statemachine/main2.cpp
@@ -57,7 +57,7 @@ int main(int argv, char **args)
//![0]
//![2]
- s12>addTransition(quitButton, SIGNAL(clicked()), s12);
+ s12->addTransition(quitButton, SIGNAL(clicked()), s12);
//![2]
//![1]
@@ -71,7 +71,7 @@ int main(int argv, char **args)
QButton *interruptButton = new QPushButton("Interrupt Button");
//![3]
- QHistoryState *s1h = s1->addHistoryState();
+ QHistoryState *s1h = new QHistoryState(s1);
QState *s3 = new QState();
s3->assignProperty(label, "text", "In s3");
diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h
index 1974f4f..c882f1f 100644
--- a/examples/opengl/pbuffers/cube.h
+++ b/examples/opengl/pbuffers/cube.h
@@ -109,9 +109,9 @@ protected:
class Cube : public QObject, public Tile
{
Q_OBJECT
- Q_PROPERTY(qreal range READ range WRITE setRange);
- Q_PROPERTY(qreal altitude READ altitude WRITE setAltitude);
- Q_PROPERTY(qreal rotation READ rotation WRITE setRotation);
+ Q_PROPERTY(qreal range READ range WRITE setRange)
+ Q_PROPERTY(qreal altitude READ altitude WRITE setAltitude)
+ Q_PROPERTY(qreal rotation READ rotation WRITE setRotation)
public:
Cube(const QVector3D &loc = QVector3D());
~Cube();
diff --git a/examples/painting/basicdrawing/renderarea.cpp b/examples/painting/basicdrawing/renderarea.cpp
index e8222af..4f07a2d 100644
--- a/examples/painting/basicdrawing/renderarea.cpp
+++ b/examples/painting/basicdrawing/renderarea.cpp
@@ -136,11 +136,9 @@ void RenderArea::paintEvent(QPaintEvent * /* event */)
QPainter painter(this);
painter.setPen(pen);
painter.setBrush(brush);
- if (antialiased) {
+ if (antialiased)
painter.setRenderHint(QPainter::Antialiasing, true);
//! [9]
- painter.translate(+0.5, +0.5);
- }
//! [10]
for (int x = 0; x < width(); x += 100) {
@@ -202,6 +200,7 @@ void RenderArea::paintEvent(QPaintEvent * /* event */)
}
}
+ painter.setRenderHint(QPainter::Antialiasing, false);
painter.setPen(palette().dark().color());
painter.setBrush(Qt::NoBrush);
painter.drawRect(QRect(0, 0, width() - 1, height() - 1));
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
index b919360..3452155 100644
--- a/examples/statemachine/rogue/movementtransition.h
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -61,7 +61,7 @@ public:
//![1]
protected:
bool eventTest(QEvent *event) {
- if (event->type() == QEvent::Wrapped &&
+ if (event->type() == QEvent::StateMachineWrapped &&
static_cast<QStateMachine::WrappedEvent *>(event)->event()->type() == QEvent::KeyPress) {
QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event();
diff --git a/examples/symbianpkgrules.pri b/examples/symbianpkgrules.pri
index 069a16e..59c5480 100644
--- a/examples/symbianpkgrules.pri
+++ b/examples/symbianpkgrules.pri
@@ -11,5 +11,3 @@ vendorinfo = \
" "
default_deployment.pkg_prerules += vendorinfo
-
-!isEmpty(TARGET.UID3):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
diff --git a/examples/video/videographicsitem/videoitem.h b/examples/video/videographicsitem/videoitem.h
index 80679dd..96f578a 100644
--- a/examples/video/videographicsitem/videoitem.h
+++ b/examples/video/videographicsitem/videoitem.h
@@ -50,6 +50,7 @@ class VideoItem
public QGraphicsItem
{
Q_OBJECT
+ Q_INTERFACES(QGraphicsItem)
public:
explicit VideoItem(QGraphicsItem *parentItem = 0);
~VideoItem();
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 38e955a..1acfefe 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -106,7 +106,13 @@ QMAKE_STRIPFLAGS_LIB += --strip-unneeded
load(qt_config)
load(platform_paths)
-MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl"
+symbian-abld {
+# Versions of abld prior to Symbian^3 have a bug where you cannot remove something from the command line without replacing it
+# Rather than figure out which version of abld we're using, we'll replace the command with a macro *that should never be used*
+ MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE"
+} else {
+ MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl"
+}
MMP_RULES += PAGED
MMP_RULES += $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6
diff --git a/mkspecs/features/symbian/qt.prf b/mkspecs/features/symbian/qt.prf
index 3b24355..0f5b08b 100644
--- a/mkspecs/features/symbian/qt.prf
+++ b/mkspecs/features/symbian/qt.prf
@@ -21,13 +21,13 @@ load(qt)
#
INCLUDEPATH = $$PREPEND_INCLUDEPATH $$INCLUDEPATH
-# Add dependency to QtLibs package to all other projects besides QtLibs.
-# Note: QtLibs with full capabilities has UID3 of 0x2001E61C,
-# while self-signed version typically has temporary UID3 of 0xE001E61C.
+# Add dependency to Qt package to all other projects besides Qt libs.
+# Note: Qt libs with full capabilities has UID3 of 0x2001E61C,
+# while self-signed version typically has temporary UID3 of 0xE001E61C.
contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0xE001E61C) {
default_deployment.pkg_prerules += \
"; Default dependency to Qt libraries" \
- "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {\"QtLibs pre-release\"}"
+ "(0x2001E61C), $${QT_MAJOR_VERSION}, $${QT_MINOR_VERSION}, $${QT_PATCH_VERSION}, {\"Qt\"}"
}
isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
index 84a2935..5fa56a7 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
@@ -1,3 +1,515 @@
+2009-10-02 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Removed the concept of a "fast access cutoff" in arrays, because it
+ punished some patterns of array access too much, and made things too
+ complex for inlining in some cases.
+
+ 1.3% speedup on SunSpider.
+
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::emitSlow_op_put_by_val):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::emitSlow_op_put_by_val):
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+ (JSC::): Check m_vectorLength instead of m_fastAccessCutoff when
+ getting / putting from / to an array. Inline putting past the end of
+ the array.
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::JSArray):
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::putSlowCase):
+ (JSC::JSArray::deleteProperty):
+ (JSC::JSArray::getOwnPropertyNames):
+ (JSC::JSArray::increaseVectorLength):
+ (JSC::JSArray::setLength):
+ (JSC::JSArray::pop):
+ (JSC::JSArray::push):
+ (JSC::JSArray::sort):
+ (JSC::JSArray::fillArgList):
+ (JSC::JSArray::copyToRegisters):
+ (JSC::JSArray::compactForSorting):
+ (JSC::JSArray::checkConsistency):
+ * runtime/JSArray.h:
+ (JSC::JSArray::canGetIndex):
+ (JSC::JSArray::canSetIndex):
+ (JSC::JSArray::setIndex):
+ (JSC::JSArray::markChildrenDirect): Removed m_fastAccessCutoff, and
+ replaced with checks for JSValue() to detect reads and writes from / to
+ uninitialized parts of the array.
+
+2009-10-02 Jonni Rainisto <jonni.rainisto@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Math.random() gives too low values on Win32 when _CRT_RAND_S is not defined
+ https://bugs.webkit.org/show_bug.cgi?id=29956
+
+ * wtf/RandomNumber.cpp:
+ (WTF::randomNumber): Added PLATFORM(WIN_OS) to handle 15bit rand()
+
+2009-10-02 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Take one branch instead of two to test for JSValue().
+
+ 1.1% SunSpider speedup.
+
+ * jit/JITCall.cpp:
+ (JSC::JIT::compileOpCall):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_to_jsnumber):
+ (JSC::JIT::emit_op_create_arguments):
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emitSlow_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
+ of testing for the cell tag with a 0 payload.
+
+ * runtime/JSValue.cpp:
+ (JSC::JSValue::description): Added support for dumping the new empty value,
+ and deleted values, in debug builds.
+
+ * runtime/JSValue.h:
+ (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
+
+ (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
+ tag, to avoid having two different c++ versions of null / empty.
+
+ (JSC::JSValue::operator bool): Test for the empty value tag, instead
+ of testing for the cell tag with a 0 payload.
+
+2009-10-01 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Allow custom memory allocation control for the whole JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=27029
+
+ Since in JavaScriptCore almost every class which has been instantiated by operator new is
+ inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
+ when USE_SYSTEM_MALLOC=0.
+
+ Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
+ (It's needed for the functionality of TCmalloc.)
+
+ Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
+
+ * JavaScriptCore.pri:
+ * wtf/FastMalloc.cpp:
+ (WTF::sleep):
+ * wtf/FastMalloc.h:
+
+2009-09-30 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Devirtualise array toString conversion
+
+ Tweak the implementation of Array.prototype.toString to have a fast path
+ when acting on a true JSArray.
+
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncToString):
+
+2009-09-30 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Geoffrey Garen.
+
+ Buildfix for platforms using JSVALUE32.
+ https://bugs.webkit.org/show_bug.cgi?id=29915
+
+ After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case.
+ Also removed unreachable code.
+
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_add):
+ - Declaration of "OperandTypes types" moved before first use.
+ - Typos fixed: dst modified to result, regT2 added.
+ - Unreachable code removed.
+ (JSC::JIT::emitSlow_op_add):
+ - Missing declaration of "OperandTypes types" added.
+
+2009-09-30 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix CRASH() macro for Symbian build.
+
+ * wtf/Assertions.h: Added missing }
+
+2009-09-29 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Standardized an optimization for adding non-numbers.
+
+ SunSpider says maybe a tiny speedup.
+
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_add):
+ (JSC::JIT::emitSlow_op_add):
+
+2009-09-29 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by David Kilzer.
+
+ [Qt] Assert messages prints visible in Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=29808
+
+ Asserts use vprintf to print the messages to stderr.
+ In Symbian Open C it is not possible to see stderr so
+ I routed the messages to stdout instead.
+
+ * wtf/Assertions.cpp:
+
+2009-09-29 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Darin Adler.
+
+ [Qt] Symbian CRASH macro implementation
+
+ Added Symbian specific crash macro that
+ stops to crash line if JIT debugging is used.
+ Additional differentiation of access violation
+ (KERN-EXEC 3) and CRASH panic.
+
+ * wtf/Assertions.h:
+
+2009-09-28 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC.
+
+ * runtime/Collector.cpp:
+ (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer
+ to ensure that we correctly interpret the contents of registers during marking.
+
+2009-09-29 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Inlined a few math operations.
+
+ ~1% SunSpider speedup.
+
+ * jit/JIT.h:
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::compileBinaryArithOpSlowCase):
+ (JSC::JIT::emitSlow_op_add):
+ (JSC::JIT::emitSlow_op_mul):
+ (JSC::JIT::emit_op_sub):
+ (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on
+ a constant int and a double.
+
+2009-09-28 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Hard dependency on SSE2 instruction set with JIT
+ https://bugs.webkit.org/show_bug.cgi?id=29779
+
+ Add floating point support checks to op_jfalse and op_jtrue, and
+ fix the logic for the slow case of op_add
+
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emitSlow_op_add):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_jfalse):
+ (JSC::JIT::emit_op_jtrue):
+
+2009-09-28 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Chromium port - recognize we are being built independently
+ of chromium and look for dependencies under webkit/chromium rather
+ than chromium/src.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29722
+
+ * JavaScriptCore.gyp/JavaScriptCore.gyp:
+
+2009-09-28 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement XSLT support with QtXmlPatterns.
+ https://bugs.webkit.org/show_bug.cgi?id=28303
+
+ * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
+
+2009-09-28 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28054
+
+ Use derefInNotNull() to work around winscw compiler forward declaration bug
+ regarding templated classes.
+
+ The compiler bug is reported at
+ https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.
+
+ The change should be reverted when the above bug is fixed in winscw compiler.
+
+ Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make winscw compiler
+ work with the default UnSpecifiedBoolType() operator, which removes the winscw hack.
+
+ * wtf/RefPtr.h:
+ (WTF::RefPtr::~RefPtr):
+ (WTF::RefPtr::clear):
+ (WTF::RefPtr::operator UnspecifiedBoolType):
+
+2009-09-28 Gabor Loki <loki@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Remove __clear_cache which is an internal function of GCC
+ https://bugs.webkit.org/show_bug.cgi?id=28886
+
+ Although __clear_cache is exported from GCC, this is an internal
+ function. GCC makes no promises about it.
+
+ * jit/ExecutableAllocator.h:
+ (JSC::ExecutableAllocator::cacheFlush):
+
+2009-09-28 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Fix an absolute path to somewhere in Oliver's machine to a relative path
+ for derived JSONObject.lut.h.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2009-09-28 Joerg Bornemann <joerg.bornemann@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add ARM version detection for Windows CE.
+
+ * wtf/Platform.h:
+
+2009-09-26 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add MarkStackSymbian.cpp to build JavascriptCore for Symbian.
+
+ Re-use Windows shrinkAllocation implementation because Symbian doesn't
+ support releasing part of memory region.
+
+ Use fastMalloc and fastFree to implement allocateStack and releaseStack
+ for Symbian port.
+
+ * JavaScriptCore.pri:
+ * runtime/MarkStack.h:
+ (JSC::MarkStack::MarkStackArray::shrinkAllocation):
+ * runtime/MarkStackSymbian.cpp: Added.
+ (JSC::MarkStack::initializePagesize):
+ (JSC::MarkStack::allocateStack):
+ (JSC::MarkStack::releaseStack):
+
+2009-09-25 Gabor Loki <loki@inf.u-szeged.hu>
+
+ Reviewed by Gavin Barraclough.
+
+ Fix unaligned data access in YARR_JIT on ARMv5 and below.
+ https://bugs.webkit.org/show_bug.cgi?id=29695
+
+ On ARMv5 and below all data access should be naturally aligned.
+ In the YARR_JIT there is a case when character pairs are
+ loaded from the input string, but this data access is not
+ naturally aligned. This fix introduces load32WithUnalignedHalfWords
+ and branch32WithUnalignedHalfWords functions which contain
+ naturally aligned memory loads - half word loads - on ARMv5 and below.
+
+ * assembler/MacroAssemblerARM.cpp:
+ (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
+ (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
+ * assembler/MacroAssemblerARMv7.h:
+ (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords):
+ (JSC::MacroAssemblerARMv7::branch32):
+ (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
+ * assembler/MacroAssemblerX86Common.h:
+ (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords):
+ (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
+ * wtf/Platform.h:
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
+
+2009-09-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Division is needlessly slow in 64-bit
+ https://bugs.webkit.org/show_bug.cgi?id=29723
+
+ Add codegen for op_div on x86-64
+
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+ (JSC::JIT::privateCompileSlowCases):
+ * jit/JIT.h:
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::compileBinaryArithOpSlowCase):
+ (JSC::JIT::emit_op_div):
+ (JSC::JIT::emitSlow_op_div):
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::isOperandConstantImmediateDouble):
+ (JSC::JIT::addressFor):
+ (JSC::JIT::emitLoadDouble):
+ (JSC::JIT::emitLoadInt32ToDouble):
+ (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber):
+
+2009-09-24 Yong Li <yong.li@torchmobile.com>
+
+ Reviewed by Adam Barth.
+
+ Replace platform-dependent code with WTF::currentTime()
+ https://bugs.webkit.org/show_bug.cgi?id=29148
+
+ * jsc.cpp:
+ (StopWatch::start):
+ (StopWatch::stop):
+ (StopWatch::getElapsedMS):
+ * runtime/TimeoutChecker.cpp:
+ (JSC::getCPUTime):
+
+2009-09-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Fix FastMalloc to build with assertions enabled.
+
+ * wtf/FastMalloc.cpp:
+ (WTF::TCMalloc_Central_FreeList::ReleaseToSpans):
+ * wtf/TCSpinLock.h:
+ (TCMalloc_SpinLock::IsHeld):
+
+2009-09-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/7215058> FastMalloc scavenging thread should be named
+
+ * wtf/FastMalloc.cpp:
+ (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name.
+ * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP).
+ * wtf/ThreadingPthreads.cpp:
+ (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP).
+
+2009-09-24 Geoffrey Garen <ggaren@apple.com>
+
+ Suggested by Darin Adler.
+
+ Removed some unnecessary parameter names.
+
+ * wtf/HashCountedSet.h:
+
+2009-09-22 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Code sampling builds are broken.
+ https://bugs.webkit.org/show_bug.cgi?id=29662
+
+ Fix build.
+
+ * bytecode/EvalCodeCache.h:
+ (JSC::EvalCodeCache::get):
+ * bytecode/SamplingTool.cpp:
+ (JSC::ScriptSampleRecord::sample):
+ (JSC::SamplingTool::doRun):
+ (JSC::SamplingTool::notifyOfScope):
+ (JSC::compareScriptSampleRecords):
+ (JSC::SamplingTool::dump):
+ * bytecode/SamplingTool.h:
+ (JSC::ScriptSampleRecord::ScriptSampleRecord):
+ (JSC::ScriptSampleRecord::~ScriptSampleRecord):
+ (JSC::SamplingTool::SamplingTool):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitNewFunction):
+ (JSC::BytecodeGenerator::emitNewFunctionExpression):
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::BytecodeGenerator::makeFunction):
+ * debugger/Debugger.cpp:
+ (JSC::evaluateInGlobalCallFrame):
+ * debugger/DebuggerCallFrame.cpp:
+ (JSC::DebuggerCallFrame::evaluate):
+ * parser/Nodes.cpp:
+ (JSC::ScopeNode::ScopeNode):
+ * runtime/Completion.cpp:
+ (JSC::checkSyntax):
+ (JSC::evaluate):
+ * runtime/Executable.cpp:
+ (JSC::FunctionExecutable::fromGlobalCode):
+ * runtime/Executable.h:
+ (JSC::ScriptExecutable::ScriptExecutable):
+ (JSC::EvalExecutable::EvalExecutable):
+ (JSC::EvalExecutable::create):
+ (JSC::ProgramExecutable::ProgramExecutable):
+ (JSC::FunctionExecutable::create):
+ (JSC::FunctionExecutable::FunctionExecutable):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::globalFuncEval):
+
+2009-09-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ * wtf/Forward.h: Added PassOwnPtr.
+
+2009-09-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix for Windows CE < 5
+
+ Define WINCEBASIC to disable the IsDebuggerPresent() code in
+ wtf/Assertions.cpp.
+
+ * JavaScriptCore.pri:
+
+2009-10-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Fix the Qt on Mac OS X build.
+
+ * wtf/FastMalloc.cpp:
+
+2009-10-02 Jørgen Lind <jorgen.lind@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Allow enabling and disabling of the JIT through a qmake variable.
+
+ Qt's configure may set this variable through .qmake.cache if a
+ commandline option is given and/or the compile test for hwcap.h
+ failed/succeeded.
+
+ * JavaScriptCore.pri:
+
+2009-09-23 Geoffrey Garen <ggaren@apple.com>
+
+ A piece of my last patch that I forgot.
+
+ * wtf/HashCountedSet.h:
+ (WTF::::clear): Added HashCountedSet::clear.
+
2009-09-24 Gabor Loki <loki@inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
@@ -28,6 +540,70 @@
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::cacheFlush):
+2009-09-21 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org
+ https://bugs.webkit.org/show_bug.cgi?id=29599
+
+ It is unsafe to attempt to cache new property transitions on
+ dictionaries of any type.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::tryCachePutByID):
+ * jit/JITStubs.cpp:
+ (JSC::JITThunks::tryCachePutByID):
+
+2009-09-21 Oliver Hunt <oliver@apple.com>
+
+ RS=Maciej Stachowiak.
+
+ Re-land SNES fix with corrected assertion.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::resolveGlobal):
+ (JSC::Interpreter::tryCachePutByID):
+ (JSC::Interpreter::tryCacheGetByID):
+ * jit/JITStubs.cpp:
+ (JSC::JITThunks::tryCachePutByID):
+ (JSC::JITThunks::tryCacheGetByID):
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/BatchedTransitionOptimizer.h:
+ (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::removeDirect):
+ * runtime/Structure.cpp:
+ (JSC::Structure::Structure):
+ (JSC::Structure::getEnumerablePropertyNames):
+ (JSC::Structure::despecifyDictionaryFunction):
+ (JSC::Structure::addPropertyTransitionToExistingStructure):
+ (JSC::Structure::addPropertyTransition):
+ (JSC::Structure::removePropertyTransition):
+ (JSC::Structure::toDictionaryTransition):
+ (JSC::Structure::toCacheableDictionaryTransition):
+ (JSC::Structure::toUncacheableDictionaryTransition):
+ (JSC::Structure::fromDictionaryTransition):
+ (JSC::Structure::removePropertyWithoutTransition):
+ * runtime/Structure.h:
+ (JSC::Structure::isDictionary):
+ (JSC::Structure::isUncacheableDictionary):
+ (JSC::Structure::):
+ * runtime/StructureChain.cpp:
+ (JSC::StructureChain::isCacheable):
+
+2009-09-21 Adam Roben <aroben@apple.com>
+
+ Revert r48573, as it caused many assertion failures
+
+ * interpreter/Interpreter.cpp:
+ * jit/JITStubs.cpp:
+ * runtime/BatchedTransitionOptimizer.h:
+ * runtime/JSObject.cpp:
+ * runtime/Structure.cpp:
+ * runtime/Structure.h:
+ * runtime/StructureChain.cpp:
+
2009-09-21 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Unreviewed make dist build fix. Missing files.
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
index 965f3d6..2330de1 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
@@ -36,9 +36,14 @@ GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
win32-* {
LIBS += -lwinmm
}
-
-contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
-contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
+contains(JAVASCRIPTCORE_JIT,yes) {
+ DEFINES+=ENABLE_JIT=1
+ DEFINES+=ENABLE_YARR_JIT=1
+}
+contains(JAVASCRIPTCORE_JIT,no) {
+ DEFINES+=ENABLE_JIT=0
+ DEFINES+=ENABLE_YARR_JIT=0
+}
# In debug mode JIT disabled until crash fixed
win32-* {
@@ -53,7 +58,10 @@ win32-* {
}
}
-wince*: SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.cpp
+wince* {
+ SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.cpp
+ DEFINES += WINCEBASIC
+}
include(pcre/pcre.pri)
@@ -136,6 +144,10 @@ win32-*|wince* {
runtime/MarkStackPosix.cpp
}
+!contains(DEFINES, USE_SYSTEM_MALLOC) {
+ SOURCES += wtf/TCSystemAlloc.cpp
+}
+
# AllInOneFile.cpp helps gcc analize and optimize code
# Other compilers may be able to do this at link time
SOURCES += \
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp
index 43648c4..d726ecd 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp
@@ -62,6 +62,33 @@ static bool isVFPPresent()
const bool MacroAssemblerARM::s_isVFPPresent = isVFPPresent();
+#if defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_REQUIRE_NATURAL_ALIGNMENT
+void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
+{
+ ARMWord op2;
+
+ ASSERT(address.scale >= 0 && address.scale <= 3);
+ op2 = m_assembler.lsl(address.index, static_cast<int>(address.scale));
+
+ if (address.offset >= 0 && address.offset + 0x2 <= 0xff) {
+ m_assembler.add_r(ARMRegisters::S0, address.base, op2);
+ m_assembler.ldrh_u(dest, ARMRegisters::S0, ARMAssembler::getOp2Byte(address.offset));
+ m_assembler.ldrh_u(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(address.offset + 0x2));
+ } else if (address.offset < 0 && address.offset >= -0xff) {
+ m_assembler.add_r(ARMRegisters::S0, address.base, op2);
+ m_assembler.ldrh_d(dest, ARMRegisters::S0, ARMAssembler::getOp2Byte(-address.offset));
+ m_assembler.ldrh_d(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::getOp2Byte(-address.offset - 0x2));
+ } else {
+ m_assembler.ldr_un_imm(ARMRegisters::S0, address.offset);
+ m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, op2);
+ m_assembler.ldrh_r(dest, address.base, ARMRegisters::S0);
+ m_assembler.add_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::OP2_IMM | 0x2);
+ m_assembler.ldrh_r(ARMRegisters::S0, address.base, ARMRegisters::S0);
+ }
+ m_assembler.orr_r(dest, dest, m_assembler.lsl(ARMRegisters::S0, 16));
+}
+#endif
+
}
#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h
index 0c696c9..aa8cbb0 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -198,6 +198,15 @@ public:
m_assembler.baseIndexTransfer32(true, dest, address.base, address.index, static_cast<int>(address.scale), address.offset);
}
+#if defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_REQUIRE_NATURAL_ALIGNMENT
+ void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest);
+#else
+ void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
+ {
+ load32(address, dest);
+ }
+#endif
+
DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
{
DataLabel32 dataLabel(this);
@@ -364,6 +373,12 @@ public:
return branch32(cond, ARMRegisters::S1, right);
}
+ Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+ {
+ load32WithUnalignedHalfWords(left, ARMRegisters::S1);
+ return branch32(cond, ARMRegisters::S1, right);
+ }
+
Jump branch16(Condition cond, BaseIndex left, RegisterID right)
{
UNUSED_PARAM(cond);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h
index 999056b..a549604 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h
@@ -375,6 +375,11 @@ public:
load32(setupArmAddress(address), dest);
}
+ void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
+ {
+ load32(setupArmAddress(address), dest);
+ }
+
void load32(void* address, RegisterID dest)
{
move(ImmPtr(address), addressTempRegister);
@@ -717,6 +722,13 @@ public:
return branch32(cond, addressTempRegister, right);
}
+ Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+ {
+ // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
+ load32WithUnalignedHalfWords(left, addressTempRegister);
+ return branch32(cond, addressTempRegister, right);
+ }
+
Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
{
load32(left.m_ptr, dataTempRegister);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h
index 61e0e17..5ebefa7 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h
@@ -306,6 +306,11 @@ public:
m_assembler.movl_mr(address.offset, address.base, address.index, address.scale, dest);
}
+ void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
+ {
+ load32(address, dest);
+ }
+
DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
{
m_assembler.movl_mr_disp32(address.offset, address.base, dest);
@@ -604,6 +609,11 @@ public:
return Jump(m_assembler.jCC(x86Condition(cond)));
}
+ Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
+ {
+ return branch32(cond, left, right);
+ }
+
Jump branch16(Condition cond, BaseIndex left, RegisterID right)
{
m_assembler.cmpw_rm(right, left.offset, left.base, left.index, left.scale);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h
index 0e1fb1e..05834fc 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/EvalCodeCache.h
@@ -50,7 +50,7 @@ namespace JSC {
evalExecutable = m_cacheMap.get(evalSource.rep());
if (!evalExecutable) {
- evalExecutable = EvalExecutable::create(makeSource(evalSource));
+ evalExecutable = EvalExecutable::create(exec, makeSource(evalSource));
exceptionValue = evalExecutable->compile(exec, scopeChain);
if (exceptionValue)
return 0;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp
index 8d0faa1..865c919 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp
@@ -157,7 +157,7 @@ void SamplingThread::stop()
}
-void ScopeSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC)
+void ScriptSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC)
{
if (!m_samples) {
m_size = codeBlock->instructions().size();
@@ -196,8 +196,8 @@ void SamplingTool::doRun()
#if ENABLE(CODEBLOCK_SAMPLING)
if (CodeBlock* codeBlock = sample.codeBlock()) {
- MutexLocker locker(m_scopeSampleMapMutex);
- ScopeSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable());
+ MutexLocker locker(m_scriptSampleMapMutex);
+ ScriptSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable());
ASSERT(record);
record->sample(codeBlock, sample.vPC());
}
@@ -209,13 +209,13 @@ void SamplingTool::sample()
s_samplingTool->doRun();
}
-void SamplingTool::notifyOfScope(ScopeNode* scope)
+void SamplingTool::notifyOfScope(ScriptExecutable* script)
{
#if ENABLE(CODEBLOCK_SAMPLING)
- MutexLocker locker(m_scopeSampleMapMutex);
- m_scopeSampleMap->set(scope, new ScopeSampleRecord(scope));
+ MutexLocker locker(m_scriptSampleMapMutex);
+ m_scopeSampleMap->set(script, new ScriptSampleRecord(script));
#else
- UNUSED_PARAM(scope);
+ UNUSED_PARAM(script);
#endif
}
@@ -254,10 +254,10 @@ static int compareLineCountInfoSampling(const void* left, const void* right)
return (leftLineCount->line > rightLineCount->line) ? 1 : (leftLineCount->line < rightLineCount->line) ? -1 : 0;
}
-static int compareScopeSampleRecords(const void* left, const void* right)
+static int compareScriptSampleRecords(const void* left, const void* right)
{
- const ScopeSampleRecord* const leftValue = *static_cast<const ScopeSampleRecord* const *>(left);
- const ScopeSampleRecord* const rightValue = *static_cast<const ScopeSampleRecord* const *>(right);
+ const ScriptSampleRecord* const leftValue = *static_cast<const ScriptSampleRecord* const *>(left);
+ const ScriptSampleRecord* const rightValue = *static_cast<const ScriptSampleRecord* const *>(right);
return (leftValue->m_sampleCount < rightValue->m_sampleCount) ? 1 : (leftValue->m_sampleCount > rightValue->m_sampleCount) ? -1 : 0;
}
@@ -318,26 +318,26 @@ void SamplingTool::dump(ExecState* exec)
// (3) Build and sort 'codeBlockSamples' array.
int scopeCount = m_scopeSampleMap->size();
- Vector<ScopeSampleRecord*> codeBlockSamples(scopeCount);
- ScopeSampleRecordMap::iterator iter = m_scopeSampleMap->begin();
+ Vector<ScriptSampleRecord*> codeBlockSamples(scopeCount);
+ ScriptSampleRecordMap::iterator iter = m_scopeSampleMap->begin();
for (int i = 0; i < scopeCount; ++i, ++iter)
codeBlockSamples[i] = iter->second;
- qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScopeSampleRecord*), compareScopeSampleRecords);
+ qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScriptSampleRecord*), compareScriptSampleRecords);
// (4) Print data from 'codeBlockSamples' array.
printf("\nCodeBlock samples\n\n");
for (int i = 0; i < scopeCount; ++i) {
- ScopeSampleRecord* record = codeBlockSamples[i];
+ ScriptSampleRecord* record = codeBlockSamples[i];
CodeBlock* codeBlock = record->m_codeBlock;
double blockPercent = (record->m_sampleCount * 100.0) / m_sampleCount;
if (blockPercent >= 1) {
//Instruction* code = codeBlock->instructions().begin();
- printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_scope->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
+ printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
if (i < 10) {
HashMap<unsigned,unsigned> lineCounts;
codeBlock->dump(exec);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h
index 1a3f7cf..711b086 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h
@@ -38,6 +38,8 @@
namespace JSC {
+ class ScriptExecutable;
+
class SamplingFlags {
friend class JIT;
public:
@@ -92,9 +94,9 @@ namespace JSC {
class ScopeNode;
struct Instruction;
- struct ScopeSampleRecord {
- ScopeSampleRecord(ScopeNode* scope)
- : m_scope(scope)
+ struct ScriptSampleRecord {
+ ScriptSampleRecord(ScriptExecutable* executable)
+ : m_executable(executable)
, m_codeBlock(0)
, m_sampleCount(0)
, m_opcodeSampleCount(0)
@@ -103,7 +105,7 @@ namespace JSC {
{
}
- ~ScopeSampleRecord()
+ ~ScriptSampleRecord()
{
if (m_samples)
free(m_samples);
@@ -111,7 +113,7 @@ namespace JSC {
void sample(CodeBlock*, Instruction*);
- RefPtr<ScopeNode> m_scope;
+ ScriptExecutable* m_executable;
CodeBlock* m_codeBlock;
int m_sampleCount;
int m_opcodeSampleCount;
@@ -119,7 +121,7 @@ namespace JSC {
unsigned m_size;
};
- typedef WTF::HashMap<ScopeNode*, ScopeSampleRecord*> ScopeSampleRecordMap;
+ typedef WTF::HashMap<ScriptExecutable*, ScriptSampleRecord*> ScriptSampleRecordMap;
class SamplingThread {
public:
@@ -193,7 +195,7 @@ namespace JSC {
, m_sampleCount(0)
, m_opcodeSampleCount(0)
#if ENABLE(CODEBLOCK_SAMPLING)
- , m_scopeSampleMap(new ScopeSampleRecordMap())
+ , m_scopeSampleMap(new ScriptSampleRecordMap())
#endif
{
memset(m_opcodeSamples, 0, sizeof(m_opcodeSamples));
@@ -210,7 +212,7 @@ namespace JSC {
void setup();
void dump(ExecState*);
- void notifyOfScope(ScopeNode* scope);
+ void notifyOfScope(ScriptExecutable* scope);
void sample(CodeBlock* codeBlock, Instruction* vPC)
{
@@ -266,8 +268,8 @@ namespace JSC {
unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
#if ENABLE(CODEBLOCK_SAMPLING)
- Mutex m_scopeSampleMapMutex;
- OwnPtr<ScopeSampleRecordMap> m_scopeSampleMap;
+ Mutex m_scriptSampleMapMutex;
+ OwnPtr<ScriptSampleRecordMap> m_scopeSampleMap;
#endif
};
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 74bf4f8..10a1136 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -273,7 +273,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d
} else {
for (size_t i = 0; i < functionStack.size(); ++i) {
FunctionBodyNode* function = functionStack[i];
- globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, makeFunction(function), scopeChain.node()), DontDelete);
+ globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, makeFunction(exec, function), scopeChain.node()), DontDelete);
}
for (size_t i = 0; i < varStack.size(); ++i) {
if (globalObject->hasProperty(exec, *varStack[i].first))
@@ -399,7 +399,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack();
for (size_t i = 0; i < functionStack.size(); ++i)
- m_codeBlock->addFunctionDecl(makeFunction(functionStack[i]));
+ m_codeBlock->addFunctionDecl(makeFunction(m_globalData, functionStack[i]));
const DeclarationStacks::VarStack& varStack = evalNode->varStack();
unsigned numVariables = varStack.size();
@@ -1316,7 +1316,7 @@ RegisterID* BytecodeGenerator::emitNewArray(RegisterID* dst, ElementNode* elemen
RegisterID* BytecodeGenerator::emitNewFunction(RegisterID* dst, FunctionBodyNode* function)
{
- unsigned index = m_codeBlock->addFunctionDecl(makeFunction(function));
+ unsigned index = m_codeBlock->addFunctionDecl(makeFunction(m_globalData, function));
emitOpcode(op_new_func);
instructions().append(dst->index());
@@ -1336,7 +1336,7 @@ RegisterID* BytecodeGenerator::emitNewRegExp(RegisterID* dst, RegExp* regExp)
RegisterID* BytecodeGenerator::emitNewFunctionExpression(RegisterID* r0, FuncExprNode* n)
{
FunctionBodyNode* function = n->body();
- unsigned index = m_codeBlock->addFunctionExpr(makeFunction(function));
+ unsigned index = m_codeBlock->addFunctionExpr(makeFunction(m_globalData, function));
emitOpcode(op_new_func_exp);
instructions().append(r0->index());
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 935787c..f614f0b 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -417,9 +417,14 @@ namespace JSC {
RegisterID* addConstantValue(JSValue);
unsigned addRegExp(RegExp*);
- PassRefPtr<FunctionExecutable> makeFunction(FunctionBodyNode* body)
+ PassRefPtr<FunctionExecutable> makeFunction(ExecState* exec, FunctionBodyNode* body)
{
- return FunctionExecutable::create(body->ident(), body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
+ return FunctionExecutable::create(exec, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
+ }
+
+ PassRefPtr<FunctionExecutable> makeFunction(JSGlobalData* globalData, FunctionBodyNode* body)
+ {
+ return FunctionExecutable::create(globalData, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
}
Vector<Instruction>& instructions() { return m_codeBlock->instructions(); }
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp
index 61167d4..db02329 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp
@@ -100,7 +100,7 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG
{
CallFrame* globalCallFrame = globalObject->globalExec();
- EvalExecutable eval(makeSource(script));
+ EvalExecutable eval(globalCallFrame, makeSource(script));
JSObject* error = eval.compile(globalCallFrame, globalCallFrame->scopeChain());
if (error)
return error;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index 9c8ca2a..88b14e6 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -79,7 +79,7 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c
if (!m_callFrame->codeBlock())
return JSValue();
- EvalExecutable eval(makeSource(script));
+ EvalExecutable eval(m_callFrame, makeSource(script));
JSObject* error = eval.compile(m_callFrame, m_callFrame->scopeChain());
if (error)
return error;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
index 76c8510..4f00b2b 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
@@ -1026,6 +1026,10 @@ NEVER_INLINE void Interpreter::tryCachePutByID(CallFrame* callFrame, CodeBlock*
// Structure transition, cache transition info
if (slot.type() == PutPropertySlot::NewProperty) {
+ if (structure->isDictionary()) {
+ vPC[0] = getOpcode(op_put_by_id_generic);
+ return;
+ }
vPC[0] = getOpcode(op_put_by_id_transition);
vPC[4] = structure->previousID();
vPC[5] = structure;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.cpp
index bf3a418..ea8434e 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.cpp
@@ -195,7 +195,7 @@ void JIT::privateCompileMainPass()
switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
DEFINE_BINARY_OP(op_del_by_val)
-#if !USE(JSVALUE32_64)
+#if USE(JSVALUE32)
DEFINE_BINARY_OP(op_div)
#endif
DEFINE_BINARY_OP(op_in)
@@ -230,7 +230,7 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_create_arguments)
DEFINE_OP(op_debug)
DEFINE_OP(op_del_by_id)
-#if USE(JSVALUE32_64)
+#if !USE(JSVALUE32)
DEFINE_OP(op_div)
#endif
DEFINE_OP(op_end)
@@ -379,7 +379,7 @@ void JIT::privateCompileSlowCases()
DEFINE_SLOWCASE_OP(op_construct)
DEFINE_SLOWCASE_OP(op_construct_verify)
DEFINE_SLOWCASE_OP(op_convert_this)
-#if USE(JSVALUE32_64)
+#if !USE(JSVALUE32)
DEFINE_SLOWCASE_OP(op_div)
#endif
DEFINE_SLOWCASE_OP(op_eq)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.h
index 5c58e9d..fcbc45e 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JIT.h
@@ -379,14 +379,18 @@ namespace JSC {
enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq };
void compileOpStrictEq(Instruction* instruction, CompileOpStrictEqType type);
+ bool isOperandConstantImmediateDouble(unsigned src);
+
+ void emitLoadDouble(unsigned index, FPRegisterID value);
+ void emitLoadInt32ToDouble(unsigned index, FPRegisterID value);
+
+ Address addressFor(unsigned index, RegisterID base = callFrameRegister);
#if USE(JSVALUE32_64)
Address tagFor(unsigned index, RegisterID base = callFrameRegister);
Address payloadFor(unsigned index, RegisterID base = callFrameRegister);
- Address addressFor(unsigned index, RegisterID base = callFrameRegister);
bool getOperandConstantImmediateInt(unsigned op1, unsigned op2, unsigned& op, int32_t& constant);
- bool isOperandConstantImmediateDouble(unsigned src);
void emitLoadTag(unsigned index, RegisterID tag);
void emitLoadPayload(unsigned index, RegisterID payload);
@@ -394,8 +398,6 @@ namespace JSC {
void emitLoad(const JSValue& v, RegisterID tag, RegisterID payload);
void emitLoad(unsigned index, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister);
void emitLoad2(unsigned index1, RegisterID tag1, RegisterID payload1, unsigned index2, RegisterID tag2, RegisterID payload2);
- void emitLoadDouble(unsigned index, FPRegisterID value);
- void emitLoadInt32ToDouble(unsigned index, FPRegisterID value);
void emitStore(unsigned index, RegisterID tag, RegisterID payload, RegisterID base = callFrameRegister);
void emitStore(unsigned index, const JSValue constant, RegisterID base = callFrameRegister);
@@ -499,6 +501,7 @@ namespace JSC {
JIT::Jump emitJumpIfNotImmediateInteger(RegisterID);
JIT::Jump emitJumpIfNotImmediateIntegers(RegisterID, RegisterID, RegisterID);
void emitJumpSlowCaseIfNotImmediateInteger(RegisterID);
+ void emitJumpSlowCaseIfNotImmediateNumber(RegisterID);
void emitJumpSlowCaseIfNotImmediateIntegers(RegisterID, RegisterID, RegisterID);
#if !USE(JSVALUE64)
@@ -511,7 +514,11 @@ namespace JSC {
void emitTagAsBoolImmediate(RegisterID reg);
void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
- void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
+#if USE(JSVALUE64)
+ void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase);
+#else
+ void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes);
+#endif
#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp
index 3be13cb..7afc1f2 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp
@@ -566,6 +566,14 @@ void JIT::emit_op_add(Instruction* currentInstruction)
unsigned op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+ if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
+ JITStubCall stubCall(this, cti_op_add);
+ stubCall.addArgument(op1);
+ stubCall.addArgument(op2);
+ stubCall.call(dst);
+ return;
+ }
+
JumpList notInt32Op1;
JumpList notInt32Op2;
@@ -630,19 +638,21 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>
unsigned op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+ if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
+ return;
+
unsigned op;
int32_t constant;
if (getOperandConstantImmediateInt(op1, op2, op, constant)) {
linkSlowCase(iter); // overflow check
- if (!supportsFloatingPoint()) {
+ if (!supportsFloatingPoint())
linkSlowCase(iter); // non-sse case
- return;
+ else {
+ ResultType opType = op == op1 ? types.first() : types.second();
+ if (!opType.definitelyIsNumber())
+ linkSlowCase(iter); // double check
}
-
- ResultType opType = op == op1 ? types.first() : types.second();
- if (!opType.definitelyIsNumber())
- linkSlowCase(iter); // double check
} else {
linkSlowCase(iter); // overflow check
@@ -1932,55 +1942,87 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsign
emitFastArithIntToImmNoCheck(regT0, regT0);
}
-void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned result, unsigned op1, unsigned, OperandTypes types)
+void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned result, unsigned op1, unsigned op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase)
{
// We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset.
COMPILE_ASSERT(((JSImmediate::TagTypeNumber + JSImmediate::DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0);
-
- Jump notImm1 = getSlowCase(iter);
- Jump notImm2 = getSlowCase(iter);
+
+ Jump notImm1;
+ Jump notImm2;
+ if (op1HasImmediateIntFastCase) {
+ notImm2 = getSlowCase(iter);
+ } else if (op2HasImmediateIntFastCase) {
+ notImm1 = getSlowCase(iter);
+ } else {
+ notImm1 = getSlowCase(iter);
+ notImm2 = getSlowCase(iter);
+ }
linkSlowCase(iter); // Integer overflow case - we could handle this in JIT code, but this is likely rare.
- if (opcodeID == op_mul) // op_mul has an extra slow case to handle 0 * negative number.
+ if (opcodeID == op_mul && !op1HasImmediateIntFastCase && !op2HasImmediateIntFastCase) // op_mul has an extra slow case to handle 0 * negative number.
linkSlowCase(iter);
emitGetVirtualRegister(op1, regT0);
Label stubFunctionCall(this);
JITStubCall stubCall(this, opcodeID == op_add ? cti_op_add : opcodeID == op_sub ? cti_op_sub : cti_op_mul);
+ if (op1HasImmediateIntFastCase || op2HasImmediateIntFastCase) {
+ emitGetVirtualRegister(op1, regT0);
+ emitGetVirtualRegister(op2, regT1);
+ }
stubCall.addArgument(regT0);
stubCall.addArgument(regT1);
stubCall.call(result);
Jump end = jump();
- // if we get here, eax is not an int32, edx not yet checked.
- notImm1.link(this);
- if (!types.first().definitelyIsNumber())
- emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
- if (!types.second().definitelyIsNumber())
- emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
- addPtr(tagTypeNumberRegister, regT0);
- movePtrToDouble(regT0, fpRegT1);
- Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1);
- convertInt32ToDouble(regT1, fpRegT2);
- Jump op2wasInteger = jump();
-
- // if we get here, eax IS an int32, edx is not.
- notImm2.link(this);
- if (!types.second().definitelyIsNumber())
- emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
- convertInt32ToDouble(regT0, fpRegT1);
- op2isDouble.link(this);
- addPtr(tagTypeNumberRegister, regT1);
- movePtrToDouble(regT1, fpRegT2);
- op2wasInteger.link(this);
+ if (op1HasImmediateIntFastCase) {
+ notImm2.link(this);
+ if (!types.second().definitelyIsNumber())
+ emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
+ emitGetVirtualRegister(op1, regT1);
+ convertInt32ToDouble(regT1, fpRegT1);
+ addPtr(tagTypeNumberRegister, regT0);
+ movePtrToDouble(regT0, fpRegT2);
+ } else if (op2HasImmediateIntFastCase) {
+ notImm1.link(this);
+ if (!types.first().definitelyIsNumber())
+ emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
+ emitGetVirtualRegister(op2, regT1);
+ convertInt32ToDouble(regT1, fpRegT1);
+ addPtr(tagTypeNumberRegister, regT0);
+ movePtrToDouble(regT0, fpRegT2);
+ } else {
+ // if we get here, eax is not an int32, edx not yet checked.
+ notImm1.link(this);
+ if (!types.first().definitelyIsNumber())
+ emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this);
+ if (!types.second().definitelyIsNumber())
+ emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
+ addPtr(tagTypeNumberRegister, regT0);
+ movePtrToDouble(regT0, fpRegT1);
+ Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1);
+ convertInt32ToDouble(regT1, fpRegT2);
+ Jump op2wasInteger = jump();
+
+ // if we get here, eax IS an int32, edx is not.
+ notImm2.link(this);
+ if (!types.second().definitelyIsNumber())
+ emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this);
+ convertInt32ToDouble(regT0, fpRegT1);
+ op2isDouble.link(this);
+ addPtr(tagTypeNumberRegister, regT1);
+ movePtrToDouble(regT1, fpRegT2);
+ op2wasInteger.link(this);
+ }
if (opcodeID == op_add)
addDouble(fpRegT2, fpRegT1);
else if (opcodeID == op_sub)
subDouble(fpRegT2, fpRegT1);
- else {
- ASSERT(opcodeID == op_mul);
+ else if (opcodeID == op_mul)
mulDouble(fpRegT2, fpRegT1);
+ else {
+ ASSERT(opcodeID == op_div);
+ divDouble(fpRegT2, fpRegT1);
}
moveDoubleToPtr(fpRegT1, regT0);
subPtr(tagTypeNumberRegister, regT0);
@@ -2025,16 +2067,14 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>
unsigned result = currentInstruction[1].u.operand;
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
+ OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
- if (isOperandConstantImmediateInt(op1) || isOperandConstantImmediateInt(op2)) {
- linkSlowCase(iter);
- linkSlowCase(iter);
- JITStubCall stubCall(this, cti_op_add);
- stubCall.addArgument(op1, regT2);
- stubCall.addArgument(op2, regT2);
- stubCall.call(result);
- } else
- compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
+ if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
+ return;
+
+ bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1);
+ bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2);
+ compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase);
}
void JIT::emit_op_mul(Instruction* currentInstruction)
@@ -2069,17 +2109,106 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>
unsigned op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
- if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0))
- || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) {
- linkSlowCase(iter);
- linkSlowCase(iter);
- // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
- JITStubCall stubCall(this, cti_op_mul);
- stubCall.addArgument(op1, regT2);
- stubCall.addArgument(op2, regT2);
- stubCall.call(result);
- } else
- compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, types);
+ bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1) && getConstantOperandImmediateInt(op1) > 0;
+ bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2) && getConstantOperandImmediateInt(op2) > 0;
+ compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase);
+}
+
+void JIT::emit_op_div(Instruction* currentInstruction)
+{
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned op1 = currentInstruction[2].u.operand;
+ unsigned op2 = currentInstruction[3].u.operand;
+ OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+
+ if (isOperandConstantImmediateDouble(op1)) {
+ emitGetVirtualRegister(op1, regT0);
+ addPtr(tagTypeNumberRegister, regT0);
+ movePtrToDouble(regT0, fpRegT0);
+ } else if (isOperandConstantImmediateInt(op1)) {
+ emitLoadInt32ToDouble(op1, fpRegT0);
+ } else {
+ emitGetVirtualRegister(op1, regT0);
+ if (!types.first().definitelyIsNumber())
+ emitJumpSlowCaseIfNotImmediateNumber(regT0);
+ Jump notInt = emitJumpIfNotImmediateInteger(regT0);
+ convertInt32ToDouble(regT0, fpRegT0);
+ Jump skipDoubleLoad = jump();
+ notInt.link(this);
+ addPtr(tagTypeNumberRegister, regT0);
+ movePtrToDouble(regT0, fpRegT0);
+ skipDoubleLoad.link(this);
+ }
+
+ if (isOperandConstantImmediateDouble(op2)) {
+ emitGetVirtualRegister(op2, regT1);
+ addPtr(tagTypeNumberRegister, regT1);
+ movePtrToDouble(regT1, fpRegT1);
+ } else if (isOperandConstantImmediateInt(op2)) {
+ emitLoadInt32ToDouble(op2, fpRegT1);
+ } else {
+ emitGetVirtualRegister(op2, regT1);
+ if (!types.second().definitelyIsNumber())
+ emitJumpSlowCaseIfNotImmediateNumber(regT1);
+ Jump notInt = emitJumpIfNotImmediateInteger(regT1);
+ convertInt32ToDouble(regT1, fpRegT1);
+ Jump skipDoubleLoad = jump();
+ notInt.link(this);
+ addPtr(tagTypeNumberRegister, regT1);
+ movePtrToDouble(regT1, fpRegT1);
+ skipDoubleLoad.link(this);
+ }
+ divDouble(fpRegT1, fpRegT0);
+
+ JumpList doubleResult;
+ Jump end;
+ bool attemptIntConversion = (!isOperandConstantImmediateInt(op1) || getConstantOperand(op1).asInt32() > 1) && isOperandConstantImmediateInt(op2);
+ if (attemptIntConversion) {
+ m_assembler.cvttsd2si_rr(fpRegT0, regT0);
+ doubleResult.append(branchTest32(Zero, regT0));
+ m_assembler.ucomisd_rr(fpRegT1, fpRegT0);
+
+ doubleResult.append(m_assembler.jne());
+ doubleResult.append(m_assembler.jp());
+ emitFastArithIntToImmNoCheck(regT0, regT0);
+ end = jump();
+ }
+
+ // Double result.
+ doubleResult.link(this);
+ moveDoubleToPtr(fpRegT0, regT0);
+ subPtr(tagTypeNumberRegister, regT0);
+
+ if (attemptIntConversion)
+ end.link(this);
+ emitPutVirtualRegister(dst, regT0);
+}
+
+void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+ unsigned result = currentInstruction[1].u.operand;
+ unsigned op1 = currentInstruction[2].u.operand;
+ unsigned op2 = currentInstruction[3].u.operand;
+ OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+ if (types.first().definitelyIsNumber() && types.second().definitelyIsNumber()) {
+#ifndef NDEBUG
+ breakpoint();
+#endif
+ return;
+ }
+ if (!isOperandConstantImmediateDouble(op1) && !isOperandConstantImmediateInt(op1)) {
+ if (!types.first().definitelyIsNumber())
+ linkSlowCase(iter);
+ }
+ if (!isOperandConstantImmediateDouble(op2) && !isOperandConstantImmediateInt(op2)) {
+ if (!types.second().definitelyIsNumber())
+ linkSlowCase(iter);
+ }
+ // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
+ JITStubCall stubCall(this, cti_op_div);
+ stubCall.addArgument(op1, regT2);
+ stubCall.addArgument(op2, regT2);
+ stubCall.call(result);
}
void JIT::emit_op_sub(Instruction* currentInstruction)
@@ -2090,7 +2219,6 @@ void JIT::emit_op_sub(Instruction* currentInstruction)
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
compileBinaryArithOp(op_sub, result, op1, op2, types);
-
emitPutVirtualRegister(result);
}
@@ -2101,7 +2229,7 @@ void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>
unsigned op2 = currentInstruction[3].u.operand;
OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
- compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types);
+ compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types, false, false);
}
#else // USE(JSVALUE64)
@@ -2284,6 +2412,15 @@ void JIT::emit_op_add(Instruction* currentInstruction)
unsigned result = currentInstruction[1].u.operand;
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
+ OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+
+ if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
+ JITStubCall stubCall(this, cti_op_add);
+ stubCall.addArgument(op1, regT2);
+ stubCall.addArgument(op2, regT2);
+ stubCall.call(result);
+ return;
+ }
if (isOperandConstantImmediateInt(op1)) {
emitGetVirtualRegister(op2, regT0);
@@ -2298,15 +2435,7 @@ void JIT::emit_op_add(Instruction* currentInstruction)
signExtend32ToPtr(regT0, regT0);
emitPutVirtualRegister(result);
} else {
- OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
- if (types.first().mightBeNumber() && types.second().mightBeNumber())
- compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
- else {
- JITStubCall stubCall(this, cti_op_add);
- stubCall.addArgument(op1, regT2);
- stubCall.addArgument(op2, regT2);
- stubCall.call(result);
- }
+ compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
}
}
@@ -2316,6 +2445,10 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
+ OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
+ if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
+ return;
+
if (isOperandConstantImmediateInt(op1)) {
Jump notImm = getSlowCase(iter);
linkSlowCase(iter);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITCall.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITCall.cpp
index 5bcde42..f4f6e62 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITCall.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITCall.cpp
@@ -242,16 +242,14 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned)
int argCount = instruction[3].u.operand;
int registerOffset = instruction[4].u.operand;
- Jump wasEval1;
- Jump wasEval2;
+ Jump wasEval;
if (opcodeID == op_call_eval) {
JITStubCall stubCall(this, cti_op_call_eval);
stubCall.addArgument(callee);
stubCall.addArgument(JIT::Imm32(registerOffset));
stubCall.addArgument(JIT::Imm32(argCount));
stubCall.call();
- wasEval1 = branchTest32(NonZero, regT0);
- wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
+ wasEval = branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag));
}
emitLoad(callee, regT1, regT2);
@@ -277,10 +275,8 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned)
emitNakedCall(m_globalData->jitStubs.ctiVirtualCall());
- if (opcodeID == op_call_eval) {
- wasEval1.link(this);
- wasEval2.link(this);
- }
+ if (opcodeID == op_call_eval)
+ wasEval.link(this);
emitStore(dst, regT1, regT0);;
@@ -312,16 +308,14 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
int argCount = instruction[3].u.operand;
int registerOffset = instruction[4].u.operand;
- Jump wasEval1;
- Jump wasEval2;
+ Jump wasEval;
if (opcodeID == op_call_eval) {
JITStubCall stubCall(this, cti_op_call_eval);
stubCall.addArgument(callee);
stubCall.addArgument(JIT::Imm32(registerOffset));
stubCall.addArgument(JIT::Imm32(argCount));
stubCall.call();
- wasEval1 = branchTest32(NonZero, regT0);
- wasEval2 = branch32(NotEqual, regT1, Imm32(JSValue::CellTag));
+ wasEval = branch32(NotEqual, regT1, Imm32(JSValue::EmptyValueTag));
}
emitLoad(callee, regT1, regT0);
@@ -365,10 +359,8 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
// Call to the callee
m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
- if (opcodeID == op_call_eval) {
- wasEval1.link(this);
- wasEval2.link(this);
- }
+ if (opcodeID == op_call_eval)
+ wasEval.link(this);
// Put the return value in dst. In the interpreter, op_ret does this.
emitStore(dst, regT1, regT0);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITInlineMethods.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITInlineMethods.h
index e69e273..f26457a 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITInlineMethods.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITInlineMethods.h
@@ -65,6 +65,11 @@ ALWAYS_INLINE void JIT::emitGetJITStubArg(unsigned argumentNumber, RegisterID ds
peek(dst, argumentStackOffset);
}
+ALWAYS_INLINE bool JIT::isOperandConstantImmediateDouble(unsigned src)
+{
+ return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isDouble();
+}
+
ALWAYS_INLINE JSValue JIT::getConstantOperand(unsigned src)
{
ASSERT(m_codeBlock->isConstantRegisterIndex(src));
@@ -305,6 +310,11 @@ ALWAYS_INLINE void JIT::sampleCodeBlock(CodeBlock* codeBlock)
#endif
#endif
+inline JIT::Address JIT::addressFor(unsigned index, RegisterID base)
+{
+ return Address(base, (index * sizeof(Register)));
+}
+
#if USE(JSVALUE32_64)
inline JIT::Address JIT::tagFor(unsigned index, RegisterID base)
@@ -317,11 +327,6 @@ inline JIT::Address JIT::payloadFor(unsigned index, RegisterID base)
return Address(base, (index * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.payload));
}
-inline JIT::Address JIT::addressFor(unsigned index, RegisterID base)
-{
- return Address(base, (index * sizeof(Register)));
-}
-
inline void JIT::emitLoadTag(unsigned index, RegisterID tag)
{
RegisterID mappedTag;
@@ -579,11 +584,6 @@ ALWAYS_INLINE bool JIT::getOperandConstantImmediateInt(unsigned op1, unsigned op
return false;
}
-ALWAYS_INLINE bool JIT::isOperandConstantImmediateDouble(unsigned src)
-{
- return m_codeBlock->isConstantRegisterIndex(src) && getConstantOperand(src).isDouble();
-}
-
/* Deprecated: Please use JITStubCall instead. */
ALWAYS_INLINE void JIT::emitPutJITStubArg(RegisterID tag, RegisterID payload, unsigned argumentNumber)
@@ -732,6 +732,24 @@ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotImmediateNumber(RegisterID reg)
{
return branchTestPtr(Zero, reg, tagTypeNumberRegister);
}
+
+inline void JIT::emitLoadDouble(unsigned index, FPRegisterID value)
+{
+ if (m_codeBlock->isConstantRegisterIndex(index)) {
+ Register& inConstantPool = m_codeBlock->constantRegister(index);
+ loadDouble(&inConstantPool, value);
+ } else
+ loadDouble(addressFor(index), value);
+}
+
+inline void JIT::emitLoadInt32ToDouble(unsigned index, FPRegisterID value)
+{
+ if (m_codeBlock->isConstantRegisterIndex(index)) {
+ Register& inConstantPool = m_codeBlock->constantRegister(index);
+ convertInt32ToDouble(AbsoluteAddress(&inConstantPool), value);
+ } else
+ convertInt32ToDouble(addressFor(index), value);
+}
#endif
ALWAYS_INLINE JIT::Jump JIT::emitJumpIfImmediateInteger(RegisterID reg)
@@ -769,6 +787,11 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateIntegers(RegisterID reg1,
addSlowCase(emitJumpIfNotImmediateIntegers(reg1, reg2, scratch));
}
+ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateNumber(RegisterID reg)
+{
+ addSlowCase(emitJumpIfNotImmediateNumber(reg));
+}
+
#if !USE(JSVALUE64)
ALWAYS_INLINE void JIT::emitFastArithDeTagImmediate(RegisterID reg)
{
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITOpcodes.cpp
index 34debcb..b5f6597 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITOpcodes.cpp
@@ -248,10 +248,8 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
addPtr(Imm32(NativeCallFrameSize - sizeof(NativeFunctionCalleeSignature)), stackPointerRegister);
// Check for an exception
- // FIXME: Maybe we can optimize this comparison to JSValue().
move(ImmPtr(&globalData->exception), regT2);
- Jump sawException1 = branch32(NotEqual, tagFor(0, regT2), Imm32(JSValue::CellTag));
- Jump sawException2 = branch32(NonZero, payloadFor(0, regT2), Imm32(0));
+ Jump sawException = branch32(NotEqual, tagFor(0, regT2), Imm32(JSValue::EmptyValueTag));
// Grab the return address.
emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT3);
@@ -264,8 +262,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
ret();
// Handle an exception
- sawException1.link(this);
- sawException2.link(this);
+ sawException.link(this);
// Grab the return address.
emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT1);
move(ImmPtr(&globalData->exceptionLocation), regT2);
@@ -794,14 +791,17 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction)
Jump isTrue2 = branch32(NotEqual, regT0, Imm32(0));
addJump(jump(), target + 2);
- isNotInteger.link(this);
+ if (supportsFloatingPoint()) {
+ isNotInteger.link(this);
- addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag)));
+ addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag)));
+
+ zeroDouble(fpRegT0);
+ emitLoadDouble(cond, fpRegT1);
+ addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2);
+ } else
+ addSlowCase(isNotInteger);
- zeroDouble(fpRegT0);
- emitLoadDouble(cond, fpRegT1);
- addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2);
-
isTrue.link(this);
isTrue2.link(this);
}
@@ -832,14 +832,17 @@ void JIT::emit_op_jtrue(Instruction* currentInstruction)
Jump isFalse2 = branch32(Equal, regT0, Imm32(0));
addJump(jump(), target + 2);
- isNotInteger.link(this);
+ if (supportsFloatingPoint()) {
+ isNotInteger.link(this);
- addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag)));
+ addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag)));
+
+ zeroDouble(fpRegT0);
+ emitLoadDouble(cond, fpRegT1);
+ addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2);
+ } else
+ addSlowCase(isNotInteger);
- zeroDouble(fpRegT0);
- emitLoadDouble(cond, fpRegT1);
- addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2);
-
isFalse.link(this);
isFalse2.link(this);
}
@@ -1231,7 +1234,7 @@ void JIT::emit_op_to_jsnumber(Instruction* currentInstruction)
emitLoad(src, regT1, regT0);
Jump isInt32 = branch32(Equal, regT1, Imm32(JSValue::Int32Tag));
- addSlowCase(branch32(AboveOrEqual, regT1, Imm32(JSValue::DeletedValueTag)));
+ addSlowCase(branch32(AboveOrEqual, regT1, Imm32(JSValue::EmptyValueTag)));
isInt32.link(this);
if (src != dst)
@@ -1381,8 +1384,7 @@ void JIT::emit_op_enter_with_activation(Instruction* currentInstruction)
void JIT::emit_op_create_arguments(Instruction*)
{
- Jump argsNotCell = branch32(NotEqual, tagFor(RegisterFile::ArgumentsRegister, callFrameRegister), Imm32(JSValue::CellTag));
- Jump argsNotNull = branchTestPtr(NonZero, payloadFor(RegisterFile::ArgumentsRegister, callFrameRegister));
+ Jump argsCreated = branch32(NotEqual, tagFor(RegisterFile::ArgumentsRegister, callFrameRegister), Imm32(JSValue::EmptyValueTag));
// If we get here the arguments pointer is a null cell - i.e. arguments need lazy creation.
if (m_codeBlock->m_numParameters == 1)
@@ -1390,8 +1392,7 @@ void JIT::emit_op_create_arguments(Instruction*)
else
JITStubCall(this, cti_op_create_arguments).call();
- argsNotCell.link(this);
- argsNotNull.link(this);
+ argsCreated.link(this);
}
void JIT::emit_op_init_arguments(Instruction*)
@@ -2707,32 +2708,20 @@ void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowC
void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- // The slow void JIT::emitSlow_that handles accesses to arrays (below) may jump back up to here.
- Label beginGetByValSlow(this);
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned base = currentInstruction[2].u.operand;
+ unsigned property = currentInstruction[3].u.operand;
- Jump notImm = getSlowCase(iter);
- linkSlowCase(iter);
- linkSlowCase(iter);
- emitFastArithIntToImmNoCheck(regT1, regT1);
+ linkSlowCase(iter); // property int32 check
+ linkSlowCaseIfNotJSCell(iter, base); // base cell check
+ linkSlowCase(iter); // base array check
+ linkSlowCase(iter); // vector length check
+ linkSlowCase(iter); // empty value
- notImm.link(this);
JITStubCall stubCall(this, cti_op_get_by_val);
- stubCall.addArgument(regT0);
- stubCall.addArgument(regT1);
- stubCall.call(currentInstruction[1].u.operand);
- emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
-
- // This is slow void JIT::emitSlow_that handles accesses to arrays above the fast cut-off.
- // First, check if this is an access to the vector
- linkSlowCase(iter);
- branch32(AboveOrEqual, regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength)), beginGetByValSlow);
-
- // okay, missed the fast region, but it is still in the vector. Get the value.
- loadPtr(BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT2);
- // Check whether the value loaded is zero; if so we need to return undefined.
- branchTestPtr(Zero, regT2, beginGetByValSlow);
- move(regT2, regT0);
- emitPutVirtualRegister(currentInstruction[1].u.operand, regT0);
+ stubCall.addArgument(base, regT2);
+ stubCall.addArgument(property, regT2);
+ stubCall.call(dst);
}
void JIT::emitSlow_op_loop_if_less(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -2789,30 +2778,20 @@ void JIT::emitSlow_op_loop_if_lesseq(Instruction* currentInstruction, Vector<Slo
void JIT::emitSlow_op_put_by_val(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- // Normal slow cases - either is not an immediate imm, or is an array.
- Jump notImm = getSlowCase(iter);
- linkSlowCase(iter);
- linkSlowCase(iter);
- emitFastArithIntToImmNoCheck(regT1, regT1);
+ unsigned base = currentInstruction[1].u.operand;
+ unsigned property = currentInstruction[2].u.operand;
+ unsigned value = currentInstruction[3].u.operand;
- notImm.link(this); {
- JITStubCall stubCall(this, cti_op_put_by_val);
- stubCall.addArgument(regT0);
- stubCall.addArgument(regT1);
- stubCall.addArgument(currentInstruction[3].u.operand, regT2);
- stubCall.call();
- emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_put_by_val));
- }
+ linkSlowCase(iter); // property int32 check
+ linkSlowCaseIfNotJSCell(iter, base); // base cell check
+ linkSlowCase(iter); // base not array check
+ linkSlowCase(iter); // in vector check
- // slow cases for immediate int accesses to arrays
- linkSlowCase(iter);
- linkSlowCase(iter); {
- JITStubCall stubCall(this, cti_op_put_by_val_array);
- stubCall.addArgument(regT0);
- stubCall.addArgument(regT1);
- stubCall.addArgument(currentInstruction[3].u.operand, regT2);
- stubCall.call();
- }
+ JITStubCall stubPutByValCall(this, cti_op_put_by_val);
+ stubPutByValCall.addArgument(regT0);
+ stubPutByValCall.addArgument(property, regT2);
+ stubPutByValCall.addArgument(value, regT2);
+ stubPutByValCall.call();
}
void JIT::emitSlow_op_loop_if_true(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp
index 08b3096..9edfd01 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -273,11 +273,14 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
addSlowCase(branch32(NotEqual, regT3, Imm32(JSValue::Int32Tag)));
emitJumpSlowCaseIfNotJSCell(base, regT1);
addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
- addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_fastAccessCutoff))));
- loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT0);
- load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), regT1); // tag
- load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0); // payload
+ loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT3);
+ addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength))));
+
+ load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), regT1); // tag
+ load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0); // payload
+ addSlowCase(branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag)));
+
emitStore(dst, regT1, regT0);
map(m_bytecodeIndex + OPCODE_LENGTH(op_get_by_val), dst, regT1, regT0);
}
@@ -288,35 +291,16 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vector<SlowCas
unsigned base = currentInstruction[2].u.operand;
unsigned property = currentInstruction[3].u.operand;
- // The slow void JIT::emitSlow_that handles accesses to arrays (below) may jump back up to here.
- Label callGetByValJITStub(this);
-
linkSlowCase(iter); // property int32 check
linkSlowCaseIfNotJSCell(iter, base); // base cell check
linkSlowCase(iter); // base array check
+ linkSlowCase(iter); // vector length check
+ linkSlowCase(iter); // empty value
JITStubCall stubCall(this, cti_op_get_by_val);
stubCall.addArgument(base);
stubCall.addArgument(property);
stubCall.call(dst);
-
- emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
-
- linkSlowCase(iter); // array fast cut-off check
-
- loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT0);
- branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength)), callGetByValJITStub);
-
- // Missed the fast region, but it is still in the vector.
- load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), regT1); // tag
- load32(BaseIndex(regT0, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0); // payload
-
- // FIXME: Maybe we can optimize this comparison to JSValue().
- Jump skip = branch32(NotEqual, regT0, Imm32(0));
- branch32(Equal, regT1, Imm32(JSValue::CellTag), callGetByValJITStub);
-
- skip.link(this);
- emitStore(dst, regT1, regT0);
}
void JIT::emit_op_put_by_val(Instruction* currentInstruction)
@@ -330,24 +314,27 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
addSlowCase(branch32(NotEqual, regT3, Imm32(JSValue::Int32Tag)));
emitJumpSlowCaseIfNotJSCell(base, regT1);
addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
- loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT3);
-
- Jump inFastVector = branch32(Below, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_fastAccessCutoff)));
+ addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength))));
- // Check if the access is within the vector.
- addSlowCase(branch32(AboveOrEqual, regT2, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength))));
-
- // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
- // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
- Jump skip = branch32(NotEqual, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), Imm32(JSValue::CellTag));
- addSlowCase(branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), Imm32(0)));
- skip.link(this);
+ loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT3);
- inFastVector.link(this);
+ Jump empty = branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), Imm32(JSValue::EmptyValueTag));
+ Label storeResult(this);
emitLoad(value, regT1, regT0);
store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))); // payload
store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4)); // tag
+ Jump end = jump();
+
+ empty.link(this);
+ add32(Imm32(1), Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
+ branch32(Below, regT2, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_length))).linkTo(storeResult, this);
+
+ add32(Imm32(1), regT2, regT0);
+ store32(regT0, Address(regT3, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ jump().linkTo(storeResult, this);
+
+ end.link(this);
}
void JIT::emitSlow_op_put_by_val(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -359,24 +346,13 @@ void JIT::emitSlow_op_put_by_val(Instruction* currentInstruction, Vector<SlowCas
linkSlowCase(iter); // property int32 check
linkSlowCaseIfNotJSCell(iter, base); // base cell check
linkSlowCase(iter); // base not array check
+ linkSlowCase(iter); // in vector check
JITStubCall stubPutByValCall(this, cti_op_put_by_val);
stubPutByValCall.addArgument(base);
stubPutByValCall.addArgument(property);
stubPutByValCall.addArgument(value);
stubPutByValCall.call();
-
- emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
-
- // Slow cases for immediate int accesses to arrays.
- linkSlowCase(iter); // in vector check
- linkSlowCase(iter); // written to slot check
-
- JITStubCall stubCall(this, cti_op_put_by_val_array);
- stubCall.addArgument(regT1, regT0);
- stubCall.addArgument(regT2);
- stubCall.addArgument(value);
- stubCall.call();
}
void JIT::emit_op_get_by_id(Instruction* currentInstruction)
@@ -958,12 +934,16 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str
void JIT::emit_op_get_by_val(Instruction* currentInstruction)
{
- emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
+ unsigned dst = currentInstruction[1].u.operand;
+ unsigned base = currentInstruction[2].u.operand;
+ unsigned property = currentInstruction[3].u.operand;
+
+ emitGetVirtualRegisters(base, regT0, property, regT1);
emitJumpSlowCaseIfNotImmediateInteger(regT1);
#if USE(JSVALUE64)
// This is technically incorrect - we're zero-extending an int32. On the hot path this doesn't matter.
- // We check the value as if it was a uint32 against the m_fastAccessCutoff - which will always fail if
- // number was signed since m_fastAccessCutoff is always less than intmax (since the total allocation
+ // We check the value as if it was a uint32 against the m_vectorLength - which will always fail if
+ // number was signed since m_vectorLength is always less than intmax (since the total allocation
// size is always less than 4Gb). As such zero extending wil have been correct (and extending the value
// to 64-bits is necessary since it's used in the address calculation. We zero extend rather than sign
// extending since it makes it easier to re-tag the value in the slow case.
@@ -971,21 +951,25 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
#else
emitFastArithImmToInt(regT1);
#endif
- emitJumpSlowCaseIfNotJSCell(regT0);
+ emitJumpSlowCaseIfNotJSCell(regT0, base);
addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
- // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT2);
- addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, OBJECT_OFFSETOF(JSArray, m_fastAccessCutoff))));
+ addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength))));
- // Get the value from the vector
loadPtr(BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0);
- emitPutVirtualRegister(currentInstruction[1].u.operand);
+ addSlowCase(branchTestPtr(Zero, regT0));
+
+ emitPutVirtualRegister(dst);
}
void JIT::emit_op_put_by_val(Instruction* currentInstruction)
{
- emitGetVirtualRegisters(currentInstruction[1].u.operand, regT0, currentInstruction[2].u.operand, regT1);
+ unsigned base = currentInstruction[1].u.operand;
+ unsigned property = currentInstruction[2].u.operand;
+ unsigned value = currentInstruction[3].u.operand;
+
+ emitGetVirtualRegisters(base, regT0, property, regT1);
emitJumpSlowCaseIfNotImmediateInteger(regT1);
#if USE(JSVALUE64)
// See comment in op_get_by_val.
@@ -993,23 +977,29 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
#else
emitFastArithImmToInt(regT1);
#endif
- emitJumpSlowCaseIfNotJSCell(regT0);
+ emitJumpSlowCaseIfNotJSCell(regT0, base);
addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
+ addSlowCase(branch32(AboveOrEqual, regT1, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength))));
- // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT2);
- Jump inFastVector = branch32(Below, regT1, Address(regT0, OBJECT_OFFSETOF(JSArray, m_fastAccessCutoff)));
- // No; oh well, check if the access if within the vector - if so, we may still be okay.
- addSlowCase(branch32(AboveOrEqual, regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength))));
- // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
- // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
- addSlowCase(branchTestPtr(Zero, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))));
+ Jump empty = branchTestPtr(Zero, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
- // All good - put the value into the array.
- inFastVector.link(this);
- emitGetVirtualRegister(currentInstruction[3].u.operand, regT0);
+ Label storeResult(this);
+ emitGetVirtualRegister(value, regT0);
storePtr(regT0, BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])));
+ Jump end = jump();
+
+ empty.link(this);
+ add32(Imm32(1), Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_numValuesInVector)));
+ branch32(Below, regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_length))).linkTo(storeResult, this);
+
+ move(regT1, regT0);
+ add32(Imm32(1), regT0);
+ store32(regT0, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_length)));
+ jump().linkTo(storeResult, this);
+
+ end.link(this);
}
void JIT::emit_op_put_by_index(Instruction* currentInstruction)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
index 08a4493..073b35a 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
@@ -730,7 +730,7 @@ NEVER_INLINE void JITThunks::tryCachePutByID(CallFrame* callFrame, CodeBlock* co
// Structure transition, cache transition info
if (slot.type() == PutPropertySlot::NewProperty) {
StructureChain* prototypeChain = structure->prototypeChain(callFrame);
- if (!prototypeChain->isCacheable()) {
+ if (!prototypeChain->isCacheable() || structure->isDictionary()) {
ctiPatchCallByReturnAddress(codeBlock, returnAddress, FunctionPtr(cti_op_put_by_id_generic));
return;
}
@@ -1983,28 +1983,6 @@ DEFINE_STUB_FUNCTION(void, op_put_by_val)
CHECK_FOR_EXCEPTION_AT_END();
}
-DEFINE_STUB_FUNCTION(void, op_put_by_val_array)
-{
- STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
- JSValue baseValue = stackFrame.args[0].jsValue();
- int i = stackFrame.args[1].int32();
- JSValue value = stackFrame.args[2].jsValue();
-
- ASSERT(isJSArray(stackFrame.globalData, baseValue));
-
- if (LIKELY(i >= 0))
- asArray(baseValue)->JSArray::put(callFrame, i, value);
- else {
- Identifier property(callFrame, UString::from(i));
- PutPropertySlot slot;
- baseValue.put(callFrame, property, value, slot);
- }
-
- CHECK_FOR_EXCEPTION_AT_END();
-}
-
DEFINE_STUB_FUNCTION(void, op_put_by_val_byte_array)
{
STUB_INIT_STACK_FRAME(stackFrame);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h
index 3ae8f24..43975ff 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h
@@ -349,7 +349,6 @@ extern "C" {
void JIT_STUB cti_op_put_by_id_generic(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_put_by_index(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_put_by_val(STUB_ARGS_DECLARATION);
- void JIT_STUB cti_op_put_by_val_array(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_put_by_val_byte_array(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_put_getter(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_put_setter(STUB_ARGS_DECLARATION);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp
index 92b1e58..ee4e393 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp
@@ -24,6 +24,7 @@
#include "BytecodeGenerator.h"
#include "Completion.h"
+#include "CurrentTime.h"
#include "InitializeThreading.h"
#include "JSArray.h"
#include "JSFunction.h"
@@ -118,53 +119,23 @@ public:
long getElapsedMS(); // call stop() first
private:
-#if PLATFORM(QT)
- uint m_startTime;
- uint m_stopTime;
-#elif PLATFORM(WIN_OS)
- DWORD m_startTime;
- DWORD m_stopTime;
-#else
- // Windows does not have timeval, disabling this class for now (bug 7399)
- timeval m_startTime;
- timeval m_stopTime;
-#endif
+ double m_startTime;
+ double m_stopTime;
};
void StopWatch::start()
{
-#if PLATFORM(QT)
- QDateTime t = QDateTime::currentDateTime();
- m_startTime = t.toTime_t() * 1000 + t.time().msec();
-#elif PLATFORM(WIN_OS)
- m_startTime = timeGetTime();
-#else
- gettimeofday(&m_startTime, 0);
-#endif
+ m_startTime = currentTime();
}
void StopWatch::stop()
{
-#if PLATFORM(QT)
- QDateTime t = QDateTime::currentDateTime();
- m_stopTime = t.toTime_t() * 1000 + t.time().msec();
-#elif PLATFORM(WIN_OS)
- m_stopTime = timeGetTime();
-#else
- gettimeofday(&m_stopTime, 0);
-#endif
+ m_stopTime = currentTime();
}
long StopWatch::getElapsedMS()
{
-#if PLATFORM(WIN_OS) || PLATFORM(QT)
- return m_stopTime - m_startTime;
-#else
- timeval elapsedTime;
- timersub(&m_stopTime, &m_startTime, &elapsedTime);
-
- return elapsedTime.tv_sec * 1000 + lroundf(elapsedTime.tv_usec / 1000.0f);
-#endif
+ return static_cast<long>((m_stopTime - m_startTime) * 1000);
}
class GlobalObject : public JSGlobalObject {
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.pro b/src/3rdparty/javascriptcore/JavaScriptCore/jsc.pro
deleted file mode 100644
index ba880ff..0000000
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.pro
+++ /dev/null
@@ -1,31 +0,0 @@
-TEMPLATE = app
-TARGET = jsc
-DESTDIR = .
-SOURCES = jsc.cpp
-QT -= gui
-CONFIG -= app_bundle
-CONFIG += building-libs
-win32-*: CONFIG += console
-win32-msvc*: CONFIG += exceptions_off stl_off
-
-include($$PWD/../WebKit.pri)
-
-CONFIG += link_pkgconfig
-
-QMAKE_RPATHDIR += $$OUTPUT_DIR/lib
-
-isEmpty(OUTPUT_DIR):OUTPUT_DIR=$$PWD/..
-CONFIG(debug, debug|release) {
- OBJECTS_DIR = obj/debug
-} else { # Release
- OBJECTS_DIR = obj/release
-}
-OBJECTS_DIR_WTR = $$OBJECTS_DIR$${QMAKE_DIR_SEP}
-include($$PWD/JavaScriptCore.pri)
-
-lessThan(QT_MINOR_VERSION, 4) {
- DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE=""
-}
-
-*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2
-*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.cpp
index 7170f73..89bbc11 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.cpp
@@ -1899,10 +1899,6 @@ ScopeNode::ScopeNode(JSGlobalData* globalData)
, ParserArenaRefCounted(globalData)
, m_features(NoFeatures)
{
-#if ENABLE(CODEBLOCK_SAMPLING)
- if (SamplingTool* sampler = globalData->interpreter->sampler())
- sampler->notifyOfScope(this);
-#endif
}
ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, CodeFeatures features, int numConstants)
@@ -1912,10 +1908,6 @@ ScopeNode::ScopeNode(JSGlobalData* globalData, const SourceCode& source, SourceE
, m_features(features)
, m_source(source)
{
-#if ENABLE(CODEBLOCK_SAMPLING)
- if (SamplingTool* sampler = globalData->interpreter->sampler())
- sampler->notifyOfScope(this);
-#endif
}
inline void ScopeNode::emitStatementsBytecode(BytecodeGenerator& generator, RegisterID* dst)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp
index e1b1f34..c453b22 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -149,10 +149,11 @@ static void putProperty(ExecState* exec, JSObject* obj, const Identifier& proper
JSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
{
- if (!thisValue.inherits(&JSArray::info))
+ bool isRealArray = isJSArray(&exec->globalData(), thisValue);
+ if (!isRealArray && !thisValue.inherits(&JSArray::info))
return throwError(exec, TypeError);
- JSObject* thisObj = asArray(thisValue);
-
+ JSArray* thisObj = asArray(thisValue);
+
HashSet<JSObject*>& arrayVisitedElements = exec->globalData().arrayVisitedElements;
if (arrayVisitedElements.size() >= MaxSecondaryThreadReentryDepth) {
if (!isMainThread() || arrayVisitedElements.size() >= MaxMainThreadReentryDepth)
@@ -163,34 +164,48 @@ JSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue
if (alreadyVisited)
return jsEmptyString(exec); // return an empty string, avoiding infinite recursion.
- Vector<UChar, 256> strBuffer;
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
+ unsigned totalSize = length ? length - 1 : 0;
+ Vector<RefPtr<UString::Rep>, 256> strBuffer(length);
for (unsigned k = 0; k < length; k++) {
- if (k >= 1)
- strBuffer.append(',');
- if (!strBuffer.data()) {
- JSObject* error = Error::create(exec, GeneralError, "Out of memory");
- exec->setException(error);
- break;
- }
-
- JSValue element = thisObj->get(exec, k);
+ JSValue element;
+ if (isRealArray && thisObj->canGetIndex(k))
+ element = thisObj->getIndex(k);
+ else
+ element = thisObj->get(exec, k);
+
if (element.isUndefinedOrNull())
continue;
-
+
UString str = element.toString(exec);
- strBuffer.append(str.data(), str.size());
-
+ strBuffer[k] = str.rep();
+ totalSize += str.size();
+
if (!strBuffer.data()) {
JSObject* error = Error::create(exec, GeneralError, "Out of memory");
exec->setException(error);
}
-
+
if (exec->hadException())
break;
}
arrayVisitedElements.remove(thisObj);
- return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
+ if (!totalSize)
+ return jsEmptyString(exec);
+ Vector<UChar> buffer;
+ buffer.reserveCapacity(totalSize);
+ if (!buffer.data())
+ return throwError(exec, GeneralError, "Out of memory");
+
+ for (unsigned i = 0; i < length; i++) {
+ if (i)
+ buffer.append(',');
+ if (RefPtr<UString::Rep> rep = strBuffer[i])
+ buffer.append(rep->data(), rep->size());
+ }
+ ASSERT(buffer.size() == totalSize);
+ unsigned finalSize = buffer.size();
+ return jsString(exec, UString(buffer.releaseBuffer(), finalSize, false));
}
JSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
index 3784da8..1e717cb 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -843,10 +843,16 @@ void NEVER_INLINE Heap::markCurrentThreadConservativelyInternal(MarkStack& markS
markConservatively(markStack, stackPointer, stackBase);
}
+#if COMPILER(GCC)
+#define REGISTER_BUFFER_ALIGNMENT __attribute__ ((aligned (sizeof(void*))))
+#else
+#define REGISTER_BUFFER_ALIGNMENT
+#endif
+
void Heap::markCurrentThreadConservatively(MarkStack& markStack)
{
// setjmp forces volatile registers onto the stack
- jmp_buf registers;
+ jmp_buf registers REGISTER_BUFFER_ALIGNMENT;
#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable: 4611)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp
index b75a7a5..3ad467d 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Completion.cpp
@@ -41,7 +41,7 @@ Completion checkSyntax(ExecState* exec, const SourceCode& source)
{
JSLock lock(exec);
- ProgramExecutable program(source);
+ ProgramExecutable program(exec, source);
JSObject* error = program.checkSyntax(exec);
if (error)
return Completion(Throw, error);
@@ -53,7 +53,7 @@ Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& s
{
JSLock lock(exec);
- ProgramExecutable program(source);
+ ProgramExecutable program(exec, source);
JSObject* error = program.compile(exec, scopeChain.node());
if (error)
return Completion(Throw, error);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.cpp
index 5e79794..7586746 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.cpp
@@ -259,7 +259,7 @@ PassRefPtr<FunctionExecutable> FunctionExecutable::fromGlobalCode(const Identifi
FunctionBodyNode* body = static_cast<FuncExprNode*>(funcExpr)->body();
ASSERT(body);
- return FunctionExecutable::create(functionName, body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
+ return FunctionExecutable::create(&exec->globalData(), functionName, body->source(), body->usesArguments(), body->parameters(), body->lineNo(), body->lastLine());
}
UString FunctionExecutable::paramString() const
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
index f3003dd..76764f9 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
@@ -27,7 +27,9 @@
#define Executable_h
#include "JSFunction.h"
+#include "Interpreter.h"
#include "Nodes.h"
+#include "SamplingTool.h"
namespace JSC {
@@ -102,11 +104,30 @@ namespace JSC {
class ScriptExecutable : public ExecutableBase {
public:
- ScriptExecutable(const SourceCode& source)
+ ScriptExecutable(JSGlobalData* globalData, const SourceCode& source)
: ExecutableBase(NUM_PARAMETERS_NOT_COMPILED)
, m_source(source)
, m_features(0)
{
+#if ENABLE(CODEBLOCK_SAMPLING)
+ if (SamplingTool* sampler = globalData->interpreter->sampler())
+ sampler->notifyOfScope(this);
+#else
+ UNUSED_PARAM(globalData);
+#endif
+ }
+
+ ScriptExecutable(ExecState* exec, const SourceCode& source)
+ : ExecutableBase(NUM_PARAMETERS_NOT_COMPILED)
+ , m_source(source)
+ , m_features(0)
+ {
+#if ENABLE(CODEBLOCK_SAMPLING)
+ if (SamplingTool* sampler = exec->globalData().interpreter->sampler())
+ sampler->notifyOfScope(this);
+#else
+ UNUSED_PARAM(exec);
+#endif
}
const SourceCode& source() { return m_source; }
@@ -137,8 +158,8 @@ namespace JSC {
class EvalExecutable : public ScriptExecutable {
public:
- EvalExecutable(const SourceCode& source)
- : ScriptExecutable(source)
+ EvalExecutable(ExecState* exec, const SourceCode& source)
+ : ScriptExecutable(exec, source)
, m_evalCodeBlock(0)
{
}
@@ -157,7 +178,7 @@ namespace JSC {
JSObject* compile(ExecState*, ScopeChainNode*);
ExceptionInfo* reparseExceptionInfo(JSGlobalData*, ScopeChainNode*, CodeBlock*);
- static PassRefPtr<EvalExecutable> create(const SourceCode& source) { return adoptRef(new EvalExecutable(source)); }
+ static PassRefPtr<EvalExecutable> create(ExecState* exec, const SourceCode& source) { return adoptRef(new EvalExecutable(exec, source)); }
private:
EvalCodeBlock* m_evalCodeBlock;
@@ -178,8 +199,8 @@ namespace JSC {
class ProgramExecutable : public ScriptExecutable {
public:
- ProgramExecutable(const SourceCode& source)
- : ScriptExecutable(source)
+ ProgramExecutable(ExecState* exec, const SourceCode& source)
+ : ScriptExecutable(exec, source)
, m_programCodeBlock(0)
{
}
@@ -221,9 +242,14 @@ namespace JSC {
class FunctionExecutable : public ScriptExecutable {
friend class JIT;
public:
- static PassRefPtr<FunctionExecutable> create(const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
+ static PassRefPtr<FunctionExecutable> create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
+ {
+ return adoptRef(new FunctionExecutable(exec, name, source, forceUsesArguments, parameters, firstLine, lastLine));
+ }
+
+ static PassRefPtr<FunctionExecutable> create(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
{
- return adoptRef(new FunctionExecutable(name, source, forceUsesArguments, parameters, firstLine, lastLine));
+ return adoptRef(new FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, firstLine, lastLine));
}
~FunctionExecutable();
@@ -264,8 +290,20 @@ namespace JSC {
static PassRefPtr<FunctionExecutable> fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, int* errLine = 0, UString* errMsg = 0);
private:
- FunctionExecutable(const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
- : ScriptExecutable(source)
+ FunctionExecutable(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
+ : ScriptExecutable(globalData, source)
+ , m_forceUsesArguments(forceUsesArguments)
+ , m_parameters(parameters)
+ , m_codeBlock(0)
+ , m_name(name)
+ , m_numVariables(0)
+ {
+ m_firstLine = firstLine;
+ m_lastLine = lastLine;
+ }
+
+ FunctionExecutable(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)
+ : ScriptExecutable(exec, source)
, m_forceUsesArguments(forceUsesArguments)
, m_parameters(parameters)
, m_codeBlock(0)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp
index 1a4402c..9e0ab59 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp
@@ -136,9 +136,7 @@ JSArray::JSArray(PassRefPtr<Structure> structure)
unsigned initialCapacity = 0;
m_storage = static_cast<ArrayStorage*>(fastZeroedMalloc(storageSize(initialCapacity)));
- m_storage->m_vectorLength = initialCapacity;
-
- m_fastAccessCutoff = 0;
+ m_vectorLength = initialCapacity;
checkConsistency();
}
@@ -150,7 +148,7 @@ JSArray::JSArray(PassRefPtr<Structure> structure, unsigned initialLength)
m_storage = static_cast<ArrayStorage*>(fastMalloc(storageSize(initialCapacity)));
m_storage->m_length = initialLength;
- m_storage->m_vectorLength = initialCapacity;
+ m_vectorLength = initialCapacity;
m_storage->m_numValuesInVector = 0;
m_storage->m_sparseValueMap = 0;
m_storage->lazyCreationData = 0;
@@ -159,8 +157,6 @@ JSArray::JSArray(PassRefPtr<Structure> structure, unsigned initialLength)
for (size_t i = 0; i < initialCapacity; ++i)
vector[i] = JSValue();
- m_fastAccessCutoff = 0;
-
checkConsistency();
Heap::heap(this)->reportExtraMemoryCost(initialCapacity * sizeof(JSValue));
@@ -173,7 +169,7 @@ JSArray::JSArray(PassRefPtr<Structure> structure, const ArgList& list)
m_storage = static_cast<ArrayStorage*>(fastMalloc(storageSize(initialCapacity)));
m_storage->m_length = initialCapacity;
- m_storage->m_vectorLength = initialCapacity;
+ m_vectorLength = initialCapacity;
m_storage->m_numValuesInVector = initialCapacity;
m_storage->m_sparseValueMap = 0;
@@ -182,8 +178,6 @@ JSArray::JSArray(PassRefPtr<Structure> structure, const ArgList& list)
for (ArgList::const_iterator it = list.begin(); it != end; ++it, ++i)
m_storage->m_vector[i] = *it;
- m_fastAccessCutoff = initialCapacity;
-
checkConsistency();
Heap::heap(this)->reportExtraMemoryCost(storageSize(initialCapacity));
@@ -207,7 +201,7 @@ bool JSArray::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot
return false;
}
- if (i < storage->m_vectorLength) {
+ if (i < m_vectorLength) {
JSValue& valueSlot = storage->m_vector[i];
if (valueSlot) {
slot.setValueSlot(&valueSlot);
@@ -253,8 +247,8 @@ bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& proper
if (isArrayIndex) {
if (i >= m_storage->m_length)
return false;
- if (i < m_storage->m_vectorLength) {
- JSValue value = m_storage->m_vector[i];
+ if (i < m_vectorLength) {
+ JSValue& value = m_storage->m_vector[i];
if (value) {
descriptor.setDescriptor(value, 0);
return true;
@@ -305,7 +299,7 @@ void JSArray::put(ExecState* exec, unsigned i, JSValue value)
m_storage->m_length = length;
}
- if (i < m_storage->m_vectorLength) {
+ if (i < m_vectorLength) {
JSValue& valueSlot = m_storage->m_vector[i];
if (valueSlot) {
valueSlot = value;
@@ -313,8 +307,7 @@ void JSArray::put(ExecState* exec, unsigned i, JSValue value)
return;
}
valueSlot = value;
- if (++m_storage->m_numValuesInVector == m_storage->m_length)
- m_fastAccessCutoff = m_storage->m_length;
+ ++m_storage->m_numValuesInVector;
checkConsistency();
return;
}
@@ -352,8 +345,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
if (increaseVectorLength(i + 1)) {
storage = m_storage;
storage->m_vector[i] = value;
- if (++storage->m_numValuesInVector == storage->m_length)
- m_fastAccessCutoff = storage->m_length;
+ ++storage->m_numValuesInVector;
checkConsistency();
} else
throwOutOfMemoryError(exec);
@@ -363,7 +355,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
// Decide how many values it would be best to move from the map.
unsigned newNumValuesInVector = storage->m_numValuesInVector + 1;
unsigned newVectorLength = increasedVectorLength(i + 1);
- for (unsigned j = max(storage->m_vectorLength, MIN_SPARSE_ARRAY_INDEX); j < newVectorLength; ++j)
+ for (unsigned j = max(m_vectorLength, MIN_SPARSE_ARRAY_INDEX); j < newVectorLength; ++j)
newNumValuesInVector += map->contains(j);
if (i >= MIN_SPARSE_ARRAY_INDEX)
newNumValuesInVector -= map->contains(i);
@@ -386,7 +378,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
return;
}
- unsigned vectorLength = storage->m_vectorLength;
+ unsigned vectorLength = m_vectorLength;
Heap::heap(this)->reportExtraMemoryCost(storageSize(newVectorLength) - storageSize(vectorLength));
@@ -404,7 +396,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
storage->m_vector[i] = value;
- storage->m_vectorLength = newVectorLength;
+ m_vectorLength = newVectorLength;
storage->m_numValuesInVector = newNumValuesInVector;
m_storage = storage;
@@ -431,7 +423,7 @@ bool JSArray::deleteProperty(ExecState* exec, unsigned i, bool checkDontDelete)
ArrayStorage* storage = m_storage;
- if (i < storage->m_vectorLength) {
+ if (i < m_vectorLength) {
JSValue& valueSlot = storage->m_vector[i];
if (!valueSlot) {
checkConsistency();
@@ -439,8 +431,6 @@ bool JSArray::deleteProperty(ExecState* exec, unsigned i, bool checkDontDelete)
}
valueSlot = JSValue();
--storage->m_numValuesInVector;
- if (m_fastAccessCutoff > i)
- m_fastAccessCutoff = i;
checkConsistency();
return true;
}
@@ -472,7 +462,7 @@ void JSArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNa
ArrayStorage* storage = m_storage;
- unsigned usedVectorLength = min(storage->m_length, storage->m_vectorLength);
+ unsigned usedVectorLength = min(storage->m_length, m_vectorLength);
for (unsigned i = 0; i < usedVectorLength; ++i) {
if (storage->m_vector[i])
propertyNames.add(Identifier::from(exec, i));
@@ -494,7 +484,7 @@ bool JSArray::increaseVectorLength(unsigned newLength)
ArrayStorage* storage = m_storage;
- unsigned vectorLength = storage->m_vectorLength;
+ unsigned vectorLength = m_vectorLength;
ASSERT(newLength > vectorLength);
ASSERT(newLength <= MAX_STORAGE_VECTOR_INDEX);
unsigned newVectorLength = increasedVectorLength(newLength);
@@ -503,7 +493,7 @@ bool JSArray::increaseVectorLength(unsigned newLength)
return false;
Heap::heap(this)->reportExtraMemoryCost(storageSize(newVectorLength) - storageSize(vectorLength));
- storage->m_vectorLength = newVectorLength;
+ m_vectorLength = newVectorLength;
for (unsigned i = vectorLength; i < newVectorLength; ++i)
storage->m_vector[i] = JSValue();
@@ -521,10 +511,7 @@ void JSArray::setLength(unsigned newLength)
unsigned length = m_storage->m_length;
if (newLength < length) {
- if (m_fastAccessCutoff > newLength)
- m_fastAccessCutoff = newLength;
-
- unsigned usedVectorLength = min(length, storage->m_vectorLength);
+ unsigned usedVectorLength = min(length, m_vectorLength);
for (unsigned i = newLength; i < usedVectorLength; ++i) {
JSValue& valueSlot = storage->m_vector[i];
bool hadValue = valueSlot;
@@ -563,20 +550,13 @@ JSValue JSArray::pop()
JSValue result;
- if (m_fastAccessCutoff > length) {
- JSValue& valueSlot = m_storage->m_vector[length];
- result = valueSlot;
- ASSERT(result);
- valueSlot = JSValue();
- --m_storage->m_numValuesInVector;
- m_fastAccessCutoff = length;
- } else if (length < m_storage->m_vectorLength) {
+ if (length < m_vectorLength) {
JSValue& valueSlot = m_storage->m_vector[length];
- result = valueSlot;
- valueSlot = JSValue();
- if (result)
+ if (valueSlot) {
--m_storage->m_numValuesInVector;
- else
+ result = valueSlot;
+ valueSlot = JSValue();
+ } else
result = jsUndefined();
} else {
result = jsUndefined();
@@ -604,11 +584,10 @@ void JSArray::push(ExecState* exec, JSValue value)
{
checkConsistency();
- if (m_storage->m_length < m_storage->m_vectorLength) {
- ASSERT(!m_storage->m_vector[m_storage->m_length]);
+ if (m_storage->m_length < m_vectorLength) {
m_storage->m_vector[m_storage->m_length] = value;
- if (++m_storage->m_numValuesInVector == ++m_storage->m_length)
- m_fastAccessCutoff = m_storage->m_length;
+ ++m_storage->m_numValuesInVector;
+ ++m_storage->m_length;
checkConsistency();
return;
}
@@ -618,8 +597,8 @@ void JSArray::push(ExecState* exec, JSValue value)
if (!map || map->isEmpty()) {
if (increaseVectorLength(m_storage->m_length + 1)) {
m_storage->m_vector[m_storage->m_length] = value;
- if (++m_storage->m_numValuesInVector == ++m_storage->m_length)
- m_fastAccessCutoff = m_storage->m_length;
+ ++m_storage->m_numValuesInVector;
+ ++m_storage->m_length;
checkConsistency();
return;
}
@@ -837,7 +816,7 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
if (!m_storage->m_length)
return;
- unsigned usedVectorLength = min(m_storage->m_length, m_storage->m_vectorLength);
+ unsigned usedVectorLength = min(m_storage->m_length, m_vectorLength);
AVLTree<AVLTreeAbstractorForArrayCompare, 44> tree; // Depth 44 is enough for 2^31 items
tree.abstractor().m_exec = exec;
@@ -886,7 +865,7 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
if (SparseArrayValueMap* map = m_storage->m_sparseValueMap) {
newUsedVectorLength += map->size();
- if (newUsedVectorLength > m_storage->m_vectorLength) {
+ if (newUsedVectorLength > m_vectorLength) {
// Check that it is possible to allocate an array large enough to hold all the entries.
if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(newUsedVectorLength)) {
throwOutOfMemoryError(exec);
@@ -926,7 +905,6 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
m_storage->m_vector[i] = JSValue();
- m_fastAccessCutoff = newUsedVectorLength;
m_storage->m_numValuesInVector = newUsedVectorLength;
checkConsistency(SortConsistencyCheck);
@@ -934,10 +912,16 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
void JSArray::fillArgList(ExecState* exec, MarkedArgumentBuffer& args)
{
- unsigned fastAccessLength = min(m_storage->m_length, m_fastAccessCutoff);
+ JSValue* vector = m_storage->m_vector;
+ unsigned vectorEnd = min(m_storage->m_length, m_vectorLength);
unsigned i = 0;
- for (; i < fastAccessLength; ++i)
- args.append(getIndex(i));
+ for (; i < vectorEnd; ++i) {
+ JSValue& v = vector[i];
+ if (!v)
+ break;
+ args.append(v);
+ }
+
for (; i < m_storage->m_length; ++i)
args.append(get(exec, i));
}
@@ -946,12 +930,17 @@ void JSArray::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSiz
{
ASSERT(m_storage->m_length == maxSize);
UNUSED_PARAM(maxSize);
- unsigned fastAccessLength = min(m_storage->m_length, m_fastAccessCutoff);
+ JSValue* vector = m_storage->m_vector;
+ unsigned vectorEnd = min(m_storage->m_length, m_vectorLength);
unsigned i = 0;
- for (; i < fastAccessLength; ++i)
- buffer[i] = getIndex(i);
- uint32_t size = m_storage->m_length;
- for (; i < size; ++i)
+ for (; i < vectorEnd; ++i) {
+ JSValue& v = vector[i];
+ if (!v)
+ break;
+ buffer[i] = v;
+ }
+
+ for (; i < m_storage->m_length; ++i)
buffer[i] = get(exec, i);
}
@@ -961,7 +950,7 @@ unsigned JSArray::compactForSorting()
ArrayStorage* storage = m_storage;
- unsigned usedVectorLength = min(m_storage->m_length, storage->m_vectorLength);
+ unsigned usedVectorLength = min(m_storage->m_length, m_vectorLength);
unsigned numDefined = 0;
unsigned numUndefined = 0;
@@ -985,7 +974,7 @@ unsigned JSArray::compactForSorting()
if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
newUsedVectorLength += map->size();
- if (newUsedVectorLength > storage->m_vectorLength) {
+ if (newUsedVectorLength > m_vectorLength) {
// Check that it is possible to allocate an array large enough to hold all the entries - if not,
// exception is thrown by caller.
if ((newUsedVectorLength > MAX_STORAGE_VECTOR_LENGTH) || !increaseVectorLength(newUsedVectorLength))
@@ -1006,7 +995,6 @@ unsigned JSArray::compactForSorting()
for (unsigned i = newUsedVectorLength; i < usedVectorLength; ++i)
storage->m_vector[i] = JSValue();
- m_fastAccessCutoff = newUsedVectorLength;
storage->m_numValuesInVector = newUsedVectorLength;
checkConsistency(SortConsistencyCheck);
@@ -1032,30 +1020,27 @@ void JSArray::checkConsistency(ConsistencyCheckType type)
if (type == SortConsistencyCheck)
ASSERT(!m_storage->m_sparseValueMap);
- ASSERT(m_fastAccessCutoff <= m_storage->m_length);
- ASSERT(m_fastAccessCutoff <= m_storage->m_numValuesInVector);
-
unsigned numValuesInVector = 0;
- for (unsigned i = 0; i < m_storage->m_vectorLength; ++i) {
+ for (unsigned i = 0; i < m_vectorLength; ++i) {
if (JSValue value = m_storage->m_vector[i]) {
ASSERT(i < m_storage->m_length);
if (type != DestructorConsistencyCheck)
value->type(); // Likely to crash if the object was deallocated.
++numValuesInVector;
} else {
- ASSERT(i >= m_fastAccessCutoff);
if (type == SortConsistencyCheck)
ASSERT(i >= m_storage->m_numValuesInVector);
}
}
ASSERT(numValuesInVector == m_storage->m_numValuesInVector);
+ ASSERT(numValuesInVector <= m_storage->m_length);
if (m_storage->m_sparseValueMap) {
SparseArrayValueMap::iterator end = m_storage->m_sparseValueMap->end();
for (SparseArrayValueMap::iterator it = m_storage->m_sparseValueMap->begin(); it != end; ++it) {
unsigned index = it->first;
ASSERT(index < m_storage->m_length);
- ASSERT(index >= m_storage->m_vectorLength);
+ ASSERT(index >= m_vectorLength);
ASSERT(index <= MAX_ARRAY_INDEX);
ASSERT(it->second);
if (type != DestructorConsistencyCheck)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h
index 37ed72b..2613991 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.h
@@ -29,7 +29,6 @@ namespace JSC {
struct ArrayStorage {
unsigned m_length;
- unsigned m_vectorLength;
unsigned m_numValuesInVector;
SparseArrayValueMap* m_sparseValueMap;
void* lazyCreationData; // A JSArray subclass can use this to fill the vector lazily.
@@ -63,18 +62,24 @@ namespace JSC {
void push(ExecState*, JSValue);
JSValue pop();
- bool canGetIndex(unsigned i) { return i < m_fastAccessCutoff; }
+ bool canGetIndex(unsigned i) { return i < m_vectorLength && m_storage->m_vector[i]; }
JSValue getIndex(unsigned i)
{
ASSERT(canGetIndex(i));
return m_storage->m_vector[i];
}
- bool canSetIndex(unsigned i) { return i < m_fastAccessCutoff; }
- JSValue setIndex(unsigned i, JSValue v)
+ bool canSetIndex(unsigned i) { return i < m_vectorLength; }
+ void setIndex(unsigned i, JSValue v)
{
ASSERT(canSetIndex(i));
- return m_storage->m_vector[i] = v;
+ JSValue& x = m_storage->m_vector[i];
+ if (!x) {
+ ++m_storage->m_numValuesInVector;
+ if (i >= m_storage->m_length)
+ m_storage->m_length = i + 1;
+ }
+ x = v;
}
void fillArgList(ExecState*, MarkedArgumentBuffer&);
@@ -110,7 +115,7 @@ namespace JSC {
enum ConsistencyCheckType { NormalConsistencyCheck, DestructorConsistencyCheck, SortConsistencyCheck };
void checkConsistency(ConsistencyCheckType = NormalConsistencyCheck);
- unsigned m_fastAccessCutoff;
+ unsigned m_vectorLength;
ArrayStorage* m_storage;
};
@@ -144,7 +149,7 @@ namespace JSC {
ArrayStorage* storage = m_storage;
- unsigned usedVectorLength = std::min(storage->m_length, storage->m_vectorLength);
+ unsigned usedVectorLength = std::min(storage->m_length, m_vectorLength);
markStack.appendValues(storage->m_vector, usedVectorLength, MayContainNullValues);
if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index b11070f..5ded370 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -286,7 +286,7 @@ JSValue JSC_HOST_CALL globalFuncEval(ExecState* exec, JSObject* function, JSValu
if (JSValue parsedObject = preparser.tryLiteralParse())
return parsedObject;
- EvalExecutable eval(makeSource(s));
+ EvalExecutable eval(exec, makeSource(s));
JSObject* error = eval.compile(exec, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain().node());
if (error)
return throwError(exec, error);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.cpp
index 39a4093..699c1cd 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.cpp
@@ -110,7 +110,10 @@ char* JSValue::description()
{
static const size_t size = 32;
static char description[size];
- if (isInt32())
+
+ if (!*this)
+ snprintf(description, size, "<JSValue()>");
+ else if (isInt32())
snprintf(description, size, "Int32: %d", asInt32());
else if (isDouble())
snprintf(description, size, "Double: %lf", asDouble());
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h
index 58e74b1..3c511d8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h
@@ -213,7 +213,8 @@ namespace JSC {
enum { FalseTag = 0xfffffffc };
enum { NullTag = 0xfffffffb };
enum { UndefinedTag = 0xfffffffa };
- enum { DeletedValueTag = 0xfffffff9 };
+ enum { EmptyValueTag = 0xfffffff9 };
+ enum { DeletedValueTag = 0xfffffff8 };
enum { LowestTag = DeletedValueTag };
@@ -427,7 +428,7 @@ namespace JSC {
inline JSValue::JSValue()
{
- u.asBits.tag = CellTag;
+ u.asBits.tag = EmptyValueTag;
u.asBits.payload = 0;
}
@@ -463,19 +464,26 @@ namespace JSC {
inline JSValue::JSValue(JSCell* ptr)
{
- u.asBits.tag = CellTag;
+ if (ptr)
+ u.asBits.tag = CellTag;
+ else
+ u.asBits.tag = EmptyValueTag;
u.asBits.payload = reinterpret_cast<int32_t>(ptr);
}
inline JSValue::JSValue(const JSCell* ptr)
{
- u.asBits.tag = CellTag;
+ if (ptr)
+ u.asBits.tag = CellTag;
+ else
+ u.asBits.tag = EmptyValueTag;
u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
}
inline JSValue::operator bool() const
{
- return u.asBits.payload || tag() != CellTag;
+ ASSERT(tag() != DeletedValueTag);
+ return tag() != EmptyValueTag;
}
inline bool JSValue::operator==(const JSValue& other) const
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp
index f7bda9e..be817c3 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp
@@ -555,7 +555,7 @@ PassRefPtr<Structure> Structure::getterSetterTransition(Structure* structure)
PassRefPtr<Structure> Structure::toDictionaryTransition(Structure* structure, DictionaryKind kind)
{
- ASSERT(!structure->isDictionary());
+ ASSERT(!structure->isUncacheableDictionary());
RefPtr<Structure> transition = create(structure->m_prototype, structure->typeInfo());
transition->m_dictionaryKind = kind;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/TimeoutChecker.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/TimeoutChecker.cpp
index d7fca33..0a8bbd3 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/TimeoutChecker.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/TimeoutChecker.cpp
@@ -35,18 +35,10 @@
#if PLATFORM(DARWIN)
#include <mach/mach.h>
-#endif
-
-#if HAVE(SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-#if PLATFORM(WIN_OS)
+#elif PLATFORM(WIN_OS)
#include <windows.h>
-#endif
-
-#if PLATFORM(QT)
-#include <QDateTime>
+#else
+#include "CurrentTime.h"
#endif
using namespace std;
@@ -75,14 +67,6 @@ static inline unsigned getCPUTime()
time += info.system_time.seconds * 1000 + info.system_time.microseconds / 1000;
return time;
-#elif HAVE(SYS_TIME_H)
- // FIXME: This should probably use getrusage with the RUSAGE_THREAD flag.
- struct timeval tv;
- gettimeofday(&tv, 0);
- return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-#elif PLATFORM(QT)
- QDateTime t = QDateTime::currentDateTime();
- return t.toTime_t() * 1000 + t.time().msec();
#elif PLATFORM(WIN_OS)
union {
FILETIME fileTime;
@@ -97,7 +81,8 @@ static inline unsigned getCPUTime()
return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
#else
-#error Platform does not have getCurrentTime function
+ // FIXME: We should return the time the current thread has spent executing.
+ return currentTime() * 1000;
#endif
}
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.cpp
index 54daf23..5af1377 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.cpp
@@ -108,7 +108,11 @@ static void vprintf_stderr_common(const char* format, va_list args)
} while (size > 1024);
}
#endif
+#if PLATFORM(SYMBIAN)
+ vfprintf(stdout, format, args);
+#else
vfprintf(stderr, format, args);
+#endif
}
WTF_ATTRIBUTE_PRINTF(1, 2)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h
index b68e70c..f529a62 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h
@@ -50,6 +50,11 @@
#include <inttypes.h>
#endif
+#if PLATFORM(SYMBIAN)
+#include <e32def.h>
+#include <e32debug.h>
+#endif
+
#ifdef NDEBUG
#define ASSERTIONS_DISABLED_DEFAULT 1
#else
@@ -120,11 +125,18 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann
/* CRASH -- gets us into the debugger or the crash reporter -- signals are ignored by the crash reporter so we must do better */
#ifndef CRASH
+#if PLATFORM(SYMBIAN)
+#define CRASH() do { \
+ __DEBUGGER(); \
+ User::Panic(_L("Webkit CRASH"),0); \
+ } while(false)
+#else
#define CRASH() do { \
*(int *)(uintptr_t)0xbbadbeef = 0; \
((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \
} while(false)
#endif
+#endif
/* ASSERT, ASSERT_WITH_MESSAGE, ASSERT_NOT_REACHED */
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp
index afb0220..f2148d0 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp
@@ -379,6 +379,9 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
+#if PLATFORM(UNIX)
+#include <unistd.h>
+#endif
#if COMPILER(MSVC)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
@@ -391,6 +394,7 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
#if PLATFORM(DARWIN)
#include "MallocZoneSupport.h"
#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
#endif
#ifndef PRIuS
@@ -1427,7 +1431,7 @@ void TCMalloc_PageHeap::init()
void* TCMalloc_PageHeap::runScavengerThread(void* context)
{
static_cast<TCMalloc_PageHeap*>(context)->scavengerThread();
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) || PLATFORM(SOLARIS)
// Without this, Visual Studio will complain that this method does not return a value.
return 0;
#endif
@@ -2274,7 +2278,7 @@ static inline TCMalloc_PageHeap* getPageHeap()
#define pageheap getPageHeap()
#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
-#if PLATFORM(WIN)
+#if PLATFORM(WIN_OS)
static void sleep(unsigned seconds)
{
::Sleep(seconds * 1000);
@@ -2283,6 +2287,10 @@ static void sleep(unsigned seconds)
void TCMalloc_PageHeap::scavengerThread()
{
+#if HAVE(PTHREAD_SETNAME_NP)
+ pthread_setname_np("JavaScriptCore: FastMalloc scavenger");
+#endif
+
while (1) {
if (!shouldContinueScavenging()) {
pthread_mutex_lock(&m_scavengeMutex);
@@ -2388,7 +2396,7 @@ ALWAYS_INLINE void TCMalloc_Central_FreeList::ReleaseToSpans(void* object) {
// The following check is expensive, so it is disabled by default
if (false) {
// Check that object does not occur in list
- int got = 0;
+ unsigned got = 0;
for (void* p = span->objects; p != NULL; p = *((void**) p)) {
ASSERT(p != object);
got++;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h
index b23e7b0..ca0961c 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h
@@ -213,6 +213,9 @@ using WTF::fastMallocAllow;
// debug-only code to make sure we don't use the system malloc via the default operator
// new by accident.
+// We musn't customize the global operator new and delete for the Qt port.
+#if !PLATFORM(QT)
+
WTF_PRIVATE_INLINE void* operator new(size_t size) { return fastMalloc(size); }
WTF_PRIVATE_INLINE void* operator new(size_t size, const std::nothrow_t&) throw() { return fastMalloc(size); }
WTF_PRIVATE_INLINE void operator delete(void* p) { fastFree(p); }
@@ -224,4 +227,6 @@ WTF_PRIVATE_INLINE void operator delete[](void* p, const std::nothrow_t&) throw(
#endif
+#endif
+
#endif /* WTF_FastMalloc_h */
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h
index 67dc3be..448de7d 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -27,6 +27,7 @@ namespace WTF {
template<typename T> class ListRefPtr;
template<typename T> class OwnArrayPtr;
template<typename T> class OwnPtr;
+ template<typename T> class PassOwnPtr;
template<typename T> class PassRefPtr;
template<typename T> class RefPtr;
template<typename T, size_t inlineCapacity> class Vector;
@@ -35,9 +36,9 @@ namespace WTF {
using WTF::ListRefPtr;
using WTF::OwnArrayPtr;
using WTF::OwnPtr;
+using WTF::PassOwnPtr;
using WTF::PassRefPtr;
using WTF::RefPtr;
using WTF::Vector;
#endif // WTF_Forward_h
-
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h
index 1a422d8..5fb6da8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h
@@ -49,23 +49,28 @@ namespace WTF {
const_iterator begin() const;
const_iterator end() const;
- iterator find(const ValueType& value);
- const_iterator find(const ValueType& value) const;
- bool contains(const ValueType& value) const;
- unsigned count(const ValueType& value) const;
+ iterator find(const ValueType&);
+ const_iterator find(const ValueType&) const;
+ bool contains(const ValueType&) const;
+ unsigned count(const ValueType&) const;
// increases the count if an equal value is already present
// the return value is a pair of an interator to the new value's location,
// and a bool that is true if an new entry was added
- std::pair<iterator, bool> add(const ValueType &value);
+ std::pair<iterator, bool> add(const ValueType&);
// reduces the count of the value, and removes it if count
// goes down to zero
- void remove(const ValueType& value);
- void remove(iterator it);
+ void remove(const ValueType&);
+ void remove(iterator);
- void clear();
-
+ // removes the value, regardless of its count
+ void clear(iterator);
+ void clear(const ValueType&);
+
+ // clears the whole set
+ void clear();
+
private:
ImplType m_impl;
};
@@ -166,6 +171,21 @@ namespace WTF {
}
template<typename Value, typename HashFunctions, typename Traits>
+ inline void HashCountedSet<Value, HashFunctions, Traits>::clear(const ValueType& value)
+ {
+ clear(find(value));
+ }
+
+ template<typename Value, typename HashFunctions, typename Traits>
+ inline void HashCountedSet<Value, HashFunctions, Traits>::clear(iterator it)
+ {
+ if (it == end())
+ return;
+
+ m_impl.remove(it);
+ }
+
+ template<typename Value, typename HashFunctions, typename Traits>
inline void HashCountedSet<Value, HashFunctions, Traits>::clear()
{
m_impl.clear();
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
index 39cafab..73212db 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
@@ -278,6 +278,10 @@
#undef ARM_ARCH_VERSION
#define ARM_ARCH_VERSION 7
#endif
+/* On ARMv5 and below the natural alignment is required. */
+#if !defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_ARCH_VERSION <= 5
+#define ARM_REQUIRE_NATURAL_ALIGNMENT 1
+#endif
/* Defines two pseudo-platforms for ARM and Thumb-2 instruction set. */
#if !defined(WTF_PLATFORM_ARM_TRADITIONAL) && !defined(WTF_PLATFORM_ARM_THUMB2)
# if defined(thumb2) || defined(__thumb2__)
@@ -560,6 +564,7 @@
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !PLATFORM(IPHONE)
#define HAVE_MADV_FREE_REUSE 1
#define HAVE_MADV_FREE 1
+#define HAVE_PTHREAD_SETNAME_NP 1
#endif
#if PLATFORM(IPHONE)
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.cpp
index 0e6e208..52fb130 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.cpp
@@ -82,6 +82,23 @@ double randomNumber()
return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53);
#elif PLATFORM(WINCE)
return genrand_res53();
+#elif PLATFORM(WIN_OS)
+ uint32_t part1 = rand() & (RAND_MAX - 1);
+ uint32_t part2 = rand() & (RAND_MAX - 1);
+ uint32_t part3 = rand() & (RAND_MAX - 1);
+ uint32_t part4 = rand() & (RAND_MAX - 1);
+ // rand only provides 15 bits on Win32
+ uint64_t fullRandom = part1;
+ fullRandom <<= 15;
+ fullRandom |= part2;
+ fullRandom <<= 15;
+ fullRandom |= part3;
+ fullRandom <<= 15;
+ fullRandom |= part4;
+
+ // Mask off the low 53bits
+ fullRandom &= (1LL << 53) - 1;
+ return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53);
#else
uint32_t part1 = rand() & (RAND_MAX - 1);
uint32_t part2 = rand() & (RAND_MAX - 1);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSpinLock.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSpinLock.h
index ced2283..4cf30c2 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSpinLock.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSpinLock.h
@@ -209,6 +209,13 @@ struct TCMalloc_SpinLock {
inline void Unlock() {
if (pthread_mutex_unlock(&private_lock_) != 0) CRASH();
}
+ bool IsHeld() {
+ if (pthread_mutex_trylock(&private_lock_))
+ return true;
+
+ Unlock();
+ return false;
+ }
};
#define SPINLOCK_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp
index 659bb0e..a43baa8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCSystemAlloc.cpp
@@ -193,10 +193,10 @@ static void* TryMmap(size_t size, size_t *actual_size, size_t alignment) {
// Return the unused memory to the system
if (adjust > 0) {
- munmap(reinterpret_cast<void*>(ptr), adjust);
+ munmap(reinterpret_cast<char*>(ptr), adjust);
}
if (adjust < extra) {
- munmap(reinterpret_cast<void*>(ptr + adjust + size), extra - adjust);
+ munmap(reinterpret_cast<char*>(ptr + adjust + size), extra - adjust);
}
ptr += adjust;
@@ -324,10 +324,10 @@ static void* TryDevMem(size_t size, size_t *actual_size, size_t alignment) {
// Return the unused virtual memory to the system
if (adjust > 0) {
- munmap(reinterpret_cast<void*>(ptr), adjust);
+ munmap(reinterpret_cast<char*>(ptr), adjust);
}
if (adjust < extra) {
- munmap(reinterpret_cast<void*>(ptr + adjust + size), extra - adjust);
+ munmap(reinterpret_cast<char*>(ptr + adjust + size), extra - adjust);
}
ptr += adjust;
@@ -442,7 +442,7 @@ void TCMalloc_SystemRelease(void* start, size_t length)
void TCMalloc_SystemRelease(void* start, size_t length)
{
- void* newAddress = mmap(start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
+ void* newAddress = mmap(reinterpret_cast<char*>(start), length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
// If the mmap failed then that's ok, we just won't return the memory to the system.
ASSERT_UNUSED(newAddress, newAddress == start || newAddress == reinterpret_cast<void*>(MAP_FAILED));
}
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadingPthreads.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadingPthreads.cpp
index c241bd9..e4fb419 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadingPthreads.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadingPthreads.cpp
@@ -186,7 +186,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
void setThreadNameInternal(const char* threadName)
{
-#if PLATFORM(DARWIN) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !PLATFORM(IPHONE)
+#if HAVE(PTHREAD_SETNAME_NP)
pthread_setname_np(threadName);
#else
UNUSED_PARAM(threadName);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp
index 4390b5b..d777424 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp
@@ -549,11 +549,11 @@ class RegexGenerator : private MacroAssembler {
}
if (mask) {
- load32(BaseIndex(input, index, TimesTwo, state.inputOffset() * sizeof(UChar)), character);
+ load32WithUnalignedHalfWords(BaseIndex(input, index, TimesTwo, state.inputOffset() * sizeof(UChar)), character);
or32(Imm32(mask), character);
state.jumpToBacktrack(branch32(NotEqual, character, Imm32(chPair | mask)), this);
} else
- state.jumpToBacktrack(branch32(NotEqual, BaseIndex(input, index, TimesTwo, state.inputOffset() * sizeof(UChar)), Imm32(chPair)), this);
+ state.jumpToBacktrack(branch32WithUnalignedHalfWords(NotEqual, BaseIndex(input, index, TimesTwo, state.inputOffset() * sizeof(UChar)), Imm32(chPair)), this);
}
void generatePatternCharacterFixed(TermGenerationState& state)
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index 3d9c27c..d75862d 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from
The commit imported was from the
- jsc-for-qtscript-4.6-staging-01102009 branch/tag
+ jsc-for-qtscript-4.6-staging-06102009 branch/tag
and has the sha1 checksum
- 79e88e90aab6674098b6d73b1b41998117164499
+ 32d226eb14d44f80e9ec96d4ca2c595181eeeca3
diff --git a/src/3rdparty/javascriptcore/WebKit.pri b/src/3rdparty/javascriptcore/WebKit.pri
index fd918c9..8291f30 100644
--- a/src/3rdparty/javascriptcore/WebKit.pri
+++ b/src/3rdparty/javascriptcore/WebKit.pri
@@ -31,7 +31,10 @@ building-libs {
DEPENDPATH += $$PWD/WebKit/qt/Api
}
-DEFINES += USE_SYSTEM_MALLOC
+!mac:!unix|symbian {
+ DEFINES += USE_SYSTEM_MALLOC
+}
+
CONFIG(release, debug|release) {
DEFINES += NDEBUG
}
@@ -48,7 +51,7 @@ symbian|*-armcc {
RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
DEFINES *= QT_NO_UITOOLS
-}
+}
*-armcc {
QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
@@ -63,7 +66,7 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
# Disable a few warnings on Windows. The warnings are also
# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
-win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
+win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996
#
# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
index d8b6f4b..2b08980 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
@@ -36,8 +36,14 @@ GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
win32-* {
LIBS += -lwinmm
}
-contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
-contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
+contains(JAVASCRIPTCORE_JIT,yes) {
+ DEFINES+=ENABLE_JIT=1
+ DEFINES+=ENABLE_YARR_JIT=1
+}
+contains(JAVASCRIPTCORE_JIT,no) {
+ DEFINES+=ENABLE_JIT=0
+ DEFINES+=ENABLE_YARR_JIT=0
+}
# In debug mode JIT disabled until crash fixed
win32-* {
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index d8d9d64..2a0ee20 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -392,7 +392,8 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
}
/*!
- \brief The load status message associated to the web graphicsitem
+ \property QGraphicsWebView::status
+ \brief the load status message.
Provides the latest status message set during the load of a URL.
Commonly shown by Status Bar widgets.
@@ -492,14 +493,15 @@ void QGraphicsWebView::load(const QNetworkRequest& request,
}
/*!
- Sets the content of the web graphicsitem to the specified \a html.
+ \property QGraphicsWebView::html
+ This property provides an HTML interface to the text in the webview.
- External objects such as stylesheets or images referenced in the HTML
- document are located relative to \a baseUrl.
+ When setting this property, external objects such as stylesheets or images
+ referenced in the HTML document are located relative to \a baseUrl.
The \a html is loaded immediately; external objects are loaded asynchronously.
- When using this method, WebKit assumes that external resources such as
+ When using these methods, WebKit assumes that external resources such as
JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
through the charset attribute of the HTML script tag. Alternatively, the
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 6bbd801..2769040 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -162,9 +162,9 @@
//on windows if you're currently dragging a widget an inner eventloop was started by the system
//to make sure that this timer is getting fired, we need to make sure to use the system timers
//that will send a WM_TIMER event. We do that by settings the timer interval to 11
- //It is 11 because QEventDispatcherWin32Private::registerTimer specifically checks if the interval
- //is greater than 10 to determine if it should use a system timer (or the multimedia timer).
-#define STARTSTOP_TIMER_DELAY 11
+ //It is 16 because QEventDispatcherWin32Private::registerTimer specifically checks if the interval
+ //is greater than 11 to determine if it should use a system timer (or the multimedia timer).
+#define STARTSTOP_TIMER_DELAY 16
#else
#define STARTSTOP_TIMER_DELAY 0
#endif
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index 5b7fd22..2812854 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -143,13 +143,14 @@ void QParallelAnimationGroup::updateCurrentTime(int currentTime)
// simulate completion of the loop seeking backwards
for (int i = 0; i < d->animations.size(); ++i) {
QAbstractAnimation *animation = d->animations.at(i);
+ //we need to make sure the animation is in the right state
+ //and then rewind it
+ d->applyGroupState(animation);
animation->setCurrentTime(0);
animation->stop();
}
}
- bool timeFwd = ((d->currentLoop == d->lastLoop && currentTime >= d->lastCurrentTime)
- || d->currentLoop > d->lastLoop);
#ifdef QANIMATION_DEBUG
qDebug("QParallellAnimationGroup %5d: setCurrentTime(%d), loop:%d, last:%d, timeFwd:%d, lastcurrent:%d, %d",
__LINE__, d->currentTime, d->currentLoop, d->lastLoop, timeFwd, d->lastCurrentTime, state());
@@ -158,34 +159,19 @@ void QParallelAnimationGroup::updateCurrentTime(int currentTime)
for (int i = 0; i < d->animations.size(); ++i) {
QAbstractAnimation *animation = d->animations.at(i);
const int dura = animation->totalDuration();
- if (dura == -1 && d->isUncontrolledAnimationFinished(animation))
- continue;
- if (dura == -1 || (currentTime <= dura && dura != 0)
- || (dura == 0 && d->currentLoop != d->lastLoop)) {
- switch (state()) {
- case Running:
- animation->start();
- break;
- case Paused:
- animation->pause();
- break;
- case Stopped:
- default:
- break;
- }
+ //if the loopcount is bigger we should always start all animations
+ if (d->currentLoop > d->lastLoop
+ //if we're at the end of the animation, we need to start it if it wasn't already started in this loop
+ //this happens in Backward direction where not all animations are started at the same time
+ || d->shouldAnimationStart(animation, d->lastCurrentTime > dura /*startIfAtEnd*/)) {
+ d->applyGroupState(animation);
}
- if (dura <= 0) {
- if (dura == -1)
- animation->setCurrentTime(currentTime);
- continue;
+ if (animation->state() == state()) {
+ animation->setCurrentTime(currentTime);
+ if (dura > 0 && currentTime > dura)
+ animation->stop();
}
-
- if ((timeFwd && d->lastCurrentTime <= dura)
- || (!timeFwd && d->currentTime <= dura))
- animation->setCurrentTime(currentTime);
- if (currentTime > dura)
- animation->stop();
}
d->lastLoop = d->currentLoop;
d->lastCurrentTime = currentTime;
@@ -208,7 +194,8 @@ void QParallelAnimationGroup::updateState(QAbstractAnimation::State oldState,
break;
case Paused:
for (int i = 0; i < d->animations.size(); ++i)
- d->animations.at(i)->pause();
+ if (d->animations.at(i)->state() == Running)
+ d->animations.at(i)->pause();
break;
case Running:
d->connectUncontrolledAnimations();
@@ -217,7 +204,8 @@ void QParallelAnimationGroup::updateState(QAbstractAnimation::State oldState,
if (oldState == Stopped)
animation->stop();
animation->setDirection(d->direction);
- animation->start();
+ if (d->shouldAnimationStart(animation, oldState == Stopped))
+ animation->start();
}
break;
}
@@ -280,6 +268,36 @@ void QParallelAnimationGroupPrivate::connectUncontrolledAnimations()
}
}
+bool QParallelAnimationGroupPrivate::shouldAnimationStart(QAbstractAnimation *animation, bool startIfAtEnd) const
+{
+ const int dura = animation->totalDuration();
+ if (dura == -1)
+ return !isUncontrolledAnimationFinished(animation);
+ if (startIfAtEnd)
+ return currentTime <= dura;
+ if (direction == QAbstractAnimation::Forward)
+ return currentTime < dura;
+ else //direction == QAbstractAnimation::Backward
+ return currentTime && currentTime <= dura;
+}
+
+void QParallelAnimationGroupPrivate::applyGroupState(QAbstractAnimation *animation)
+{
+ switch (state)
+ {
+ case QAbstractAnimation::Running:
+ animation->start();
+ break;
+ case QAbstractAnimation::Paused:
+ animation->pause();
+ break;
+ case QAbstractAnimation::Stopped:
+ default:
+ break;
+ }
+}
+
+
bool QParallelAnimationGroupPrivate::isUncontrolledAnimationFinished(QAbstractAnimation *anim) const
{
return uncontrolledFinishTime.value(anim, -1) >= 0;
diff --git a/src/corelib/animation/qparallelanimationgroup_p.h b/src/corelib/animation/qparallelanimationgroup_p.h
index 8e1fb34..fa0ef95 100644
--- a/src/corelib/animation/qparallelanimationgroup_p.h
+++ b/src/corelib/animation/qparallelanimationgroup_p.h
@@ -74,6 +74,8 @@ public:
int lastLoop;
int lastCurrentTime;
+ bool shouldAnimationStart(QAbstractAnimation *animation, bool startIfAtEnd) const;
+ void applyGroupState(QAbstractAnimation *animation);
bool isUncontrolledAnimationFinished(QAbstractAnimation *anim) const;
void connectUncontrolledAnimations();
void disconnectUncontrolledAnimations();
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index b64d7df..4742e54 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -132,9 +132,9 @@ void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
}
if (newValue.userType() == propertyType) {
- //no conversion is needed, we directly call the QObject::qt_metacall
+ //no conversion is needed, we directly call the QMetaObject::metacall
void *data = const_cast<void*>(newValue.constData());
- targetValue->qt_metacall(QMetaObject::WriteProperty, propertyIndex, &data);
+ QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, &data);
} else {
targetValue->setProperty(propertyName.constData(), newValue);
}
diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h
index 1f52a0e..5880120 100644
--- a/src/corelib/arch/qatomic_symbian.h
+++ b/src/corelib/arch/qatomic_symbian.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp
index 71bd145..8f02155 100644
--- a/src/corelib/arch/symbian/qatomic_symbian.cpp
+++ b/src/corelib/arch/symbian/qatomic_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index 724b18d..17f4d91 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -4,6 +4,7 @@ HEADERS += \
codecs/qisciicodec_p.h \
codecs/qlatincodec_p.h \
codecs/qsimplecodec_p.h \
+ codecs/qtextcodec_p.h \
codecs/qtextcodec.h \
codecs/qtsciicodec_p.h \
codecs/qutfcodec_p.h \
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 4f0e13c..680fcd7 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -741,6 +741,26 @@ static void setup()
setupLocaleMapper();
}
+/*!
+ \enum QTextCodec::ConversionFlag
+
+ \value DefaultConversion No flag is set.
+ \value ConvertInvalidToNull If this flag is set, each invalid input
+ character is output as a null character.
+ \value IgnoreHeader Ignore any Unicode byte-order mark and don't generate any.
+
+ \omitvalue FreeFunction
+*/
+
+/*!
+ \fn QTextCodec::ConverterState::ConverterState(ConversionFlags flags)
+
+ Constructs a ConverterState object initialized with the given \a flags.
+*/
+
+/*!
+ Destroys the ConverterState object.
+*/
QTextCodec::ConverterState::~ConverterState()
{
if (flags & FreeFunction)
@@ -883,29 +903,6 @@ QTextCodec::ConverterState::~ConverterState()
*/
/*!
- \enum QTextCodec::ConversionFlag
-
- \value DefaultConversion No flag is set.
- \value ConvertInvalidToNull If this flag is set, each invalid input
- character is output as a null character.
- \value IgnoreHeader Ignore any Unicode byte-order mark and don't generate any.
-
- \omitvalue FreeFunction
-*/
-
-/*!
- \fn QTextCodec::ConverterState::ConverterState(ConversionFlags flags)
-
- Constructs a ConverterState object initialized with the given \a flags.
-*/
-
-/*!
- \fn QTextCodec::ConverterState::~ConverterState()
-
- Destroys the ConverterState object.
-*/
-
-/*!
\nonreentrant
Constructs a QTextCodec, and gives it the highest precedence. The
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 63e2891..742f4ec 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -955,6 +955,17 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \macro QT_VERSION_CHECK
+ \relates <QtGlobal>
+
+ Turns the major, minor and patch numbers of a version into an
+ integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
+ be compared with another similarly processed version id.
+
+ \sa QT_VERSION
+*/
+
+/*!
\macro QT_VERSION
\relates <QtGlobal>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index dcd4397..5720505 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1478,17 +1478,17 @@ public:
#ifdef Q_OS_SYMBIAN
enum SymbianVersion {
SV_Unknown = 0x0000,
- SV_9_2 = 0x0001,
- SV_9_3 = 0x0002,
- SV_9_4 = 0x0004
+ SV_9_2 = 10,
+ SV_9_3 = 20,
+ SV_9_4 = 30
};
static SymbianVersion symbianVersion();
enum S60Version {
- SV_S60_None = 0x0000,
- SV_S60_Unknown = 0x0001,
- SV_S60_3_1 = 0x0002,
- SV_S60_3_2 = 0x0004,
- SV_S60_5_0 = 0x0008
+ SV_S60_None = 0,
+ SV_S60_Unknown = 1,
+ SV_S60_3_1 = 10,
+ SV_S60_3_2 = 20,
+ SV_S60_5_0 = 30
};
static S60Version s60Version();
#endif
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 6f0b0ee..b7775bd 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -849,6 +849,9 @@
getter functions QWidget::isEnabled(). This is set/cleared by the
Qt kernel.
+ \value WA_DontShowOnScreen Indicates that the widget is hidden or is
+ not a part of the viewable Desktop.
+
\omitvalue WA_DropSiteRegistered
\omitvalue WA_ForceAcceptDrops
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index cc62201..19e86a6 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -442,7 +442,7 @@ QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const
}
/*!
- Sets the floating point precision of the data stream. If the floating point precision is
+ Sets the floating point precision of the data stream to \a precision. If the floating point precision is
DoublePrecision and the version of the data stream is Qt_4_6 or higher, all floating point
numbers will be written and read with 64-bit precision. If the floating point precision is
SinglePrecision and the version is Qt_4_6 or higher, all floating point numbers will be written
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 7cf22f2..f61a59c 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -85,6 +85,10 @@ public:
Qt_4_4 = 10,
Qt_4_5 = 11,
Qt_4_6 = 12
+#if QT_VERSION >= 0x040700
+#error Add the datastream version for this Qt version
+ Qt_4_7 = Qt_4_6
+#endif
};
enum ByteOrder {
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
index a07d084..d738c18 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian.cpp
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h
index 456d18b..edba47c 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian_p.h
+++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index d93cdba..f5de750 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index c9a4cf1..22d0019 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3384,6 +3384,8 @@ QString QUrlPrivate::canonicalHost() const
const char *ptr = ba.constData();
if (!_IPLiteral(&ptr))
that->host.clear();
+ else
+ that->host = host.toLower();
} else {
that->host = qt_ACE_do(host, NormalizeAce);
}
@@ -5941,7 +5943,7 @@ QString QUrl::toLocalFile() const
QString tmp;
QString ourPath = path();
- if (d->scheme.isEmpty() || d->scheme.toLower() == QLatin1String("file")) {
+ if (d->scheme.isEmpty() || QString::compare(d->scheme, QLatin1String("file"), Qt::CaseInsensitive) == 0) {
// magic for shared drive on windows
if (!d->host.isEmpty()) {
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 4f23d21..8ca32e5 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h
index 56097bc..f86bfd3 100644
--- a/src/corelib/kernel/qcore_symbian_p.h
+++ b/src/corelib/kernel/qcore_symbian_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index a039d32..d66cead 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -324,7 +324,6 @@ private:
friend class QGraphicsView;
friend class QGraphicsViewPrivate;
friend class QGraphicsScenePrivate;
- friend class QGraphicsWidget;
};
class Q_CORE_EXPORT QTimerEvent : public QEvent
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 11a0da6..acbb7e4 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index fd0350d..c4107da 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index aae351c..1e6402f 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -539,6 +539,10 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t)
int ok = 0;
+ //in the animation api, we delay the start of the animation
+ //for the dock widgets, we need to use a system timer because dragging a native window
+ //makes Windows start its own event loop.
+ //So if this threshold changes, please change STARTSTOP_TIMER_DELAY in qabstractanimation.cpp accordingly.
if (t->interval > 15 || !t->interval || !qtimeSetEvent) {
ok = 1;
if (!t->interval) // optimization for single-shot-zero-timer
diff --git a/src/corelib/kernel/qmath.cpp b/src/corelib/kernel/qmath.cpp
index 24bec4a..7c1e726 100644
--- a/src/corelib/kernel/qmath.cpp
+++ b/src/corelib/kernel/qmath.cpp
@@ -43,7 +43,7 @@
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
+const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
0.0,
0.024541228522912288,
0.049067674327418015,
diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp
index a05e7b4..8a45d14 100644
--- a/src/corelib/kernel/qsharedmemory_symbian.cpp
+++ b/src/corelib/kernel/qsharedmemory_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
index 31fd9e9..ad4b4f4 100644
--- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtCore of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index 321a05c..13b6fe2 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -48,6 +48,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qobject.h>
#include <QtCore/qset.h>
+#include <QtCore/qvariant.h>
QT_BEGIN_HEADER
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index c95537b..69dcc8a 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -174,6 +174,9 @@ inline QDBusVariant::QDBusVariant(const QVariant &dBusVariant)
inline void QDBusVariant::setVariant(const QVariant &dBusVariant)
{ QVariant::operator=(dBusVariant); }
+inline bool operator==(const QDBusVariant &v1, const QDBusVariant &v2)
+{ return v1.variant() == v2.variant(); }
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QDBusVariant)
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index dacb54c..5b0983b 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -628,7 +628,7 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
nsFont = [mgr fontWithFamily:qt_mac_QStringToNSString(font.family())
traits:mask
weight:weight
- size:font.pointSize()];
+ size:QFontInfo(font).pointSize()];
}
[mgr setSelectedFont:nsFont isMultiple:NO];
diff --git a/src/gui/embedded/qvfbhdr.h b/src/gui/embedded/qvfbhdr.h
index eff5fc2..73b13d3 100644
--- a/src/gui/embedded/qvfbhdr.h
+++ b/src/gui/embedded/qvfbhdr.h
@@ -70,7 +70,7 @@ QT_MODULE(Gui)
.append("/qt_soundserver")
#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \
.append("/QtEmbedded")
-#define QTE_PIPE_QVFB QTE_PIPE
+#define QTE_PIPE_QVFB(DISPLAY) QTE_PIPE(DISPLAY)
#else
#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2") \
.arg(QT_QWS_TEMP_DIR).arg(DISPLAY)
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index fdb1708..ffbb67c 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -118,9 +118,13 @@ QGraphicsAnchor::~QGraphicsAnchor()
}
/*!
- Set the spacing for the anchor to \a spacing.
+ \property QGraphicsAnchor::spacing
+ \brief the space between items in the QGraphicsAnchorLayout.
- \sa spacing(), unsetSpacing()
+ Depending on the anchor type, the default spacing is either
+ 0 or a value returned from the style.
+
+ \sa QGraphicsAnchorLayout::anchor()
*/
void QGraphicsAnchor::setSpacing(qreal spacing)
{
@@ -128,23 +132,12 @@ void QGraphicsAnchor::setSpacing(qreal spacing)
d->setSpacing(spacing);
}
-/*!
- Returns the spacing for the anchor
-
- \sa setSpacing()
-*/
qreal QGraphicsAnchor::spacing() const
{
Q_D(const QGraphicsAnchor);
return d->spacing();
}
-/*!
- Resets the spacing of the anchor point to be the default spacing. Depending on the anchor type,
- the default spacing is either 0 or a value returned from the style.
-
- \sa setSpacing(), spacing(), QGraphicsAnchorLayout::anchor()
-*/
void QGraphicsAnchor::unsetSpacing()
{
Q_D(QGraphicsAnchor);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h
index d9a87ba..99dbf92 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.h
@@ -61,7 +61,7 @@ class QGraphicsAnchorLayoutPrivate;
class Q_GUI_EXPORT QGraphicsAnchor : public QObject
{
Q_OBJECT
- Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing)
+ Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET unsetSpacing)
public:
void setSpacing(qreal spacing);
void unsetSpacing();
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 0690690..3069733 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -609,6 +609,7 @@
/*!
\enum QGraphicsItem::PanelModality
+ \since 4.6
This enum specifies the behavior of a modal panel. A modal panel
is one that blocks input to other panels. Note that items that
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 1226722..961f44f 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -254,6 +254,8 @@
QT_BEGIN_NAMESPACE
+bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
+
static void _q_hoverFromMouseEvent(QGraphicsSceneHoverEvent *hover, const QGraphicsSceneMouseEvent *mouseEvent)
{
hover->setWidget(mouseEvent->widget());
@@ -1051,7 +1053,15 @@ bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event)
return false;
if (filterDescendantEvent(item, event))
return false;
- return (item && item->isEnabled() ? item->sceneEvent(event) : false);
+ if (!item || !item->isEnabled())
+ return false;
+ if (QGraphicsObject *o = item->toGraphicsObject()) {
+ bool spont = event->spontaneous();
+ if (spont ? qt_sendSpontaneousEvent(o, event) : QApplication::sendEvent(o, event))
+ return true;
+ event->spont = spont;
+ }
+ return item->sceneEvent(event);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 224f50b..35a3c13 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -168,8 +168,6 @@ QT_BEGIN_NAMESPACE
\sa QGraphicsProxyWidget, QGraphicsItem, {Widgets and Layouts}
*/
-bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
-
/*!
Constructs a QGraphicsWidget instance. The optional \a parent argument is
passed to QGraphicsItem's constructor. The optional \a wFlags argument
@@ -349,7 +347,7 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
// setPos triggers ItemPositionChange, which can adjust position
wd->inSetGeometry = 1;
- wd->setPosHelper(newGeom.topLeft());
+ setPos(newGeom.topLeft());
wd->inSetGeometry = 0;
newGeom.moveTopLeft(pos());
@@ -1103,10 +1101,6 @@ QVariant QGraphicsWidget::propertyChange(const QString &propertyName, const QVar
*/
bool QGraphicsWidget::sceneEvent(QEvent *event)
{
- bool spont = event->spontaneous();
- if (spont ? qt_sendSpontaneousEvent(this, event) : QApplication::sendEvent(this, event))
- return true;
- event->spont = spont;
return QGraphicsItem::sceneEvent(event);
}
diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp
index 1ece8b1..00fc204 100644
--- a/src/gui/graphicsview/qsimplex_p.cpp
+++ b/src/gui/graphicsview/qsimplex_p.cpp
@@ -75,15 +75,24 @@ QT_BEGIN_NAMESPACE
3.c) Run simplex to optimize the original problem towards its optimal solution.
*/
+/*!
+ \internal
+*/
QSimplex::QSimplex() : objective(0), rows(0), columns(0), firstArtificial(0), matrix(0)
{
}
+/*!
+ \internal
+*/
QSimplex::~QSimplex()
{
clearDataStructures();
}
+/*!
+ \internal
+*/
void QSimplex::clearDataStructures()
{
if (matrix == 0)
@@ -312,11 +321,17 @@ void QSimplex::solveMaxHelper()
while (iterate()) ;
}
+/*!
+ \internal
+*/
void QSimplex::setObjective(QSimplexConstraint *newObjective)
{
objective = newObjective;
}
+/*!
+ \internal
+*/
void QSimplex::clearRow(int rowIndex)
{
qreal *item = matrix + rowIndex * columns;
@@ -324,6 +339,9 @@ void QSimplex::clearRow(int rowIndex)
item[i] = 0.0;
}
+/*!
+ \internal
+*/
void QSimplex::clearColumns(int first, int last)
{
for (int i = 0; i < rows; ++i) {
@@ -333,6 +351,9 @@ void QSimplex::clearColumns(int first, int last)
}
}
+/*!
+ \internal
+*/
void QSimplex::dumpMatrix()
{
qDebug("---- Simplex Matrix ----\n");
@@ -352,6 +373,9 @@ void QSimplex::dumpMatrix()
qDebug("------------------------\n");
}
+/*!
+ \internal
+*/
void QSimplex::combineRows(int toIndex, int fromIndex, qreal factor)
{
if (!factor)
@@ -375,6 +399,9 @@ void QSimplex::combineRows(int toIndex, int fromIndex, qreal factor)
}
}
+/*!
+ \internal
+*/
int QSimplex::findPivotColumn()
{
qreal min = 0;
@@ -429,6 +456,9 @@ int QSimplex::pivotRowForColumn(int column)
return minIndex;
}
+/*!
+ \internal
+*/
void QSimplex::reducedRowEchelon()
{
for (int i = 1; i < rows; ++i) {
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 326dd10..37b6438 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -664,7 +664,12 @@ void QS60PixmapData::setAlphaChannel(const QPixmap &alphaChannel)
QImage QS60PixmapData::toImage() const
{
- return image;
+ QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
+ that->beginDataAccess();
+ QImage copy = that->image.copy();
+ that->endDataAccess();
+
+ return copy;
}
QPaintEngine* QS60PixmapData::paintEngine() const
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 6cde898..74543a0 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -387,7 +387,14 @@ struct QX11AlphaDetector
return hasAlpha();
}
- QX11AlphaDetector(const QImage *i) : image(i), checked(false), has(false) { }
+ QX11AlphaDetector(const QImage *i, Qt::ImageConversionFlags flags)
+ : image(i), checked(false), has(false)
+ {
+ if (flags & Qt::NoOpaqueDetection) {
+ checked = true;
+ has = image->hasAlphaChannel();
+ }
+ }
const QImage *image;
mutable bool checked;
@@ -427,7 +434,7 @@ void QX11PixmapData::fromImage(const QImage &img,
return;
}
- QX11AlphaDetector alphaCheck(&img);
+ QX11AlphaDetector alphaCheck(&img, flags);
int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
if (qt_x11_preferred_pixmap_depth)
@@ -1252,8 +1259,11 @@ void QX11PixmapData::release()
QPixmap QX11PixmapData::alphaChannel() const
{
- if (!hasAlphaChannel())
- return QPixmap();
+ if (!hasAlphaChannel()) {
+ QPixmap pm(w, h);
+ pm.fill(Qt::white);
+ return pm;
+ }
QImage im(toImage());
return QPixmap::fromImage(im.alphaChannel(), Qt::OrderedDither);
}
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 749b8f3..df445db 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -1074,6 +1074,16 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
const QRectF &src) const
{
Q_D(const QPixmapDropShadowFilter);
+ QPixmapFilter *filter = p->paintEngine() && p->paintEngine()->isExtended() ?
+ static_cast<QPaintEngineEx *>(p->paintEngine())->pixmapFilter(type(), this) : 0;
+ QPixmapDropShadowFilter *dropShadowFilter = static_cast<QPixmapDropShadowFilter*>(filter);
+ if (dropShadowFilter) {
+ dropShadowFilter->setColor(d->color);
+ dropShadowFilter->setBlurRadius(d->blurFilter->radius());
+ dropShadowFilter->setOffset(d->offset);
+ dropShadowFilter->draw(p, pos, px, src);
+ return;
+ }
QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toRect()).toImage();
QPainter tmpPainter(&tmp);
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 18cab13..27528de 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -751,7 +751,6 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)
}
}
-
if (delegate) {
if (d->delegateRefCount(delegate) == 0) {
connect(delegate, SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)),
@@ -762,6 +761,7 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)
}
}
d->itemDelegate = delegate;
+ update();
}
/*!
@@ -826,6 +826,7 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de
}
d->rowDelegates.insert(row, delegate);
}
+ update();
}
/*!
@@ -882,6 +883,7 @@ void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelega
}
d->columnDelegates.insert(column, delegate);
}
+ update();
}
/*!
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index 4abdef9..c78a49b 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -54,6 +54,12 @@
#elif defined(Q_WS_MAC)
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
+
+#if defined(Q_WS_X11) && !defined(Q_NO_STYLE_GTK)
+#include <private/qt_x11_p.h>
+#include <private/gtksymbols_p.h>
+#endif
+
#include <private/qfunctions_p.h>
#ifndef SHGFI_ADDOVERLAYS
@@ -378,6 +384,15 @@ QIcon QFileIconProviderPrivate::getMacIcon(const QFileInfo &fi) const
QIcon QFileIconProvider::icon(const QFileInfo &info) const
{
Q_D(const QFileIconProvider);
+
+#if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK)
+ if (X11->desktopEnvironment == DE_GNOME) {
+ QIcon gtkIcon = QGtk::getFilesystemIcon(info);
+ if (!gtkIcon.isNull())
+ return gtkIcon;
+ }
+#endif
+
#ifdef Q_WS_MAC
QIcon retIcon = d->getMacIcon(info);
if (!retIcon.isNull())
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index f1ffaa6..15bd445 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -191,6 +191,359 @@ QList<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w,
return list.toList();
}
+#undef DEBUG_SPAN_UPDATE
+
+#ifdef DEBUG_SPAN_UPDATE
+QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
+{
+ str << "(" << span.top() << "," << span.left() << "," << span.bottom() << "," << span.right() << ")";
+ return str;
+}
+#endif
+
+/** \internal
+* Updates the span collection after row insertion.
+*/
+void QSpanCollection::updateInsertedRows(int start, int end)
+{
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << Q_FUNC_INFO;
+ qDebug() << start << end;
+ qDebug() << index;
+#endif
+ if (spans.isEmpty())
+ return;
+
+ int delta = end - start + 1;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("Before");
+#endif
+ for (SpanList::iterator it = spans.begin(); it != spans.end(); ++it) {
+ Span *span = *it;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << span << *span;
+#endif
+ if (span->m_bottom < start)
+ continue;
+ if (span->m_top >= start)
+ span->m_top += delta;
+ span->m_bottom += delta;
+ }
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("After");
+ foreach (QSpanCollection::Span *span, spans)
+ qDebug() << span << *span;
+#endif
+
+ for (Index::iterator it_y = index.begin(); it_y != index.end(); ) {
+ int y = -it_y.key();
+ if (y < start) {
+ ++it_y;
+ continue;
+ }
+
+ index.insert(-y - delta, it_y.value());
+ it_y = index.erase(it_y);
+ }
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << index;
+#endif
+}
+
+/** \internal
+* Updates the span collection after column insertion.
+*/
+void QSpanCollection::updateInsertedColumns(int start, int end)
+{
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << Q_FUNC_INFO;
+ qDebug() << start << end;
+ qDebug() << index;
+#endif
+ if (spans.isEmpty())
+ return;
+
+ int delta = end - start + 1;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("Before");
+#endif
+ for (SpanList::iterator it = spans.begin(); it != spans.end(); ++it) {
+ Span *span = *it;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << span << *span;
+#endif
+ if (span->m_right < start)
+ continue;
+ if (span->m_left >= start)
+ span->m_left += delta;
+ span->m_right += delta;
+ }
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("After");
+ foreach (QSpanCollection::Span *span, spans)
+ qDebug() << span << *span;
+#endif
+
+ for (Index::iterator it_y = index.begin(); it_y != index.end(); ++it_y) {
+ SubIndex &subindex = it_y.value();
+ for (SubIndex::iterator it = subindex.begin(); it != subindex.end(); ) {
+ int x = -it.key();
+ if (x < start) {
+ ++it;
+ continue;
+ }
+ subindex.insert(-x - delta, it.value());
+ it = subindex.erase(it);
+ }
+ }
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << index;
+#endif
+}
+
+/** \internal
+* Cleans a subindex from to be deleted spans. The update argument is used
+* to move the spans inside the subindex, in case their anchor changed.
+* \return true if no span in this subindex starts at y, and should thus be deleted.
+*/
+bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int y, bool update)
+{
+ if (subindex.isEmpty())
+ return true;
+
+ bool should_be_deleted = true;
+ SubIndex::iterator it = subindex.end();
+ do {
+ --it;
+ int x = -it.key();
+ Span *span = it.value();
+ if (span->will_be_deleted) {
+ it = subindex.erase(it);
+ continue;
+ }
+ if (update && span->m_left != x) {
+ subindex.insert(-span->m_left, span);
+ it = subindex.erase(it);
+ }
+ if (should_be_deleted && span->m_top == y)
+ should_be_deleted = false;
+ } while (it != subindex.begin());
+
+ return should_be_deleted;
+}
+
+/** \internal
+* Updates the span collection after row removal.
+*/
+void QSpanCollection::updateRemovedRows(int start, int end)
+{
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << Q_FUNC_INFO;
+ qDebug() << start << end;
+ qDebug() << index;
+#endif
+ if (spans.isEmpty())
+ return;
+
+ SpanList spansToBeDeleted;
+ int delta = end - start + 1;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("Before");
+#endif
+ for (SpanList::iterator it = spans.begin(); it != spans.end(); ) {
+ Span *span = *it;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << span << *span;
+#endif
+ if (span->m_bottom < start) {
+ ++it;
+ continue;
+ }
+ if (span->m_top < start) {
+ if (span->m_bottom <= end)
+ span->m_bottom = start - 1;
+ else
+ span->m_bottom -= delta;
+ } else {
+ if (span->m_bottom > end) {
+ if (span->m_top <= end)
+ span->m_top = start;
+ else
+ span->m_top -= delta;
+ span->m_bottom -= delta;
+ } else {
+ span->will_be_deleted = true;
+ }
+ }
+ if (span->m_top == span->m_bottom && span->m_left == span->m_right)
+ span->will_be_deleted = true;
+ if (span->will_be_deleted) {
+ spansToBeDeleted.append(span);
+ it = spans.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("After");
+ foreach (QSpanCollection::Span *span, spans)
+ qDebug() << span << *span;
+#endif
+ if (spans.isEmpty()) {
+ qDeleteAll(spansToBeDeleted);
+ index.clear();
+ return;
+ }
+
+ Index::iterator it_y = index.end();
+ do {
+ --it_y;
+ int y = -it_y.key();
+ SubIndex &subindex = it_y.value();
+ if (y < start) {
+ if (cleanSpanSubIndex(subindex, y))
+ it_y = index.erase(it_y);
+ } else if (y >= start && y <= end) {
+ bool span_at_start = false;
+ SubIndex spansToBeMoved;
+ for (SubIndex::iterator it = subindex.begin(); it != subindex.end(); ++it) {
+ Span *span = it.value();
+ if (span->will_be_deleted)
+ continue;
+ if (!span_at_start && span->m_top == start)
+ span_at_start = true;
+ spansToBeMoved.insert(it.key(), span);
+ }
+
+ if (y == start && span_at_start)
+ subindex.clear();
+ else
+ it_y = index.erase(it_y);
+
+ if (span_at_start) {
+ Index::iterator it_start;
+ if (y == start)
+ it_start = it_y;
+ else {
+ it_start = index.find(-start);
+ if (it_start == index.end())
+ it_start = index.insert(-start, SubIndex());
+ }
+ SubIndex &start_subindex = it_start.value();
+ for (SubIndex::iterator it = spansToBeMoved.begin(); it != spansToBeMoved.end(); ++it)
+ start_subindex.insert(it.key(), it.value());
+ }
+ } else {
+ if (y == end + 1) {
+ Index::iterator it_top = index.find(-y + delta);
+ if (it_top == index.end())
+ it_top = index.insert(-y + delta, SubIndex());
+ for (SubIndex::iterator it = subindex.begin(); it != subindex.end(); ) {
+ Span *span = it.value();
+ if (!span->will_be_deleted)
+ it_top.value().insert(it.key(), span);
+ ++it;
+ }
+ } else {
+ index.insert(-y + delta, subindex);
+ }
+ it_y = index.erase(it_y);
+ }
+ } while (it_y != index.begin());
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << index;
+ qDebug("Deleted");
+ foreach (QSpanCollection::Span *span, spansToBeDeleted)
+ qDebug() << span << *span;
+#endif
+ qDeleteAll(spansToBeDeleted);
+}
+
+/** \internal
+* Updates the span collection after column removal.
+*/
+void QSpanCollection::updateRemovedColumns(int start, int end)
+{
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << Q_FUNC_INFO;
+ qDebug() << start << end;
+ qDebug() << index;
+#endif
+ if (spans.isEmpty())
+ return;
+
+ SpanList toBeDeleted;
+ int delta = end - start + 1;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("Before");
+#endif
+ for (SpanList::iterator it = spans.begin(); it != spans.end(); ) {
+ Span *span = *it;
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << span << *span;
+#endif
+ if (span->m_right < start) {
+ ++it;
+ continue;
+ }
+ if (span->m_left < start) {
+ if (span->m_right <= end)
+ span->m_right = start - 1;
+ else
+ span->m_right -= delta;
+ } else {
+ if (span->m_right > end) {
+ if (span->m_left <= end)
+ span->m_left = start;
+ else
+ span->m_left -= delta;
+ span->m_right -= delta;
+ } else {
+ span->will_be_deleted = true;
+ }
+ }
+ if (span->m_top == span->m_bottom && span->m_left == span->m_right)
+ span->will_be_deleted = true;
+ if (span->will_be_deleted) {
+ toBeDeleted.append(span);
+ it = spans.erase(it);
+ } else {
+ ++it;
+ }
+ }
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug("After");
+ foreach (QSpanCollection::Span *span, spans)
+ qDebug() << span << *span;
+#endif
+ if (spans.isEmpty()) {
+ qDeleteAll(toBeDeleted);
+ index.clear();
+ return;
+ }
+
+ for (Index::iterator it_y = index.begin(); it_y != index.end(); ) {
+ int y = -it_y.key();
+ if (cleanSpanSubIndex(it_y.value(), y, true))
+ it_y = index.erase(it_y);
+ else
+ ++it_y;
+ }
+
+#ifdef DEBUG_SPAN_UPDATE
+ qDebug() << index;
+ qDebug("Deleted");
+ foreach (QSpanCollection::Span *span, toBeDeleted)
+ qDebug() << span << *span;
+#endif
+ qDeleteAll(toBeDeleted);
+}
+
class QTableCornerButton : public QAbstractButton
{
Q_OBJECT
@@ -299,6 +652,9 @@ void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan
sp->m_right = column + columnSpan - 1;
spans.updateSpan(sp, old_height);
return;
+ } else if (rowSpan == 1 && columnSpan == 1) {
+ qWarning() << "QTableView::setSpan: single cell span won't be added";
+ return;
}
sp = new QSpanCollection::Span(row, column, rowSpan, columnSpan);
spans.addSpan(sp);
@@ -460,6 +816,46 @@ void QTableViewPrivate::drawAndClipSpans(const QRegion &area, QPainter *painter,
/*!
\internal
+ Updates spans after row insertion.
+*/
+void QTableViewPrivate::_q_updateSpanInsertedRows(const QModelIndex &parent, int start, int end)
+{
+ Q_UNUSED(parent)
+ spans.updateInsertedRows(start, end);
+}
+
+/*!
+ \internal
+ Updates spans after column insertion.
+*/
+void QTableViewPrivate::_q_updateSpanInsertedColumns(const QModelIndex &parent, int start, int end)
+{
+ Q_UNUSED(parent)
+ spans.updateInsertedColumns(start, end);
+}
+
+/*!
+ \internal
+ Updates spans after row removal.
+*/
+void QTableViewPrivate::_q_updateSpanRemovedRows(const QModelIndex &parent, int start, int end)
+{
+ Q_UNUSED(parent)
+ spans.updateRemovedRows(start, end);
+}
+
+/*!
+ \internal
+ Updates spans after column removal.
+*/
+void QTableViewPrivate::_q_updateSpanRemovedColumns(const QModelIndex &parent, int start, int end)
+{
+ Q_UNUSED(parent)
+ spans.updateRemovedColumns(start, end);
+}
+
+/*!
+ \internal
Draws a table cell.
*/
void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItemV4 &option, const QModelIndex &index)
@@ -629,6 +1025,14 @@ QTableView::~QTableView()
void QTableView::setModel(QAbstractItemModel *model)
{
Q_D(QTableView);
+ connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedRows(QModelIndex,int,int)));
+ connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanInsertedColumns(QModelIndex,int,int)));
+ connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedRows(QModelIndex,int,int)));
+ connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
+ this, SLOT(_q_updateSpanRemovedColumns(QModelIndex,int,int)));
d->verticalHeader->setModel(model);
d->horizontalHeader->setModel(model);
QAbstractItemView::setModel(model);
diff --git a/src/gui/itemviews/qtableview.h b/src/gui/itemviews/qtableview.h
index a08d6a9..541c419 100644
--- a/src/gui/itemviews/qtableview.h
+++ b/src/gui/itemviews/qtableview.h
@@ -182,6 +182,10 @@ private:
Q_DISABLE_COPY(QTableView)
Q_PRIVATE_SLOT(d_func(), void _q_selectRow(int))
Q_PRIVATE_SLOT(d_func(), void _q_selectColumn(int))
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSpanInsertedRows(QModelIndex,int,int))
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSpanInsertedColumns(QModelIndex,int,int))
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSpanRemovedRows(QModelIndex,int,int))
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSpanRemovedColumns(QModelIndex,int,int))
};
#endif // QT_NO_TABLEVIEW
diff --git a/src/gui/itemviews/qtableview_p.h b/src/gui/itemviews/qtableview_p.h
index 36a3ece..c785bd7 100644
--- a/src/gui/itemviews/qtableview_p.h
+++ b/src/gui/itemviews/qtableview_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/QList>
+#include <QtCore/QLinkedList>
#include <QtCore/QMap>
#include <QtCore/QSet>
#include <QtCore/QDebug>
@@ -82,10 +83,11 @@ public:
int m_left;
int m_bottom;
int m_right;
+ bool will_be_deleted;
Span()
- : m_top(-1), m_left(-1), m_bottom(-1), m_right(-1) { }
+ : m_top(-1), m_left(-1), m_bottom(-1), m_right(-1), will_be_deleted(false) { }
Span(int row, int column, int rowCount, int columnCount)
- : m_top(row), m_left(column), m_bottom(row+rowCount-1), m_right(column+columnCount-1) { }
+ : m_top(row), m_left(column), m_bottom(row+rowCount-1), m_right(column+columnCount-1), will_be_deleted(false) { }
inline int top() const { return m_top; }
inline int left() const { return m_left; }
inline int bottom() const { return m_bottom; }
@@ -105,12 +107,20 @@ public:
void clear();
QList<Span *> spansInRect(int x, int y, int w, int h) const;
- QList<Span *> spans; //lists of all spans
+ void updateInsertedRows(int start, int end);
+ void updateInsertedColumns(int start, int end);
+ void updateRemovedRows(int start, int end);
+ void updateRemovedColumns(int start, int end);
+
+ typedef QLinkedList<Span *> SpanList;
+ SpanList spans; //lists of all spans
private:
//the indexes are negative so the QMap::lowerBound do what i need.
typedef QMap<int, Span *> SubIndex;
typedef QMap<int, SubIndex> Index;
Index index;
+
+ bool cleanSpanSubIndex(SubIndex &subindex, int end, bool update = false);
};
Q_DECLARE_TYPEINFO ( QSpanCollection::Span, Q_MOVABLE_TYPE);
@@ -227,6 +237,11 @@ public:
void selectRow(int row, bool anchor);
void selectColumn(int column, bool anchor);
+
+ void _q_updateSpanInsertedRows(const QModelIndex &parent, int start, int end);
+ void _q_updateSpanInsertedColumns(const QModelIndex &parent, int start, int end);
+ void _q_updateSpanRemovedRows(const QModelIndex &parent, int start, int end);
+ void _q_updateSpanRemovedColumns(const QModelIndex &parent, int start, int end);
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 634f23a..167beb2 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -232,6 +232,7 @@ QString qws_dataDir()
// Get the filename of the pipe Qt for Embedded Linux uses for server/client comms
Q_GUI_EXPORT QString qws_qtePipeFilename()
{
+ qws_dataDir();
return QTE_PIPE(qws_display_id);
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index af9fe92..acd1041 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -955,13 +955,14 @@ void QSymbianControl::setFocusSafely(bool focus)
/*!
\typedef QApplication::QS60MainApplicationFactory
+ \since 4.6
This is a typedef for a pointer to a function with the following
signature:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 47
- \sa QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)
+ \sa QApplication::QApplication()
*/
/*!
@@ -1031,6 +1032,11 @@ void qt_init(QApplicationPrivate * /* priv */, int)
//Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this)
const TInt KMachineUidSamsungI8510 = 0x2000C51E;
+ // HAL::Get(HALData::EPen, TInt& result) may set 'result' to 1 on some 3.1 systems (e.g. N95).
+ // But we know that S60 systems below 5.0 did not support touch.
+ static const bool touchIsUnsupportedOnSystem =
+ QSysInfo::s60Version() == QSysInfo::SV_S60_3_1
+ || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2;
TInt machineUID;
TInt mouse;
TInt touch;
@@ -1042,7 +1048,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
if (err != KErrNone)
machineUID = 0;
err = HAL::Get(HALData::EPen, touch);
- if (err != KErrNone)
+ if (err != KErrNone || touchIsUnsupportedOnSystem)
touch = 0;
if (mouse || machineUID == KMachineUidSamsungI8510) {
S60->hasTouchscreen = false;
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index bbce438..e46a370 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2256,8 +2256,13 @@ void qt_init(QApplicationPrivate *priv, int,
unsigned long length, after;
uchar *data = 0;
- if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(DTWM_IS_RUNNING),
- 0, 1, False, AnyPropertyType, &type, &format, &length,
+ QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
+ if (session == QLatin1String("kde")) {
+ X11->desktopEnvironment = DE_KDE;
+ } else if (session == QLatin1String("gnome") || session == QLatin1String("xfce")) {
+ X11->desktopEnvironment = DE_GNOME;
+ } else if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(DTWM_IS_RUNNING),
+ 0, 1, False, AnyPropertyType, &type, &format, &length,
&after, &data) == Success && length) {
// DTWM is running, meaning most likely CDE is running...
X11->desktopEnvironment = DE_CDE;
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index 6ceab07..3e5dadc 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -252,7 +252,7 @@ QFormLayoutPrivate::QFormLayoutPrivate()
: fieldGrowthPolicy(DefaultFieldGrowthPolicy),
rowWrapPolicy(DefaultRowWrapPolicy), has_hfw(false), dirty(true), sizesDirty(true),
expandVertical(0), expandHorizontal(0), labelAlignment(0), formAlignment(0),
- hfw_width(-1), hfw_sh_height(-1), min_width(-1),
+ layoutWidth(-1), hfw_width(-1), hfw_sh_height(-1), min_width(-1),
sh_width(-1), thresh_width(QLAYOUTSIZE_MAX), hSpacing(-1), vSpacing(-1)
{
}
diff --git a/src/gui/kernel/qtooltip.cpp b/src/gui/kernel/qtooltip.cpp
index 2d0d209..4261808 100644
--- a/src/gui/kernel/qtooltip.cpp
+++ b/src/gui/kernel/qtooltip.cpp
@@ -183,7 +183,6 @@ QTipLabel::QTipLabel(const QString &text, QWidget *w)
setFrameStyle(QFrame::NoFrame);
setAlignment(Qt::AlignLeft);
setIndent(1);
- setWordWrap(Qt::mightBeRichText(text));
qApp->installEventFilter(this);
setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0);
setMouseTracking(true);
@@ -208,6 +207,7 @@ void QTipLabel::reuseTip(const QString &text)
}
#endif
+ setWordWrap(Qt::mightBeRichText(text));
setText(text);
QFontMetrics fm(font());
QSize extra(1, 0);
diff --git a/src/gui/kernel/qwhatsthis.cpp b/src/gui/kernel/qwhatsthis.cpp
index 5e5e56f..0da3a9b 100644
--- a/src/gui/kernel/qwhatsthis.cpp
+++ b/src/gui/kernel/qwhatsthis.cpp
@@ -194,9 +194,9 @@ QWhatsThat::QWhatsThat(const QString& txt, QWidget* parent, QWidget *showTextFor
#ifndef QT_NO_CURSOR
setCursor(Qt::ArrowCursor);
#endif
-
QRect r;
doc = 0;
+ ensurePolished(); // Ensures style sheet font before size calc
if (Qt::mightBeRichText(text)) {
doc = new QTextDocument();
doc->setUndoRedoEnabled(false);
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 3cfbb09..4cbf762 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -923,7 +923,7 @@ void QWidget::setAutoFillBackground(bool enabled)
Note: Currently softkeys are only supported on the Symbian Platform.
- \sa addAction, QAction, QMenuBar
+ \sa addAction(), QAction, QMenuBar
*/
@@ -5130,7 +5130,8 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
return;
QPixmap pixmap(size);
- if (!(renderFlags & QWidget::DrawWindowBackground))
+ if (!(renderFlags & QWidget::DrawWindowBackground)
+ || !q->palette().brush(q->backgroundRole()).isOpaque())
pixmap.fill(Qt::transparent);
q->render(&pixmap, QPoint(), toBePainted, renderFlags);
@@ -11447,20 +11448,29 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction)
const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint()));
- // For focus proxies, the child widget handling the focus can have keypad navigation focus,
+ // For focus proxies, the child widget handling the focus can have keypad navigation focus,
// but the owner of the proxy cannot.
// Additionally, empty widgets should be ignored.
if (targetCandidate->focusProxy() || targetCandidateRect.isEmpty())
continue;
+ // Only navigate to a target widget that...
if ( targetCandidate != sourceWidget
+ // ...takes the focus,
&& targetCandidate->focusPolicy() & Qt::TabFocus
+ // ...is above if DirectionNorth,
&& !(direction == DirectionNorth && targetCandidateRect.bottom() > sourceRect.top())
+ // ...is on the right if DirectionEast,
&& !(direction == DirectionEast && targetCandidateRect.left() < sourceRect.right())
+ // ...is below if DirectionSouth,
&& !(direction == DirectionSouth && targetCandidateRect.top() < sourceRect.bottom())
+ // ...is on the left if DirectionWest,
&& !(direction == DirectionWest && targetCandidateRect.right() > sourceRect.left())
+ // ...is enabled,
&& targetCandidate->isEnabled()
+ // ...is visible,
&& targetCandidate->isVisible()
+ // ...is in the same window,
&& targetCandidate->window() == sourceWindow) {
const int targetCandidateDistance = pointToRect(sourcePoint, targetCandidateRect);
if (targetCandidateDistance < shortestDistance) {
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 62e08f3..d9b824b 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -514,7 +514,7 @@ QString QColor::name() const
\i #RRRRGGGGBBBB
\i A name from the list of colors defined in the list of \l{SVG color keyword names}
provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
- These color names work on all platforms. Note that these color names are \i not the
+ These color names work on all platforms. Note that these color names are \e not the
same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not
refer to the same color.
\i \c transparent - representing the absence of a color.
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 4d2521a..59482c6 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1402,6 +1402,7 @@ void QX11PaintEngine::updateBrush(const QBrush &brush, const QPointF &origin)
mask |= GCTile;
#ifndef QT_NO_XRENDER
if (d->pdev_depth == 32 && d->brush_pm.depth() != 32) {
+ d->brush_pm.detach();
QX11PixmapData *brushData = static_cast<QX11PixmapData*>(d->brush_pm.data.data());
brushData->convertToARGB32();
}
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index e73282f..4cccc91 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -534,7 +534,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n
QImage image = img;
QImage::Format format = image.format();
- if (image.depth() == 1 && *bitmap) {
+ if (image.depth() == 1 && *bitmap && img.colorTable().size() == 0) {
if (format == QImage::Format_MonoLSB)
image = image.convertToFormat(QImage::Format_Mono);
format = QImage::Format_Mono;
diff --git a/src/gui/painting/qprintengine_ps.cpp b/src/gui/painting/qprintengine_ps.cpp
index 772a30d..b740fbc 100644
--- a/src/gui/painting/qprintengine_ps.cpp
+++ b/src/gui/painting/qprintengine_ps.cpp
@@ -751,6 +751,7 @@ bool QPSPrintEngine::begin(QPaintDevice *pdev)
d->boundingBox = QRect();
d->fontsUsed = "";
d->hugeDocument = false;
+ d->simplePen = false;
setActive(true);
d->printerState = QPrinter::Active;
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index abe9e5e..8118450 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-#define Q_NEAR_CLIP 0.000001
+#define Q_NEAR_CLIP (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
#ifdef MAP
# undef MAP
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index 592b34c..3a118bd 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -140,7 +140,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
// Not ready for painting yet, bail out. This can happen in
// QWidget::create_sys()
- if (!d->image)
+ if (!d->image || rgn.numRects() == 0)
return;
#ifdef Q_WS_WIN
@@ -203,9 +203,11 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
wrgn.translate(-wOffset);
QRect wbr = wrgn.boundingRect();
- int num;
- XRectangle *rects = (XRectangle *)qt_getClipRects(wrgn, num);
- XSetClipRectangles(X11->display, d_ptr->gc, 0, 0, rects, num, YXBanded);
+ if (wrgn.numRects() != 1) {
+ int num;
+ XRectangle *rects = (XRectangle *)qt_getClipRects(wrgn, num);
+ XSetClipRectangles(X11->display, d_ptr->gc, 0, 0, rects, num, YXBanded);
+ }
QRect br = rgn.boundingRect().translated(offset);
#ifndef QT_NO_MITSHM
@@ -219,17 +221,23 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
const QImage &src = d->image->image;
br = br.intersected(src.rect());
if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) {
+ Q_ASSERT(src.depth() >= 16);
+ const QImage sub_src(src.scanLine(br.y()) + br.x() * (uint(src.depth()) / 8),
+ br.width(), br.height(), src.bytesPerLine(), src.format());
QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType);
data->xinfo = widget->x11Info();
- data->fromImage(src, Qt::AutoColor);
+ data->fromImage(sub_src, Qt::NoOpaqueDetection);
QPixmap pm = QPixmap(data);
- XCopyArea(X11->display, pm.handle(), widget->handle(), d_ptr->gc, br.x() , br.y() , br.width(), br.height(), wbr.x(), wbr.y());
+ XCopyArea(X11->display, pm.handle(), widget->handle(), d_ptr->gc, 0 , 0 , br.width(), br.height(), wbr.x(), wbr.y());
} else {
// qpaintengine_x11.cpp
extern void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const QImage &image, Drawable hd, GC gc, Display *dpy, Visual *visual, int depth);
qt_x11_drawImage(br, wbr.topLeft(), src, widget->handle(), d_ptr->gc, X11->display, (Visual *)widget->x11Info().visual(), widget->x11Info().depth());
}
}
+
+ if (wrgn.numRects() != 1)
+ XSetClipMask(X11->display, d_ptr->gc, XNone);
#endif // FALCON
#ifdef Q_WS_MAC
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 5e4433c..46c4c42 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -129,9 +129,12 @@ void QX11WindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint
// qDebug() << "XSetClipRectangles";
// for (int i = 0; i < num; ++i)
// qDebug() << ' ' << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height;
- XSetClipRectangles(X11->display, gc, 0, 0, rects, num, YXBanded);
+ if (num != 1)
+ XSetClipRectangles(X11->display, gc, 0, 0, rects, num, YXBanded);
XCopyArea(X11->display, d_ptr->device.handle(), widget->handle(), gc,
br.x() + offset.x(), br.y() + offset.y(), br.width(), br.height(), wbr.x(), wbr.y());
+ if (num != 1)
+ XSetClipMask(X11->display, gc, XNone);
}
void QX11WindowSurface::setGeometry(const QRect &rect)
diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp
index 54fb3b1..2973c97 100644
--- a/src/gui/s60framework/qs60mainapplication.cpp
+++ b/src/gui/s60framework/qs60mainapplication.cpp
@@ -63,7 +63,7 @@ _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main.rsc");
* \class QS60MainApplication
* \obsolete
* \since 4.6
- * \brief Helper class for S60 migration
+ * \brief The QS60MainApplication class provides support for migration from S60.
*
* The QS60MainApplication provides a helper class for use in migrating from existing S60 based
* applications to Qt based applications. It is used in the exact same way as the
@@ -80,7 +80,7 @@ _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main.rsc");
* Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian
* leaves.
*
- * \sa QS60MainDocument, QS60MainAppUi, QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)
+ * \sa QS60MainDocument, QS60MainAppUi, QApplication::QS60MainApplicationFactory
*/
/*!
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index 9e2333b..d8181f8 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -51,7 +51,9 @@
#include "qs60mainappui.h"
#include <QtGui/qapplication.h>
#include <QtGui/qmenu.h>
-#include <QtGui/private/qt_s60_p.h>
+#include <private/qmenu_p.h>
+#include <private/qt_s60_p.h>
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -226,17 +228,14 @@ void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane)
*/
void QS60MainAppUi::RestoreMenuL(CCoeControl* menuWindow, TInt resourceId, TMenuType menuType)
{
- if ((resourceId == R_QT_WRAPPERAPP_MENUBAR) || (resourceId == R_AVKON_MENUPANE_FEP_DEFAULT)) {
- TResourceReader reader;
- iCoeEnv->CreateResourceReaderLC(reader, resourceId);
- menuWindow->ConstructFromResourceL(reader);
- CleanupStack::PopAndDestroy();
+ if (resourceId >= QT_SYMBIAN_FIRST_MENU_ITEM && resourceId <= QT_SYMBIAN_LAST_MENU_ITEM) {
+ if (menuType == EMenuPane)
+ DynInitMenuPaneL(resourceId, (CEikMenuPane*)menuWindow);
+ else
+ DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow);
+ } else {
+ CAknAppUi::RestoreMenuL(menuWindow, resourceId, menuType);
}
-
- if (menuType == EMenuPane)
- DynInitMenuPaneL(resourceId, (CEikMenuPane*)menuWindow);
- else
- DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow);
}
QT_END_NAMESPACE
diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp
index e9a0b78..1de5ffa 100644
--- a/src/gui/statemachine/qguistatemachine.cpp
+++ b/src/gui/statemachine/qguistatemachine.cpp
@@ -90,52 +90,38 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::Close:
return new QCloseEvent(*static_cast<QCloseEvent*>(e));
case QEvent::Quit:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ParentChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ParentAboutToChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ThreadChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WindowActivate:
case QEvent::WindowDeactivate:
return new QEvent(*e);
case QEvent::ShowToParent:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::HideToParent:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::Wheel:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QWheelEvent(*static_cast<QWheelEvent*>(e));
case QEvent::WindowTitleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WindowIconChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ApplicationWindowIconChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ApplicationFontChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ApplicationLayoutDirectionChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ApplicationPaletteChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::PaletteChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::Clipboard:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
@@ -146,14 +132,11 @@ static QEvent *cloneEvent(QEvent *e)
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
case QEvent::SockAct:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WinEventAct:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::DeferredDelete:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
#ifndef QT_NO_DRAGANDDROP
case QEvent::DragEnter:
return new QDragEnterEvent(*static_cast<QDragEnterEvent*>(e));
@@ -164,139 +147,99 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::Drop:
return new QDropEvent(*static_cast<QDragMoveEvent*>(e));
case QEvent::DragResponse:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QDragResponseEvent(*static_cast<QDragResponseEvent*>(e));
#endif
case QEvent::ChildAdded:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QChildEvent(*static_cast<QChildEvent*>(e));
case QEvent::ChildPolished:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QChildEvent(*static_cast<QChildEvent*>(e));
#ifdef QT3_SUPPORT
case QEvent::ChildInsertedRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ChildInserted:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QChildEvent(*static_cast<QChildEvent*>(e));
case QEvent::LayoutHint:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
#endif
case QEvent::ChildRemoved:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QChildEvent(*static_cast<QChildEvent*>(e));
case QEvent::ShowWindowRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::PolishRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::Polish:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::LayoutRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::UpdateRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::UpdateLater:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::EmbeddingControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ActivateControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::DeactivateControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
+
case QEvent::ContextMenu:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QContextMenuEvent(*static_cast<QContextMenuEvent*>(e));
case QEvent::InputMethod:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QInputMethodEvent(*static_cast<QInputMethodEvent*>(e));
case QEvent::AccessibilityPrepare:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::TabletMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::LocaleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::LanguageChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::LayoutDirectionChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::Style:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::TabletPress:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::TabletRelease:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::OkRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::HelpRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::IconDrag:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QIconDragEvent(*static_cast<QIconDragEvent*>(e));
case QEvent::FontChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::EnabledChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ActivationChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::StyleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::IconTextChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ModifiedChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::MouseTrackingChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WindowBlocked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WindowUnblocked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::WindowStateChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QWindowStateChangeEvent(*static_cast<QWindowStateChangeEvent*>(e));
case QEvent::ToolTip:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::WhatsThis:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::StatusTip:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QStatusTipEvent(*static_cast<QStatusTipEvent*>(e));
#ifndef QT_NO_ACTION
case QEvent::ActionChanged:
case QEvent::ActionAdded:
@@ -304,15 +247,12 @@ static QEvent *cloneEvent(QEvent *e)
return new QActionEvent(*static_cast<QActionEvent*>(e));
#endif
case QEvent::FileOpen:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QFileOpenEvent(*static_cast<QFileOpenEvent*>(e));
case QEvent::Shortcut:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QShortcutEvent(*static_cast<QShortcutEvent*>(e));
case QEvent::ShortcutOverride:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QKeyEvent(*static_cast<QKeyEvent*>(e));
#ifdef QT3_SUPPORT
case QEvent::Accel:
@@ -324,43 +264,30 @@ static QEvent *cloneEvent(QEvent *e)
#endif
case QEvent::WhatsThisClicked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e));
case QEvent::ToolBarChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QToolBarChangeEvent(*static_cast<QToolBarChangeEvent*>(e));
case QEvent::ApplicationActivate:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ApplicationDeactivate:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::QueryWhatsThis:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::EnterWhatsThisMode:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::LeaveWhatsThisMode:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ZOrderChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::HoverEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::HoverLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::HoverMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QHoverEvent(*static_cast<QHoverEvent*>(e));
case QEvent::AccessibilityHelp:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
@@ -371,19 +298,17 @@ static QEvent *cloneEvent(QEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::EnterEditFocus:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::LeaveEditFocus:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
#endif
case QEvent::AcceptDropsChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
+#ifdef QT3_SUPPORT
case QEvent::MenubarUpdated:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QMenubarUpdatedEvent(*static_cast<QMenubarUpdatedEvent*>(e));
+#endif
case QEvent::ZeroTimerEvent:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
@@ -426,80 +351,82 @@ static QEvent *cloneEvent(QEvent *e)
}
case QEvent::GraphicsSceneHoverEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::GraphicsSceneHoverMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneHoverLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ case QEvent::GraphicsSceneHoverLeave: {
+ QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(e);
+ QGraphicsSceneHoverEvent *he2 = new QGraphicsSceneHoverEvent(he->type());
+ he2->setPos(he->pos());
+ he2->setScenePos(he->scenePos());
+ he2->setScreenPos(he->screenPos());
+ he2->setLastPos(he->lastPos());
+ he2->setLastScenePos(he->lastScenePos());
+ he2->setLastScreenPos(he->lastScreenPos());
+ he2->setModifiers(he->modifiers());
+ return he2;
+ }
case QEvent::GraphicsSceneHelp:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::GraphicsSceneDragEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::GraphicsSceneDragMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::GraphicsSceneDragLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneDrop:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneWheel:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ case QEvent::GraphicsSceneDrop: {
+ QGraphicsSceneDragDropEvent *dde = static_cast<QGraphicsSceneDragDropEvent*>(e);
+ QGraphicsSceneDragDropEvent *dde2 = new QGraphicsSceneDragDropEvent(dde->type());
+ dde2->setPos(dde->pos());
+ dde2->setScenePos(dde->scenePos());
+ dde2->setScreenPos(dde->screenPos());
+ dde2->setButtons(dde->buttons());
+ dde2->setModifiers(dde->modifiers());
+ return dde2;
+ }
+ case QEvent::GraphicsSceneWheel: {
+ QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e);
+ QGraphicsSceneWheelEvent *we2 = new QGraphicsSceneWheelEvent(we->type());
+ we2->setPos(we->pos());
+ we2->setScenePos(we->scenePos());
+ we2->setScreenPos(we->screenPos());
+ we2->setButtons(we->buttons());
+ we2->setModifiers(we->modifiers());
+ we2->setOrientation(we->orientation());
+ return we2;
+ }
#endif
case QEvent::KeyboardLayoutChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::DynamicPropertyChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e));
case QEvent::TabletEnterProximity:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::TabletLeaveProximity:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QTabletEvent(*static_cast<QTabletEvent*>(e));
case QEvent::NonClientAreaMouseMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::NonClientAreaMouseButtonPress:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::NonClientAreaMouseButtonRelease:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
case QEvent::NonClientAreaMouseButtonDblClick:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QMouseEvent(*static_cast<QMouseEvent*>(e));
case QEvent::MacSizeChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ContentsRectChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::MacGLWindowChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::FutureCallOut:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
#ifndef QT_NO_GRAPHICSVIEW
- case QEvent::GraphicsSceneResize:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ case QEvent::GraphicsSceneResize: {
+ QGraphicsSceneResizeEvent *re = static_cast<QGraphicsSceneResizeEvent*>(e);
+ QGraphicsSceneResizeEvent *re2 = new QGraphicsSceneResizeEvent();
+ re2->setOldSize(re->oldSize());
+ re2->setNewSize(re->newSize());
+ return re2;
+ }
case QEvent::GraphicsSceneMove: {
QGraphicsSceneMoveEvent *me = static_cast<QGraphicsSceneMoveEvent*>(e);
QGraphicsSceneMoveEvent *me2 = new QGraphicsSceneMoveEvent();
@@ -510,11 +437,9 @@ static QEvent *cloneEvent(QEvent *e)
}
#endif
case QEvent::CursorChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::ToolTipChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
+ return new QEvent(*e);
case QEvent::NetworkReplyUpdated:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
@@ -531,6 +456,23 @@ static QEvent *cloneEvent(QEvent *e)
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
#endif
+
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ return new QTouchEvent(*static_cast<QTouchEvent*>(e));
+
+ case QEvent::NativeGesture:
+ Q_ASSERT_X(false, "cloneEvent()", "not implemented");
+ break;
+
+ case QEvent::RequestSoftwareInputPanel:
+ case QEvent::CloseSoftwareInputPanel:
+ return new QEvent(*e);
+
+ case QEvent::UpdateSoftKeys:
+ return new QEvent(*e);
+
case QEvent::User:
case QEvent::MaxUser:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 1cb0ca4..d62f717 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -58,6 +58,7 @@
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
#include <QtCore/QHash>
+#include <QtCore/QUrl>
#include <private/qapplication_p.h>
#include <private/qiconloader_p.h>
@@ -124,6 +125,7 @@ Ptr_gtk_progress_set_adjustment QGtk::gtk_progress_set_adjustment = 0;
Ptr_gtk_range_set_adjustment QGtk::gtk_range_set_adjustment = 0;
Ptr_gtk_range_set_inverted QGtk::gtk_range_set_inverted = 0;
Ptr_gtk_icon_factory_lookup_default QGtk::gtk_icon_factory_lookup_default = 0;
+Ptr_gtk_icon_theme_get_default QGtk::gtk_icon_theme_get_default = 0;
Ptr_gtk_widget_style_get QGtk::gtk_widget_style_get = 0;
Ptr_gtk_icon_set_render_icon QGtk::gtk_icon_set_render_icon = 0;
Ptr_gtk_fixed_new QGtk::gtk_fixed_new = 0;
@@ -196,6 +198,9 @@ Ptr_gconf_client_get_default QGtk::gconf_client_get_default = 0;
Ptr_gconf_client_get_string QGtk::gconf_client_get_string = 0;
Ptr_gconf_client_get_bool QGtk::gconf_client_get_bool = 0;
+Ptr_gnome_icon_lookup_sync QGtk::gnome_icon_lookup_sync = 0;
+Ptr_gnome_vfs_init QGtk::gnome_vfs_init = 0;
+
static QString classPath(GtkWidget *widget)
{
char* class_path;
@@ -281,6 +286,7 @@ static void resolveGtk()
QGtk::gtk_range_set_inverted = (Ptr_gtk_range_set_inverted)libgtk.resolve("gtk_range_set_inverted");
QGtk::gtk_container_add = (Ptr_gtk_container_add)libgtk.resolve("gtk_container_add");
QGtk::gtk_icon_factory_lookup_default = (Ptr_gtk_icon_factory_lookup_default)libgtk.resolve("gtk_icon_factory_lookup_default");
+ QGtk::gtk_icon_theme_get_default = (Ptr_gtk_icon_theme_get_default)libgtk.resolve("gtk_icon_theme_get_default");
QGtk::gtk_widget_style_get = (Ptr_gtk_widget_style_get)libgtk.resolve("gtk_widget_style_get");
QGtk::gtk_icon_set_render_icon = (Ptr_gtk_icon_set_render_icon)libgtk.resolve("gtk_icon_set_render_icon");
QGtk::gtk_fixed_new = (Ptr_gtk_fixed_new)libgtk.resolve("gtk_fixed_new");
@@ -325,6 +331,9 @@ static void resolveGtk()
QGtk::pango_font_description_get_weight = (Ptr_pango_font_description_get_weight)libgtk.resolve("pango_font_description_get_weight");
QGtk::pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
QGtk::pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
+
+ QGtk::gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve( QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
+ QGtk::gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve( QLS("gnomevfs-2"), 0, "gnome_vfs_init");
}
void QGtk::cleanup_gtk_widgets()
@@ -969,6 +978,25 @@ QString QGtk::saveFilename(QWidget *parent, const QString &caption, const QStrin
return filename;
}
+QIcon QGtk::getFilesystemIcon(const QFileInfo &info)
+{
+ QIcon icon;
+ if (QGtk::gnome_vfs_init && QGtk::gnome_icon_lookup_sync) {
+ QGtk::gnome_vfs_init();
+ GtkIconTheme *theme = QGtk::gtk_icon_theme_get_default();
+ QString fileurl = QUrl::fromLocalFile(info.absoluteFilePath()).toEncoded();
+ char * icon_name = QGtk::gnome_icon_lookup_sync(theme,
+ NULL,
+ qPrintable(fileurl),
+ NULL,
+ GNOME_ICON_LOOKUP_FLAGS_NONE,
+ NULL);
+ return QIcon::fromTheme(icon_name);
+ g_free(icon_name);
+ }
+ return icon;
+}
+
QT_END_NAMESPACE
#endif // !defined(QT_NO_STYLE_GTK)
diff --git a/src/gui/styles/gtksymbols_p.h b/src/gui/styles/gtksymbols_p.h
index 4fb193d..313d948 100644
--- a/src/gui/styles/gtksymbols_p.h
+++ b/src/gui/styles/gtksymbols_p.h
@@ -121,6 +121,7 @@ typedef void (*Ptr_gtk_progress_set_adjustment)(GtkProgress *, GtkAdjustment *);
typedef void (*Ptr_gtk_range_set_inverted)(GtkRange*, bool);
typedef void (*Ptr_gtk_container_add)(GtkContainer *container, GtkWidget *widget);
typedef GtkIconSet* (*Ptr_gtk_icon_factory_lookup_default) (const gchar*);
+typedef GtkIconTheme* (*Ptr_gtk_icon_theme_get_default) (void);
typedef void (*Ptr_gtk_widget_style_get)(GtkWidget *, const gchar *first_property_name, ...);
typedef GtkTreeViewColumn* (*Ptr_gtk_tree_view_column_new)(void);
typedef GtkWidget* (*Ptr_gtk_fixed_new)(void);
@@ -195,6 +196,29 @@ typedef void (*Ptr_gdk_x11_window_set_user_time) (GdkWindow *window, guint32);
typedef XID (*Ptr_gdk_x11_drawable_get_xid) (GdkDrawable *);
typedef Display* (*Ptr_gdk_x11_drawable_get_xdisplay) ( GdkDrawable *);
+
+typedef enum {
+ GNOME_ICON_LOOKUP_FLAGS_NONE = 0,
+ GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1<<0,
+ GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1<<1,
+ GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1<<2
+} GnomeIconLookupFlags;
+
+typedef enum {
+ GNOME_ICON_LOOKUP_RESULT_FLAGS_NONE = 0,
+ GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL = 1<<0
+} GnomeIconLookupResultFlags;
+
+struct GnomeThumbnailFactory;
+typedef gboolean (*Ptr_gnome_vfs_init) (void);
+typedef char* (*Ptr_gnome_icon_lookup_sync) (
+ GtkIconTheme *icon_theme,
+ GnomeThumbnailFactory *,
+ const char *file_uri,
+ const char *custom_icon,
+ GnomeIconLookupFlags flags,
+ GnomeIconLookupResultFlags *result);
+
QT_BEGIN_NAMESPACE
class QGtk
@@ -219,6 +243,7 @@ public:
QString *selectedFilter, QFileDialog::Options options);
static QString getGConfString(const QString &key, const QString &fallback = QString());
static bool getGConfBool(const QString &key, bool fallback = 0);
+ static QIcon getFilesystemIcon(const QFileInfo &);
static Ptr_gtk_container_forall gtk_container_forall;
static Ptr_gtk_init gtk_init;
@@ -263,6 +288,7 @@ public:
static Ptr_gtk_range_set_adjustment gtk_range_set_adjustment;
static Ptr_gtk_range_set_inverted gtk_range_set_inverted;
static Ptr_gtk_icon_factory_lookup_default gtk_icon_factory_lookup_default;
+ static Ptr_gtk_icon_theme_get_default gtk_icon_theme_get_default;
static Ptr_gtk_widget_style_get gtk_widget_style_get;
static Ptr_gtk_icon_set_render_icon gtk_icon_set_render_icon;
static Ptr_gtk_fixed_new gtk_fixed_new;
@@ -333,6 +359,9 @@ public:
static Ptr_gconf_client_get_default gconf_client_get_default;
static Ptr_gconf_client_get_string gconf_client_get_string;
static Ptr_gconf_client_get_bool gconf_client_get_bool;
+
+ static Ptr_gnome_icon_lookup_sync gnome_icon_lookup_sync;
+ static Ptr_gnome_vfs_init gnome_vfs_init;
};
// Helper to ensure that we have polished all our gtk widgets
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 6def06e..db4c07c 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1223,11 +1223,13 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e)
cursor.deleteChar();
}
else if (e == QKeySequence::DeleteEndOfWord) {
- cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor);
+ if (!cursor.hasSelection())
+ cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
}
else if (e == QKeySequence::DeleteStartOfWord) {
- cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor);
+ if (!cursor.hasSelection())
+ cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
}
else if (e == QKeySequence::DeleteEndOfLine) {
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index facc8dc..bdab3f2 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -345,9 +345,9 @@ QList<QTextOption::Tab> QTextOption::tabs() const
This enum holds the different types of tabulator
- \value LeftTab, A left-tab
- \value RightTab, A right-tab
- \value CenterTab, A centered-tab
+ \value LeftTab A left-tab
+ \value RightTab A right-tab
+ \value CenterTab A centered-tab
\value DelimiterTab A tab stopping at a certain delimiter-character
*/
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 95ff4c1..b606538 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2443,7 +2443,10 @@ void QComboBox::showPopup()
}
container->setGeometry(listRect);
- bool updatesEnabled = container->updatesEnabled();
+#ifndef Q_WS_MAC
+ const bool updatesEnabled = container->updatesEnabled();
+#endif
+
#if defined(Q_WS_WIN) && !defined(QT_NO_EFFECTS)
bool scrollDown = (listRect.topLeft() == below);
if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 5ba0571..3d908a1 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -1000,8 +1000,10 @@ void QLabel::paintEvent(QPaintEvent *)
d->ensureTextLayouted();
QAbstractTextDocumentLayout::PaintContext context;
-
- if (!isEnabled() && style->styleHint(QStyle::SH_EtchDisabledText, &opt, this)) {
+ if (!isEnabled() && !d->control &&
+ // We cannot support etched for rich text controls because custom
+ // colors and links will override the light palette
+ style->styleHint(QStyle::SH_EtchDisabledText, &opt, this)) {
context.palette = opt.palette;
context.palette.setColor(QPalette::Text, context.palette.light().color());
painter.save();
diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h
index 3d41727..0346a55 100644
--- a/src/gui/widgets/qmenu.h
+++ b/src/gui/widgets/qmenu.h
@@ -52,19 +52,11 @@
#endif
QT_BEGIN_HEADER
-#ifdef Q_WS_S60
- class CEikMenuPane;
-#endif
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
-#ifdef Q_WS_S60
-void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
-void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
-#endif // Q_WS_S60
-
#ifndef QT_NO_MENU
class QMenuPrivate;
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index 2d5632e..9c4f260 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -63,11 +63,18 @@
#ifdef Q_WS_S60
class CEikMenuPane;
+#define QT_SYMBIAN_FIRST_MENU_ITEM 32000
+#define QT_SYMBIAN_LAST_MENU_ITEM 41999 // 10000 items ought to be enough for anybody...
#endif
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENU
+#ifdef Q_WS_S60
+void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
+void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
+#endif // Q_WS_S60
+
class QTornOffMenu;
class QEventLoop;
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index 6fc4371..c656ef8 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -66,8 +66,6 @@ QT_BEGIN_NAMESPACE
typedef QMultiHash<QWidget *, QMenuBarPrivate *> MenuBarHash;
Q_GLOBAL_STATIC(MenuBarHash, menubars)
-#define QT_FIRST_MENU_ITEM 32000
-
struct SymbianMenuItem
{
int id;
@@ -78,7 +76,7 @@ struct SymbianMenuItem
static QList<SymbianMenuItem*> symbianMenus;
static QList<QMenuBar*> nativeMenuBars;
-static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+static uint qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM;
static QPointer<QWidget> widgetWithContextMenu;
static QList<QAction*> contextMenuActionList;
static QAction contextAction(0);
@@ -145,6 +143,9 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
if (action->action->isSeparator())
return;
+ Q_ASSERT_X(action->command <= QT_SYMBIAN_LAST_MENU_ITEM, "qt_symbian_insert_action",
+ "Too many menu actions");
+
const int underlineShortCut = QApplication::style()->styleHint(QStyle::SH_UnderlineShortcut);
QString iconText = action->action->iconText();
TPtrC menuItemText = qt_QString2TPtrC( underlineShortCut ? action->action->text() : iconText);
@@ -213,7 +214,7 @@ static void rebuildMenu()
if (w) {
mb = menubars()->value(w);
- qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+ qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM;
deleteAll( &symbianMenus );
if (!mb)
return;
@@ -250,12 +251,12 @@ void QMenuBarPrivate::symbianCommands(int command)
int size = nativeMenuBars.size();
for (int i = 0; i < nativeMenuBars.size(); ++i) {
- SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
- if (!menu)
+ SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus);
+ if (!menu)
continue;
emit nativeMenuBars.at(i)->triggered(menu->action);
- menu->action->activate(QAction::Trigger);
+ menu->action->activate(QAction::Trigger);
break;
}
}
@@ -289,6 +290,7 @@ QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate
QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate()
{
+ qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM;
deleteAll( &symbianMenus );
symbianMenus.clear();
d = 0;
@@ -390,14 +392,14 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList<
void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild()
{
contexMenuCommand = 0;
- qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM;
+ qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM;
deleteAll( &symbianMenus );
if (d)
insertNativeMenuItems(d->actions);
contextMenuActionList.clear();
if (widgetWithContextMenu) {
- contexMenuCommand = qt_symbian_menu_static_cmd_id;
+ contexMenuCommand = qt_symbian_menu_static_cmd_id; // Increased inside insertNativeMenuItems
contextAction.setText(QMenuBar::tr("Actions"));
contextMenuActionList.append(&contextAction);
insertNativeMenuItems(contextMenuActionList);
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index d519bfe..2ed6cd7 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -519,6 +519,9 @@ QTextBlock QPlainTextEditControl::firstVisibleBlock() const
int QPlainTextEditControl::hitTest(const QPointF &point, Qt::HitTestAccuracy ) const {
int currentBlockNumber = topBlock;
QTextBlock currentBlock = document()->findBlockByNumber(currentBlockNumber);
+ if (!currentBlock.isValid())
+ return -1;
+
QPlainTextDocumentLayout *documentLayout = qobject_cast<QPlainTextDocumentLayout*>(document()->documentLayout());
Q_ASSERT(documentLayout);
@@ -1578,7 +1581,35 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
}
#endif
- if (!(d->control->textInteractionFlags() & Qt::TextEditable)) {
+#ifndef QT_NO_SHORTCUT
+
+ Qt::TextInteractionFlags tif = d->control->textInteractionFlags();
+
+ if (tif & Qt::TextSelectableByKeyboard){
+ if (e == QKeySequence::SelectPreviousPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Up, QTextCursor::KeepAnchor);
+ return;
+ } else if (e ==QKeySequence::SelectNextPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Down, QTextCursor::KeepAnchor);
+ return;
+ }
+ }
+ if (tif & (Qt::TextSelectableByKeyboard | Qt::TextEditable)) {
+ if (e == QKeySequence::MoveToPreviousPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Up, QTextCursor::MoveAnchor);
+ return;
+ } else if (e == QKeySequence::MoveToNextPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Down, QTextCursor::MoveAnchor);
+ return;
+ }
+ }
+#endif // QT_NO_SHORTCUT
+
+ if (!(tif & Qt::TextEditable)) {
switch (e->key()) {
case Qt::Key_Space:
e->accept();
@@ -1605,27 +1636,6 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
return;
}
-#ifndef QT_NO_SHORTCUT
- if (e == QKeySequence::MoveToPreviousPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Up, QTextCursor::MoveAnchor);
- return;
- } else if (e == QKeySequence::MoveToNextPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Down, QTextCursor::MoveAnchor);
- return;
- } else if (e == QKeySequence::SelectPreviousPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Up, QTextCursor::KeepAnchor);
- return;
- } else if (e ==QKeySequence::SelectNextPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Down, QTextCursor::KeepAnchor);
- return;
- }
-#endif // QT_NO_SHORTCUT
-
-
d->sendControlEvent(e);
#ifdef QT_KEYPAD_NAVIGATION
if (!e->isAccepted()) {
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index dc78fd5..b894aa8 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -1220,8 +1220,35 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
break;
}
#endif
+#ifndef QT_NO_SHORTCUT
- if (!(d->control->textInteractionFlags() & Qt::TextEditable)) {
+ Qt::TextInteractionFlags tif = d->control->textInteractionFlags();
+
+ if (tif & Qt::TextSelectableByKeyboard){
+ if (e == QKeySequence::SelectPreviousPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Up, QTextCursor::KeepAnchor);
+ return;
+ } else if (e ==QKeySequence::SelectNextPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Down, QTextCursor::KeepAnchor);
+ return;
+ }
+ }
+ if (tif & (Qt::TextSelectableByKeyboard | Qt::TextEditable)) {
+ if (e == QKeySequence::MoveToPreviousPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Up, QTextCursor::MoveAnchor);
+ return;
+ } else if (e == QKeySequence::MoveToNextPage) {
+ e->accept();
+ d->pageUpDown(QTextCursor::Down, QTextCursor::MoveAnchor);
+ return;
+ }
+ }
+#endif // QT_NO_SHORTCUT
+
+ if (!(tif & Qt::TextEditable)) {
switch (e->key()) {
case Qt::Key_Space:
e->accept();
@@ -1248,26 +1275,6 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
return;
}
-#ifndef QT_NO_SHORTCUT
- if (e == QKeySequence::MoveToPreviousPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Up, QTextCursor::MoveAnchor);
- return;
- } else if (e == QKeySequence::MoveToNextPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Down, QTextCursor::MoveAnchor);
- return;
- } else if (e == QKeySequence::SelectPreviousPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Up, QTextCursor::KeepAnchor);
- return;
- } else if (e ==QKeySequence::SelectNextPage) {
- e->accept();
- d->pageUpDown(QTextCursor::Down, QTextCursor::KeepAnchor);
- return;
- }
-#endif // QT_NO_SHORTCUT
-
{
QTextCursor cursor = d->control->textCursor();
const QString text = e->text();
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index dc24875..55020a6 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -360,33 +360,30 @@ void QAudioDeviceInfoInternal::updateLists()
QList<QByteArray> QAudioDeviceInfoInternal::deviceList(QAudio::Mode mode)
{
- QAudio::Mode _m;
QList<QByteArray> devices;
QByteArray filter;
- QString dir;
// Create a list of all current audio devices that support mode
void **hints, **n;
char *name, *descr, *io;
if(snd_device_name_hint(-1, "pcm", &hints) < 0) {
- qWarning()<<"no alsa devices available";
+ qWarning() << "no alsa devices available";
return devices;
}
n = hints;
+ if(mode == QAudio::AudioInput) {
+ filter = "Input";
+ } else {
+ filter = "Output";
+ }
+
while (*n != NULL) {
- _m = QAudio::AudioOutput;
name = snd_device_name_get_hint(*n, "NAME");
descr = snd_device_name_get_hint(*n, "DESC");
io = snd_device_name_get_hint(*n, "IOID");
- dir = QString::fromUtf8(io);
- if((name != NULL) && (descr != NULL) && ((io == NULL) || (dir.length() ==filter.length()))) {
- if(dir.length() == 5)
- _m = QAudio::AudioInput;
- if(io == NULL)
- _m = mode;
-
+ if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) {
QString str = QLatin1String(name);
if(str.contains(QLatin1String("default"))) {
@@ -400,17 +397,12 @@ QList<QByteArray> QAudioDeviceInfoInternal::deviceList(QAudio::Mode mode)
free(descr);
if(io != NULL)
free(io);
- n++;
+ ++n;
}
snd_device_name_free_hint(hints);
if(devices.size() > 0) {
devices.append("default");
- if(mode == QAudio::AudioInput) {
- filter.append("Input");
- } else {
- filter.append("Output");
- }
}
return devices;
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 7ca1659..439d564 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -981,6 +981,10 @@ void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)
manager->d_func()->objectCache.clear();
}
+QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
+{
+}
+
QT_END_NAMESPACE
#include "moc_qnetworkaccessmanager.cpp"
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 96a49cc..3bd83c4 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -76,6 +76,7 @@ public:
#endif
cookieJarCreated(false)
{ }
+ ~QNetworkAccessManagerPrivate();
void _q_replyFinished();
void _q_replySslErrors(const QList<QSslError> &errors);
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 675e88a..86ccef2 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1576,7 +1576,7 @@ bool QAbstractSocket::setSocketDescriptor(int socketDescriptor, SocketState sock
\sa socketOption()
\since 4.6
*/
-void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, QVariant value)
+void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)
{
if (!d_func()->socketEngine)
return;
diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h
index 4a7763f..5d94a01 100644
--- a/src/network/socket/qabstractsocket.h
+++ b/src/network/socket/qabstractsocket.h
@@ -154,8 +154,8 @@ public:
OpenMode openMode = ReadWrite);
// ### Qt 5: Make virtual?
- void setSocketOption(QAbstractSocket::SocketOption o, QVariant v);
- QVariant socketOption(QAbstractSocket::SocketOption o);
+ void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value);
+ QVariant socketOption(QAbstractSocket::SocketOption option);
SocketType socketType() const;
SocketState state() const;
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 821d7c6..4bd6ff3 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -395,11 +395,7 @@ QMultiMap<QSsl::AlternateNameEntryType, QString> QSslCertificate::alternateSubje
else if (genName->type == GEN_EMAIL)
result.insert(QSsl::EmailEntry, altName);
}
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
q_sk_pop_free((STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_sk_free));
-#else
- q_sk_pop_free((STACK*)altNames, q_sk_free);
-#endif
}
return result;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 0762752..12f41bd 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -144,13 +144,12 @@ DEFINEFUNC2(void, RAND_seed, const void *a, a, int b, b, return, DUMMYARG)
DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
+DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
-DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
#else
DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
-DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(STACK*), b, return, DUMMYARG)
DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
#endif
DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 8d71caa..ae6618f 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -256,13 +256,12 @@ void q_RAND_seed(const void *a, int b);
int q_RAND_status();
void q_RSA_free(RSA *a);
int q_sk_num(STACK *a);
+void q_sk_pop_free(STACK *a, void (*b)(void *));
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
void q_sk_free(_STACK *a);
-void q_sk_pop_free(STACK *a, void (*b)(void *));
void * q_sk_value(STACK *a, int b);
#else
void q_sk_free(STACK *a);
-void q_sk_pop_free(STACK *a, void (*b)(STACK *));
char * q_sk_value(STACK *a, int b);
#endif
int q_SSL_accept(SSL *a);
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 59c50aa..e22303d 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -60,12 +60,8 @@ QGLEngineSharedShaders *QGLEngineSharedShaders::shadersForContext(const QGLConte
{
QGLEngineSharedShaders *p = reinterpret_cast<QGLEngineSharedShaders *>(qt_shared_shaders()->value(context));
if (!p) {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != context)
- const_cast<QGLContext *>(context)->makeCurrent();
+ QGLShareContextScope scope(context);
qt_shared_shaders()->insert(context, p = new QGLEngineSharedShaders(context));
- if (oldContext && oldContext != context)
- oldContext->makeCurrent();
}
return p;
}
diff --git a/src/opengl/gl2paintengineex/qglgradientcache.cpp b/src/opengl/gl2paintengineex/qglgradientcache.cpp
index 4b2b2a0..e06f15d 100644
--- a/src/opengl/gl2paintengineex/qglgradientcache.cpp
+++ b/src/opengl/gl2paintengineex/qglgradientcache.cpp
@@ -57,13 +57,9 @@ QGL2GradientCache *QGL2GradientCache::cacheForContext(const QGLContext *context)
{
QGL2GradientCache *p = reinterpret_cast<QGL2GradientCache *>(qt_gradient_caches()->value(context));
if (!p) {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != context)
- const_cast<QGLContext *>(context)->makeCurrent();
+ QGLShareContextScope scope(context);
p = new QGL2GradientCache;
qt_gradient_caches()->insert(context, p);
- if (oldContext && oldContext != context)
- oldContext->makeCurrent();
}
return p;
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 992d47d..7cd5aa4 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -162,15 +162,11 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(QGLContext *context, QFontEngineGlyph
QGLTextureGlyphCache::~QGLTextureGlyphCache()
{
if (ctx) {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != ctx)
- ctx->makeCurrent();
+ QGLShareContextScope scope(ctx);
glDeleteFramebuffers(1, &m_fbo);
if (m_width || m_height)
glDeleteTextures(1, &m_texture);
- if (oldContext && oldContext != ctx)
- oldContext->makeCurrent();
}
}
@@ -766,6 +762,8 @@ void QGL2PaintEngineEx::beginNativePainting()
d->dirtyStencilRegion = QRect(0, 0, d->width, d->height);
d->resetGLState();
+ d->shaderManager->setDirty();
+
d->needsSync = true;
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 4f42082..12123f3 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -278,6 +278,8 @@ public:
QScopedPointer<QPixmapFilter> colorizeFilter;
QScopedPointer<QPixmapFilter> blurFilter;
QScopedPointer<QPixmapFilter> fastBlurFilter;
+ QScopedPointer<QPixmapFilter> dropShadowFilter;
+ QScopedPointer<QPixmapFilter> fastDropShadowFilter;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 2327d7a..3f96d1c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1393,11 +1393,39 @@ bool operator!=(const QGLFormat& a, const QGLFormat& b)
/*****************************************************************************
QGLContext implementation
*****************************************************************************/
-QGLContextPrivate::~QGLContextPrivate()
+
+QGLContextGroup::~QGLContextGroup()
+{
+ // Clear any remaining QGLSharedResourceGuard objects on the group.
+ QGLSharedResourceGuard *guard = m_guards;
+ while (guard != 0) {
+ guard->m_group = 0;
+ guard->m_id = 0;
+ guard = guard->m_next;
+ }
+}
+
+void QGLContextGroup::addGuard(QGLSharedResourceGuard *guard)
+{
+ if (m_guards)
+ m_guards->m_prev = guard;
+ guard->m_next = m_guards;
+ guard->m_prev = 0;
+ m_guards = guard;
+}
+
+void QGLContextGroup::removeGuard(QGLSharedResourceGuard *guard)
{
- if (!reference->deref())
- delete reference;
+ if (guard->m_next)
+ guard->m_next->m_prev = guard->m_prev;
+ if (guard->m_prev)
+ guard->m_prev->m_next = guard->m_next;
+ else
+ m_guards = guard->m_next;
+}
+QGLContextPrivate::~QGLContextPrivate()
+{
if (!group->m_refs.deref()) {
Q_ASSERT(group->context() == q_ptr);
delete group;
@@ -1626,8 +1654,10 @@ void QGLTextureCache::pixmapCleanupHook(QPixmap* pixmap)
}
#if defined(Q_WS_X11)
QPixmapData *pd = pixmap->data_ptr().data();
- Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken
- QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
+ if (pd->classId() == QPixmapData::X11Class) {
+ Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken
+ QGLContextPrivate::destroyGlSurfaceForPixmap(pd);
+ }
#endif
}
@@ -1806,6 +1836,8 @@ QGLContext::~QGLContext()
QGLTextureCache::instance()->removeContextTextures(this);
QGLTextureCache::deleteIfEmpty(); // ### thread safety
+ d_ptr->group->cleanupResources(this);
+
QGLSignalProxy::instance()->emitAboutToDestroyContext(this);
reset();
}
@@ -3751,6 +3783,11 @@ bool QGLWidget::event(QEvent *e)
glFinish();
doneCurrent();
} else if (e->type() == QEvent::ParentChange) {
+ // if we've reparented a window that has the current context
+ // bound, we need to rebind that context to the new window id
+ if (d->glcx == QGLContext::currentContext())
+ makeCurrent();
+
if (d->glcx->d_func()->screen != d->xinfo.screen() || testAttribute(Qt::WA_TranslucentBackground)) {
setContext(new QGLContext(d->glcx->requestedFormat(), this));
// ### recreating the overlay isn't supported atm
@@ -4908,16 +4945,15 @@ void QGLShareRegister::removeShare(const QGLContext *context) {
group->m_shares.clear();
}
-QGLContextResource::QGLContextResource(FreeFunc f, QObject *parent)
- : QObject(parent), free(f)
+QGLContextResource::QGLContextResource(FreeFunc f)
+ : free(f), active(0)
{
- connect(QGLSignalProxy::instance(), SIGNAL(aboutToDestroyContext(const QGLContext *)), this, SLOT(removeOne(const QGLContext *)));
}
QGLContextResource::~QGLContextResource()
{
#ifndef QT_NO_DEBUG
- if (m_resources.size()) {
+ if (active != 0) {
qWarning("QtOpenGL: Resources are still available at program shutdown.\n"
" This is possibly caused by a leaked QGLWidget, \n"
" QGLFramebufferObject or QGLPixelBuffer.");
@@ -4927,121 +4963,53 @@ QGLContextResource::~QGLContextResource()
void QGLContextResource::insert(const QGLContext *key, void *value)
{
- QList<const QGLContext *> shares = qgl_share_reg()->shares(key);
- if (shares.size() == 0)
- shares.append(key);
- void *oldValue = 0;
- for (int i = 0; i < shares.size(); ++i) {
- ResourceHash::iterator it = m_resources.find(shares.at(i));
- if (it != m_resources.end()) {
- Q_ASSERT(oldValue == 0 || oldValue == it.value());
- oldValue = it.value();
- it.value() = value;
- } else {
- m_resources.insert(shares.at(i), value);
- }
- }
- if (oldValue != 0 && oldValue != value) {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != key)
- const_cast<QGLContext *>(key)->makeCurrent();
- free(oldValue);
- if (oldContext && oldContext != key)
- oldContext->makeCurrent();
- }
+ QGLContextGroup *group = QGLContextPrivate::contextGroup(key);
+ Q_ASSERT(!group->m_resources.contains(this));
+ group->m_resources.insert(this, value);
+ active.ref();
}
void *QGLContextResource::value(const QGLContext *key)
{
- ResourceHash::const_iterator it = m_resources.find(key);
- // Check if there is a value associated with 'key'.
- if (it != m_resources.end())
- return it.value();
- // Check if there is a value associated with sharing contexts.
- QList<const QGLContext *> shares = qgl_share_reg()->shares(key);
- for (int i = 0; i < shares.size() && it == m_resources.end(); ++i)
- it = m_resources.find(shares.at(i));
- if (it == m_resources.end())
- return 0; // Didn't find anything.
-
- // Found something! Share this info with all the buddies.
- for (int i = 0; i < shares.size(); ++i)
- m_resources.insert(shares.at(i), it.value());
- return it.value();
-}
-
-void QGLContextResource::removeGroup(const QGLContext *key)
-{
- QList<const QGLContext *> shares = qgl_share_reg()->shares(key);
- if (shares.size() == 0)
- shares.append(key);
- void *oldValue = 0;
- for (int i = 0; i < shares.size(); ++i) {
- ResourceHash::iterator it = m_resources.find(shares.at(i));
- if (it != m_resources.end()) {
- Q_ASSERT(oldValue == 0 || oldValue == it.value());
- oldValue = it.value();
- m_resources.erase(it);
- }
- }
- if (oldValue != 0) {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != key)
- const_cast<QGLContext *>(key)->makeCurrent();
- free(oldValue);
- if (oldContext && oldContext != key)
- oldContext->makeCurrent();
- }
+ QGLContextGroup *group = QGLContextPrivate::contextGroup(key);
+ return group->m_resources.value(this, 0);
}
-void QGLContextResource::removeOne(const QGLContext *key)
+void QGLContextResource::cleanup(const QGLContext *ctx, void *value)
{
- ResourceHash::iterator it = m_resources.find(key);
- if (it == m_resources.end())
+ QGLShareContextScope scope(ctx);
+ free(value);
+ active.deref();
+}
+
+void QGLContextGroup::cleanupResources(const QGLContext *ctx)
+{
+ // If there are still shares, then no cleanup to be done yet.
+ if (m_shares.size() > 1)
return;
- QList<const QGLContext *> shares = qgl_share_reg()->shares(key);
- if (shares.size() > 1) {
- Q_ASSERT(key->isSharing());
- // At least one of the shared contexts must stay in the cache.
- // Otherwise, the value pointer is lost.
- for (int i = 0; i < 2/*shares.size()*/; ++i)
- m_resources.insert(shares.at(i), it.value());
- } else {
- QGLContext *oldContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (oldContext != key)
- const_cast<QGLContext *>(key)->makeCurrent();
- free(it.value());
- if (oldContext && oldContext != key)
- oldContext->makeCurrent();
- }
- m_resources.erase(it);
+ // Iterate over all resources and free each in turn.
+ QHash<QGLContextResource *, void *>::ConstIterator it;
+ for (it = m_resources.begin(); it != m_resources.end(); ++it)
+ it.key()->cleanup(ctx, it.value());
}
-QGLContextReference::QGLContextReference(const QGLContext *ctx)
- : m_ref(1), m_ctx(ctx)
+QGLSharedResourceGuard::~QGLSharedResourceGuard()
{
- connect(QGLSignalProxy::instance(),
- SIGNAL(aboutToDestroyContext(const QGLContext *)),
- this, SLOT(aboutToDestroyContext(const QGLContext *)));
+ if (m_group)
+ m_group->removeGuard(this);
}
-void QGLContextReference::aboutToDestroyContext(const QGLContext *ctx)
+void QGLSharedResourceGuard::setContext(const QGLContext *context)
{
- // Bail out if our context is not being destroyed.
- if (ctx != m_ctx || !m_ctx)
- return;
-
- // Find some other context that this one is shared with to take over.
- QList<const QGLContext *> shares = qgl_share_reg()->shares(m_ctx);
- shares.removeAll(m_ctx);
- if (!shares.isEmpty()) {
- m_ctx = shares[0];
- return;
+ if (m_group)
+ m_group->removeGuard(this);
+ if (context) {
+ m_group = QGLContextPrivate::contextGroup(context);
+ m_group->addGuard(this);
+ } else {
+ m_group = 0;
}
-
- // No more contexts sharing with this one, so the reference is now invalid.
- m_ctx = 0;
}
QT_END_NAMESPACE
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 1957429..8d4f673 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -219,6 +219,9 @@ public:
#endif
};
+class QGLContextResource;
+class QGLSharedResourceGuard;
+
// QGLContextPrivate has the responsibility of creating context groups.
// QGLContextPrivate and QGLShareRegister will both maintain the reference counter and destroy
// context groups when needed.
@@ -226,42 +229,29 @@ public:
class QGLContextGroup
{
public:
+ ~QGLContextGroup();
+
QGLExtensionFuncs &extensionFuncs() {return m_extensionFuncs;}
const QGLContext *context() const {return m_context;}
+
+ void addGuard(QGLSharedResourceGuard *guard);
+ void removeGuard(QGLSharedResourceGuard *guard);
private:
- QGLContextGroup(const QGLContext *context) : m_context(context), m_refs(1) { }
+ QGLContextGroup(const QGLContext *context) : m_context(context), m_guards(0), m_refs(1) { }
QGLExtensionFuncs m_extensionFuncs;
const QGLContext *m_context; // context group's representative
QList<const QGLContext *> m_shares;
+ QHash<QGLContextResource *, void *> m_resources;
+ QGLSharedResourceGuard *m_guards; // double-linked list of active guards.
QAtomicInt m_refs;
+ void cleanupResources(const QGLContext *ctx);
+
friend class QGLShareRegister;
+ friend class QGLContext;
friend class QGLContextPrivate;
-};
-
-// Reference to a QGLContext which automatically switches to another
-// shared context when the main one is destroyed. If there is no
-// shared context to switch to, the context pointer is set to null.
-// Note: should be merged into QGLContextGroup at some point.
-class QGLContextReference : public QObject
-{
- Q_OBJECT
-public:
- QGLContextReference(const QGLContext *ctx);
- ~QGLContextReference() {}
-
- const QGLContext *context() const { return m_ctx; }
-
- void ref() { m_ref.ref(); }
- bool deref() { return m_ref.deref(); }
-
-private slots:
- void aboutToDestroyContext(const QGLContext *ctx);
-
-private:
- QAtomicInt m_ref;
- const QGLContext *m_ctx;
+ friend class QGLContextResource;
};
class QGLTexture;
@@ -270,7 +260,7 @@ class QGLContextPrivate
{
Q_DECLARE_PUBLIC(QGLContext)
public:
- explicit QGLContextPrivate(QGLContext *context) : internal_context(false), q_ptr(context) {reference = new QGLContextReference(context); group = new QGLContextGroup(context);}
+ explicit QGLContextPrivate(QGLContext *context) : internal_context(false), q_ptr(context) {group = new QGLContextGroup(context);}
~QGLContextPrivate();
QGLTexture *bindTexture(const QImage &image, GLenum target, GLint format,
QGLContext::BindOptions options);
@@ -333,7 +323,6 @@ public:
QGLContext *q_ptr;
QGLFormat::OpenGLVersionFlags version_flags;
- QGLContextReference *reference;
QGLContextGroup *group;
GLint max_texture_size;
@@ -411,6 +400,46 @@ public:
extern Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg();
+// Temporarily make a context current if not already current or
+// shared with the current contex. The previous context is made
+// current when the object goes out of scope.
+class Q_OPENGL_EXPORT QGLShareContextScope
+{
+public:
+ QGLShareContextScope(const QGLContext *ctx)
+ : m_oldContext(0)
+ {
+ QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
+ if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) {
+ m_oldContext = currentContext;
+ m_ctx = const_cast<QGLContext *>(ctx);
+ m_ctx->makeCurrent();
+ } else {
+ m_ctx = currentContext;
+ }
+ }
+
+ operator QGLContext *()
+ {
+ return m_ctx;
+ }
+
+ QGLContext *operator->()
+ {
+ return m_ctx;
+ }
+
+ ~QGLShareContextScope()
+ {
+ if (m_oldContext)
+ m_oldContext->makeCurrent();
+ }
+
+private:
+ QGLContext *m_oldContext;
+ QGLContext *m_ctx;
+};
+
class QGLTexture {
public:
QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
@@ -426,12 +455,8 @@ public:
~QGLTexture() {
if (options & QGLContext::MemoryManagedBindOption) {
- QGLContext *current = const_cast<QGLContext *>(QGLContext::currentContext());
- QGLContext *ctx = const_cast<QGLContext *>(context);
- Q_ASSERT(ctx);
- bool switch_context = current != ctx && !QGLContext::areSharing(current, ctx);
- if (switch_context)
- ctx->makeCurrent();
+ Q_ASSERT(context);
+ QGLShareContextScope scope(context);
#if defined(Q_WS_X11)
// Although glXReleaseTexImage is a glX call, it must be called while there
// is a current context - the context the pixmap was bound to a texture in.
@@ -441,8 +466,6 @@ public:
QGLContextPrivate::unbindPixmapFromTexture(boundPixmap);
#endif
glDeleteTextures(1, &id);
- if (switch_context && current)
- current->makeCurrent();
}
}
@@ -506,66 +529,21 @@ inline GLenum qt_gl_preferredTextureTarget()
}
// One resource per group of shared contexts.
-class QGLContextResource : public QObject
+class Q_AUTOTEST_EXPORT QGLContextResource
{
- Q_OBJECT
public:
typedef void (*FreeFunc)(void *);
- QGLContextResource(FreeFunc f, QObject *parent = 0);
+ QGLContextResource(FreeFunc f);
~QGLContextResource();
// Set resource 'value' for 'key' and all its shared contexts.
void insert(const QGLContext *key, void *value);
// Return resource for 'key' or a shared context.
void *value(const QGLContext *key);
- // Free resource for 'key' and all its shared contexts.
- void removeGroup(const QGLContext *key);
-private slots:
- // Remove entry 'key' from cache and delete resource if there are no shared contexts.
- void removeOne(const QGLContext *key);
+ // Cleanup 'value' in response to a context group being destroyed.
+ void cleanup(const QGLContext *ctx, void *value);
private:
- typedef QHash<const QGLContext *, void *> ResourceHash;
- ResourceHash m_resources;
FreeFunc free;
-};
-
-// Temporarily make a context current if not already current or
-// shared with the current contex. The previous context is made
-// current when the object goes out of scope.
-class Q_OPENGL_EXPORT QGLShareContextScope
-{
-public:
- QGLShareContextScope(const QGLContext *ctx)
- : m_oldContext(0)
- {
- QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
- if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) {
- m_oldContext = currentContext;
- m_ctx = const_cast<QGLContext *>(ctx);
- m_ctx->makeCurrent();
- } else {
- m_ctx = currentContext;
- }
- }
-
- operator QGLContext *()
- {
- return m_ctx;
- }
-
- QGLContext *operator->()
- {
- return m_ctx;
- }
-
- ~QGLShareContextScope()
- {
- if (m_oldContext)
- m_oldContext->makeCurrent();
- }
-
-private:
- QGLContext *m_oldContext;
- QGLContext *m_ctx;
+ QAtomicInt active;
};
// Put a guard around a GL object identifier and its context.
@@ -577,44 +555,27 @@ class Q_OPENGL_EXPORT QGLSharedResourceGuard
{
public:
QGLSharedResourceGuard(const QGLContext *context)
- : m_ctxref(0), m_id(0)
+ : m_group(0), m_id(0), m_next(0), m_prev(0)
{
setContext(context);
}
QGLSharedResourceGuard(const QGLContext *context, GLuint id)
- : m_ctxref(0), m_id(id)
+ : m_group(0), m_id(id), m_next(0), m_prev(0)
{
setContext(context);
}
- ~QGLSharedResourceGuard()
- {
- if (m_ctxref && !m_ctxref->deref())
- delete m_ctxref;
- }
+ ~QGLSharedResourceGuard();
const QGLContext *context() const
{
- return m_ctxref ? m_ctxref->context() : 0;
+ return m_group ? m_group->context() : 0;
}
- void setContext(const QGLContext *context)
- {
- if (m_ctxref && !m_ctxref->deref())
- delete m_ctxref;
- if (context) {
- m_ctxref = context->d_ptr->reference;
- m_ctxref->ref();
- } else {
- m_ctxref = 0;
- }
- }
+ void setContext(const QGLContext *context);
GLuint id() const
{
- if (m_ctxref && m_ctxref->context())
- return m_id;
- else
- return 0;
+ return m_id;
}
void setId(GLuint id)
@@ -623,8 +584,12 @@ public:
}
private:
- QGLContextReference *m_ctxref;
+ QGLContextGroup *m_group;
GLuint m_id;
+ QGLSharedResourceGuard *m_next;
+ QGLSharedResourceGuard *m_prev;
+
+ friend class QGLContextGroup;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 1ae3866..0603369 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -104,11 +104,12 @@ public:
void setUniforms(QGLShaderProgram *program);
+ static QByteArray generateGaussianShader(int radius, bool dropShadow = false);
+
protected:
bool processGL(QPainter *painter, const QPointF &pos, const QPixmap &src, const QRectF &srcRect) const;
private:
- static QByteArray generateGaussianShader(int radius);
mutable QSize m_textureSize;
mutable bool m_horizontalBlur;
@@ -118,6 +119,25 @@ private:
mutable Qt::RenderHint m_hint;
};
+class QGLPixmapDropShadowFilter : public QGLCustomShaderStage, public QGLPixmapFilter<QPixmapDropShadowFilter>
+{
+public:
+ QGLPixmapDropShadowFilter(Qt::RenderHint hint);
+
+ void setUniforms(QGLShaderProgram *program);
+
+protected:
+ bool processGL(QPainter *painter, const QPointF &pos, const QPixmap &src, const QRectF &srcRect) const;
+
+private:
+ mutable QSize m_textureSize;
+ mutable bool m_horizontalBlur;
+
+ mutable bool m_haveCached;
+ mutable int m_cachedRadius;
+ mutable Qt::RenderHint m_hint;
+};
+
extern QGLWidget *qt_gl_share_widget();
QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *prototype)
@@ -141,6 +161,18 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr
return d->blurFilter.data();
}
+ case QPixmapFilter::DropShadowFilter: {
+ const QPixmapDropShadowFilter *proto = static_cast<const QPixmapDropShadowFilter *>(prototype);
+ if (proto->blurRadius() <= 5) {
+ if (!d->fastDropShadowFilter)
+ d->fastDropShadowFilter.reset(new QGLPixmapDropShadowFilter(Qt::PerformanceHint));
+ return d->fastDropShadowFilter.data();
+ }
+ if (!d->dropShadowFilter)
+ d->dropShadowFilter.reset(new QGLPixmapDropShadowFilter(Qt::QualityHint));
+ return d->dropShadowFilter.data();
+ }
+
case QPixmapFilter::ConvolutionFilter:
if (!d->convolutionFilter)
d->convolutionFilter.reset(new QGLPixmapConvolutionFilter);
@@ -279,6 +311,20 @@ static const char *qt_gl_blur_filter_fast =
" return color * (1.0 / float(samples));"
"}";
+static const char *qt_gl_drop_shadow_filter_fast =
+ "const int samples = 9;"
+ "uniform mediump vec2 delta;"
+ "uniform mediump vec4 shadowColor;"
+ "lowp vec4 customShader(lowp sampler2D src, highp vec2 srcCoords) {"
+ " mediump vec4 color = vec4(0.0, 0.0, 0.0, 0.0);"
+ " mediump float offset = (float(samples) - 1.0) / 2.0;"
+ " for (int i = 0; i < samples; i++) {"
+ " mediump vec2 coord = srcCoords + delta * (offset - float(i)) / offset;"
+ " color += texture2D(src, coord).a * shadowColor;"
+ " }"
+ " return color * (1.0 / float(samples));"
+ "}";
+
QGLPixmapBlurFilter::QGLPixmapBlurFilter(Qt::RenderHint hint)
: m_haveCached(false)
, m_cachedRadius(5)
@@ -380,7 +426,7 @@ static inline qreal gaussian(qreal dx, qreal sigma)
return exp(-dx * dx / (2 * sigma * sigma)) / (Q_2PI * sigma * sigma);
}
-QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius)
+QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius, bool dropShadow)
{
Q_ASSERT(radius >= 1);
@@ -388,6 +434,8 @@ QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius)
source.reserve(1000);
source.append("uniform highp vec2 delta;\n");
+ if (dropShadow)
+ source.append("uniform mediump vec4 shadowColor;\n");
source.append("lowp vec4 customShader(lowp sampler2D src, highp vec2 srcCoords) {\n");
QVector<qreal> sampleOffsets;
@@ -444,7 +492,10 @@ QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius)
source.append(coordinate);
source.append(";\n");
- source.append(" sample += texture2D(src, coord)");
+ if (dropShadow)
+ source.append(" sample += texture2D(src, coord).a * shadowColor");
+ else
+ source.append(" sample += texture2D(src, coord)");
weightSum += weights.at(i);
if (weights.at(i) != qreal(1)) {
@@ -463,4 +514,114 @@ QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius)
return source;
}
+QGLPixmapDropShadowFilter::QGLPixmapDropShadowFilter(Qt::RenderHint hint)
+ : m_haveCached(false)
+ , m_cachedRadius(5)
+ , m_hint(hint)
+{
+ if (hint == Qt::PerformanceHint) {
+ QGLPixmapDropShadowFilter *filter = const_cast<QGLPixmapDropShadowFilter *>(this);
+ filter->setSource(qt_gl_drop_shadow_filter_fast);
+ m_haveCached = true;
+ }
+}
+
+bool QGLPixmapDropShadowFilter::processGL(QPainter *painter, const QPointF &pos, const QPixmap &src, const QRectF &srcRect) const
+{
+ QGLPixmapDropShadowFilter *filter = const_cast<QGLPixmapDropShadowFilter *>(this);
+
+ int radius = this->blurRadius();
+ if (!m_haveCached || (m_hint == Qt::QualityHint && radius != m_cachedRadius)) {
+ // Only regenerate the shader from source if parameters have changed.
+ m_haveCached = true;
+ m_cachedRadius = radius;
+ filter->setSource(QGLPixmapBlurFilter::generateGaussianShader(radius, true));
+ }
+
+ QGLFramebufferObjectFormat format;
+ format.setInternalTextureFormat(GLenum(src.hasAlphaChannel() ? GL_RGBA : GL_RGB));
+ QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(src.size(), format);
+
+ if (!fbo)
+ return false;
+
+ glBindTexture(GL_TEXTURE_2D, fbo->texture());
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glBindTexture(GL_TEXTURE_2D, 0);
+
+ // prepare for updateUniforms
+ m_textureSize = src.size();
+
+ // horizontal pass, to pixmap
+ m_horizontalBlur = true;
+
+ QPainter fboPainter(fbo);
+
+ if (src.hasAlphaChannel()) {
+ glClearColor(0, 0, 0, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+
+ // ensure GL_LINEAR filtering is used
+ fboPainter.setRenderHint(QPainter::SmoothPixmapTransform);
+ filter->setOnPainter(&fboPainter);
+ fboPainter.drawPixmap(0, 0, src);
+ filter->removeFromPainter(&fboPainter);
+ fboPainter.end();
+
+ QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(painter->paintEngine());
+
+ // vertical pass, to painter
+ m_horizontalBlur = false;
+
+ painter->save();
+ // ensure GL_LINEAR filtering is used
+ painter->setRenderHint(QPainter::SmoothPixmapTransform);
+ filter->setOnPainter(painter);
+ QPointF ofs = offset();
+ engine->drawTexture(src.rect().translated(pos.x() + ofs.x(), pos.y() + ofs.y()), fbo->texture(), fbo->size(), src.rect().translated(0, fbo->height() - src.height()));
+ filter->removeFromPainter(painter);
+ painter->restore();
+
+ qgl_fbo_pool()->release(fbo);
+
+ // Now draw the actual pixmap over the top.
+ painter->drawPixmap(pos, src, srcRect);
+
+ return true;
+}
+
+void QGLPixmapDropShadowFilter::setUniforms(QGLShaderProgram *program)
+{
+ QColor col = color();
+ if (m_horizontalBlur) {
+ program->setUniformValue("shadowColor", 1.0f, 1.0f, 1.0f, 1.0f);
+ } else {
+ qreal alpha = col.alphaF();
+ program->setUniformValue("shadowColor", col.redF() * alpha,
+ col.greenF() * alpha,
+ col.blueF() * alpha,
+ alpha);
+ }
+ if (m_hint == Qt::QualityHint) {
+ if (m_horizontalBlur)
+ program->setUniformValue("delta", 1.0 / m_textureSize.width(), 0.0);
+ else
+ program->setUniformValue("delta", 0.0, 1.0 / m_textureSize.height());
+ } else {
+ // 1.4 is chosen to most closely match the blurriness of the gaussian blur
+ // at low radii
+ qreal blur = blurRadius() / 1.4f;
+
+ if (m_horizontalBlur)
+ program->setUniformValue("delta", blur / m_textureSize.width(), 0.0);
+ else
+ program->setUniformValue("delta", 0.0, blur / m_textureSize.height());
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index da490c0..3e4a8e7 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -2311,7 +2311,7 @@ void QOpenGLPaintEnginePrivate::updateDepthClip()
void QOpenGLPaintEnginePrivate::systemStateChanged()
{
Q_Q(QOpenGLPaintEngine);
- if (q->state()->hasClipping)
+ if (q->painter()->hasClipping())
q->updateClipRegion(q->painter()->clipRegion(), Qt::ReplaceClip);
else
q->updateClipRegion(QRegion(), Qt::NoClip);
diff --git a/src/openvg/qpixmapfilter_vg.cpp b/src/openvg/qpixmapfilter_vg.cpp
index ca4db38..613f4ea 100644
--- a/src/openvg/qpixmapfilter_vg.cpp
+++ b/src/openvg/qpixmapfilter_vg.cpp
@@ -220,8 +220,6 @@ void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const
QVGPixmapDropShadowFilter::QVGPixmapDropShadowFilter()
: QPixmapDropShadowFilter(),
- prevRadius(0.0f),
- kernelSize(0),
firstTime(true)
{
}
@@ -290,41 +288,30 @@ void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, con
// Blacken the source image.
vgColorMatrix(tmpImage, srcImage, matrix[0]);
- // Recompute the convolution kernel if the blur radius has changed.
- qreal radius = blurRadius();
- if (radius != prevRadius || firstTime) {
- prevRadius = radius;
- int dim = 2 * qRound(radius) + 1;
- int size = dim * dim;
- VGshort f = VGshort(1024.0f / size);
- kernel.resize(size);
- for (int i = 0; i < size; ++i)
- kernel[i] = f;
- kernelSize = dim;
- }
+ // Clamp the radius range. We divide by 2 because the OpenVG blur
+ // is "too blurry" compared to the default raster implementation.
+ VGfloat maxRadius = VGfloat(vgGeti(VG_MAX_GAUSSIAN_STD_DEVIATION));
+ VGfloat radiusF = VGfloat(blurRadius()) / 2.0f;
+ if (radiusF < 0.001f)
+ radiusF = 0.001f;
+ else if (radiusF > maxRadius)
+ radiusF = maxRadius;
- // Apply the convolution filter using the kernel.
- VGfloat values[4];
- values[0] = 0.0f;
- values[1] = 0.0f;
- values[2] = 0.0f;
- values[3] = 0.0f;
- vgSetfv(VG_TILE_FILL_COLOR, 4, values);
- vgConvolve(dstImage, tmpImage,
- kernelSize, kernelSize, 0, 0,
- kernel.constData(), 1.0f / 1024.0f, 0.0f,
- VG_TILE_FILL);
+ // Blur the blackened source image.
+ vgGaussianBlur(dstImage, tmpImage, radiusF, radiusF, VG_TILE_PAD);
firstTime = false;
VGImage child = VG_INVALID_HANDLE;
+ QRect srect;
if (srcRect.isNull() ||
(srcRect.topLeft().isNull() && srcRect.size() == size)) {
child = dstImage;
+ srect = QRect(0, 0, size.width(), size.height());
} else {
- QRect src = srcRect.toRect();
- child = vgChildImage(dstImage, src.x(), src.y(), src.width(), src.height());
+ srect = srcRect.toRect();
+ child = vgChildImage(dstImage, srect.x(), srect.y(), srect.width(), srect.height());
}
qt_vg_drawVGImage(painter, dest + offset(), child);
@@ -333,6 +320,9 @@ void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, con
vgDestroyImage(child);
vgDestroyImage(tmpImage);
vgDestroyImage(dstImage);
+
+ // Now draw the actual pixmap over the top.
+ painter->drawPixmap(dest, src, srect);
}
QVGPixmapBlurFilter::QVGPixmapBlurFilter(QObject *parent)
diff --git a/src/openvg/qpixmapfilter_vg_p.h b/src/openvg/qpixmapfilter_vg_p.h
index 8bd4f7e..58111ec 100644
--- a/src/openvg/qpixmapfilter_vg_p.h
+++ b/src/openvg/qpixmapfilter_vg_p.h
@@ -98,10 +98,7 @@ public:
private:
mutable VGfloat matrix[5][4];
mutable QColor prevColor;
- mutable qreal prevRadius;
- mutable int kernelSize;
mutable bool firstTime;
- mutable QVarLengthArray<VGshort, 16> kernel;
};
class Q_OPENVG_EXPORT QVGPixmapBlurFilter : public QPixmapBlurFilter
diff --git a/src/qt3support/widgets/q3popupmenu.h b/src/qt3support/widgets/q3popupmenu.h
index c8525bd..2af69d9 100644
--- a/src/qt3support/widgets/q3popupmenu.h
+++ b/src/qt3support/widgets/q3popupmenu.h
@@ -54,8 +54,8 @@ class Q_COMPAT_EXPORT Q3PopupMenu : public QMenu
{
Q_OBJECT
public:
- inline Q3PopupMenu(QWidget *parent = 0, const char * =0) : QMenu(parent)
- { }
+ inline Q3PopupMenu(QWidget *parent = 0, const char *name = 0) : QMenu(parent)
+ { setObjectName(QLatin1String(name)); }
inline int exec() { return findIdForAction(QMenu::exec()); }
inline int exec(const QPoint & pos, int indexAtPoint = 0) {
@@ -64,8 +64,8 @@ public:
void setFrameRect(QRect) {}
QRect frameRect() const { return QRect(); }
- enum DummyFrame { Box, Sunken, Plain, Raised, MShadow, NoFrame, Panel, StyledPanel,
- HLine, VLine, GroupBoxPanel, WinPanel, ToolBarPanel, MenuBarPanel,
+ enum DummyFrame { Box, Sunken, Plain, Raised, MShadow, NoFrame, Panel, StyledPanel,
+ HLine, VLine, GroupBoxPanel, WinPanel, ToolBarPanel, MenuBarPanel,
PopupPanel, LineEditPanel, TabWidgetPanel, MShape };
void setFrameShadow(DummyFrame) {}
DummyFrame frameShadow() const { return Plain; }
@@ -75,10 +75,10 @@ public:
int frameStyle() const { return 0; }
int frameWidth() const { return 0; }
void setLineWidth(int) {}
- int lineWidth() const { return 0; }
+ int lineWidth() const { return 0; }
void setMargin(int margin) { setContentsMargins(margin, margin, margin, margin); }
- int margin() const
- { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy); return margin; }
+ int margin() const
+ { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy); return margin; }
void setMidLineWidth(int) {}
int midLineWidth() const { return 0; }
diff --git a/src/qt3support/widgets/q3toolbar.cpp b/src/qt3support/widgets/q3toolbar.cpp
index 73b30ab..dbe3afd 100644
--- a/src/qt3support/widgets/q3toolbar.cpp
+++ b/src/qt3support/widgets/q3toolbar.cpp
@@ -422,7 +422,7 @@ void Q3ToolBar::addSeparator()
}
/*!
- \reimp
+ \internal
*/
void Q3ToolBar::styleChange(QStyle &oldStyle)
diff --git a/src/s60installs/qt.svg b/src/s60installs/qt.svg
index 22cb204..6230ada 100644
--- a/src/s60installs/qt.svg
+++ b/src/s60installs/qt.svg
@@ -3,15 +3,15 @@
<svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" height="146.3063" version="1.0" viewBox="0 0 122 146" width="121.60006">
<g transform="translate(-376.34283,-407.78046)">
<g transform="matrix(0.697424,0,0,0.697424,376.34283,407.78046)">
-<path d="M 43.086,0.358597 C 40.9414,0.00358582 38.8399,-0.0824127 36.8086,0.0775909 L 36.8047,0.0735931 C 36.8047,0.0735931 22.9219,1.01859 22.2891,1.0696 C 9.6211,2.08159 0,12.5036 0,26.8896 L 0,196.554 L 14.1914,209.781 L 156.789,185.816 C 166.606,184.113 174.356,172.538 174.356,160.038 L 174.356,21.8786 L 43.086,0.358597 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
-<path d="M 174.356,160.042 C 174.356,172.538 166.606,184.113 156.789,185.816 L 14.1914,209.781 L 14.1914,25.9916 C 14.1914,9.2726 27.5313,-2.20741 43.086,0.358597 L 174.356,21.8786 L 174.356,160.042 z" style="fill:#3fe400;fill-rule:evenodd;stroke:none"/>
+<path d="M 43.086,0.358597 C 40.9414,0.00358582 38.8399,-0.0824127 36.8086,0.0775909 L 36.8047,0.0735931 C 36.8047,0.0735931 22.9219,1.01859 22.2891,1.0696 C 9.6211,2.08159 0,12.5036 0,26.8896 L 0,196.554 L 14.1914,209.781 L 156.789,185.816 C 166.606,184.113 174.356,172.538 174.356,160.038 L 174.356,21.8786 L 43.086,0.358597 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
+<path d="M 174.356,160.042 C 174.356,172.538 166.606,184.113 156.789,185.816 L 14.1914,209.781 L 14.1914,25.9916 C 14.1914,9.2726 27.5313,-2.20741 43.086,0.358597 L 174.356,21.8786 L 174.356,160.042 z" style="fill:#80c342;fill-rule:evenodd;stroke:none"/>
<path d="M 130.422,45.9136 L 141.938,47.1516 L 141.938,67.3626 L 154.899,68.2766 L 154.899,80.9566 L 141.938,80.3586 L 141.938,126.691 C 141.938,130.723 142.383,133.316 143.278,134.48 C 144.078,135.547 145.324,136.074 146.988,136.074 C 147.149,136.074 147.317,136.07 147.485,136.058 C 150.035,135.91 152.805,135.125 155.828,133.75 L 155.828,145.398 C 150.692,147.656 145.653,148.996 140.703,149.418 C 139.985,149.473 139.293,149.504 138.625,149.504 C 134.145,149.504 130.719,148.203 128.379,145.57 C 125.649,142.519 124.289,137.621 124.289,130.898 L 124.289,79.5426 L 118.063,79.2576 L 118.063,65.6716 L 125.649,66.2186 L 130.422,45.9136 z" style="fill:#ffffff;fill-rule:evenodd;stroke:none"/>
-<path d="M 154.899,80.9566 L 141.938,80.3586 L 141.938,80.6366 L 148.883,80.9566 L 154.899,80.9566 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
-<path d="M 144.637,135.598 C 145.297,135.926 146.067,136.074 146.988,136.074 C 147.149,136.074 147.317,136.07 147.485,136.058 C 150.035,135.91 152.805,135.125 155.828,133.75 L 149.813,133.75 C 147.992,134.582 146.281,135.207 144.637,135.598 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
-<path d="M 128.379,145.57 C 125.649,142.519 124.289,137.621 124.289,130.898 L 124.289,79.5426 L 118.063,79.2576 L 118.063,65.6716 L 112.047,65.6716 L 112.047,68.7066 C 112.918,71.9796 113.602,75.5266 114.11,79.3506 L 118.274,79.5426 L 118.274,130.898 C 118.274,137.621 119.641,142.519 122.364,145.57 C 124.707,148.203 128.129,149.504 132.61,149.504 L 138.625,149.504 C 134.145,149.504 130.719,148.203 128.379,145.57 z M 130.422,45.9136 L 124.406,45.9136 L 119.738,65.7966 L 125.649,66.2186 L 130.422,45.9136 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 154.899,80.9566 L 141.938,80.3586 L 141.938,80.6366 L 148.883,80.9566 L 154.899,80.9566 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
+<path d="M 144.637,135.598 C 145.297,135.926 146.067,136.074 146.988,136.074 C 147.149,136.074 147.317,136.07 147.485,136.058 C 150.035,135.91 152.805,135.125 155.828,133.75 L 149.813,133.75 C 147.992,134.582 146.281,135.207 144.637,135.598 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
+<path d="M 128.379,145.57 C 125.649,142.519 124.289,137.621 124.289,130.898 L 124.289,79.5426 L 118.063,79.2576 L 118.063,65.6716 L 112.047,65.6716 L 112.047,68.7066 C 112.918,71.9796 113.602,75.5266 114.11,79.3506 L 118.274,79.5426 L 118.274,130.898 C 118.274,137.621 119.641,142.519 122.364,145.57 C 124.707,148.203 128.129,149.504 132.61,149.504 L 138.625,149.504 C 134.145,149.504 130.719,148.203 128.379,145.57 z M 130.422,45.9136 L 124.406,45.9136 L 119.738,65.7966 L 125.649,66.2186 L 130.422,45.9136 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
<path d="M 91.1528,132.406 C 93.5038,126.355 94.6638,114.492 94.6638,96.7886 C 94.6638,80.8976 93.5158,69.9726 91.1798,63.9756 C 88.8438,57.9486 85.3478,54.6946 80.6598,54.2846 C 80.3008,54.2536 79.9458,54.2336 79.6018,54.2336 C 75.2618,54.2336 71.9218,56.7686 69.5938,61.8586 C 67.0738,67.4016 65.8008,78.8976 65.8008,96.2966 C 65.8008,113.113 67.0388,125.047 69.5348,132.051 C 71.8908,138.723 75.4138,142.027 80.0388,142.027 C 80.2458,142.027 80.4488,142.019 80.6598,142.008 C 85.2928,141.715 88.7808,138.512 91.1528,132.406 M 109.129,136.156 C 105.012,145.863 98.7348,152.214 90.1408,155.156 C 91.0078,159.605 92.3168,162.597 94.0628,164.175 C 95.4138,165.386 97.4958,165.996 100.285,165.996 C 101.09,165.996 101.953,165.941 102.875,165.839 L 102.875,178.964 L 96.9138,179.746 C 95.1558,179.976 93.4878,180.089 91.9098,180.089 C 86.6918,180.089 82.4648,178.824 79.2888,176.265 C 75.0818,172.886 71.9808,166.371 69.9918,156.73 C 60.8555,154.785 53.7344,148.976 48.8008,139.226 C 43.7969,129.324 41.25,114.836 41.25,95.8866 C 41.25,75.4566 44.7344,60.3786 51.5938,50.8156 C 57.3828,42.7456 65.4568,38.7766 75.6168,38.7766 C 77.2458,38.7766 78.9258,38.8786 80.6598,39.0816 C 92.6138,40.4566 101.278,46.0976 106.918,55.8706 C 112.453,65.4326 115.172,79.1366 115.172,97.1326 C 115.172,113.617 113.172,126.582 109.129,136.156 z" style="fill:#ffffff;fill-rule:evenodd;stroke:none"/>
-<path d="M 100.281,165.996 C 101.09,165.996 101.953,165.941 102.871,165.839 L 98.0348,165.839 C 98.7108,165.945 99.4878,165.996 100.281,165.996 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
-<path d="M 84.8518,63.9756 C 87.1878,69.9726 88.3358,80.8976 88.3358,96.7886 C 88.3358,114.492 87.1758,126.355 84.8238,132.406 C 82.9298,137.285 80.2968,140.308 76.9608,141.476 C 77.9258,141.844 78.9528,142.027 80.0388,142.027 C 80.2458,142.027 80.4488,142.019 80.6598,142.008 C 85.2928,141.715 88.7808,138.512 91.1528,132.406 C 93.5038,126.355 94.6638,114.492 94.6638,96.7886 C 94.6638,80.8976 93.5158,69.9726 91.1798,63.9756 C 88.8438,57.9486 85.3478,54.6946 80.6598,54.2846 C 80.3008,54.2536 79.9458,54.2336 79.6018,54.2336 C 78.5118,54.2336 77.4848,54.3936 76.5198,54.7146 L 76.5198,54.7146 L 76.5158,54.7146 C 80.1168,55.8356 82.8948,58.9296 84.8518,63.9756 z M 82.5078,178.253 C 82.3948,178.203 82.2808,178.148 82.1718,178.093 C 82.1598,178.089 82.1488,178.081 82.1368,178.078 C 82.0348,178.027 81.9298,177.972 81.8278,177.921 C 81.8088,177.91 81.7888,177.902 81.7698,177.89 C 81.6798,177.839 81.5858,177.792 81.4918,177.742 C 81.4648,177.726 81.4378,177.706 81.4058,177.691 C 81.3238,177.648 81.2418,177.601 81.1638,177.554 C 81.1248,177.531 81.0858,177.507 81.0508,177.484 C 80.9808,177.445 80.9058,177.402 80.8358,177.359 C 80.7888,177.328 80.7418,177.3 80.6958,177.269 C 80.6368,177.23 80.5778,177.195 80.5198,177.156 C 80.4608,177.117 80.4058,177.081 80.3518,177.042 C 80.3008,177.011 80.2498,176.976 80.2028,176.945 C 80.1368,176.898 80.0708,176.851 80.0078,176.808 C 79.9688,176.781 79.9298,176.753 79.8948,176.726 C 79.8168,176.671 79.7418,176.613 79.6638,176.554 C 79.6408,176.538 79.6138,176.519 79.5858,176.499 C 79.4878,176.421 79.3868,176.343 79.2888,176.265 C 75.0818,172.886 71.9808,166.371 69.9918,156.73 C 60.8555,154.785 53.7344,148.976 48.8008,139.226 C 43.7969,129.324 41.25,114.836 41.25,95.8866 C 41.25,75.4566 44.7344,60.3786 51.5938,50.8156 C 57.3828,42.7456 65.4568,38.7766 75.6168,38.7766 C 75.6528,38.7766 69.2658,38.7766 69.2658,38.7766 L 69.2658,38.7766 C 59.1172,38.7846 51.0508,42.7536 45.2656,50.8156 C 38.4102,60.3786 34.9219,75.4566 34.9219,95.8866 C 34.9219,114.836 37.4688,129.324 42.4727,139.226 C 47.4063,148.976 54.5274,154.785 63.6638,156.73 C 65.6528,166.371 68.7538,172.886 72.9608,176.265 C 76.1368,178.824 80.3638,180.089 85.5858,180.089 C 85.6838,180.089 85.7848,180.089 85.8828,180.085 L 91.4218,180.085 C 88.0158,180.035 85.0388,179.425 82.5158,178.257 C 82.5158,178.257 82.5118,178.257 82.5078,178.253 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 100.281,165.996 C 101.09,165.996 101.953,165.941 102.871,165.839 L 98.0348,165.839 C 98.7108,165.945 99.4878,165.996 100.281,165.996 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
+<path d="M 84.8518,63.9756 C 87.1878,69.9726 88.3358,80.8976 88.3358,96.7886 C 88.3358,114.492 87.1758,126.355 84.8238,132.406 C 82.9298,137.285 80.2968,140.308 76.9608,141.476 C 77.9258,141.844 78.9528,142.027 80.0388,142.027 C 80.2458,142.027 80.4488,142.019 80.6598,142.008 C 85.2928,141.715 88.7808,138.512 91.1528,132.406 C 93.5038,126.355 94.6638,114.492 94.6638,96.7886 C 94.6638,80.8976 93.5158,69.9726 91.1798,63.9756 C 88.8438,57.9486 85.3478,54.6946 80.6598,54.2846 C 80.3008,54.2536 79.9458,54.2336 79.6018,54.2336 C 78.5118,54.2336 77.4848,54.3936 76.5198,54.7146 L 76.5198,54.7146 L 76.5158,54.7146 C 80.1168,55.8356 82.8948,58.9296 84.8518,63.9756 z M 82.5078,178.253 C 82.3948,178.203 82.2808,178.148 82.1718,178.093 C 82.1598,178.089 82.1488,178.081 82.1368,178.078 C 82.0348,178.027 81.9298,177.972 81.8278,177.921 C 81.8088,177.91 81.7888,177.902 81.7698,177.89 C 81.6798,177.839 81.5858,177.792 81.4918,177.742 C 81.4648,177.726 81.4378,177.706 81.4058,177.691 C 81.3238,177.648 81.2418,177.601 81.1638,177.554 C 81.1248,177.531 81.0858,177.507 81.0508,177.484 C 80.9808,177.445 80.9058,177.402 80.8358,177.359 C 80.7888,177.328 80.7418,177.3 80.6958,177.269 C 80.6368,177.23 80.5778,177.195 80.5198,177.156 C 80.4608,177.117 80.4058,177.081 80.3518,177.042 C 80.3008,177.011 80.2498,176.976 80.2028,176.945 C 80.1368,176.898 80.0708,176.851 80.0078,176.808 C 79.9688,176.781 79.9298,176.753 79.8948,176.726 C 79.8168,176.671 79.7418,176.613 79.6638,176.554 C 79.6408,176.538 79.6138,176.519 79.5858,176.499 C 79.4878,176.421 79.3868,176.343 79.2888,176.265 C 75.0818,172.886 71.9808,166.371 69.9918,156.73 C 60.8555,154.785 53.7344,148.976 48.8008,139.226 C 43.7969,129.324 41.25,114.836 41.25,95.8866 C 41.25,75.4566 44.7344,60.3786 51.5938,50.8156 C 57.3828,42.7456 65.4568,38.7766 75.6168,38.7766 C 75.6528,38.7766 69.2658,38.7766 69.2658,38.7766 L 69.2658,38.7766 C 59.1172,38.7846 51.0508,42.7536 45.2656,50.8156 C 38.4102,60.3786 34.9219,75.4566 34.9219,95.8866 C 34.9219,114.836 37.4688,129.324 42.4727,139.226 C 47.4063,148.976 54.5274,154.785 63.6638,156.73 C 65.6528,166.371 68.7538,172.886 72.9608,176.265 C 76.1368,178.824 80.3638,180.089 85.5858,180.089 C 85.6838,180.089 85.7848,180.089 85.8828,180.085 L 91.4218,180.085 C 88.0158,180.035 85.0388,179.425 82.5158,178.257 C 82.5158,178.257 82.5118,178.257 82.5078,178.253 z" style="fill:#006225;fill-rule:evenodd;stroke:none"/>
</g>
</g>
</svg>
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index d21c524..3aef05e 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -7,7 +7,7 @@ symbian: {
SUBDIRS=
# WARNING: Changing TARGET name will break Symbian SISX upgrade functionality
# DO NOT TOUCH TARGET VARIABLE IF YOU ARE NOT SURE WHAT YOU ARE DOING
- TARGET = "Qt for S60"
+ TARGET = "Qt"
TARGET.UID3 = 0x2001E61C
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
@@ -29,12 +29,12 @@ symbian: {
"ELSEIF package(0x102752AE)" \
" \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"!:\\sys\\bin\\qts60plugin_3_2.dll\"" \
"ELSEIF package(0x102032BE)" \
- " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"!:\\sys\\bin\\qts60plugin_3_1.dll\"" \
- "ELSE" \
+ " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"!:\\sys\\bin\\qts60plugin_3_1.dll\"" \
+ "ELSE" \
" \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"!:\\sys\\bin\\qts60plugin_5_0.dll\"" \
- "ENDIF"
- qtlibraries.pkg_postrules += qts60plugindeployment
-
+ "ENDIF"
+ qtlibraries.pkg_postrules += qts60plugindeployment
+
sqlitedeployment = \
"; EXISTS statement does not resolve !. Lets check the most common drives" \
"IF NOT EXISTS(\"c:\\sys\\bin\\sqlite3.dll\") AND NOT EXISTS(\"e:\\sys\\bin\\sqlite3.dll\") AND NOT EXISTS(\"z:\\sys\\bin\\sqlite3.dll\")" \
diff --git a/src/s60installs/selfsigned.cer b/src/s60installs/selfsigned.cer
index af72449..95c94d5 100644
--- a/src/s60installs/selfsigned.cer
+++ b/src/s60installs/selfsigned.cer
@@ -1,10 +1,12 @@
-----BEGIN CERTIFICATE-----
-MIIDFTCCAtOgAwIBAgIBADALBgcqhkjOOAQDBQAwcDELMAkGA1UEBhMCTk8xDjAM
-BgNVBAoTBU5va2lhMRQwEgYDVQQLEwtRdCBTb2Z0d2FyZTEOMAwGA1UEAxMFVHJv
-bGwxKzApBgkqhkiG9w0BCQEWHHF0czYwLWZlZWRiYWNrQHRyb2xsdGVjaC5jb20w
-HhcNMDgxMDAzMTMwNDM1WhcNMDkxMDAzMTMwNDM1WjBwMQswCQYDVQQGEwJOTzEO
-MAwGA1UEChMFTm9raWExFDASBgNVBAsTC1F0IFNvZnR3YXJlMQ4wDAYDVQQDEwVU
-cm9sbDErMCkGCSqGSIb3DQEJARYccXRzNjAtZmVlZGJhY2tAdHJvbGx0ZWNoLmNv
+MIIDczCCAzOgAwIBAgIBATAJBgcqhkjOOAQDMIGgMTAwLgYDVQQDEycoc2VsZi1z
+aWduZWQpIFF0IERldmVsb3BtZW50IEZyYW1ld29ya3MxIjAgBgNVBAsTGVF0IERl
+dmVsb3BtZW50IEZyYW1ld29ya3MxDjAMBgNVBAoTBU5va2lhMQswCQYDVQQGEwJO
+TzErMCkGCSqGSIb3DQEJARYccXRzNjAtZmVlZGJhY2tAdHJvbGx0ZWNoLmNvbTAe
+Fw0wOTEwMDUxMTExMTdaFw0xOTEwMDMxMTExMTdaMIGgMTAwLgYDVQQDEycoc2Vs
+Zi1zaWduZWQpIFF0IERldmVsb3BtZW50IEZyYW1ld29ya3MxIjAgBgNVBAsTGVF0
+IERldmVsb3BtZW50IEZyYW1ld29ya3MxDjAMBgNVBAoTBU5va2lhMQswCQYDVQQG
+EwJOTzErMCkGCSqGSIb3DQEJARYccXRzNjAtZmVlZGJhY2tAdHJvbGx0ZWNoLmNv
bTCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQC7OyI3lyV06OqahpbeEa5p9ucmoBxV
n6YKvBjliPNMhQe7Di1Igv63rllQPqABv1Qu1YJc5CPiF4dSSQ/R7XjKEQqPZY4A
PZooTKWVCs+e3Yo2HWaZYRks/euvcqvEOqmkZ2RUccaTb1T+b2et0vphFmlVYXPx
@@ -14,6 +16,6 @@ taqAVb9V2DrDHx3s0gSQmS5BNK2KThZCNOgj3YT4GRIZR4L6gqDBS5dkWLrwFUfC
l6Hw9tizQR4EO4HgjEnMSxzXDzsDgYQAAoGAJH/tVAEb1boQKTt5eHRI/zCtw4ab
Vtw7jHMzqQ+m921izJyzz5AJCVjtu6a1bLnW09i9oFIZ7bYs+Cd+qRgac2cVkX4x
xmMXuAgw03VMf3vEbK2M2+BkjpUGrfoST5XG/eJbno6Tp1BGvYd88ZLt3gXBPnqi
-2QpMaOGqMED4mWkwCwYHKoZIzjgEAwUAAy8AMCwCFGCSlB1FYaBiIAuirrAACZzi
-p2jnAhQ/hlJjpxOgF7Z5RZCNAhz6HNhZ3g==
+2QpMaOGqMED4mWkwCQYHKoZIzjgEAwMvADAsAhQSh0SkUWPDv9enEQqkKCfjDu7H
+xAIUft1Qc3eFaoW+ki69TgptZnkki6M=
-----END CERTIFICATE-----
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index fb14940..863ac30 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -805,7 +805,6 @@ QScriptEnginePrivate::QScriptEnginePrivate()
JSC::JSGlobalObject *globalObject = new (globalData)QScript::GlobalObject();
JSC::ExecState* exec = globalObject->globalExec();
- *thisRegisterForFrame(exec) = JSC::JSValue();
scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());
@@ -1079,12 +1078,13 @@ JSC::JSValue QScriptEnginePrivate::toUsableValue(JSC::JSValue value)
/*!
\internal
Return the 'this' value for a given context
- The result may be null for the global context
*/
JSC::JSValue QScriptEnginePrivate::thisForContext(JSC::ExecState *frame)
{
if (frame->codeBlock() != 0) {
return frame->thisValue();
+ } else if(frame == frame->lexicalGlobalObject()->globalExec()) {
+ return frame->globalThisValue();
} else {
JSC::Register *thisRegister = thisRegisterForFrame(frame);
return thisRegister->jsValue();
@@ -1116,8 +1116,7 @@ uint QScriptEnginePrivate::contextFlags(JSC::ExecState *exec)
void QScriptEnginePrivate::setContextFlags(JSC::ExecState *exec, uint flags)
{
Q_ASSERT(!exec->codeBlock());
- quintptr flag_ptr = flags;
- exec->registers()[JSC::RegisterFile::ReturnValueRegister] = JSC::JSValue(reinterpret_cast<JSC::JSObject*>(flag_ptr));
+ exec->registers()[JSC::RegisterFile::ReturnValueRegister] = JSC::Register::withInt(flags);
}
@@ -2168,7 +2167,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
exec->clearException();
JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject());
- JSC::EvalExecutable executable(source);
+ JSC::EvalExecutable executable(exec, source);
JSC::JSObject* error = executable.compile(exec, exec->scopeChain());
if (error) {
exec->setException(error);
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index f2716e4..92c987c 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1738,7 +1738,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex,
void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
const PropertyFlags &flags)
{
- Q_D(const QScriptValue);
+ Q_D(QScriptValue);
if (!d || !d->isObject())
return;
if (value.engine() && (value.engine() != engine())) {
@@ -1752,7 +1752,9 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
JSC::asObject(d->jscValue)->deleteProperty(exec, arrayIndex, /*checkDontDelete=*/false);
} else {
if ((flags & QScriptValue::PropertyGetter) || (flags & QScriptValue::PropertySetter)) {
- Q_ASSERT_X(false, Q_FUNC_INFO, "property getters and setters not implemented");
+ // fall back to string-based setProperty(), since there is no
+ // JSC::JSObject::defineGetter(unsigned)
+ d->setProperty(JSC::Identifier::from(exec, arrayIndex), value, flags);
} else {
if (flags != QScriptValue::KeepExistingFlags) {
// if (JSC::asObject(d->jscValue)->hasOwnProperty(exec, arrayIndex))
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index dfe30e7..5125546 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -811,13 +811,18 @@ bool QSqlQuery::isForwardOnly() const
Forward only mode can be (depending on the driver) more memory
efficient since results do not need to be cached. It will also
improve performance on some databases. For this to be true, you must
- call \c setForwardMode() before the query is prepared or executed.
+ call \c setForwardOnly() before the query is prepared or executed.
Note that the constructor that takes a query and a database may
execute the query.
Forward only mode is off by default.
- \sa isForwardOnly(), next(), seek()
+ Setting forward only to false is a suggestion to the database engine,
+ which has the final say on whether a result set is forward only or
+ scrollable. isForwardOnly() will always return the correct status of
+ the result set.
+
+ \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly()
*/
void QSqlQuery::setForwardOnly(bool forward)
{
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 791b8a6..efca595 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -559,7 +559,12 @@ bool QSqlResult::isForwardOnly() const
mode needs much less memory since results do not have to be
cached. By default, this feature is disabled.
- \sa isForwardOnly(), fetchNext()
+ Setting forward only to false is a suggestion to the database engine,
+ which has the final say on whether a result set is forward only or
+ scrollable. isForwardOnly() will always return the correct status of
+ the result set.
+
+ \sa isForwardOnly(), fetchNext(), QSqlQuery::setForwardOnly()
*/
void QSqlResult::setForwardOnly(bool forward)
{
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 6d2a0f9..3ed918e 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3569,20 +3569,16 @@ bool QSvgHandler::startElement(const QString &localName,
* a lookup by the qualified name here, but this is namespace aware, since
* the XML namespace can only be bound to prefix "xml." */
const QStringRef xmlSpace(attributes.value(QLatin1String("xml:space")));
- if(xmlSpace.isNull())
- {
+ if (xmlSpace.isNull()) {
// This element has no xml:space attribute.
- m_whitespaceMode.push(QSvgText::Default);
- }
- else if(xmlSpace == QLatin1String("preserve"))
+ m_whitespaceMode.push(m_whitespaceMode.isEmpty() ? QSvgText::Default : m_whitespaceMode.top());
+ } else if (xmlSpace == QLatin1String("preserve")) {
m_whitespaceMode.push(QSvgText::Preserve);
- else if(xmlSpace == QLatin1String("default"))
+ } else if (xmlSpace == QLatin1String("default")) {
m_whitespaceMode.push(QSvgText::Default);
- else
- {
+ } else {
qWarning() << QString::fromLatin1("\"%1\" is an invalid value for attribute xml:space. "
"Valid values are \"preserve\" and \"default\".").arg(xmlSpace.toString());
-
m_whitespaceMode.push(QSvgText::Default);
}
diff --git a/src/xmlpatterns/api/qabstractxmlpullprovider.cpp b/src/xmlpatterns/api/qabstractxmlpullprovider.cpp
index 83cf20f..6dbd50b 100644
--- a/src/xmlpatterns/api/qabstractxmlpullprovider.cpp
+++ b/src/xmlpatterns/api/qabstractxmlpullprovider.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qabstractxmlpullprovider_p.h b/src/xmlpatterns/api/qabstractxmlpullprovider_p.h
index 1bf61d7..547bf4b 100644
--- a/src/xmlpatterns/api/qabstractxmlpullprovider_p.h
+++ b/src/xmlpatterns/api/qabstractxmlpullprovider_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qpullbridge.cpp b/src/xmlpatterns/api/qpullbridge.cpp
index 9f96b5f..80dac38 100644
--- a/src/xmlpatterns/api/qpullbridge.cpp
+++ b/src/xmlpatterns/api/qpullbridge.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qpullbridge_p.h b/src/xmlpatterns/api/qpullbridge_p.h
index 2d8be62..1553a3e 100644
--- a/src/xmlpatterns/api/qpullbridge_p.h
+++ b/src/xmlpatterns/api/qpullbridge_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschema.cpp b/src/xmlpatterns/api/qxmlschema.cpp
index 5d4bd80..287cf11 100644
--- a/src/xmlpatterns/api/qxmlschema.cpp
+++ b/src/xmlpatterns/api/qxmlschema.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschema.h b/src/xmlpatterns/api/qxmlschema.h
index 0e4972e..145f2dc 100644
--- a/src/xmlpatterns/api/qxmlschema.h
+++ b/src/xmlpatterns/api/qxmlschema.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschema_p.cpp b/src/xmlpatterns/api/qxmlschema_p.cpp
index e2e725b..f5ed5c0 100644
--- a/src/xmlpatterns/api/qxmlschema_p.cpp
+++ b/src/xmlpatterns/api/qxmlschema_p.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschema_p.h b/src/xmlpatterns/api/qxmlschema_p.h
index fd7a1a1..2376fe3 100644
--- a/src/xmlpatterns/api/qxmlschema_p.h
+++ b/src/xmlpatterns/api/qxmlschema_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschemavalidator.cpp b/src/xmlpatterns/api/qxmlschemavalidator.cpp
index f7d7957..11e0417 100644
--- a/src/xmlpatterns/api/qxmlschemavalidator.cpp
+++ b/src/xmlpatterns/api/qxmlschemavalidator.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschemavalidator.h b/src/xmlpatterns/api/qxmlschemavalidator.h
index e928193..7121d19 100644
--- a/src/xmlpatterns/api/qxmlschemavalidator.h
+++ b/src/xmlpatterns/api/qxmlschemavalidator.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/api/qxmlschemavalidator_p.h b/src/xmlpatterns/api/qxmlschemavalidator_p.h
index 6eb508d..fb9492a 100644
--- a/src/xmlpatterns/api/qxmlschemavalidator_p.h
+++ b/src/xmlpatterns/api/qxmlschemavalidator_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/data/qcomparisonfactory.cpp b/src/xmlpatterns/data/qcomparisonfactory.cpp
index f885004..66d72af 100644
--- a/src/xmlpatterns/data/qcomparisonfactory.cpp
+++ b/src/xmlpatterns/data/qcomparisonfactory.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/data/qcomparisonfactory_p.h b/src/xmlpatterns/data/qcomparisonfactory_p.h
index 2e73bbe..61f65b1 100644
--- a/src/xmlpatterns/data/qcomparisonfactory_p.h
+++ b/src/xmlpatterns/data/qcomparisonfactory_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/data/qvaluefactory.cpp b/src/xmlpatterns/data/qvaluefactory.cpp
index c75e6d3..bac53b2 100644
--- a/src/xmlpatterns/data/qvaluefactory.cpp
+++ b/src/xmlpatterns/data/qvaluefactory.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/data/qvaluefactory_p.h b/src/xmlpatterns/data/qvaluefactory_p.h
index c9ecd28..e383d27 100644
--- a/src/xmlpatterns/data/qvaluefactory_p.h
+++ b/src/xmlpatterns/data/qvaluefactory_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qnamespacesupport.cpp b/src/xmlpatterns/schema/qnamespacesupport.cpp
index ecd53e9..05b87e3 100644
--- a/src/xmlpatterns/schema/qnamespacesupport.cpp
+++ b/src/xmlpatterns/schema/qnamespacesupport.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qnamespacesupport_p.h b/src/xmlpatterns/schema/qnamespacesupport_p.h
index 3748894..2a2cb1e 100644
--- a/src/xmlpatterns/schema/qnamespacesupport_p.h
+++ b/src/xmlpatterns/schema/qnamespacesupport_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdalternative.cpp b/src/xmlpatterns/schema/qxsdalternative.cpp
index 8493efe..279a184 100644
--- a/src/xmlpatterns/schema/qxsdalternative.cpp
+++ b/src/xmlpatterns/schema/qxsdalternative.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdalternative_p.h b/src/xmlpatterns/schema/qxsdalternative_p.h
index 3e42a3b..f94f0ac 100644
--- a/src/xmlpatterns/schema/qxsdalternative_p.h
+++ b/src/xmlpatterns/schema/qxsdalternative_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdannotated.cpp b/src/xmlpatterns/schema/qxsdannotated.cpp
index 84575fc..151057d 100644
--- a/src/xmlpatterns/schema/qxsdannotated.cpp
+++ b/src/xmlpatterns/schema/qxsdannotated.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdannotated_p.h b/src/xmlpatterns/schema/qxsdannotated_p.h
index 8d0f872..f8d7fe1 100644
--- a/src/xmlpatterns/schema/qxsdannotated_p.h
+++ b/src/xmlpatterns/schema/qxsdannotated_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdannotation.cpp b/src/xmlpatterns/schema/qxsdannotation.cpp
index 13d40f9..9c76378 100644
--- a/src/xmlpatterns/schema/qxsdannotation.cpp
+++ b/src/xmlpatterns/schema/qxsdannotation.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdannotation_p.h b/src/xmlpatterns/schema/qxsdannotation_p.h
index db6785b..a8e2d55 100644
--- a/src/xmlpatterns/schema/qxsdannotation_p.h
+++ b/src/xmlpatterns/schema/qxsdannotation_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdapplicationinformation.cpp b/src/xmlpatterns/schema/qxsdapplicationinformation.cpp
index 19d1e06..45c6391 100644
--- a/src/xmlpatterns/schema/qxsdapplicationinformation.cpp
+++ b/src/xmlpatterns/schema/qxsdapplicationinformation.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdapplicationinformation_p.h b/src/xmlpatterns/schema/qxsdapplicationinformation_p.h
index eab3871..1a549cb 100644
--- a/src/xmlpatterns/schema/qxsdapplicationinformation_p.h
+++ b/src/xmlpatterns/schema/qxsdapplicationinformation_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdassertion.cpp b/src/xmlpatterns/schema/qxsdassertion.cpp
index e604203..2f2d8aa 100644
--- a/src/xmlpatterns/schema/qxsdassertion.cpp
+++ b/src/xmlpatterns/schema/qxsdassertion.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdassertion_p.h b/src/xmlpatterns/schema/qxsdassertion_p.h
index 4ba47d5..c511c85 100644
--- a/src/xmlpatterns/schema/qxsdassertion_p.h
+++ b/src/xmlpatterns/schema/qxsdassertion_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattribute.cpp b/src/xmlpatterns/schema/qxsdattribute.cpp
index a61898e..68f9e3d 100644
--- a/src/xmlpatterns/schema/qxsdattribute.cpp
+++ b/src/xmlpatterns/schema/qxsdattribute.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattribute_p.h b/src/xmlpatterns/schema/qxsdattribute_p.h
index aae690b..d64d335 100644
--- a/src/xmlpatterns/schema/qxsdattribute_p.h
+++ b/src/xmlpatterns/schema/qxsdattribute_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributegroup.cpp b/src/xmlpatterns/schema/qxsdattributegroup.cpp
index a9b8412..b0dbc8a 100644
--- a/src/xmlpatterns/schema/qxsdattributegroup.cpp
+++ b/src/xmlpatterns/schema/qxsdattributegroup.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributegroup_p.h b/src/xmlpatterns/schema/qxsdattributegroup_p.h
index 1cd28fa..0d76d53 100644
--- a/src/xmlpatterns/schema/qxsdattributegroup_p.h
+++ b/src/xmlpatterns/schema/qxsdattributegroup_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributereference.cpp b/src/xmlpatterns/schema/qxsdattributereference.cpp
index 97f0c6a..853705a 100644
--- a/src/xmlpatterns/schema/qxsdattributereference.cpp
+++ b/src/xmlpatterns/schema/qxsdattributereference.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributereference_p.h b/src/xmlpatterns/schema/qxsdattributereference_p.h
index 711031f..9c3ef80 100644
--- a/src/xmlpatterns/schema/qxsdattributereference_p.h
+++ b/src/xmlpatterns/schema/qxsdattributereference_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributeterm.cpp b/src/xmlpatterns/schema/qxsdattributeterm.cpp
index 08d3332..afed862 100644
--- a/src/xmlpatterns/schema/qxsdattributeterm.cpp
+++ b/src/xmlpatterns/schema/qxsdattributeterm.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributeterm_p.h b/src/xmlpatterns/schema/qxsdattributeterm_p.h
index f00df73..45f5402 100644
--- a/src/xmlpatterns/schema/qxsdattributeterm_p.h
+++ b/src/xmlpatterns/schema/qxsdattributeterm_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributeuse.cpp b/src/xmlpatterns/schema/qxsdattributeuse.cpp
index 7f0c66a..4055d48 100644
--- a/src/xmlpatterns/schema/qxsdattributeuse.cpp
+++ b/src/xmlpatterns/schema/qxsdattributeuse.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdattributeuse_p.h b/src/xmlpatterns/schema/qxsdattributeuse_p.h
index 5048a04..648620f 100644
--- a/src/xmlpatterns/schema/qxsdattributeuse_p.h
+++ b/src/xmlpatterns/schema/qxsdattributeuse_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdcomplextype.cpp b/src/xmlpatterns/schema/qxsdcomplextype.cpp
index 40f752a..42aeb60 100644
--- a/src/xmlpatterns/schema/qxsdcomplextype.cpp
+++ b/src/xmlpatterns/schema/qxsdcomplextype.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdcomplextype_p.h b/src/xmlpatterns/schema/qxsdcomplextype_p.h
index 5453b8b..d28d2fc 100644
--- a/src/xmlpatterns/schema/qxsdcomplextype_p.h
+++ b/src/xmlpatterns/schema/qxsdcomplextype_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsddocumentation.cpp b/src/xmlpatterns/schema/qxsddocumentation.cpp
index 8b7928d..de610b4 100644
--- a/src/xmlpatterns/schema/qxsddocumentation.cpp
+++ b/src/xmlpatterns/schema/qxsddocumentation.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsddocumentation_p.h b/src/xmlpatterns/schema/qxsddocumentation_p.h
index 2bd9bf4..cdccfd7 100644
--- a/src/xmlpatterns/schema/qxsddocumentation_p.h
+++ b/src/xmlpatterns/schema/qxsddocumentation_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdelement.cpp b/src/xmlpatterns/schema/qxsdelement.cpp
index c783421..1ebec06 100644
--- a/src/xmlpatterns/schema/qxsdelement.cpp
+++ b/src/xmlpatterns/schema/qxsdelement.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdelement_p.h b/src/xmlpatterns/schema/qxsdelement_p.h
index 9051722..93c5983 100644
--- a/src/xmlpatterns/schema/qxsdelement_p.h
+++ b/src/xmlpatterns/schema/qxsdelement_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdfacet.cpp b/src/xmlpatterns/schema/qxsdfacet.cpp
index d0148fd..80acc74 100644
--- a/src/xmlpatterns/schema/qxsdfacet.cpp
+++ b/src/xmlpatterns/schema/qxsdfacet.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdfacet_p.h b/src/xmlpatterns/schema/qxsdfacet_p.h
index 24a6114..349e211 100644
--- a/src/xmlpatterns/schema/qxsdfacet_p.h
+++ b/src/xmlpatterns/schema/qxsdfacet_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidcache.cpp b/src/xmlpatterns/schema/qxsdidcache.cpp
index a52b597..cfca2e9 100644
--- a/src/xmlpatterns/schema/qxsdidcache.cpp
+++ b/src/xmlpatterns/schema/qxsdidcache.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidcache_p.h b/src/xmlpatterns/schema/qxsdidcache_p.h
index caf9d4d..b24e4b7 100644
--- a/src/xmlpatterns/schema/qxsdidcache_p.h
+++ b/src/xmlpatterns/schema/qxsdidcache_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidchelper.cpp b/src/xmlpatterns/schema/qxsdidchelper.cpp
index e814c25..7740929 100644
--- a/src/xmlpatterns/schema/qxsdidchelper.cpp
+++ b/src/xmlpatterns/schema/qxsdidchelper.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidchelper_p.h b/src/xmlpatterns/schema/qxsdidchelper_p.h
index a88567e..f3a9bac 100644
--- a/src/xmlpatterns/schema/qxsdidchelper_p.h
+++ b/src/xmlpatterns/schema/qxsdidchelper_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidentityconstraint.cpp b/src/xmlpatterns/schema/qxsdidentityconstraint.cpp
index 3f280dc..12f8446 100644
--- a/src/xmlpatterns/schema/qxsdidentityconstraint.cpp
+++ b/src/xmlpatterns/schema/qxsdidentityconstraint.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdidentityconstraint_p.h b/src/xmlpatterns/schema/qxsdidentityconstraint_p.h
index 5359340..a675ea0 100644
--- a/src/xmlpatterns/schema/qxsdidentityconstraint_p.h
+++ b/src/xmlpatterns/schema/qxsdidentityconstraint_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdinstancereader.cpp b/src/xmlpatterns/schema/qxsdinstancereader.cpp
index 969dc09..a7cb735 100644
--- a/src/xmlpatterns/schema/qxsdinstancereader.cpp
+++ b/src/xmlpatterns/schema/qxsdinstancereader.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdinstancereader_p.h b/src/xmlpatterns/schema/qxsdinstancereader_p.h
index dca6204..9c9fcd1 100644
--- a/src/xmlpatterns/schema/qxsdinstancereader_p.h
+++ b/src/xmlpatterns/schema/qxsdinstancereader_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdmodelgroup.cpp b/src/xmlpatterns/schema/qxsdmodelgroup.cpp
index af74dee..69e5fad 100644
--- a/src/xmlpatterns/schema/qxsdmodelgroup.cpp
+++ b/src/xmlpatterns/schema/qxsdmodelgroup.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdmodelgroup_p.h b/src/xmlpatterns/schema/qxsdmodelgroup_p.h
index 02e89d0..c4f54e5 100644
--- a/src/xmlpatterns/schema/qxsdmodelgroup_p.h
+++ b/src/xmlpatterns/schema/qxsdmodelgroup_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdnotation.cpp b/src/xmlpatterns/schema/qxsdnotation.cpp
index 32d480d..2cd27a4 100644
--- a/src/xmlpatterns/schema/qxsdnotation.cpp
+++ b/src/xmlpatterns/schema/qxsdnotation.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdnotation_p.h b/src/xmlpatterns/schema/qxsdnotation_p.h
index 7db4cbf..598392a 100644
--- a/src/xmlpatterns/schema/qxsdnotation_p.h
+++ b/src/xmlpatterns/schema/qxsdnotation_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdparticle.cpp b/src/xmlpatterns/schema/qxsdparticle.cpp
index 1b8d2b8..650524c 100644
--- a/src/xmlpatterns/schema/qxsdparticle.cpp
+++ b/src/xmlpatterns/schema/qxsdparticle.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdparticle_p.h b/src/xmlpatterns/schema/qxsdparticle_p.h
index a72acbb..4e6561e 100644
--- a/src/xmlpatterns/schema/qxsdparticle_p.h
+++ b/src/xmlpatterns/schema/qxsdparticle_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdparticlechecker.cpp b/src/xmlpatterns/schema/qxsdparticlechecker.cpp
index 3fdfb33..ef1d135 100644
--- a/src/xmlpatterns/schema/qxsdparticlechecker.cpp
+++ b/src/xmlpatterns/schema/qxsdparticlechecker.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdparticlechecker_p.h b/src/xmlpatterns/schema/qxsdparticlechecker_p.h
index 9ed7fd8..742f0d0 100644
--- a/src/xmlpatterns/schema/qxsdparticlechecker_p.h
+++ b/src/xmlpatterns/schema/qxsdparticlechecker_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdreference.cpp b/src/xmlpatterns/schema/qxsdreference.cpp
index 6a0fc37..d98a405 100644
--- a/src/xmlpatterns/schema/qxsdreference.cpp
+++ b/src/xmlpatterns/schema/qxsdreference.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdreference_p.h b/src/xmlpatterns/schema/qxsdreference_p.h
index bb37257..028d190 100644
--- a/src/xmlpatterns/schema/qxsdreference_p.h
+++ b/src/xmlpatterns/schema/qxsdreference_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschema.cpp b/src/xmlpatterns/schema/qxsdschema.cpp
index 7dc821d..cb766d1 100644
--- a/src/xmlpatterns/schema/qxsdschema.cpp
+++ b/src/xmlpatterns/schema/qxsdschema.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschema_p.h b/src/xmlpatterns/schema/qxsdschema_p.h
index 1bad61c..e63324e 100644
--- a/src/xmlpatterns/schema/qxsdschema_p.h
+++ b/src/xmlpatterns/schema/qxsdschema_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemachecker.cpp b/src/xmlpatterns/schema/qxsdschemachecker.cpp
index dde72f5..0d16940 100644
--- a/src/xmlpatterns/schema/qxsdschemachecker.cpp
+++ b/src/xmlpatterns/schema/qxsdschemachecker.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemachecker_helper.cpp b/src/xmlpatterns/schema/qxsdschemachecker_helper.cpp
index aec411f..3a44365 100644
--- a/src/xmlpatterns/schema/qxsdschemachecker_helper.cpp
+++ b/src/xmlpatterns/schema/qxsdschemachecker_helper.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemachecker_p.h b/src/xmlpatterns/schema/qxsdschemachecker_p.h
index aed95f5..b4966d9 100644
--- a/src/xmlpatterns/schema/qxsdschemachecker_p.h
+++ b/src/xmlpatterns/schema/qxsdschemachecker_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemacontext.cpp b/src/xmlpatterns/schema/qxsdschemacontext.cpp
index 61f0511..8e22632 100644
--- a/src/xmlpatterns/schema/qxsdschemacontext.cpp
+++ b/src/xmlpatterns/schema/qxsdschemacontext.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemacontext_p.h b/src/xmlpatterns/schema/qxsdschemacontext_p.h
index a49f1d7..6a04ba3 100644
--- a/src/xmlpatterns/schema/qxsdschemacontext_p.h
+++ b/src/xmlpatterns/schema/qxsdschemacontext_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemadebugger.cpp b/src/xmlpatterns/schema/qxsdschemadebugger.cpp
index f85b902..8ec7381 100644
--- a/src/xmlpatterns/schema/qxsdschemadebugger.cpp
+++ b/src/xmlpatterns/schema/qxsdschemadebugger.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemadebugger_p.h b/src/xmlpatterns/schema/qxsdschemadebugger_p.h
index cdf4bb5..2225b88 100644
--- a/src/xmlpatterns/schema/qxsdschemadebugger_p.h
+++ b/src/xmlpatterns/schema/qxsdschemadebugger_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp
index a56f3ef..e9f32c2 100644
--- a/src/xmlpatterns/schema/qxsdschemahelper.cpp
+++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemahelper_p.h b/src/xmlpatterns/schema/qxsdschemahelper_p.h
index 680ceaa..410b224 100644
--- a/src/xmlpatterns/schema/qxsdschemahelper_p.h
+++ b/src/xmlpatterns/schema/qxsdschemahelper_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemamerger.cpp b/src/xmlpatterns/schema/qxsdschemamerger.cpp
index c1455b5..4ffcea3 100644
--- a/src/xmlpatterns/schema/qxsdschemamerger.cpp
+++ b/src/xmlpatterns/schema/qxsdschemamerger.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemamerger_p.h b/src/xmlpatterns/schema/qxsdschemamerger_p.h
index 3187596..599a08b 100644
--- a/src/xmlpatterns/schema/qxsdschemamerger_p.h
+++ b/src/xmlpatterns/schema/qxsdschemamerger_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemaparser_p.h b/src/xmlpatterns/schema/qxsdschemaparser_p.h
index 60c9d66..ad5e9ce 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser_p.h
+++ b/src/xmlpatterns/schema/qxsdschemaparser_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemaparsercontext.cpp b/src/xmlpatterns/schema/qxsdschemaparsercontext.cpp
index 4f28d26..381d4d0 100644
--- a/src/xmlpatterns/schema/qxsdschemaparsercontext.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaparsercontext.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemaparsercontext_p.h b/src/xmlpatterns/schema/qxsdschemaparsercontext_p.h
index c42b165..19c516a 100644
--- a/src/xmlpatterns/schema/qxsdschemaparsercontext_p.h
+++ b/src/xmlpatterns/schema/qxsdschemaparsercontext_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemaresolver.cpp b/src/xmlpatterns/schema/qxsdschemaresolver.cpp
index 3ec598d..34eb12c 100644
--- a/src/xmlpatterns/schema/qxsdschemaresolver.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaresolver.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschemaresolver_p.h b/src/xmlpatterns/schema/qxsdschemaresolver_p.h
index 3aee0d8..ef0154b 100644
--- a/src/xmlpatterns/schema/qxsdschemaresolver_p.h
+++ b/src/xmlpatterns/schema/qxsdschemaresolver_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschematoken.cpp b/src/xmlpatterns/schema/qxsdschematoken.cpp
index 0e98d46..a04f8ae 100644
--- a/src/xmlpatterns/schema/qxsdschematoken.cpp
+++ b/src/xmlpatterns/schema/qxsdschematoken.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschematoken_p.h b/src/xmlpatterns/schema/qxsdschematoken_p.h
index c20f9fe..fbf71f0 100644
--- a/src/xmlpatterns/schema/qxsdschematoken_p.h
+++ b/src/xmlpatterns/schema/qxsdschematoken_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschematypesfactory.cpp b/src/xmlpatterns/schema/qxsdschematypesfactory.cpp
index b9d3037..b5f319b 100644
--- a/src/xmlpatterns/schema/qxsdschematypesfactory.cpp
+++ b/src/xmlpatterns/schema/qxsdschematypesfactory.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdschematypesfactory_p.h b/src/xmlpatterns/schema/qxsdschematypesfactory_p.h
index 21ee31e..74ecc3c 100644
--- a/src/xmlpatterns/schema/qxsdschematypesfactory_p.h
+++ b/src/xmlpatterns/schema/qxsdschematypesfactory_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdsimpletype.cpp b/src/xmlpatterns/schema/qxsdsimpletype.cpp
index 699c056..6fd5658 100644
--- a/src/xmlpatterns/schema/qxsdsimpletype.cpp
+++ b/src/xmlpatterns/schema/qxsdsimpletype.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdsimpletype_p.h b/src/xmlpatterns/schema/qxsdsimpletype_p.h
index e6f9b87..6305fc7 100644
--- a/src/xmlpatterns/schema/qxsdsimpletype_p.h
+++ b/src/xmlpatterns/schema/qxsdsimpletype_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdstatemachine.cpp b/src/xmlpatterns/schema/qxsdstatemachine.cpp
index 08dfda9..85bc752 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine.cpp
+++ b/src/xmlpatterns/schema/qxsdstatemachine.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_p.h b/src/xmlpatterns/schema/qxsdstatemachine_p.h
index 8cb08e9..e671499 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp b/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp
index 54ee06e..fed8a41 100644
--- a/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp
+++ b/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdstatemachinebuilder_p.h b/src/xmlpatterns/schema/qxsdstatemachinebuilder_p.h
index 31e5c2f..c17ca9b 100644
--- a/src/xmlpatterns/schema/qxsdstatemachinebuilder_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachinebuilder_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdterm.cpp b/src/xmlpatterns/schema/qxsdterm.cpp
index 691d304..19af613 100644
--- a/src/xmlpatterns/schema/qxsdterm.cpp
+++ b/src/xmlpatterns/schema/qxsdterm.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdterm_p.h b/src/xmlpatterns/schema/qxsdterm_p.h
index ec63615..6b3f66a 100644
--- a/src/xmlpatterns/schema/qxsdterm_p.h
+++ b/src/xmlpatterns/schema/qxsdterm_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdtypechecker.cpp b/src/xmlpatterns/schema/qxsdtypechecker.cpp
index 4eb10dc..4bb03f5 100644
--- a/src/xmlpatterns/schema/qxsdtypechecker.cpp
+++ b/src/xmlpatterns/schema/qxsdtypechecker.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdtypechecker_p.h b/src/xmlpatterns/schema/qxsdtypechecker_p.h
index bb2df6d..ae90bdc 100644
--- a/src/xmlpatterns/schema/qxsdtypechecker_p.h
+++ b/src/xmlpatterns/schema/qxsdtypechecker_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsduserschematype.cpp b/src/xmlpatterns/schema/qxsduserschematype.cpp
index 1b48610..95892e1 100644
--- a/src/xmlpatterns/schema/qxsduserschematype.cpp
+++ b/src/xmlpatterns/schema/qxsduserschematype.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsduserschematype_p.h b/src/xmlpatterns/schema/qxsduserschematype_p.h
index 92e672e..72162d5 100644
--- a/src/xmlpatterns/schema/qxsduserschematype_p.h
+++ b/src/xmlpatterns/schema/qxsduserschematype_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel.cpp b/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel.cpp
index 8672338..3cbb6c1 100644
--- a/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel.cpp
+++ b/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel_p.h b/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel_p.h
index 62ecba6..c502835 100644
--- a/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel_p.h
+++ b/src/xmlpatterns/schema/qxsdvalidatedxmlnodemodel_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp
index 7552c41..fda3548 100644
--- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp
+++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader_p.h b/src/xmlpatterns/schema/qxsdvalidatinginstancereader_p.h
index 7a1754e..4dc736a 100644
--- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader_p.h
+++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdwildcard.cpp b/src/xmlpatterns/schema/qxsdwildcard.cpp
index 55ada50..abf490e 100644
--- a/src/xmlpatterns/schema/qxsdwildcard.cpp
+++ b/src/xmlpatterns/schema/qxsdwildcard.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdwildcard_p.h b/src/xmlpatterns/schema/qxsdwildcard_p.h
index be1716b..8940f13 100644
--- a/src/xmlpatterns/schema/qxsdwildcard_p.h
+++ b/src/xmlpatterns/schema/qxsdwildcard_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdxpathexpression.cpp b/src/xmlpatterns/schema/qxsdxpathexpression.cpp
index 2ac0a39..d5b4f1a 100644
--- a/src/xmlpatterns/schema/qxsdxpathexpression.cpp
+++ b/src/xmlpatterns/schema/qxsdxpathexpression.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/qxsdxpathexpression_p.h b/src/xmlpatterns/schema/qxsdxpathexpression_p.h
index 24891c3..8685da5 100644
--- a/src/xmlpatterns/schema/qxsdxpathexpression_p.h
+++ b/src/xmlpatterns/schema/qxsdxpathexpression_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/schema/tokens.xml b/src/xmlpatterns/schema/tokens.xml
index df37e4a..b3b8e18 100644
--- a/src/xmlpatterns/schema/tokens.xml
+++ b/src/xmlpatterns/schema/tokens.xml
@@ -113,7 +113,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/type/qnamedschemacomponent.cpp b/src/xmlpatterns/type/qnamedschemacomponent.cpp
index b0d832a..0edd593 100644
--- a/src/xmlpatterns/type/qnamedschemacomponent.cpp
+++ b/src/xmlpatterns/type/qnamedschemacomponent.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/src/xmlpatterns/type/qnamedschemacomponent_p.h b/src/xmlpatterns/type/qnamedschemacomponent_p.h
index ca3c775..2c8c6ce 100644
--- a/src/xmlpatterns/type/qnamedschemacomponent_p.h
+++ b/src/xmlpatterns/type/qnamedschemacomponent_p.h
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
+** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 9321e19..f3ecdae 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -203,6 +203,7 @@ SUBDIRS += \
qmainwindow \
qmake \
qmap \
+ qmath \
qmatrixnxn \
qmdiarea \
qmdisubwindow \
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index be2d882..4e385d5 100644
--- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
@@ -184,6 +184,10 @@ public:
virtual ~tst_QAbstractItemView();
void basic_tests(TestView *view);
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
private slots:
void getSetCheck();
void emptyModels_data();
@@ -320,6 +324,17 @@ tst_QAbstractItemView::~tst_QAbstractItemView()
{
}
+void tst_QAbstractItemView::initTestCase()
+{
+#ifdef Q_OS_WINCE_WM
+ qApp->setAutoMaximizeThreshold(-1);
+#endif
+}
+
+void tst_QAbstractItemView::cleanupTestCase()
+{
+}
+
void tst_QAbstractItemView::emptyModels_data()
{
QTest::addColumn<QString>("viewType");
@@ -1198,13 +1213,10 @@ void tst_QAbstractItemView::task250754_fontChange()
QFont font = tree.font();
font.setPointSize(5);
tree.setFont(font);
- QTest::qWait(30);
-
QTRY_VERIFY(!tree.verticalScrollBar()->isVisible());
font.setPointSize(45);
tree.setFont(font);
- QTest::qWait(30);
//now with the huge items, the scrollbar must be visible
QTRY_VERIFY(tree.verticalScrollBar()->isVisible());
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index 69c4c92..9f2e4e7 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -2846,11 +2846,11 @@ void tst_QAccessibility::mdiSubWindowTest()
{
QMdiArea mdiArea;
mdiArea.show();
+ qApp->setActiveWindow(&mdiArea);
#if defined(Q_WS_X11)
qt_x11_wait_for_window_manager(&mdiArea);
- QTest::qWait(100);
+ QTest::qWait(150);
#endif
- qApp->setActiveWindow(&mdiArea);
bool isSubWindowsPlacedNextToEachOther = false;
const int subWindowCount = 5;
diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro
index ce1281f..674064f 100644
--- a/tests/auto/qcssparser/qcssparser.pro
+++ b/tests/auto/qcssparser/qcssparser.pro
@@ -3,7 +3,6 @@ SOURCES += tst_qcssparser.cpp
QT += xml
requires(contains(QT_CONFIG,private_tests))
-
!symbian: {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
@@ -11,5 +10,8 @@ requires(contains(QT_CONFIG,private_tests))
wince*|symbian: {
addFiles.sources = testdata
addFiles.path = .
- DEPLOYMENT += addFiles
+ timesFont.sources = C:/Windows/Fonts/times.ttf
+ timesFont.path = .
+ DEPLOYMENT += addFiles timesFont
}
+
diff --git a/tests/auto/qcssparser/tst_qcssparser.cpp b/tests/auto/qcssparser/tst_qcssparser.cpp
index c7f50d4..150f131 100644
--- a/tests/auto/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/qcssparser/tst_qcssparser.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include <QtTest/QtTest>
#include <QtXml/QtXml>
+#if defined(Q_OS_WINCE)
+#include <QtGui/QFontDatabase>
+#endif
//TESTED_CLASS=QCss
//TESTED_FILES=gui/text/qcssparser.cpp gui/text/qcssparser_p.h
@@ -49,6 +52,11 @@
class tst_QCssParser : public QObject
{
Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
private slots:
void scanner_data();
void scanner();
@@ -91,8 +99,33 @@ private slots:
void extractBorder();
void noTextDecoration();
void quotedAndUnquotedIdentifiers();
+
+private:
+#if defined(Q_OS_WINCE)
+ int m_timesFontId;
+#endif
};
+void tst_QCssParser::initTestCase()
+{
+#if defined(Q_OS_WINCE)
+ QFontDatabase fontDB;
+ m_timesFontId = -1;
+ if (!fontDB.families().contains("Times New Roman")) {
+ m_timesFontId = QFontDatabase::addApplicationFont("times.ttf");
+ QVERIFY(m_timesFontId != -1);
+ }
+#endif
+}
+
+void tst_QCssParser::cleanupTestCase()
+{
+#if defined(Q_OS_WINCE)
+ if (m_timesFontId != -1)
+ QFontDatabase::removeApplicationFont(m_timesFontId);
+#endif
+}
+
void tst_QCssParser::scanner_data()
{
QTest::addColumn<QString>("input");
diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp
index dc6878d..e95bc53 100644
--- a/tests/auto/qdialog/tst_qdialog.cpp
+++ b/tests/auto/qdialog/tst_qdialog.cpp
@@ -50,6 +50,8 @@
#include <QVBoxLayout>
#include <QSizeGrip>
+#include "../../shared/util.h"
+
Q_DECLARE_METATYPE(QSize)
@@ -160,8 +162,8 @@ void tst_QDialog::initTestCase()
void tst_QDialog::cleanupTestCase()
{
if (testWidget) {
- delete testWidget;
- testWidget = 0;
+ delete testWidget;
+ testWidget = 0;
}
}
@@ -585,35 +587,27 @@ void tst_QDialog::reject()
TestRejectDialog dialog;
dialog.show();
QTest::qWaitForWindowShown(&dialog);
- QTest::qWait(100);
- QVERIFY(dialog.isVisible());
+ QTRY_VERIFY(dialog.isVisible());
dialog.reject();
- QTest::qWait(100);
- QVERIFY(!dialog.isVisible());
+ QTRY_VERIFY(!dialog.isVisible());
QCOMPARE(dialog.called, 1);
dialog.show();
QTest::qWaitForWindowShown(&dialog);
- QTest::qWait(100);
-
- QVERIFY(dialog.isVisible());
+ QTRY_VERIFY(dialog.isVisible());
QVERIFY(dialog.close());
- QTest::qWait(100);
- QVERIFY(!dialog.isVisible());
+ QTRY_VERIFY(!dialog.isVisible());
QCOMPARE(dialog.called, 2);
dialog.cancelReject = true;
dialog.show();
QTest::qWaitForWindowShown(&dialog);
- QTest::qWait(100);
- QVERIFY(dialog.isVisible());
+ QTRY_VERIFY(dialog.isVisible());
dialog.reject();
- QTest::qWait(100);
- QVERIFY(dialog.isVisible());
+ QTRY_VERIFY(dialog.isVisible());
QCOMPARE(dialog.called, 3);
QVERIFY(!dialog.close());
- QTest::qWait(100);
- QVERIFY(dialog.isVisible());
+ QTRY_VERIFY(dialog.isVisible());
QCOMPARE(dialog.called, 4);
}
diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 2cc2558..29e4fe6 100644
--- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -795,6 +795,8 @@ void tst_QFileSystemModel::sort()
model->sort(0, Qt::DescendingOrder);
QVERIFY(idx.column() != 0);
+ model->setRootPath(QDir::homePath());
+
QFETCH(bool, fileDialogMode);
MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel();
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index f15b249..e036e4b 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -1754,6 +1754,29 @@ void tst_QGL::destroyFBOAfterContext()
delete fbo;
}
+#ifdef QT_BUILD_INTERNAL
+
+class tst_QGLResource : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QGLResource(QObject *parent = 0) : QObject(parent) {}
+ ~tst_QGLResource() { ++deletions; }
+
+ static int deletions;
+};
+
+int tst_QGLResource::deletions = 0;
+
+static void qt_shared_test_free(void *data)
+{
+ delete reinterpret_cast<tst_QGLResource *>(data);
+}
+
+Q_GLOBAL_STATIC_WITH_ARGS(QGLContextResource, qt_shared_test, (qt_shared_test_free))
+
+#endif
+
void tst_QGL::shareRegister()
{
#ifdef QT_BUILD_INTERNAL
@@ -1775,6 +1798,12 @@ void tst_QGL::shareRegister()
guard.setId(3);
QVERIFY(guard.id() == 3);
+ // Add a resource to the first context.
+ tst_QGLResource *res1 = new tst_QGLResource();
+ QVERIFY(!qt_shared_test()->value(glw1->context()));
+ qt_shared_test()->insert(glw1->context(), res1);
+ QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
+
// Create another context that shares with the first.
QGLWidget *glw2 = new QGLWidget(0, glw1);
if (!glw2->isSharing()) {
@@ -1784,6 +1813,10 @@ void tst_QGL::shareRegister()
}
QVERIFY(glw1->context() != glw2->context());
+ // Check that the first context's resource is also on the second.
+ QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
+ QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
+
// Guard should still be the same.
QVERIFY(guard.context() == glw1->context());
QVERIFY(guard.id() == 3);
@@ -1814,6 +1847,14 @@ void tst_QGL::shareRegister()
QGLSharedResourceGuard guard3(glw3->context());
guard3.setId(5);
+ // Add a resource to the third context.
+ tst_QGLResource *res3 = new tst_QGLResource();
+ QVERIFY(!qt_shared_test()->value(glw3->context()));
+ qt_shared_test()->insert(glw3->context(), res3);
+ QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
+ QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
+ QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+
// First two should still be sharing, but third is in its own list.
list = shareReg->shares(glw1->context());
QCOMPARE(list.size(), 2);
@@ -1849,6 +1890,11 @@ void tst_QGL::shareRegister()
// Delete the first context.
delete glw1;
+ // The first context's resource should transfer to the second context.
+ QCOMPARE(tst_QGLResource::deletions, 0);
+ QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
+ QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+
// Shared guard should now be the second context, with the id the same.
QVERIFY(guard.context() == glw2->context());
QVERIFY(guard.id() == 3);
@@ -1859,9 +1905,11 @@ void tst_QGL::shareRegister()
list = shareReg->shares(glw2->context());
QCOMPARE(list.size(), 0);
- // Clean up.
+ // Clean up and check that the resources are properly deleted.
delete glw2;
+ QCOMPARE(tst_QGLResource::deletions, 1);
delete glw3;
+ QCOMPARE(tst_QGLResource::deletions, 2);
// Guards should now be null and the id zero.
QVERIFY(guard.context() == 0);
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 9545198..e4eaf4e 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -6444,14 +6444,12 @@ void tst_QGraphicsItem::nestedClipping()
QGraphicsView view(&scene);
view.setOptimizationFlag(QGraphicsView::IndirectPainting);
view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
- QTest::qWait(250);
+ QTest::qWaitForWindowShown(&view);
+ QTest::qWait(25);
QList<QGraphicsItem *> expected;
expected << root << l1 << l2 << l3;
- QCOMPARE(scene.drawnItems, expected);
+ QTRY_COMPARE(scene.drawnItems, expected);
QImage image(200, 200, QImage::Format_ARGB32_Premultiplied);
image.fill(0);
@@ -7303,16 +7301,17 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption()
rect->startTrack = false;
view.show();
QTest::qWaitForWindowShown(&view);
+ QTest::qWait(60);
rect->startTrack = true;
rect->update(10, 10, 10, 10);
- QTest::qWait(12);
+ QTest::qWait(60);
rect->startTrack = false;
rect->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
QVERIFY((rect->flags() & QGraphicsItem::ItemUsesExtendedStyleOption));
- QTest::qWait(12);
+ QTest::qWait(60);
rect->startTrack = true;
rect->update(10, 10, 10, 10);
- QTest::qWait(12);
+ QTest::qWait(60);
}
void tst_QGraphicsItem::itemSendsGeometryChanges()
@@ -7631,7 +7630,7 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem()
QVERIFY(items.isEmpty());
items = scene.items(QPointF(80, 80));
QCOMPARE(items.size(), 1);
- QCOMPARE(items.at(0), static_cast<EventTester *>(item3));
+ QCOMPARE(items.at(0), static_cast<QGraphicsItem *>(item3));
item1->repaints = 0;
item2->repaints = 0;
@@ -7654,7 +7653,7 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem()
QVERIFY(items.isEmpty());
items = scene.items(QPointF(80, 80));
QCOMPARE(items.size(), 1);
- QCOMPARE(items.at(0), static_cast<EventTester *>(item3));
+ QCOMPARE(items.at(0), static_cast<QGraphicsItem *>(item3));
}
void tst_QGraphicsItem::focusProxy()
@@ -8384,7 +8383,7 @@ void tst_QGraphicsItem::ensureDirtySceneTransform()
QGraphicsView view(&scene);
view.show();
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
//We move the parent
parent->move();
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 4e46819..4f28df4 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1370,6 +1370,8 @@ void tst_QGraphicsLinearLayout::layoutDirection()
QGraphicsWidget *window = new QGraphicsWidget(0, Qt::Window);
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
layout->setContentsMargins(1, 2, 3, 4);
+ layout->setSpacing(6);
+
RectWidget *w1 = new RectWidget;
w1->setPreferredSize(20, 20);
w1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index e55dc9aa..8459331 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1705,7 +1705,7 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
view.scale(1.7, 1.7);
view.show();
QTest::qWaitForWindowShown(&view);
- QTest::qWait(50);
+ QTest::qWait(70);
QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove);
mouseEvent.setScenePos(QPointF(-1000, -1000));
@@ -1726,7 +1726,7 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
qApp->processEvents(); // this posts updates from the scene to the view
qApp->processEvents(); // which trigger a repaint here
- QVERIFY(items.at(i)->isHovered);
+ QTRY_VERIFY(items.at(i)->isHovered);
if (i < 14)
QVERIFY(!items.at(i + 1)->isHovered);
i += j ? 1 : -1;
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 78fb4f3..df3ebef 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -2932,18 +2932,16 @@ void tst_QGraphicsView::task239729_noViewUpdate()
view = new QGraphicsView(&scene);
}
- view->show();
- QTest::qWaitForWindowShown(view);
- QTest::qWait(150);
-
EventSpy spy(view->viewport(), QEvent::Paint);
QCOMPARE(spy.count(), 0);
- QTest::qWait(100);
- QCOMPARE(spy.count(), 0);
+ view->show();
+ QTest::qWaitForWindowShown(view);
+
+ QTRY_COMPARE(spy.count(), 1);
scene.update();
QApplication::processEvents();
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 2);
delete view;
}
@@ -2979,6 +2977,7 @@ void tst_QGraphicsView::task245469_itemsAtPointWithClip()
parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
QGraphicsView view(&scene);
+ view.resize(150,150);
view.rotate(90);
view.show();
QTest::qWaitForWindowShown(&view);
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 0b73733..26021e0 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -157,6 +157,7 @@ private slots:
void shortcutsDeletion();
void painterStateProtectionOnWindowFrame();
void ensureClipping();
+ void widgetSendsGeometryChanges();
void respectHFW();
// Task fixes
@@ -2562,6 +2563,76 @@ void tst_QGraphicsWidget::ensureClipping()
QVERIFY(scene.drawnItems.contains(childitem));
}
+class ItemChangeTester : public QGraphicsWidget
+{
+public:
+ ItemChangeTester()
+ { setFlag(ItemSendsGeometryChanges); clear(); }
+ ItemChangeTester(QGraphicsItem *parent) : QGraphicsWidget(parent)
+ { setFlag(ItemSendsGeometryChanges); clear(); }
+
+ void clear()
+ {
+ changes.clear();
+ values.clear();
+ oldValues.clear();
+ }
+ QList<GraphicsItemChange> changes;
+ QList<QVariant> values;
+ QList<QVariant> oldValues;
+protected:
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value)
+ {
+ changes << change;
+ values << value;
+ switch (change) {
+ case QGraphicsItem::ItemPositionChange:
+ oldValues << pos();
+ break;
+ case QGraphicsItem::ItemPositionHasChanged:
+ break;
+ default:
+ break;
+ }
+ return value;
+ }
+};
+
+void tst_QGraphicsWidget::widgetSendsGeometryChanges()
+{
+ ItemChangeTester widget;
+ widget.setFlags(0);
+ widget.clear();
+
+ QPointF pos(10, 10);
+ widget.setPos(pos);
+
+ QCOMPARE(widget.pos(), pos);
+ QCOMPARE(widget.changes.size(), 0);
+
+ widget.setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+ QCOMPARE(widget.changes.size(), 2);
+
+ widget.setPos(QPointF());
+ QCOMPARE(widget.changes.size(), 4);
+
+ QCOMPARE(widget.pos(), QPointF());
+
+ QRectF geometry(20, 20, 50, 50);
+ widget.setGeometry(geometry);
+ QCOMPARE(widget.changes.size(), 6);
+
+ QCOMPARE(widget.geometry(), geometry);
+
+ QCOMPARE(widget.changes, QList<QGraphicsItem::GraphicsItemChange>()
+ << QGraphicsItem::ItemFlagsChange
+ << QGraphicsItem::ItemFlagsHaveChanged
+ << QGraphicsItem::ItemPositionChange
+ << QGraphicsItem::ItemPositionHasChanged
+ << QGraphicsItem::ItemPositionChange
+ << QGraphicsItem::ItemPositionHasChanged);
+}
+
class HFWWidget : public QGraphicsWidget
{
public:
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index 6036a14..7aab6de 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -899,9 +899,21 @@ void tst_QHttpNetworkConnection::getMultipleWithPipeliningAndMultiplePriorities(
} while (finishedCount != replies.length());
- // redundant
- for (int i = 0; i < replies.length(); i++)
+ int pipelinedCount = 0;
+ for (int i = 0; i < replies.length(); i++) {
QVERIFY(replies.at(i)->isFinished());
+ QVERIFY (!(replies.at(i)->request().isPipeliningAllowed() == false
+ && replies.at(i)->isPipeliningUsed()));
+
+ if (replies.at(i)->isPipeliningUsed())
+ pipelinedCount++;
+ }
+
+ // We allow pipelining for every 2nd,3rd,4th,6th,8th,9th,10th etc request.
+ // Assume that half of the requests had been pipelined.
+ // (this is a very relaxed condition, when last measured 79 of 100
+ // requests had been pipelined)
+ QVERIFY(pipelinedCount >= requestCount / 2);
qDebug() << "===" << stopWatch.elapsed() << "msec ===";
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 1417e69..8368114 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -3493,6 +3493,7 @@ void tst_QLineEdit::task241436_passwordEchoOnEditRestoreEchoMode()
testWidget->setEchoMode(QLineEdit::PasswordEchoOnEdit);
testWidget->setFocus();
+ QApplication::setActiveWindow(testWidget);
QTRY_VERIFY(testWidget->hasFocus());
QTest::keyPress(testWidget, '0');
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index d9cab02..7599ce6a06 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -1617,6 +1617,8 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
list.setModel(&model);
list.setViewMode(QListView::IconMode);
list.show();
+ QTest::qWaitForWindowShown(&list);
+
class MyItemDelegate : public QStyledItemDelegate
{
public:
@@ -1630,11 +1632,10 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
mutable int numPaints;
} delegate;
- list.setItemDelegate(&delegate);
-
delegate.numPaints = 0;
- QTest::qWaitForWindowShown(&list); //makes sure the layout is done
- QTRY_VERIFY(delegate.numPaints > 0);
+ list.setItemDelegate(&delegate);
+ QApplication::processEvents();
+ QTRY_VERIFY(delegate.numPaints > 0); //makes sure the layout is done
const QPoint topLeft(-6, 0);
list.setPositionForIndex(topLeft, index);
diff --git a/tests/auto/qmath/qmath.pro b/tests/auto/qmath/qmath.pro
new file mode 100644
index 0000000..03134ee
--- /dev/null
+++ b/tests/auto/qmath/qmath.pro
@@ -0,0 +1,6 @@
+load(qttest_p4)
+
+QT = core
+
+SOURCES += tst_qmath.cpp
+QT = core
diff --git a/tests/auto/qmath/tst_qmath.cpp b/tests/auto/qmath/tst_qmath.cpp
new file mode 100644
index 0000000..efc7cfa
--- /dev/null
+++ b/tests/auto/qmath/tst_qmath.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** 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 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 <qmath.h>
+
+static const qreal PI = 3.14159265358979323846264338327950288;
+
+class tst_QMath : public QObject
+{
+ Q_OBJECT
+private slots:
+ void fastSinCos();
+};
+
+void tst_QMath::fastSinCos()
+{
+ // Test evenly spaced angles from 0 to 2pi radians.
+ const int LOOP_COUNT = 100000;
+ for (int i = 0; i < LOOP_COUNT; ++i) {
+ qreal angle = i * 2 * PI / (LOOP_COUNT - 1);
+ QVERIFY(qAbs(qSin(angle) - qFastSin(angle)) < 1e-5);
+ QVERIFY(qAbs(qCos(angle) - qFastCos(angle)) < 1e-5);
+ }
+}
+
+QTEST_APPLESS_MAIN(tst_QMath)
+
+#include "tst_qmath.moc"
diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp
index 725c31e..068d1fa 100644
--- a/tests/auto/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp
@@ -1759,7 +1759,7 @@ void tst_QMdiArea::tileSubWindows()
// Horizontal scroll bar.
QScrollBar *hBar = workspace.horizontalScrollBar();
QCOMPARE(workspace.horizontalScrollBarPolicy(), Qt::ScrollBarAsNeeded);
- QVERIFY(hBar->isVisible());
+ QTRY_VERIFY(hBar->isVisible());
QCOMPARE(hBar->value(), 0);
QCOMPARE(hBar->minimum(), 0);
@@ -1776,9 +1776,9 @@ void tst_QMdiArea::tileSubWindows()
#endif
qApp->processEvents();
- QVERIFY(workspace.size() != QSize(150, 150));
- QVERIFY(!vBar->isVisible());
- QVERIFY(!hBar->isVisible());
+ QTRY_VERIFY(workspace.size() != QSize(150, 150));
+ QTRY_VERIFY(!vBar->isVisible());
+ QTRY_VERIFY(!hBar->isVisible());
}
void tst_QMdiArea::cascadeAndTileSubWindows()
@@ -1853,6 +1853,7 @@ void tst_QMdiArea::resizeMaximizedChildWindows()
#if defined(Q_WS_X11)
qt_x11_wait_for_window_manager(&workspace);
#endif
+ QTest::qWait(100);
workspace.resize(startSize, startSize);
workspace.setOption(QMdiArea::DontMaximizeSubWindowOnActivation);
QSize workspaceSize = workspace.size();
@@ -1865,6 +1866,7 @@ void tst_QMdiArea::resizeMaximizedChildWindows()
windows.append(window);
qApp->processEvents();
window->showMaximized();
+ QTest::qWait(100);
QVERIFY(window->isMaximized());
QSize windowSize = window->size();
QVERIFY(windowSize.isValid());
@@ -1874,7 +1876,7 @@ void tst_QMdiArea::resizeMaximizedChildWindows()
QTest::qWait(100);
qApp->processEvents();
QTRY_COMPARE(workspace.size(), workspaceSize + QSize(increment, increment));
- QCOMPARE(window->size(), windowSize + QSize(increment, increment));
+ QTRY_COMPARE(window->size(), windowSize + QSize(increment, increment));
workspaceSize = workspace.size();
}
diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
index 2d70bef..b556b87 100644
--- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -1003,9 +1003,9 @@ void tst_QMdiSubWindow::setSystemMenu()
mainWindow.setCentralWidget(mdiArea);
mainWindow.menuBar();
mainWindow.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&mainWindow);
-#endif
+ QTest::qWaitForWindowShown(&mainWindow);
+ QTest::qWait(60);
+
QTRY_VERIFY(subWindow->isVisible());
QPoint globalPopupPos;
@@ -1650,7 +1650,7 @@ void tst_QMdiSubWindow::resizeTimer()
QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
mdiArea.show();
QTest::qWaitForWindowShown(&mdiArea);
- QTest::qWait(250);
+ QTest::qWait(300);
EventSpy timerEventSpy(subWindow, QEvent::Timer);
@@ -1663,7 +1663,7 @@ void tst_QMdiSubWindow::resizeTimer()
QTest::qWait(500); // Wait for timer events to occur.
- QVERIFY(timerEventSpy.count() > 0);
+ QTRY_VERIFY(timerEventSpy.count() > 0);
}
void tst_QMdiSubWindow::fixedMinMaxSize()
diff --git a/tests/auto/qnetworkreply/certs/server.key b/tests/auto/qnetworkreply/certs/server.key
new file mode 100644
index 0000000..9d1664d
--- /dev/null
+++ b/tests/auto/qnetworkreply/certs/server.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCnyKBKxBkFG2a6MuLS8RxvF4LkOS4BUZDbBDQyESHCDW9Z2FOQ
+VD+Dj6nTs9XuGpuArsMlyV6lr0tgBaqg0ZEBH8oEg+NYHJkyRYRwclgDmEpji0H1
+CEnSkQJga+Rk/t2gqnQI6TRMkV8SPTdNVCytf1uYYDYCjDv2RfMnapuUnQIDAQAB
+AoGANFzLkanTeSGNFM0uttBipFT9F4a00dqHz6JnO7zXAT26I5r8sU1pqQBb6uLz
+/+Qz5Zwk8RUAQcsMRgJetuPQUb0JZjF6Duv24hNazqXBCu7AZzUenjafwmKC/8ri
+KpX3fTwqzfzi//FKGgbXQ80yykSSliDL3kn/drATxsLCgQECQQDXhEFWLJ0vVZ1s
+1Ekf+3NITE+DR16X+LQ4W6vyEHAjTbaNWtcTKdAWLA2l6N4WAAPYSi6awm+zMxx4
+VomVTsjdAkEAx0z+e7natLeFcrrq8pbU+wa6SAP1VfhQWKitxL1e7u/QO90NCpxE
+oQYKzMkmmpOOFjQwEMAy1dvFMbm4LHlewQJAC/ksDBaUcQHHqjktCtrUb8rVjAyW
+A8lscckeB2fEYyG5J6dJVaY4ClNOOs5yMDS2Afk1F6H/xKvtQ/5CzInA/QJATDub
+K+BPU8jO9q+gpuIi3VIZdupssVGmCgObVCHLakG4uO04y9IyPhV9lA9tALtoIf4c
+VIvv5fWGXBrZ48kZAQJBAJmVCdzQxd9LZI5vxijUCj5EI4e+x5DRqVUvyP8KCZrC
+AiNyoDP85T+hBZaSXK3aYGpVwelyj3bvo1GrTNwNWLw=
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/qnetworkreply/certs/server.pem b/tests/auto/qnetworkreply/certs/server.pem
new file mode 100644
index 0000000..67eb495
--- /dev/null
+++ b/tests/auto/qnetworkreply/certs/server.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEEzCCAvugAwIBAgIBADANBgkqhkiG9w0BAQUFADCBnDELMAkGA1UEBhMCTk8x
+DTALBgNVBAgTBE9zbG8xEDAOBgNVBAcTB055ZGFsZW4xFjAUBgNVBAoTDVRyb2xs
+dGVjaCBBU0ExFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5mbHVrZS50
+cm9sbC5ubzElMCMGCSqGSIb3DQEJARYWYWhhbnNzZW5AdHJvbGx0ZWNoLmNvbTAe
+Fw0wNzEyMDQwMTEwMzJaFw0zNTA0MjEwMTEwMzJaMGMxCzAJBgNVBAYTAk5PMQ0w
+CwYDVQQIEwRPc2xvMRYwFAYDVQQKEw1Ucm9sbHRlY2ggQVNBMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEXMBUGA1UEAxMOZmx1a2UudHJvbGwubm8wgZ8wDQYJKoZIhvcN
+AQEBBQADgY0AMIGJAoGBAKfIoErEGQUbZroy4tLxHG8XguQ5LgFRkNsENDIRIcIN
+b1nYU5BUP4OPqdOz1e4am4CuwyXJXqWvS2AFqqDRkQEfygSD41gcmTJFhHByWAOY
+SmOLQfUISdKRAmBr5GT+3aCqdAjpNEyRXxI9N01ULK1/W5hgNgKMO/ZF8ydqm5Sd
+AgMBAAGjggEaMIIBFjAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NM
+IEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUIYUEPSMBZuX3nxqEJIqv
+Cnn05awwgbsGA1UdIwSBszCBsKGBoqSBnzCBnDELMAkGA1UEBhMCTk8xDTALBgNV
+BAgTBE9zbG8xEDAOBgNVBAcTB055ZGFsZW4xFjAUBgNVBAoTDVRyb2xsdGVjaCBB
+U0ExFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5mbHVrZS50cm9sbC5u
+bzElMCMGCSqGSIb3DQEJARYWYWhhbnNzZW5AdHJvbGx0ZWNoLmNvbYIJAI6otOiR
+t1QuMA0GCSqGSIb3DQEBBQUAA4IBAQBtV1/RBUPwYgXsKnGl3BkI8sSmvbsl2cqJ
+AQ7kzx/BjMgkGDVTWXvAQ7Qy5piypu8VBQtIX+GgDJepoXfYNRgwvKmP07dUx/Gp
+nl3mGb/2PFsr2OQ+YhiIi9Mk4UCbDOYpFmKr6gUkcDaqVZPvAoEbIxCiBOtWlXX8
++JSxXULFPzZEhV06LpBGiqK5b4euDBVAGTGQ/Dslu67xZhMNhZDZSTSP8l35ettN
+XSf2dp01jAamTKOxsrZvHdejAP1y657qRKGvITR9x0LiSZEZi8CtuoKAqHFw9DUx
+kWOEIJXpYK9ki8z/PYp2dD3IVW3kjsMrHOhCGK6f5mucNAbsavLD
+-----END CERTIFICATE-----
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 578ab29..7adb67f 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -258,6 +258,7 @@ private Q_SLOTS:
void httpConnectionCount();
#ifndef QT_NO_OPENSSL
+ void ioPostToHttpsUploadProgress();
void ignoreSslErrorsList_data();
void ignoreSslErrorsList();
void ignoreSslErrorsListWithSlot_data();
@@ -3099,6 +3100,109 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
QCOMPARE(reply->error(), QNetworkReply::ContentReSendError);
}
+#ifndef QT_NO_OPENSSL
+class SslServer : public QTcpServer {
+ Q_OBJECT
+public:
+ SslServer() : socket(0) {};
+ void incomingConnection(int socketDescriptor) {
+ QSslSocket *serverSocket = new QSslSocket;
+ serverSocket->setParent(this);
+
+ if (serverSocket->setSocketDescriptor(socketDescriptor)) {
+ connect(serverSocket, SIGNAL(encrypted()), this, SLOT(encryptedSlot()));
+ serverSocket->setProtocol(QSsl::AnyProtocol);
+ connect(serverSocket, SIGNAL(sslErrors(const QList<QSslError>&)), serverSocket, SLOT(ignoreSslErrors()));
+ serverSocket->setLocalCertificate (SRCDIR "/certs/server.pem");
+ serverSocket->setPrivateKey (SRCDIR "/certs/server.key");
+ serverSocket->startServerEncryption();
+ } else {
+ delete serverSocket;
+ }
+ }
+signals:
+ void newEncryptedConnection();
+public slots:
+ void encryptedSlot() {
+ socket = (QSslSocket*) sender();
+ emit newEncryptedConnection();
+ }
+public:
+ QSslSocket *socket;
+};
+
+// very similar to ioPostToHttpUploadProgress but for SSL
+void tst_QNetworkReply::ioPostToHttpsUploadProgress()
+{
+ QFile sourceFile(SRCDIR "/bigfile");
+ QVERIFY(sourceFile.open(QIODevice::ReadOnly));
+
+ // emulate a minimal https server
+ SslServer server;
+ server.listen(QHostAddress(QHostAddress::LocalHost), 0);
+
+ // create the request
+ QUrl url = QUrl(QString("https://127.0.0.1:%1/").arg(server.serverPort()));
+ QNetworkRequest request(url);
+ QNetworkReplyPtr reply = manager.post(request, &sourceFile);
+ QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
+ connect(&server, SIGNAL(newEncryptedConnection()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ connect(reply, SIGNAL(sslErrors(const QList<QSslError>&)), reply, SLOT(ignoreSslErrors()));
+
+ // get the request started and the incoming socket connected
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QTcpSocket *incomingSocket = server.socket;
+ QVERIFY(incomingSocket);
+ disconnect(&server, SIGNAL(newEncryptedConnection()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+
+
+ incomingSocket->setReadBufferSize(1*1024);
+ QTestEventLoop::instance().enterLoop(2);
+ // some progress should have been made
+ QList<QVariant> args = spy.last();
+ qDebug() << "tst_QNetworkReply::ioPostToHttpsUploadProgress"
+ << args.at(0).toLongLong()
+ << sourceFile.size()
+ << spy.size();
+ QVERIFY(!args.isEmpty());
+ QVERIFY(args.at(0).toLongLong() > 0);
+ // FIXME this is where it messes up
+
+ QEXPECT_FAIL("", "Either the readBufferSize of QSslSocket is broken or we do upload too much. Hm.", Abort);
+ QVERIFY(args.at(0).toLongLong() != sourceFile.size());
+
+ incomingSocket->setReadBufferSize(32*1024);
+ incomingSocket->read(16*1024);
+ QTestEventLoop::instance().enterLoop(2);
+ // some more progress than before
+ QList<QVariant> args2 = spy.last();
+ QVERIFY(!args2.isEmpty());
+ QVERIFY(args2.at(0).toLongLong() > args.at(0).toLongLong());
+
+ // set the read buffer to unlimited
+ incomingSocket->setReadBufferSize(0);
+ QTestEventLoop::instance().enterLoop(10);
+ // progress should be finished
+ QList<QVariant> args3 = spy.last();
+ QVERIFY(!args3.isEmpty());
+ QVERIFY(args3.at(0).toLongLong() > args2.at(0).toLongLong());
+ QCOMPARE(args3.at(0).toLongLong(), args3.at(1).toLongLong());
+ QCOMPARE(args3.at(0).toLongLong(), sourceFile.size());
+
+ // after sending this, the QNAM should emit finished()
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ incomingSocket->write("HTTP/1.0 200 OK\r\n");
+ incomingSocket->write("Content-Length: 0\r\n");
+ incomingSocket->write("\r\n");
+ QTestEventLoop::instance().enterLoop(10);
+ // not timeouted -> finished() was emitted
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ incomingSocket->close();
+ server.close();
+}
+#endif
void tst_QNetworkReply::ioPostToHttpUploadProgress()
{
@@ -3889,10 +3993,14 @@ void tst_QNetworkReply::httpConnectionCount()
QTime time;
time.start();
- while(pendingConnectionCount != 6) {
- QCoreApplication::instance()->processEvents();
- while (server.nextPendingConnection())
+ while(pendingConnectionCount <= 20) {
+ QTestEventLoop::instance().enterLoop(1);
+ QTcpSocket *socket = server.nextPendingConnection();
+ while (socket != 0) {
pendingConnectionCount++;
+ socket->setParent(&server);
+ socket = server.nextPendingConnection();
+ }
// at max. wait 10 sec
if (time.elapsed() > 10000)
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index acd23b0..8578d36 100644
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -62,6 +62,7 @@ public Q_SLOTS:
private slots:
void construction();
void setCurrentTime();
+ void stateChanged();
void clearGroup();
void propagateGroupUpdateToChildren();
void updateChildrenWithRunningGroup();
@@ -252,6 +253,112 @@ void tst_QParallelAnimationGroup::setCurrentTime()
QCOMPARE(loopsForever->currentTime(), 1);
}
+void tst_QParallelAnimationGroup::stateChanged()
+{
+ //this ensures that the correct animations are started when starting the group
+ TestAnimation *anim1 = new TestAnimation;
+ TestAnimation *anim2 = new TestAnimation;
+ TestAnimation *anim3 = new TestAnimation;
+ TestAnimation *anim4 = new TestAnimation;
+ anim1->setDuration(1000);
+ anim2->setDuration(2000);
+ anim3->setDuration(3000);
+ anim4->setDuration(3000);
+ QParallelAnimationGroup group;
+ group.addAnimation(anim1);
+ group.addAnimation(anim2);
+ group.addAnimation(anim3);
+ group.addAnimation(anim4);
+
+ QSignalSpy spy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy3(anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy spy4(anim4, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+
+ //first; let's start forward
+ group.start();
+ //all the animations should be started
+ QCOMPARE(spy1.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy1.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy2.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy3.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy3.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy4.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy4.last().at(1)), TestAnimation::Running);
+
+ group.setCurrentTime(1500); //anim1 should be finished
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(spy1.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy1.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy2.count(), 1); //no change
+ QCOMPARE(spy3.count(), 1); //no change
+ QCOMPARE(spy4.count(), 1); //no change
+
+ group.setCurrentTime(2500); //anim2 should be finished
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(spy1.count(), 2); //no change
+ QCOMPARE(spy2.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy2.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy3.count(), 1); //no change
+ QCOMPARE(spy4.count(), 1); //no change
+
+ group.setCurrentTime(3500); //everything should be finished
+ QCOMPARE(group.state(), QAnimationGroup::Stopped);
+ QCOMPARE(spy1.count(), 2); //no change
+ QCOMPARE(spy2.count(), 2); //no change
+ QCOMPARE(spy3.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy3.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy4.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy4.last().at(1)), TestAnimation::Stopped);
+
+ //cleanup
+ spy1.clear();
+ spy2.clear();
+ spy3.clear();
+ spy4.clear();
+
+ //now let's try to reverse that
+ group.setDirection(QAbstractAnimation::Backward);
+ group.start();
+
+ //only anim3 and anim4 should be started
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(spy1.count(), 0);
+ QCOMPARE(spy2.count(), 0);
+ QCOMPARE(spy3.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy3.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy4.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy4.last().at(1)), TestAnimation::Running);
+
+ group.setCurrentTime(1500); //anim2 should be started
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(spy1.count(), 0); //no change
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy2.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy3.count(), 1); //no change
+ QCOMPARE(spy4.count(), 1); //no change
+
+ group.setCurrentTime(500); //anim1 is finally also started
+ QCOMPARE(group.state(), QAnimationGroup::Running);
+ QCOMPARE(spy1.count(), 1);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy1.last().at(1)), TestAnimation::Running);
+ QCOMPARE(spy2.count(), 1); //no change
+ QCOMPARE(spy3.count(), 1); //no change
+ QCOMPARE(spy4.count(), 1); //no change
+
+ group.setCurrentTime(0); //everything should be stopped
+ QCOMPARE(group.state(), QAnimationGroup::Stopped);
+ QCOMPARE(spy1.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy1.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy2.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy2.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy3.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy3.last().at(1)), TestAnimation::Stopped);
+ QCOMPARE(spy4.count(), 2);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy4.last().at(1)), TestAnimation::Stopped);
+}
+
void tst_QParallelAnimationGroup::clearGroup()
{
QParallelAnimationGroup group;
@@ -398,7 +505,7 @@ void tst_QParallelAnimationGroup::deleteChildrenWithRunningGroup()
QCOMPARE(group.state(), QAnimationGroup::Running);
QCOMPARE(anim1->state(), QAnimationGroup::Running);
- QTest::qWait(50);
+ QTest::qWait(80);
QVERIFY(group.currentTime() > 0);
delete anim1;
@@ -564,14 +671,23 @@ void tst_QParallelAnimationGroup::zeroDurationAnimation()
anim2.setEndValue(100);
anim2.setDuration(100);
+ TestAnimation anim3;
+ anim3.setStartValue(0);
+ anim3.setEndValue(100);
+ anim3.setDuration(10);
+
QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy1(&anim1, SIGNAL(finished()));
QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy2(&anim2, SIGNAL(finished()));
+ QSignalSpy stateChangedSpy3(&anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy finishedSpy3(&anim3, SIGNAL(finished()));
+
group.addAnimation(&anim1);
group.addAnimation(&anim2);
+ group.addAnimation(&anim3);
QCOMPARE(stateChangedSpy1.count(), 0);
group.start();
QCOMPARE(stateChangedSpy1.count(), 2);
@@ -586,9 +702,15 @@ void tst_QParallelAnimationGroup::zeroDurationAnimation()
QCOMPARE(qVariantValue<QAbstractAnimation::State>(stateChangedSpy1.at(0).at(1)),
QAnimationGroup::Running);
+ QCOMPARE(stateChangedSpy3.count(), 1);
+ QCOMPARE(finishedSpy3.count(), 0);
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(stateChangedSpy3.at(0).at(1)),
+ QAnimationGroup::Running);
+
QCOMPARE(anim1.state(), QAnimationGroup::Stopped);
QCOMPARE(anim2.state(), QAnimationGroup::Running);
+ QCOMPARE(anim3.state(), QAnimationGroup::Running);
QCOMPARE(group.state(), QAnimationGroup::Running);
@@ -596,19 +718,24 @@ void tst_QParallelAnimationGroup::zeroDurationAnimation()
group.setLoopCount(4);
stateChangedSpy1.clear();
stateChangedSpy2.clear();
+ stateChangedSpy3.clear();
group.start();
QCOMPARE(stateChangedSpy1.count(), 2);
QCOMPARE(stateChangedSpy2.count(), 1);
+ QCOMPARE(stateChangedSpy3.count(), 1);
group.setCurrentTime(50);
QCOMPARE(stateChangedSpy1.count(), 2);
QCOMPARE(stateChangedSpy2.count(), 1);
+ QCOMPARE(stateChangedSpy3.count(), 2);
group.setCurrentTime(150);
QCOMPARE(stateChangedSpy1.count(), 4);
QCOMPARE(stateChangedSpy2.count(), 3);
+ QCOMPARE(stateChangedSpy3.count(), 4);
group.setCurrentTime(50);
QCOMPARE(stateChangedSpy1.count(), 6);
QCOMPARE(stateChangedSpy2.count(), 5);
+ QCOMPARE(stateChangedSpy3.count(), 6);
}
@@ -863,6 +990,23 @@ void tst_QParallelAnimationGroup::pauseResume()
QCOMPARE(anim->state(), QAnimationGroup::Running);
QCOMPARE(anim->currentTime(), currentTime);
QCOMPARE(spy.count(), 1);
+
+ group.stop();
+ spy.clear();
+ new TestAnimation2(500, &group);
+ group.start();
+ QCOMPARE(spy.count(), 1); //the animation should have been started
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy.last().at(1)), TestAnimation::Running);
+ group.setCurrentTime(250); //end of first animation
+ QCOMPARE(spy.count(), 2); //the animation should have been stopped
+ QCOMPARE(qVariantValue<QAbstractAnimation::State>(spy.last().at(1)), TestAnimation::Stopped);
+ group.pause();
+ QCOMPARE(spy.count(), 2); //this shouldn't have changed
+ group.resume();
+ QCOMPARE(spy.count(), 2); //this shouldn't have changed
+
+
+
}
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 2568b94..36c1518 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -166,6 +166,8 @@ private slots:
void fromImage_crash();
void fromData();
+
+ void preserveDepth();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1448,6 +1450,23 @@ void tst_QPixmap::task_246446()
QVERIFY(pm.mask().isNull());
}
+void tst_QPixmap::preserveDepth()
+{
+ QPixmap target(64, 64);
+ target.fill(Qt::transparent);
+
+ QPixmap source(64, 64);
+ source.fill(Qt::white);
+
+ int depth = source.depth();
+
+ QPainter painter(&target);
+ painter.setBrush(source);
+ painter.drawRect(target.rect());
+ painter.end();
+
+ QCOMPARE(depth, source.depth());
+}
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index b487d74..9775d36 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -244,16 +244,23 @@ void tst_QPixmapCache::insert()
QPixmap p2(10, 10);
p2.fill(Qt::yellow);
+ // Calcuate estimated num of items what fits to cache
+ int estimatedNum = (1024 * QPixmapCache::cacheLimit())
+ / ((p1.width() * p1.height() * p1.depth()) / 8);
+
+ // Mare sure we will put enough items to reach the cache limit
+ const int numberOfKeys = estimatedNum + 1000;
+
// make sure it doesn't explode
- for (int i = 0; i < 20000; ++i)
+ for (int i = 0; i < numberOfKeys; ++i)
QPixmapCache::insert("0", p1);
// ditto
- for (int j = 0; j < 40000; ++j)
+ for (int j = 0; j < numberOfKeys; ++j)
QPixmapCache::insert(QString::number(j), p1);
int num = 0;
- for (int k = 0; k < 40000; ++k) {
+ for (int k = 0; k < numberOfKeys; ++k) {
if (QPixmapCache::find(QString::number(k)))
++num;
}
@@ -261,9 +268,6 @@ void tst_QPixmapCache::insert()
if (QPixmapCache::find("0"))
++num;
- int estimatedNum = (1024 * QPixmapCache::cacheLimit())
- / ((p1.width() * p1.height() * p1.depth()) / 8);
-
QVERIFY(num <= estimatedNum);
QPixmap p3;
QPixmapCache::insert("null", p3);
@@ -281,11 +285,11 @@ void tst_QPixmapCache::insert()
//The int part of the API
// make sure it doesn't explode
QList<QPixmapCache::Key> keys;
- for (int i = 0; i < 40000; ++i)
+ for (int i = 0; i < numberOfKeys; ++i)
keys.append(QPixmapCache::insert(p1));
num = 0;
- for (int k = 0; k < 40000; ++k) {
+ for (int k = 0; k < numberOfKeys; ++k) {
if (QPixmapCache::find(keys.at(k), &p2))
++num;
}
@@ -393,7 +397,12 @@ void tst_QPixmapCache::clear()
QPixmap p1(10, 10);
p1.fill(Qt::red);
- const int numberOfKeys = 40000;
+ // Calcuate estimated num of items what fits to cache
+ int estimatedNum = (1024 * QPixmapCache::cacheLimit())
+ / ((p1.width() * p1.height() * p1.depth()) / 8);
+
+ // Mare sure we will put enough items to reach the cache limit
+ const int numberOfKeys = estimatedNum + 1000;
for (int i = 0; i < numberOfKeys; ++i)
QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0);
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index d6df94b..3c05d90 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -108,6 +108,8 @@ private slots:
void testActualNumCopies();
+ void taskQTBUG4497_reusePrinterOnDifferentFiles();
+
private:
};
@@ -971,5 +973,37 @@ void tst_QPrinter::testActualNumCopies()
QCOMPARE(p.actualNumCopies(), 15);
}
+static void printPage(QPainter *painter)
+{
+ painter->setPen(QPen(Qt::black, 4));
+ painter->drawRect(50, 60, 70, 80);
+}
+
+void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
+{
+ QPrinter printer;
+ {
+
+ printer.setOutputFileName("out1.ps");
+ QPainter painter(&printer);
+ printPage(&painter);
+
+ }
+ {
+
+ printer.setOutputFileName("out2.ps");
+ QPainter painter(&printer);
+ printPage(&painter);
+
+ }
+ QFile file1("out1.ps");
+ QVERIFY(file1.open(QIODevice::ReadOnly));
+
+ QFile file2("out2.ps");
+ QVERIFY(file2.open(QIODevice::ReadOnly));
+
+ QCOMPARE(file1.readAll(), file2.readAll());
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index b193d67..89f8a5cf 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -83,6 +83,7 @@ private slots:
void argumentsObjectInNative();
void jsActivationObject();
void qobjectAsActivationObject();
+ void parentContextCallee_QT2270();
};
tst_QScriptContext::tst_QScriptContext()
@@ -1222,5 +1223,21 @@ void tst_QScriptContext::qobjectAsActivationObject()
}
}
+static QScriptValue getParentContextCallee(QScriptContext *ctx, QScriptEngine *)
+{
+ return ctx->parentContext()->callee();
+}
+
+void tst_QScriptContext::parentContextCallee_QT2270()
+{
+ QScriptEngine engine;
+ engine.globalObject().setProperty("getParentContextCallee", engine.newFunction(getParentContextCallee));
+ QScriptValue fun = engine.evaluate("(function() { return getParentContextCallee(); })");
+ QVERIFY(fun.isFunction());
+ QScriptValue callee = fun.call();
+ QEXPECT_FAIL("", "QT-2270: Incorrect parentContext() returned for native call", Abort);
+ QVERIFY(callee.equals(fun));
+}
+
QTEST_MAIN(tst_QScriptContext)
#include "tst_qscriptcontext.moc"
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 6b64e76..5636c54 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -87,6 +87,7 @@ private slots:
void getSetPrototype();
void getSetScope();
void getSetProperty();
+ void arrayElementGetterSetter();
void getSetData();
void getSetScriptClass();
void call();
@@ -2115,6 +2116,32 @@ void tst_QScriptValue::getSetProperty()
QVERIFY(object.propertyFlags(foo) == 0);
}
+void tst_QScriptValue::arrayElementGetterSetter()
+{
+ QScriptEngine eng;
+ QScriptValue obj = eng.newObject();
+ obj.setProperty(1, eng.newFunction(getterSetter), QScriptValue::PropertyGetter|QScriptValue::PropertySetter);
+ {
+ QScriptValue num(123);
+ obj.setProperty("x", num);
+ QScriptValue ret = obj.property(1);
+ QVERIFY(ret.isValid());
+ QVERIFY(ret.equals(num));
+ }
+ {
+ QScriptValue num(456);
+ obj.setProperty(1, num);
+ QScriptValue ret = obj.property(1);
+ QVERIFY(ret.isValid());
+ QVERIFY(ret.equals(num));
+ QVERIFY(ret.equals(obj.property("1")));
+ }
+ QCOMPARE(obj.propertyFlags("1"), QScriptValue::PropertyGetter|QScriptValue::PropertySetter);
+
+ obj.setProperty(1, QScriptValue(), QScriptValue::PropertyGetter|QScriptValue::PropertySetter);
+ QVERIFY(obj.propertyFlags("1") == 0);
+}
+
void tst_QScriptValue::getSetPrototype()
{
QScriptEngine eng;
diff --git a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
index c4ff76c..4ab3b0b 100644
--- a/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
+++ b/tests/auto/qsharedmemory/tst_qsharedmemory.cpp
@@ -764,7 +764,7 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
bool consumerFailed = false;
while (!consumers.isEmpty()) {
- consumers.first()->waitForFinished(1000);
+ consumers.first()->waitForFinished(2000);
if (consumers.first()->state() == QProcess::Running ||
consumers.first()->exitStatus() != QProcess::NormalExit ||
consumers.first()->exitCode() != 0) {
@@ -773,7 +773,7 @@ void tst_QSharedMemory::simpleProcessProducerConsumer()
delete consumers.takeFirst();
}
QCOMPARE(consumerFailed, false);
- QCOMPARE(failedProcesses, unsigned int (0));
+ QCOMPARE(failedProcesses, (unsigned int)(0));
}
QTEST_MAIN(tst_QSharedMemory)
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index fa63c4b..58eaacb 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -308,7 +308,7 @@ extern int forwardDeclaredDestructorRunCount;
void tst_QSharedPointer::forwardDeclaration1()
{
-#if defined(Q_CC_SUN)
+#if defined(Q_CC_SUN) || defined(Q_CC_WINSCW) || defined(Q_CC_RVCT)
QSKIP("This type of forward declaration is not valid with this compiler", SkipAll);
#else
externalForwardDeclaration();
@@ -1448,10 +1448,11 @@ void tst_QSharedPointer::threadStressTest_data()
QTest::newRow("1+1") << 1 << 1;
QTest::newRow("2+10") << 2 << 10;
+#ifndef Q_OS_WINCE
+ // Windows CE cannot run this many threads
QTest::newRow("5+10") << 5 << 10;
QTest::newRow("5+30") << 5 << 30;
-#ifndef Q_OS_WINCE
QTest::newRow("100+100") << 100 << 100;
#endif
}
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index 75da2e6..c48d50d 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -4,4 +4,8 @@ SOURCES += tst_qsound.cpp
wince*|symbian*: {
deploy.sources += 4.wav
DEPLOYMENT = deploy
-} \ No newline at end of file
+ DEFINES += SRCDIR=\\\"\\\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp
index 76451e3..dd5f2ce 100644
--- a/tests/auto/qsound/tst_qsound.cpp
+++ b/tests/auto/qsound/tst_qsound.cpp
@@ -56,7 +56,7 @@ private slots:
void tst_QSound::checkFinished()
{
- QSound sound("4.wav");
+ QSound sound(SRCDIR"4.wav");
sound.setLoops(3);
sound.play();
QTest::qWait(5000);
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 4175bef..c9c8f5e 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -157,6 +157,8 @@ private slots:
void mysqlOdbc_unsignedIntegers();
void mysql_multiselect_data() { generic_data("QMYSQL"); }
void mysql_multiselect(); // For task 144331
+ void mysql_savepointtest_data() { generic_data("QMYSQL"); }
+ void mysql_savepointtest();
void accessOdbc_strings_data() { generic_data(); }
void accessOdbc_strings();
@@ -2433,6 +2435,19 @@ void tst_QSqlDatabase::sqlStatementUseIsNull_189093()
QCOMPARE(statment.count("IS NULL", Qt::CaseInsensitive), 2);
}
+void tst_QSqlDatabase::mysql_savepointtest()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+ if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
+ QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
+
+ 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("savepoint foo"));
+}
QTEST_MAIN(tst_QSqlDatabase)
#include "tst_qsqldatabase.moc"
diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp
index b808f7f..1516346 100644
--- a/tests/auto/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp
@@ -42,6 +42,9 @@
#include <QtTest/QtTest>
#include <QtCore/QCoreApplication>
#include <QtGui/QPushButton>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsSceneEvent>
+#include <QtGui/QGraphicsTextItem>
#include "qstatemachine.h"
#include "qstate.h"
@@ -127,6 +130,7 @@ private slots:
void allSourceToTargetConfigurations();
void signalTransitions();
void eventTransitions();
+ void graphicsSceneEventTransitions();
void historyStates();
void startAndStop();
void targetStateWithNoParent();
@@ -2426,6 +2430,29 @@ void tst_QStateMachine::eventTransitions()
}
}
+void tst_QStateMachine::graphicsSceneEventTransitions()
+{
+ QGraphicsScene scene;
+ QGraphicsTextItem *textItem = scene.addText("foo");
+
+ QStateMachine machine;
+ QState *s1 = new QState(&machine);
+ QFinalState *s2 = new QFinalState(&machine);
+ QEventTransition *t = new QEventTransition(textItem, QEvent::GraphicsSceneMouseMove);
+ t->setTargetState(s2);
+ s1->addTransition(t);
+ machine.setInitialState(s1);
+
+ QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ machine.start();
+ QTRY_COMPARE(startedSpy.count(), 1);
+ QVERIFY(finishedSpy.count() == 0);
+ QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove);
+ scene.sendEvent(textItem, &mouseEvent);
+ QTRY_COMPARE(finishedSpy.count(), 1);
+}
+
void tst_QStateMachine::historyStates()
{
for (int x = 0; x < 2; ++x) {
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index e1b5a41..c95d86c 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -1294,10 +1294,17 @@ void tst_QSvgRenderer::testUseElement()
p.begin(&images[i]);
renderer.render(&p);
p.end();
+
if (i < 4 && i != 0) {
QCOMPARE(images[0], images[i]);
} else if (i > 4 && i < 7) {
- QCOMPARE(images[4], images[i]);
+ if (sizeof(qreal) != sizeof(float))
+ {
+ // These images use blending functions which due to numerical
+ // issues on Windows CE and likes differ in very few pixels.
+ // For this reason an exact comparison will fail.
+ QCOMPARE(images[4], images[i]);
+ }
} else if (i > 7) {
QCOMPARE(images[8], images[i]);
}
diff --git a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
index 6bfab15..44986fa 100644
--- a/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
+++ b/tests/auto/qsystemsemaphore/tst_qsystemsemaphore.cpp
@@ -42,13 +42,12 @@
#include <QtTest/QtTest>
#include <qsystemsemaphore.h>
-
//TESTED_CLASS=
//TESTED_FILES=
#define EXISTING_SHARE "existing"
-
#define LACKYLOC "../qsharedmemory/lackey"
+#define LACKYWAITTIME 10000
class tst_QSystemSemaphore : public QObject
{
@@ -199,12 +198,12 @@ void tst_QSystemSemaphore::basicProcesses()
release.setProcessChannelMode(QProcess::ForwardedChannels);
acquire.start(LACKYLOC "/lackey", acquireArguments);
- acquire.waitForFinished(5000);
+ acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state() == QProcess::Running);
acquire.kill();
release.start(LACKYLOC "/lackey", releaseArguments);
- acquire.waitForFinished(5000);
- release.waitForFinished(5000);
+ acquire.waitForFinished(LACKYWAITTIME);
+ release.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state() == QProcess::NotRunning);
}
@@ -259,13 +258,13 @@ void tst_QSystemSemaphore::undo()
QProcess acquire;
acquire.setProcessChannelMode(QProcess::ForwardedChannels);
acquire.start(LACKYLOC "/lackey", acquireArguments);
- acquire.waitForFinished(1000);
+ acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
// At process exit the kernel should auto undo
acquire.start(LACKYLOC "/lackey", acquireArguments);
- acquire.waitForFinished(1000);
+ acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
}
@@ -285,17 +284,17 @@ void tst_QSystemSemaphore::initialValue()
release.setProcessChannelMode(QProcess::ForwardedChannels);
acquire.start(LACKYLOC "/lackey", acquireArguments);
- acquire.waitForFinished(10000);
+ acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
acquire.start(LACKYLOC "/lackey", acquireArguments << "2");
- acquire.waitForFinished(1000);
+ acquire.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::Running);
acquire.kill();
release.start(LACKYLOC "/lackey", releaseArguments);
- acquire.waitForFinished(10000);
- release.waitForFinished(10000);
+ acquire.waitForFinished(LACKYWAITTIME);
+ release.waitForFinished(LACKYWAITTIME);
QVERIFY(acquire.state()== QProcess::NotRunning);
}
QTEST_MAIN(tst_QSystemSemaphore)
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 09e1e87..4bf7c2e 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -164,6 +164,10 @@ private slots:
void span();
void spans();
void spans_data();
+ void spansAfterRowInsertion();
+ void spansAfterColumnInsertion();
+ void spansAfterRowRemoval();
+ void spansAfterColumnRemoval();
void checkHeaderReset();
void checkHeaderMinSize();
@@ -268,6 +272,28 @@ public:
return QVariant();
}
+ bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start > row_count)
+ return false;
+
+ beginInsertRows(parent, start, start + count - 1);
+ row_count += count;
+ endInsertRows();
+ return true;
+ }
+
+ bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start >= row_count || row_count < count)
+ return false;
+
+ beginRemoveRows(parent, start, start + count - 1);
+ row_count -= count;
+ endRemoveRows();
+ return true;
+ }
+
void removeLastRow()
{
beginRemoveRows(QModelIndex(), row_count - 1, row_count - 1);
@@ -282,6 +308,28 @@ public:
endRemoveRows();
}
+ bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start > column_count)
+ return false;
+
+ beginInsertColumns(parent, start, start + count - 1);
+ column_count += count;
+ endInsertColumns();
+ return true;
+ }
+
+ bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start >= column_count || column_count < count)
+ return false;
+
+ beginRemoveColumns(parent, start, start + count - 1);
+ column_count -= count;
+ endRemoveColumns();
+ return true;
+ }
+
void removeLastColumn()
{
beginRemoveColumns(QModelIndex(), column_count - 1, column_count - 1);
@@ -2339,7 +2387,7 @@ void tst_QTableView::scrollTo()
QSize forcedSize(columnWidth * 2, rowHeight * 2);
view.resize(forcedSize);
QTest::qWaitForWindowShown(&view);
- QTest::qWait(0);
+ QTest::qWait(50);
QTRY_COMPARE(view.size(), forcedSize);
view.setModel(&model);
@@ -2354,7 +2402,7 @@ void tst_QTableView::scrollTo()
for (int c = 0; c < columnCount; ++c)
view.setColumnWidth(c, columnWidth);
- QTest::qWait(100); // ### needed to pass the test
+ QTest::qWait(150); // ### needed to pass the test
view.horizontalScrollBar()->setValue(horizontalScroll);
view.verticalScrollBar()->setValue(verticalScroll);
@@ -2608,7 +2656,7 @@ void tst_QTableView::span_data()
<< -1 << -1
<< 6 << 6
<< 3 << 3
- << 3 << 3
+ << 2 << 3
<< true;
}
@@ -2797,6 +2845,149 @@ void tst_QTableView::spans()
QCOMPARE(view.rowSpan(pos.x(), pos.y()), expectedRowSpan);
}
+void tst_QTableView::spansAfterRowInsertion()
+{
+ QtTestTableModel model(10, 10);
+ QtTestTableView view;
+ view.setModel(&model);
+ view.setSpan(3, 3, 3, 3);
+ view.show();
+ QTest::qWait(50);
+
+ // Insertion before the span only shifts the span.
+ view.model()->insertRows(0, 2);
+ QCOMPARE(view.rowSpan(3, 3), 1);
+ QCOMPARE(view.columnSpan(3, 3), 1);
+ QCOMPARE(view.rowSpan(5, 3), 3);
+ QCOMPARE(view.columnSpan(5, 3), 3);
+
+ // Insertion happens before the given row, so it only shifts the span also.
+ view.model()->insertRows(5, 2);
+ QCOMPARE(view.rowSpan(5, 3), 1);
+ QCOMPARE(view.columnSpan(5, 3), 1);
+ QCOMPARE(view.rowSpan(7, 3), 3);
+ QCOMPARE(view.columnSpan(7, 3), 3);
+
+ // Insertion inside the span expands it.
+ view.model()->insertRows(8, 2);
+ QCOMPARE(view.rowSpan(7, 3), 5);
+ QCOMPARE(view.columnSpan(7, 3), 3);
+
+ // Insertion after the span does nothing to it.
+ view.model()->insertRows(12, 2);
+ QCOMPARE(view.rowSpan(7, 3), 5);
+ QCOMPARE(view.columnSpan(7, 3), 3);
+}
+
+void tst_QTableView::spansAfterColumnInsertion()
+{
+ QtTestTableModel model(10, 10);
+ QtTestTableView view;
+ view.setModel(&model);
+ view.setSpan(3, 3, 3, 3);
+ view.show();
+ QTest::qWait(50);
+
+ // Insertion before the span only shifts the span.
+ view.model()->insertColumns(0, 2);
+ QCOMPARE(view.rowSpan(3, 3), 1);
+ QCOMPARE(view.columnSpan(3, 3), 1);
+ QCOMPARE(view.rowSpan(3, 5), 3);
+ QCOMPARE(view.columnSpan(3, 5), 3);
+
+ // Insertion happens before the given column, so it only shifts the span also.
+ view.model()->insertColumns(5, 2);
+ QCOMPARE(view.rowSpan(3, 5), 1);
+ QCOMPARE(view.columnSpan(3, 5), 1);
+ QCOMPARE(view.rowSpan(3, 7), 3);
+ QCOMPARE(view.columnSpan(3, 7), 3);
+
+ // Insertion inside the span expands it.
+ view.model()->insertColumns(8, 2);
+ QCOMPARE(view.rowSpan(3, 7), 3);
+ QCOMPARE(view.columnSpan(3, 7), 5);
+
+ // Insertion after the span does nothing to it.
+ view.model()->insertColumns(12, 2);
+ QCOMPARE(view.rowSpan(3, 7), 3);
+ QCOMPARE(view.columnSpan(3, 7), 5);
+}
+
+void tst_QTableView::spansAfterRowRemoval()
+{
+ QtTestTableModel model(10, 10);
+ QtTestTableView view;
+ view.setModel(&model);
+
+ QList<QRect> spans;
+ spans << QRect(0, 1, 1, 2)
+ << QRect(1, 2, 1, 2)
+ << QRect(2, 2, 1, 5)
+ << QRect(2, 8, 1, 2)
+ << QRect(3, 4, 1, 2)
+ << QRect(4, 4, 1, 4)
+ << QRect(5, 6, 1, 3)
+ << QRect(6, 7, 1, 3);
+ foreach (QRect span, spans)
+ view.setSpan(span.top(), span.left(), span.height(), span.width());
+
+ view.show();
+ QTest::qWait(100);
+ view.model()->removeRows(3, 3);
+
+ QList<QRect> expectedSpans;
+ expectedSpans << QRect(0, 1, 1, 2)
+ << QRect(1, 2, 1, 1)
+ << QRect(2, 2, 1, 2)
+ << QRect(2, 5, 1, 2)
+ << QRect(3, 4, 1, 1)
+ << QRect(4, 3, 1, 2)
+ << QRect(5, 3, 1, 3)
+ << QRect(6, 4, 1, 3);
+ foreach (QRect span, expectedSpans) {
+ QCOMPARE(view.columnSpan(span.top(), span.left()), span.width());
+ QCOMPARE(view.rowSpan(span.top(), span.left()), span.height());
+ }
+}
+
+void tst_QTableView::spansAfterColumnRemoval()
+{
+ QtTestTableModel model(10, 10);
+ QtTestTableView view;
+ view.setModel(&model);
+
+ // Same set as above just swapping columns and rows.
+ QList<QRect> spans;
+ spans << QRect(0, 1, 1, 2)
+ << QRect(1, 2, 1, 2)
+ << QRect(2, 2, 1, 5)
+ << QRect(2, 8, 1, 2)
+ << QRect(3, 4, 1, 2)
+ << QRect(4, 4, 1, 4)
+ << QRect(5, 6, 1, 3)
+ << QRect(6, 7, 1, 3);
+ foreach (QRect span, spans)
+ view.setSpan(span.left(), span.top(), span.width(), span.height());
+
+ view.show();
+ QTest::qWait(100);
+ view.model()->removeColumns(3, 3);
+
+ QList<QRect> expectedSpans;
+ expectedSpans << QRect(0, 1, 1, 2)
+ << QRect(1, 2, 1, 1)
+ << QRect(2, 2, 1, 2)
+ << QRect(2, 5, 1, 2)
+ << QRect(3, 4, 1, 1)
+ << QRect(4, 3, 1, 2)
+ << QRect(5, 3, 1, 3)
+ << QRect(6, 4, 1, 3);
+ foreach (QRect span, expectedSpans) {
+ QCOMPARE(view.columnSpan(span.left(), span.top()), span.height());
+ QCOMPARE(view.rowSpan(span.left(), span.top()), span.width());
+ }
+}
+
class Model : public QAbstractTableModel {
Q_OBJECT
diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp
index a539a7f..2751e9d 100644
--- a/tests/auto/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp
@@ -134,7 +134,7 @@ void tst_QThreadOnce::sameThread()
void tst_QThreadOnce::multipleThreads()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS)
+#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) || defined(Q_OS_SYMBIAN)
const int NumberOfThreads = 20;
#else
const int NumberOfThreads = 100;
diff --git a/tests/auto/qtooltip/tst_qtooltip.cpp b/tests/auto/qtooltip/tst_qtooltip.cpp
index 283effa..fc76069 100644
--- a/tests/auto/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/qtooltip/tst_qtooltip.cpp
@@ -66,6 +66,7 @@ private slots:
// task-specific tests below me
void task183679_data();
void task183679();
+ void whatsThis();
void setPalette();
};
@@ -131,6 +132,27 @@ void tst_QToolTip::task183679()
QCOMPARE(QToolTip::isVisible(), visible);
}
+#include <QWhatsThis>
+
+void tst_QToolTip::whatsThis()
+{
+ qApp->setStyleSheet( "QWidget { font-size: 72px; }" );
+ QWhatsThis::showText(QPoint(0,0), "THis is text");
+ QTest::qWait(400);
+ QWidget *whatsthis = 0;
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
+ if (widget->inherits("QWhatsThat")) {
+ whatsthis = widget;
+ break;
+ }
+ }
+ QVERIFY(whatsthis);
+ QVERIFY(whatsthis->isVisible());
+ QVERIFY(whatsthis->height() > 100); // Test QTBUG-2416
+ qApp->setStyleSheet("");
+}
+
+
void tst_QToolTip::setPalette()
{
//the previous test may still have a tooltip pending for deletion
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index 4a74d96..11c4543 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -468,6 +468,7 @@ void tst_QTreeWidget::editItem()
QTest::ignoreMessage(QtWarningMsg, "edit: editing failed");
tree.editItem(item, col);
QApplication::instance()->processEvents();
+ QApplication::instance()->processEvents();
QLineEdit *editor = qFindChild<QLineEdit*>(&tree);
if (editor) {
QVERIFY(item->flags() & Qt::ItemIsEditable);
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index fb3cf0e..8856792 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -671,6 +671,26 @@ void tst_QUrl::setUrl()
}
/*
+ The tests below are copied from kdelibs/kdecore/tests/kurltest.cpp (an old version of)
+
+ Copyright (c) 1999-2005 Waldo Bastian <bastian@kde.org>
+ Copyright (c) 2000-2005 David Faure <faure@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+/*
### File / directory specifics
KURL u2( QCString("/home/dfaure/") );
@@ -2242,6 +2262,9 @@ void tst_QUrl::ipv6_2_data()
QTest::newRow("[::ffff:129.144.52.38]")
<< QString("http://[::ffff:129.144.52.38]/cgi/test.cgi")
<< QString("http://[::ffff:129.144.52.38]/cgi/test.cgi");
+ QTest::newRow("[::FFFF:129.144.52.38]")
+ << QString("http://[::FFFF:129.144.52.38]/cgi/test.cgi")
+ << QString("http://[::ffff:129.144.52.38]/cgi/test.cgi");
}
void tst_QUrl::ipv6_2()
diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
index c2bbe22..f534f3b 100644
--- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp
@@ -491,7 +491,7 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 1 : 1000)) {
+ if (thread[y].wait(exited > 0 ? 3 : 1000)) {
thread_exited[y] = TRUE;
++exited;
}
@@ -535,7 +535,7 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? 3 : 1000)) {
thread_exited[y] = TRUE;
++exited;
}
@@ -587,7 +587,7 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 1 : 1000)) {
+ if (thread[y].wait(exited > 0 ? 3 : 1000)) {
thread_exited[y] = TRUE;
++exited;
}
@@ -633,7 +633,7 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 1 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? 3 : 1000)) {
thread_exited[y] = TRUE;
++exited;
}
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index e31d621..f8341c3 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -5498,10 +5498,11 @@ void tst_QWidget::multipleToplevelFocusCheck()
QTest::qWait(100);
- w1.activateWindow();
QApplication::setActiveWindow(&w1);
+ w1.activateWindow();
QApplication::processEvents();
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&w1));
+ QTest::qWait(50);
QTest::mouseDClick(&w1, Qt::LeftButton);
QTRY_COMPARE(QApplication::focusWidget(), static_cast<QWidget *>(w1.edit));
@@ -7470,10 +7471,11 @@ void tst_QWidget::updateWhileMinimized()
QTest::qWaitForWindowShown(&widget);
QApplication::processEvents();
QTRY_VERIFY(widget.numPaintEvents > 0);
+ QTest::qWait(50);
// Minimize window.
widget.showMinimized();
- QTest::qWait(30);
+ QTest::qWait(70);
widget.reset();
@@ -8174,7 +8176,7 @@ public:
static bool firstTime = true;
if (firstTime)
- QTimer::singleShot(100, this, SLOT(resizeMe()));
+ QTimer::singleShot(150, this, SLOT(resizeMe()));
firstTime = false;
}
@@ -8191,7 +8193,7 @@ void tst_QWidget::moveInResizeEvent()
testWidget.setGeometry(50, 50, 200, 200);
testWidget.show();
QTest::qWaitForWindowShown(&testWidget);
- QTest::qWait(120);
+ QTest::qWait(160);
QRect expectedGeometry(100,100, 100, 100);
QTRY_COMPARE(testWidget.geometry(), expectedGeometry);
@@ -8672,7 +8674,7 @@ void tst_QWidget::setClearAndResizeMask()
// Mask child widget with a mask that is bigger than the rect
child.setMask(QRegion(0, 0, 1000, 1000));
- QTest::qWait(10);
+ QTest::qWait(100);
#ifdef Q_WS_MAC
// Mac always issues a full update when calling setMask, and we cannot force it to not do so.
QTRY_COMPARE(child.numPaintEvents, 1);
@@ -8684,7 +8686,7 @@ void tst_QWidget::setClearAndResizeMask()
// ...and the same applies when clearing the mask.
child.clearMask();
- QTest::qWait(10);
+ QTest::qWait(100);
#ifdef Q_WS_MAC
// Mac always issues a full update when calling setMask, and we cannot force it to not do so.
QTRY_VERIFY(child.numPaintEvents > 0);
@@ -8709,6 +8711,7 @@ void tst_QWidget::setClearAndResizeMask()
// Disable the size grip on the Mac; otherwise it'll be included when grabbing the window.
resizeParent.setFixedSize(resizeParent.size());
resizeChild.show();
+ QTest::qWait(100);
resizeChild.paintedRegion = QRegion();
QTimer::singleShot(100, &resizeChild, SLOT(shrinkMask()));
@@ -8987,6 +8990,9 @@ void tst_QWidget::syntheticEnterLeave()
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
{
+#ifdef Q_OS_WINCE_WM
+ QSKIP("Windows Mobile has no proper cursor support", SkipAll);
+#endif
class SELParent : public QWidget
{
public:
@@ -9021,12 +9027,11 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&parent);
#endif
- QTest::qWait(100);
+ QTest::qWait(150);
QCursor::setPos(child.mapToGlobal(QPoint(100, 100)));
- QTest::qWait(100);
// Make sure the cursor has entered the child.
- QVERIFY(child.numEnterEvents > 0);
+ QTRY_VERIFY(child.numEnterEvents > 0);
child.hide();
child.reset();
@@ -9116,7 +9121,7 @@ void tst_QWidget::paintOutsidePaintEvent()
widget.show();
QTest::qWaitForWindowShown(&widget);
- QTest::qWait(20);
+ QTest::qWait(60);
const QPixmap before = QPixmap::grabWindow(widget.winId());
@@ -9126,6 +9131,7 @@ void tst_QWidget::paintOutsidePaintEvent()
painter.fillRect(child1.rect(), Qt::red);
painter.end();
XSync(QX11Info::display(), false); // Flush output buffer.
+ QTest::qWait(60);
const QPixmap after = QPixmap::grabWindow(widget.winId());
@@ -9198,6 +9204,7 @@ void tst_QWidget::focusWidget_task254563()
void tst_QWidget::destroyBackingStore()
{
+#ifdef QT_BUILD_INTERNAL
UpdateWidget w;
w.reset();
w.show();
@@ -9222,6 +9229,7 @@ void tst_QWidget::destroyBackingStore()
w.update();
QApplication::processEvents();
QCOMPARE(w.numPaintEvents, 2);
+#endif
}
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
index 2490a65..25f0f07 100644
--- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
+++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp
@@ -51,6 +51,9 @@
#include <QDesktopWidget>
#include <QX11Info>
+
+#include "../../shared/util.h"
+
class tst_QWindowSurface : public QObject
{
Q_OBJECT
@@ -238,9 +241,9 @@ void tst_QWindowSurface::grabWidget()
parentWidget.show();
QTest::qWaitForWindowShown(&parentWidget);
- QTest::qWait(220);
-
- QPixmap parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget);
+ QPixmap parentPixmap;
+ QTRY_COMPARE((parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget)).size(),
+ QSize(300,300));
QPixmap childPixmap = childWidget.windowSurface()->grabWidget(&childWidget);
QPixmap babyPixmap = babyWidget.windowSurface()->grabWidget(&babyWidget);
QPixmap parentSubPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget, QRect(25, 25, 100, 100));
diff --git a/tests/auto/symbols/tst_symbols.cpp b/tests/auto/symbols/tst_symbols.cpp
index 87bd63b..6103ede 100644
--- a/tests/auto/symbols/tst_symbols.cpp
+++ b/tests/auto/symbols/tst_symbols.cpp
@@ -100,6 +100,7 @@ void tst_Symbols::globalObjects()
#ifndef Q_OS_LINUX
QSKIP("Linux-specific test", SkipAll);
#endif
+ QSKIP("Test disabled, we're not fixing these issues in this Qt version", SkipAll);
// these are regexps for global objects that are allowed in Qt
QStringList whitelist = QStringList()
diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
index 531e48b..bcc988a 100644
--- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
+++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
@@ -14,7 +14,10 @@ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:PATTERNIST_SDK = $${PATTERNIST_SDK}d
else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug
}
-LIBS += -l$$PATTERNIST_SDK -lQtXml
+
+LIBS += -l$$PATTERNIST_SDK
+
+QT += xml
INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/lib/ \
$$QT_BUILD_TREE/include/QtXmlPatterns/private \
diff --git a/tests/benchmarks/qtableview/tst_qtableview.cpp b/tests/benchmarks/qtableview/tst_qtableview.cpp
index deeba3f..7247a23 100644
--- a/tests/benchmarks/qtableview/tst_qtableview.cpp
+++ b/tests/benchmarks/qtableview/tst_qtableview.cpp
@@ -75,6 +75,50 @@ public:
return QVariant();
}
+ bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start > row_count)
+ return false;
+
+ beginInsertRows(parent, start, start + count - 1);
+ row_count += count;
+ endInsertRows();
+ return true;
+ }
+
+ bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start >= row_count || row_count < count)
+ return false;
+
+ beginRemoveRows(parent, start, start + count - 1);
+ row_count -= count;
+ endRemoveRows();
+ return true;
+ }
+
+ bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start > column_count)
+ return false;
+
+ beginInsertColumns(parent, start, start + count - 1);
+ column_count += count;
+ endInsertColumns();
+ return true;
+ }
+
+ bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex())
+ {
+ if (start < 0 || start >= column_count || column_count < count)
+ return false;
+
+ beginRemoveColumns(parent, start, start + count - 1);
+ column_count -= count;
+ endRemoveColumns();
+ return true;
+ }
+
int row_count;
int column_count;
};
@@ -99,6 +143,14 @@ private slots:
void spanDraw();
void spanSelectColumn();
void spanSelectAll();
+ void rowInsertion_data();
+ void rowInsertion();
+ void rowRemoval_data();
+ void rowRemoval();
+ void columnInsertion_data();
+ void columnInsertion();
+ void columnRemoval_data();
+ void columnRemoval();
private:
static inline void spanInit_helper(QTableView *);
};
@@ -189,5 +241,127 @@ void tst_QTableView::spanSelectColumn()
}
}
+typedef QVector<QRect> SpanList;
+Q_DECLARE_METATYPE(SpanList)
+
+void spansData()
+{
+ QTest::addColumn<SpanList>("spans");
+
+ QTest::newRow("Without spans")
+ << SpanList();
+
+ QTest::newRow("With spans")
+ << (SpanList()
+ << QRect(0, 1, 1, 2)
+ << QRect(1, 2, 1, 2)
+ << QRect(2, 2, 1, 5)
+ << QRect(2, 8, 1, 2)
+ << QRect(3, 4, 1, 2)
+ << QRect(4, 4, 1, 4)
+ << QRect(5, 6, 1, 3)
+ << QRect(6, 7, 1, 3));
+}
+
+void tst_QTableView::rowInsertion_data()
+{
+ spansData();
+}
+
+void tst_QTableView::rowInsertion()
+{
+ QFETCH(SpanList, spans);
+
+ QtTestTableModel model(10, 10);
+ QTableView view;
+ view.setModel(&model);
+
+ foreach (QRect span, spans)
+ view.setSpan(span.top(), span.left(), span.height(), span.width());
+ view.show();
+ QTest::qWait(50);
+
+ QBENCHMARK_ONCE {
+ view.model()->insertRows(0, 2);
+ view.model()->insertRows(5, 2);
+ view.model()->insertRows(8, 2);
+ view.model()->insertRows(12, 2);
+ }
+}
+
+void tst_QTableView::rowRemoval_data()
+{
+ spansData();
+}
+
+void tst_QTableView::rowRemoval()
+{
+ QFETCH(SpanList, spans);
+
+ QtTestTableModel model(10, 10);
+ QTableView view;
+ view.setModel(&model);
+
+ foreach (QRect span, spans)
+ view.setSpan(span.top(), span.left(), span.height(), span.width());
+ view.show();
+ QTest::qWait(50);
+
+ QBENCHMARK_ONCE {
+ view.model()->removeRows(3, 3);
+ }
+}
+
+void tst_QTableView::columnInsertion_data()
+{
+ spansData();
+}
+
+void tst_QTableView::columnInsertion()
+{
+ QFETCH(SpanList, spans);
+
+ QtTestTableModel model(10, 10);
+ QTableView view;
+ view.setModel(&model);
+
+ // Same set as for rowInsertion, just swapping columns and rows.
+ foreach (QRect span, spans)
+ view.setSpan(span.left(), span.top(), span.width(), span.height());
+ view.show();
+ QTest::qWait(50);
+
+ QBENCHMARK_ONCE {
+ view.model()->insertColumns(0, 2);
+ view.model()->insertColumns(5, 2);
+ view.model()->insertColumns(8, 2);
+ view.model()->insertColumns(12, 2);
+ }
+}
+
+void tst_QTableView::columnRemoval_data()
+{
+ spansData();
+}
+
+void tst_QTableView::columnRemoval()
+{
+ QFETCH(SpanList, spans);
+
+ QtTestTableModel model(10, 10);
+ QTableView view;
+ view.setModel(&model);
+
+ // Same set as for rowRemoval, just swapping columns and rows.
+ foreach (QRect span, spans)
+ view.setSpan(span.left(), span.top(), span.width(), span.height());
+ view.show();
+ QTest::qWait(50);
+
+ QBENCHMARK_ONCE {
+ view.model()->removeColumns(3, 3);
+ }
+}
+
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"
diff --git a/util/webkit/mkdist-javascriptcore b/util/webkit/mkdist-javascriptcore
index dc33f6c..07419ea 100755
--- a/util/webkit/mkdist-javascriptcore
+++ b/util/webkit/mkdist-javascriptcore
@@ -41,6 +41,7 @@ files_to_remove=""
files_to_remove="$files_to_remove JavaScriptCore/AllInOneFile.cpp"
files_to_remove="$files_to_remove JavaScriptCore/JavaScriptCoreSources.bkl"
files_to_remove="$files_to_remove JavaScriptCore/jscore.bkl"
+files_to_remove="$files_to_remove JavaScriptCore/jsc.pro"
require_clean_work_tree() {
# test if working tree is dirty
diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit
index 34a2ec7..9611d38 100755
--- a/util/webkit/mkdist-webkit
+++ b/util/webkit/mkdist-webkit
@@ -143,6 +143,8 @@ excluded_directories="$excluded_directories WebCore/storage/wince"
excluded_directories="$excluded_directories WebCore/platform/wx"
excluded_directories="$excluded_directories WebCore/platform/wince"
+excluded_directories="$excluded_directories WebKit/qt/Plugins"
+
excluded_directories="$excluded_directories WebKit/gtk"
excluded_directories="$excluded_directories WebKit/win"
excluded_directories="$excluded_directories WebKit/wx"
@@ -204,6 +206,7 @@ files_to_remove="$files_to_remove WebKit/qt/QGVLauncher/main.cpp"
files_to_remove="$files_to_remove JavaScriptCore/AllInOneFile.cpp"
files_to_remove="$files_to_remove JavaScriptCore/JavaScriptCoreSources.bkl"
files_to_remove="$files_to_remove JavaScriptCore/jscore.bkl"
+files_to_remove="$files_to_remove JavaScriptCore/jsc.pro"
files_to_remove="$files_to_remove WebCore/wscript"
files_to_remove="$files_to_remove WebCore/WebCore.ContextMenus.exp"